Ver Fonte

qcacld-3.0: Add support to get Async tid to link response info

Add the following fixes to get Async TID to link map info:
1. Add APIs to register and unregister the T2LM callback.
2. Add HDD callbacks.
3. Send T2LM info, when receiving TID-to-link mapping response
   from the associated AP MLD.

Change-Id: Ia98605b3244b24cc3cac41d2decf22ff6aa82f88
CRs-Fixed: 3431518
Deeksha Gupta há 2 anos atrás
pai
commit
e3f3adbce6

+ 4 - 0
components/umac/mlme/mlo_mgr/src/wlan_t2lm_api.c

@@ -256,6 +256,10 @@ QDF_STATUS t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
 	}
 
 	wlan_t2lm_clear_peer_negotiation(peer);
+
+	/* Notify the registered caller about the link update*/
+	wlan_mlo_dev_t2lm_notify_link_update(vdev,
+					     &t2lm_ctx->established_t2lm.t2lm);
 	wlan_send_tid_to_link_mapping(vdev,
 				      &t2lm_ctx->established_t2lm.t2lm);
 

+ 33 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -26572,6 +26572,39 @@ wlan_hdd_cfg80211_get_t2lm_mapping_status(struct wiphy *wiphy,
 
 	return errno;
 }
+
+QDF_STATUS hdd_mlo_dev_t2lm_notify_link_update(struct wlan_objmgr_vdev *vdev,
+					       struct wlan_t2lm_info *t2lm)
+{
+	struct cfg80211_mlo_tid_map map;
+	struct hdd_adapter *adapter;
+	struct net_device *dev;
+	bool found = false;
+
+	adapter = wlan_hdd_get_adapter_from_objmgr(vdev);
+	if (!adapter) {
+		hdd_err("null adapter");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	dev = adapter->dev;
+	hdd_enter_dev(dev);
+
+	qdf_mem_zero(&map, sizeof(map));
+
+	wlan_hdd_fill_map(t2lm, &map, &found);
+	if (!found) {
+		hdd_debug("Failed to get t2lm info");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	wlan_hdd_print_t2lm_info(&map);
+	cfg80211_tid_to_link_map_change(dev, &map);
+
+	hdd_exit();
+
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 static struct cfg80211_ops wlan_hdd_cfg80211_ops = {

+ 21 - 0
core/hdd/src/wlan_hdd_cfg80211.h

@@ -1062,6 +1062,27 @@ struct wlan_objmgr_vdev *wlan_key_get_link_vdev(struct hdd_adapter *adapter,
 void wlan_key_put_link_vdev(struct wlan_objmgr_vdev *link_vdev,
 			    wlan_objmgr_ref_dbgid id);
 
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_TID_LINK_MAP_SUPPORT)
+/**
+ * hdd_mlo_dev_t2lm_notify_link_update() - Send update T2LM info event
+ * @vdev: Pointer to vdev
+ * @t2lm: T2LM info
+ *
+ * Send update T2LM info event to userspace
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS hdd_mlo_dev_t2lm_notify_link_update(struct wlan_objmgr_vdev *vdev,
+					       struct wlan_t2lm_info *t2lm);
+#else
+static inline
+QDF_STATUS hdd_mlo_dev_t2lm_notify_link_update(struct wlan_objmgr_vdev *vdev,
+					       struct wlan_t2lm_info *t2lm)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 #if defined(WLAN_FEATURE_11BE_MLO) && \
 	defined(CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT)
 /**

+ 5 - 0
core/hdd/src/wlan_hdd_main.c

@@ -6464,8 +6464,10 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter)
 	hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
 
 	qdf_spin_lock_bh(&adapter->deflink->vdev_lock);
+	hdd_mlo_t2lm_unregister_callback(adapter->deflink->vdev);
 	adapter->deflink->vdev = NULL;
 	qdf_spin_unlock_bh(&adapter->deflink->vdev_lock);
+
 	osif_cm_osif_priv_deinit(vdev);
 
 	/* Release the hdd reference */
@@ -6798,6 +6800,9 @@ int hdd_vdev_create(struct hdd_adapter *adapter)
 	hdd_store_vdev_info(adapter, vdev);
 	osif_cm_osif_priv_init(vdev);
 
+	if (hdd_adapter_is_ml_adapter(adapter))
+		hdd_mlo_t2lm_register_callback(vdev);
+
 	set_bit(SME_SESSION_OPENED, &adapter->event_flags);
 	status = sme_vdev_post_vdev_create_setup(hdd_ctx->mac_handle, vdev);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 18 - 0
core/hdd/src/wlan_hdd_mlo.c

@@ -248,6 +248,24 @@ struct hdd_adapter *hdd_get_ml_adapter(struct hdd_context *hdd_ctx)
 	return NULL;
 }
 
+void hdd_mlo_t2lm_register_callback(struct wlan_objmgr_vdev *vdev)
+{
+	if (!vdev || !vdev->mlo_dev_ctx)
+		return;
+
+	wlan_register_t2lm_link_update_notify_handler(
+			hdd_mlo_dev_t2lm_notify_link_update,
+			vdev->mlo_dev_ctx);
+}
+
+void hdd_mlo_t2lm_unregister_callback(struct wlan_objmgr_vdev *vdev)
+{
+	if (!vdev || !vdev->mlo_dev_ctx)
+		return;
+
+	wlan_unregister_t2lm_link_update_notify_handler(vdev->mlo_dev_ctx, 0);
+}
+
 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
 int hdd_update_vdev_mac_address(struct hdd_context *hdd_ctx,
 				struct hdd_adapter *adapter,