|
@@ -289,12 +289,15 @@ bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr)
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef WLAN_FEATURE_11BE_MLO
|
|
#ifdef WLAN_FEATURE_11BE_MLO
|
|
-bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr)
|
|
|
|
|
|
+bool mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t *peer_addr,
|
|
|
|
+ uint8_t *peer_vdev_id)
|
|
{
|
|
{
|
|
qdf_list_t *ml_list;
|
|
qdf_list_t *ml_list;
|
|
|
|
+ uint32_t idx, count;
|
|
struct wlan_mlo_dev_context *mld_cur, *mld_next;
|
|
struct wlan_mlo_dev_context *mld_cur, *mld_next;
|
|
struct wlan_mlo_peer_list *mlo_peer_list;
|
|
struct wlan_mlo_peer_list *mlo_peer_list;
|
|
- bool ret_status = false;
|
|
|
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
|
+ bool ret_status = false, same_ml_ctx = false;
|
|
struct mlo_mgr_context *g_mlo_ctx = wlan_objmgr_get_mlo_ctx();
|
|
struct mlo_mgr_context *g_mlo_ctx = wlan_objmgr_get_mlo_ctx();
|
|
|
|
|
|
if (!g_mlo_ctx || !peer_addr ||
|
|
if (!g_mlo_ctx || !peer_addr ||
|
|
@@ -311,23 +314,57 @@ bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr)
|
|
mlo_dev_lock_acquire(mld_cur);
|
|
mlo_dev_lock_acquire(mld_cur);
|
|
if (qdf_is_macaddr_equal(&mld_cur->mld_addr,
|
|
if (qdf_is_macaddr_equal(&mld_cur->mld_addr,
|
|
(struct qdf_mac_addr *)peer_addr)) {
|
|
(struct qdf_mac_addr *)peer_addr)) {
|
|
|
|
+ /* For self peer, the address passed will match the
|
|
|
|
+ * MLD address of its own ML dev context, so allow
|
|
|
|
+ * peer creation in this scenario as both are in
|
|
|
|
+ * same ML dev context.
|
|
|
|
+ */
|
|
|
|
+ if (peer_vdev_id) {
|
|
|
|
+ count = QDF_ARRAY_SIZE(mld_cur->wlan_vdev_list);
|
|
|
|
+ for (idx = 0; idx < count; idx++) {
|
|
|
|
+ vdev = mld_cur->wlan_vdev_list[idx];
|
|
|
|
+ if (!vdev)
|
|
|
|
+ continue;
|
|
|
|
+ if (*peer_vdev_id ==
|
|
|
|
+ wlan_vdev_get_id(vdev)) {
|
|
|
|
+ same_ml_ctx = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
mlo_dev_lock_release(mld_cur);
|
|
mlo_dev_lock_release(mld_cur);
|
|
mlo_err("MLD ID %d exists with mac " QDF_MAC_ADDR_FMT,
|
|
mlo_err("MLD ID %d exists with mac " QDF_MAC_ADDR_FMT,
|
|
mld_cur->mld_id, QDF_MAC_ADDR_REF(peer_addr));
|
|
mld_cur->mld_id, QDF_MAC_ADDR_REF(peer_addr));
|
|
ret_status = true;
|
|
ret_status = true;
|
|
- goto g_ml_ref;
|
|
|
|
|
|
+ goto check_same_ml_ctx;
|
|
}
|
|
}
|
|
|
|
|
|
/* Check the peer list for a MAC address match */
|
|
/* Check the peer list for a MAC address match */
|
|
mlo_peer_list = &mld_cur->mlo_peer_list;
|
|
mlo_peer_list = &mld_cur->mlo_peer_list;
|
|
ml_peerlist_lock_acquire(mlo_peer_list);
|
|
ml_peerlist_lock_acquire(mlo_peer_list);
|
|
if (mlo_get_mlpeer(mld_cur, (struct qdf_mac_addr *)peer_addr)) {
|
|
if (mlo_get_mlpeer(mld_cur, (struct qdf_mac_addr *)peer_addr)) {
|
|
|
|
+ /* If peer_vdev_id is NULL, then API will treat any
|
|
|
|
+ * match as happening on another dev context
|
|
|
|
+ */
|
|
|
|
+ if (peer_vdev_id) {
|
|
|
|
+ count = QDF_ARRAY_SIZE(mld_cur->wlan_vdev_list);
|
|
|
|
+ for (idx = 0; idx < count; idx++) {
|
|
|
|
+ vdev = mld_cur->wlan_vdev_list[idx];
|
|
|
|
+ if (!vdev)
|
|
|
|
+ continue;
|
|
|
|
+ if (*peer_vdev_id ==
|
|
|
|
+ wlan_vdev_get_id(vdev)) {
|
|
|
|
+ same_ml_ctx = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
ml_peerlist_lock_release(mlo_peer_list);
|
|
ml_peerlist_lock_release(mlo_peer_list);
|
|
mlo_dev_lock_release(mld_cur);
|
|
mlo_dev_lock_release(mld_cur);
|
|
mlo_err("MLD ID %d ML Peer exists with mac " QDF_MAC_ADDR_FMT,
|
|
mlo_err("MLD ID %d ML Peer exists with mac " QDF_MAC_ADDR_FMT,
|
|
mld_cur->mld_id, QDF_MAC_ADDR_REF(peer_addr));
|
|
mld_cur->mld_id, QDF_MAC_ADDR_REF(peer_addr));
|
|
ret_status = true;
|
|
ret_status = true;
|
|
- goto g_ml_ref;
|
|
|
|
|
|
+ goto check_same_ml_ctx;
|
|
}
|
|
}
|
|
ml_peerlist_lock_release(mlo_peer_list);
|
|
ml_peerlist_lock_release(mlo_peer_list);
|
|
|
|
|
|
@@ -336,6 +373,10 @@ bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr)
|
|
mld_cur = mld_next;
|
|
mld_cur = mld_next;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+check_same_ml_ctx:
|
|
|
|
+ if (same_ml_ctx)
|
|
|
|
+ ret_status = false;
|
|
|
|
+
|
|
g_ml_ref:
|
|
g_ml_ref:
|
|
ml_link_lock_release(g_mlo_ctx);
|
|
ml_link_lock_release(g_mlo_ctx);
|
|
return ret_status;
|
|
return ret_status;
|