Jelajahi Sumber

qcacmn: Fix event dispatch for MLO_SYNC_WAIT

Add count to hold number of vdevs in a MLD link and fix sending
WLAN_VDEV_SM_EV_MLO_SYNC_COMPLETE in sync context to vdev SM.

Change-Id: Ie07c3e541ed5926ac08ae5a9d50e4365fefb1d52
CRs-Fixed: 2982475
Santosh Anbu 4 tahun lalu
induk
melakukan
1c91398f51

+ 4 - 1
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -94,8 +94,10 @@ struct wlan_mlo_sta {
 
 /*
  * struct wlan_mlo_ap - MLO AP related info
+ * @num_ml_vdevs: number of vdevs to form MLD
  */
 struct wlan_mlo_ap {
+	uint8_t num_ml_vdevs;
 };
 
 /*
@@ -110,7 +112,8 @@ struct wlan_mlo_peer_list {
 
 /*
  * struct wlan_mlo_dev_context - MLO device context
- *
+ * @node: QDF list node member
+ * @mld_id: MLD id
  * @mld_addr: MLO device MAC address
  * @wlan_vdev_list: list of vdevs associated with this MLO connection
  * @wlan_vdev_count: number of elements in the vdev list

+ 5 - 5
umac/mlo_mgr/src/wlan_mlo_mgr_ap.c

@@ -33,7 +33,7 @@ bool mlo_ap_vdev_attach(struct wlan_objmgr_vdev *vdev,
 {
 	struct wlan_mlo_dev_context *dev_ctx;
 
-	if (!vdev || !vdev->mlo_dev_ctx) {
+	if (!vdev || !vdev->mlo_dev_ctx || !vdev->mlo_dev_ctx->ap_ctx) {
 		mlo_err("Invalid input");
 		return false;
 	}
@@ -47,7 +47,7 @@ bool mlo_ap_vdev_attach(struct wlan_objmgr_vdev *vdev,
 	 * and they should provide the same vdev_count.
 	 */
 	mlo_dev_lock_acquire(dev_ctx);
-	dev_ctx->wlan_vdev_count = vdev_count;
+	dev_ctx->ap_ctx->num_ml_vdevs = vdev_count;
 	mlo_dev_lock_release(dev_ctx);
 
 	return true;
@@ -101,7 +101,7 @@ static bool mlo_is_ap_vdev_up_allowed(struct wlan_objmgr_vdev *vdev)
 	int i;
 	bool up_allowed = false;
 
-	if (!vdev || !vdev->mlo_dev_ctx) {
+	if (!vdev || !vdev->mlo_dev_ctx || !vdev->mlo_dev_ctx->ap_ctx) {
 		mlo_err("Invalid input");
 		return up_allowed;
 	}
@@ -117,7 +117,7 @@ static bool mlo_is_ap_vdev_up_allowed(struct wlan_objmgr_vdev *vdev)
 			vdev_count++;
 	}
 
-	if (vdev_count == dev_ctx->wlan_vdev_count)
+	if (vdev_count == dev_ctx->ap_ctx->num_ml_vdevs)
 		up_allowed = true;
 	mlo_dev_lock_release(dev_ctx);
 
@@ -178,7 +178,7 @@ static void mlo_handle_link_ready(struct wlan_objmgr_vdev *vdev)
 		if (dev_ctx->wlan_vdev_list[i] &&
 		    wlan_vdev_mlme_is_mlo_ap(dev_ctx->wlan_vdev_list[i]) &&
 		    mlo_pre_link_up(dev_ctx->wlan_vdev_list[i]))
-			wlan_vdev_mlme_sm_deliver_evt(
+			wlan_vdev_mlme_sm_deliver_evt_sync(
 				dev_ctx->wlan_vdev_list[i],
 				WLAN_VDEV_SM_EV_MLO_SYNC_COMPLETE,
 				0, NULL);

+ 6 - 2
umac/mlo_mgr/src/wlan_mlo_mgr_main.c

@@ -234,8 +234,12 @@ static QDF_STATUS mlo_dev_ctx_init(struct wlan_objmgr_vdev *vdev)
 		}
 	} else if (wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE) {
 		ml_dev->ap_ctx = qdf_mem_malloc(sizeof(struct wlan_mlo_ap));
-		if (!ml_dev->ap_ctx)
-			mlo_debug("Failed to allocate memory for ap ctx");
+		if (!ml_dev->ap_ctx) {
+			mlo_err("Failed to allocate memory for ap ctx");
+			mlo_dev_lock_destroy(ml_dev);
+			qdf_mem_free(ml_dev);
+			return QDF_STATUS_E_NOMEM;
+		}
 	}
 
 	ml_link_lock_acquire(g_mlo_ctx);