Pārlūkot izejas kodu

qcacld-3.0: Add new api in tdls module

Add new api for tdls mld feature:
ucfg_tdls_get_mlo_vdev
ucfg_tdls_release_mlo_vdev
ucfg_tdls_discovery_on_going

Change-Id: I874fd5ef1af94a9e576ba6738a12b7e2af891537
CRs-Fixed: 3439345
Paul Zhang 2 gadi atpakaļ
vecāks
revīzija
75bb0abb6a

+ 45 - 0
components/tdls/core/src/wlan_tdls_main.c

@@ -1210,6 +1210,51 @@ release_ref:
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+struct wlan_objmgr_vdev *wlan_tdls_get_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+						uint8_t index,
+						wlan_objmgr_ref_dbgid dbg_id)
+{
+	struct wlan_mlo_dev_context *mlo_dev_ctx;
+	struct wlan_objmgr_vdev *mlo_vdev;
+
+	if (!vdev)
+		return NULL;
+
+	mlo_dev_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_dev_ctx)
+		return NULL;
+
+	mlo_vdev = mlo_dev_ctx->wlan_vdev_list[index];
+	if (mlo_vdev &&
+	    wlan_objmgr_vdev_try_get_ref(mlo_vdev, dbg_id) ==
+							QDF_STATUS_SUCCESS)
+		return mlo_vdev;
+
+	return NULL;
+}
+
+void wlan_tdls_release_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+				wlan_objmgr_ref_dbgid dbg_id)
+{
+	if (!vdev)
+		return;
+
+	wlan_objmgr_vdev_release_ref(vdev, dbg_id);
+}
+#else
+struct wlan_objmgr_vdev *wlan_tdls_get_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+						uint8_t index,
+						wlan_objmgr_ref_dbgid dbg_id)
+{
+	return NULL;
+}
+
+void wlan_tdls_release_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+				wlan_objmgr_ref_dbgid dbg_id)
+{
+}
+#endif
 /**
  * tdls_get_vdev() - Get tdls specific vdev object manager
  * @psoc: wlan psoc object manager

+ 25 - 0
components/tdls/core/src/wlan_tdls_main.h

@@ -202,6 +202,7 @@ struct tdls_set_state_info {
  * @fw_tdls_6g_capability: bool for tdls 6g fw capability
  * @bss_sta_power: bss sta power
  * @bss_sta_power_type: bss sta power type
+ * @timer_cnt: used for mlo tdls to monitor discovery response
  * @fw_tdls_wideband_capability: bool for tdls wideband fw capability
  */
 struct tdls_soc_priv_obj {
@@ -258,6 +259,7 @@ struct tdls_soc_priv_obj {
 	uint8_t bss_sta_power;
 	uint8_t bss_sta_power_type;
 #endif
+	qdf_atomic_t timer_cnt;
 	bool fw_tdls_wideband_capability;
 };
 
@@ -747,6 +749,29 @@ tdls_process_policy_mgr_notification(struct wlan_objmgr_psoc *psoc);
  */
 QDF_STATUS
 tdls_process_decrement_active_session(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * wlan_tdls_get_mlo_vdev() - get mlo vdev for tdls
+ * @vdev: vdev object
+ * @index: index of vdev in mlo list
+ * @dbg_id: debug id
+ *
+ * Return: vdev pointer
+ */
+struct wlan_objmgr_vdev *wlan_tdls_get_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+						uint8_t index,
+						wlan_objmgr_ref_dbgid dbg_id);
+
+/**
+ * wlan_tdls_release_mlo_vdev() - release mlo vdev for tdls
+ * @vdev: vdev object
+ * @dbg_id: debug id
+ *
+ * Return: void
+ */
+void wlan_tdls_release_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+				wlan_objmgr_ref_dbgid dbg_id);
+
 /**
  * tdls_scan_complete_event_handler() - scan complete event handler for tdls
  * @vdev: vdev object

+ 29 - 0
components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h

@@ -335,6 +335,35 @@ QDF_STATUS ucfg_set_tdls_offchan_mode(struct wlan_objmgr_vdev *vdev,
 QDF_STATUS ucfg_set_tdls_secoffchanneloffset(struct wlan_objmgr_vdev *vdev,
 					     int offchanoffset);
 
+/**
+ * ucfg_tdls_discovery_on_going() - check discovery is on going
+ * @vdev: vdev object
+ *
+ * Return: true if tdls discovery on going else false
+ */
+bool ucfg_tdls_discovery_on_going(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * ucfg_tdls_get_mlo_vdev() - get mlo vdev for tdls
+ * @vdev: vdev object
+ * @index: index of vdev in mlo list
+ * @dbg_id: debug id
+ *
+ * Return: vdev pointer
+ */
+struct wlan_objmgr_vdev *ucfg_tdls_get_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+						uint8_t index,
+						wlan_objmgr_ref_dbgid dbg_id);
+
+/**
+ * ucfg_tdls_release_mlo_vdev() - release mlo vdev for tdls
+ * @vdev: vdev object
+ * @dbg_id: debug id
+ *
+ * Return: void
+ */
+void ucfg_tdls_release_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+				wlan_objmgr_ref_dbgid dbg_id);
 /**
  * ucfg_tdls_set_rssi() - API to set TDLS RSSI on peer given by mac
  * @vdev: vdev object

+ 29 - 2
components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c

@@ -864,8 +864,8 @@ QDF_STATUS ucfg_tdls_send_mgmt_frame(
 		mgmt_req->tdls_mgmt.len = 0;
 	}
 
-	tdls_debug("vdev id: %d, session id : %d", mgmt_req->vdev_id,
-		    mgmt_req->session_id);
+	tdls_debug("vdev id: %d, session id : %d, action %d", mgmt_req->vdev_id,
+		   mgmt_req->session_id, req->chk_frame.action_code);
 	status = wlan_objmgr_vdev_try_get_ref(req->vdev, WLAN_TDLS_NB_ID);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -1178,6 +1178,33 @@ free:
 	return status;
 }
 
+struct wlan_objmgr_vdev *ucfg_tdls_get_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+						uint8_t index,
+						wlan_objmgr_ref_dbgid dbg_id)
+{
+	return wlan_tdls_get_mlo_vdev(vdev, index, dbg_id);
+}
+
+void ucfg_tdls_release_mlo_vdev(struct wlan_objmgr_vdev *vdev,
+				wlan_objmgr_ref_dbgid dbg_id)
+{
+	return wlan_tdls_release_mlo_vdev(vdev, dbg_id);
+}
+
+bool ucfg_tdls_discovery_on_going(struct wlan_objmgr_vdev *vdev)
+{
+	struct tdls_soc_priv_obj *tdls_soc;
+	uint8_t count;
+
+	tdls_soc = wlan_vdev_get_tdls_soc_obj(vdev);
+	if (!tdls_soc)
+		return false;
+	count = qdf_atomic_read(&tdls_soc->timer_cnt);
+	tdls_debug("discovery req timer count %d", count);
+
+	return count ? true : false;
+}
+
 QDF_STATUS ucfg_tdls_set_rssi(struct wlan_objmgr_vdev *vdev,
 			      uint8_t *mac, int8_t rssi)
 {