Selaa lähdekoodia

qcacmn: Strip MBSSID IE from the TX VAP only for 11BE platforms

While generating the scan entry for TX VAP, the decision to
strip MBSSID IE from the TX VAP beacon, will be taken if the
platform supports 11BE.

CRs-Fixed: 3300515
Change-Id: Ie45da7a02a2811172b2403d5fd1bc4b9271432d5
Adwait Nayak 2 vuotta sitten
vanhempi
sitoutus
7fdbe9bdc7

+ 9 - 0
target_if/core/inc/target_if.h

@@ -2813,6 +2813,15 @@ QDF_STATUS target_if_mlo_teardown_req(struct wlan_objmgr_pdev **pdev,
 				      uint8_t num_pdevs, uint32_t reason);
 #endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/
 
+/**
+ * target_if_is_platform_eht_capable():
+ * API to check if the platform is EHT capable
+ * @pdev: pdev object
+ *
+ * Return: True if platform is 11BE capable; else False
+ */
+bool target_if_is_platform_eht_capable(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id);
 #ifdef REO_SHARED_QREF_TABLE_EN
 static inline void target_if_set_reo_shared_qref_feature(struct wlan_objmgr_psoc *psoc,
 							 struct tgt_info *info)

+ 29 - 0
target_if/scan/src/target_if_scan.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -452,6 +453,33 @@ target_if_scan_cancel(struct wlan_objmgr_pdev *pdev,
 	return wmi_unified_scan_stop_cmd_send(pdev_wmi_handle, req);
 }
 
+#if defined(WLAN_FEATURE_11BE) && defined(WLAN_FEATURE_11BE_MLO_MBSSID)
+bool target_if_is_platform_eht_capable(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id)
+{
+	struct wlan_psoc_host_mac_phy_caps *mac_phy_cap_arr, *mac_phy_cap;
+
+	if (psoc->tgt_if_handle) {
+		mac_phy_cap_arr =
+			target_psoc_get_mac_phy_cap(psoc->tgt_if_handle);
+		if (!mac_phy_cap_arr)
+			return false;
+
+		mac_phy_cap = &mac_phy_cap_arr[pdev_id];
+		if (mac_phy_cap && mac_phy_cap->supports_11be)
+			return true;
+	}
+
+	return false;
+}
+#else
+bool target_if_is_platform_eht_capable(struct wlan_objmgr_psoc *psoc,
+				       uint8_t pdev_id)
+{
+	return false;
+}
+#endif
+
 QDF_STATUS
 target_if_scan_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
 {
@@ -470,6 +498,7 @@ target_if_scan_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
 	scan->obss_disable = target_if_obss_scan_disable;
 	scan->scan_reg_ev_handler = target_if_scan_register_event_handler;
 	scan->scan_unreg_ev_handler = target_if_scan_unregister_event_handler;
+	scan->is_platform_eht_capable = target_if_is_platform_eht_capable;
 
 	return QDF_STATUS_SUCCESS;
 }

+ 2 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -408,6 +408,8 @@ struct wlan_lmac_if_scan_tx_ops {
 	QDF_STATUS (*scan_unreg_ev_handler)(struct wlan_objmgr_psoc *psoc,
 			void *arg);
 	QDF_STATUS (*set_chan_list)(struct wlan_objmgr_pdev *pdev, void *arg);
+	bool (*is_platform_eht_capable)(struct wlan_objmgr_psoc *psoc,
+					uint8_t pdev_id);
 };
 
 /**

+ 125 - 43
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -3456,7 +3456,18 @@ static QDF_STATUS util_scan_parse_mbssid(struct wlan_objmgr_pdev *pdev,
 
 	return QDF_STATUS_SUCCESS;
 }
+#else
+static QDF_STATUS util_scan_parse_mbssid(struct wlan_objmgr_pdev *pdev,
+					 uint8_t *frame, qdf_size_t frame_len,
+					 uint32_t frm_subtype,
+					 struct mgmt_rx_event_params *rx_param,
+					 qdf_list_t *scan_list)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
 
+#if defined(WLAN_FEATURE_11BE) && defined(WLAN_FEATURE_11BE_MLO_MBSSID)
 /*
  * util_scan_gen_txvap_scan_entry() - Strip out the MBSSID tag from the received
  * frame and update the modified frame length before generating a scan entry.
@@ -3574,27 +3585,113 @@ util_scan_gen_txvap_scan_entry(struct wlan_objmgr_pdev *pdev,
 	qdf_mem_free(trimmed_frame);
 	return status;
 }
-#else
-static QDF_STATUS util_scan_parse_mbssid(struct wlan_objmgr_pdev *pdev,
-					 uint8_t *frame, qdf_size_t frame_len,
-					 uint32_t frm_subtype,
-					 struct mgmt_rx_event_params *rx_param,
-					 qdf_list_t *scan_list)
+
+/*
+ * util_scan_parse_eht_beacon() : This API will be executed
+ * only for 11BE platforms as per current design.
+ * IF MBSSID IE is present in the beacon then
+ * scan component will create a new entry for
+ * each BSSID found in the MBSSID
+ * util_scan_parse_mbssid() takes care of creating
+ * scan entries for every non tx profile present in
+ * the MBSSID tag.
+ * util_scan_gen_txvap_scan_entry() helps in generating
+ * scan entry for the tx profile.
+ */
+static QDF_STATUS
+util_scan_parse_eht_beacon(struct wlan_objmgr_pdev *pdev,
+			   uint8_t *frame, qdf_size_t frame_len,
+			   uint8_t *ie_list, uint32_t ielen,
+			   uint32_t frm_subtype,
+			   struct mgmt_rx_event_params *rx_param,
+			   qdf_list_t *scan_list,
+			   struct scan_mbssid_info *mbssid_info,
+			   uint8_t *mbssid_ie)
 {
-	return QDF_STATUS_SUCCESS;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	if (mbssid_ie) {
+		status = util_scan_parse_mbssid(pdev, frame, frame_len,
+						frm_subtype, rx_param,
+						scan_list);
+
+		if (QDF_IS_STATUS_ERROR(status)) {
+			scm_debug_rl("NonTx prof: Failed to create scan entry");
+			return status;
+		}
+
+		status = util_scan_gen_txvap_scan_entry(pdev, frame,
+							frame_len, ie_list,
+							ielen, frm_subtype,
+							rx_param, scan_list,
+							mbssid_info);
+
+		if (QDF_IS_STATUS_ERROR(status))
+			scm_debug_rl("TX prof: Failed to create scan entry");
+
+		return status;
+	}
+
+	/*For Non MBSSIE case*/
+	status = util_scan_gen_scan_entry(pdev, frame, frame_len,
+					  frm_subtype, rx_param,
+					  mbssid_info, scan_list);
+
+	if (QDF_IS_STATUS_ERROR(status))
+		scm_debug_rl("Non-MBSSIE frame: Failed to create scan entry");
+
+	return status;
 }
 
+static bool
+util_scan_is_platform_eht_capable(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_objmgr_psoc *psoc = NULL;
+	struct wlan_lmac_if_tx_ops *tx_ops = NULL;
+	struct wlan_lmac_if_scan_tx_ops *scan_ops = NULL;
+	uint8_t pdev_id;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		scm_debug_rl("psoc is null");
+		return false;
+	}
+	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
+	if (!tx_ops) {
+		scm_debug_rl("tx_ops is null");
+		return false;
+	}
+	scan_ops = &tx_ops->scan;
+	if (!scan_ops) {
+		scm_debug_rl("scan_ops is null");
+		return false;
+	}
+	pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
+
+	if (scan_ops->is_platform_eht_capable)
+		return scan_ops->is_platform_eht_capable;
+
+	return false;
+}
+#else
 static QDF_STATUS
-util_scan_gen_txvap_scan_entry(struct wlan_objmgr_pdev *pdev,
-			       uint8_t *frame, qdf_size_t frame_len,
-			       uint8_t *ie_list, uint32_t ielen,
-			       uint32_t frm_subtype,
-			       struct mgmt_rx_event_params *rx_param,
-			       qdf_list_t *scan_list,
-			       struct scan_mbssid_info *mbssid_info)
+util_scan_parse_eht_beacon(struct wlan_objmgr_pdev *pdev,
+			   uint8_t *frame, qdf_size_t frame_len,
+			   uint8_t *ie_list, uint32_t ielen,
+			   uint32_t frm_subtype,
+			   struct mgmt_rx_event_params *rx_param,
+			   qdf_list_t *scan_list,
+			   struct scan_mbssid_info *mbssid_info,
+			   uint8_t *mbssid_ie)
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static bool
+util_scan_is_platform_eht_capable(struct wlan_objmgr_pdev *pdev)
+{
+	return false;
+}
 #endif
 
 static QDF_STATUS
@@ -3612,6 +3709,7 @@ util_scan_parse_beacon_frame(struct wlan_objmgr_pdev *pdev,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct scan_mbssid_info mbssid_info = { 0 };
 	uint8_t *ie_list;
+	bool eht_support = false;
 
 	hdr = (struct wlan_frame_hdr *)frame;
 	bcn = (struct wlan_bcn_frame *)
@@ -3641,45 +3739,29 @@ util_scan_parse_beacon_frame(struct wlan_objmgr_pdev *pdev,
 		}
 	}
 
-	/*
-	 * IF MBSSID IE is present in the beacon then
-	 * scan component will create a new entry for
-	 * each BSSID found in the MBSSID
-	 * util_scan_parse_mbssid() takes care of creating
-	 * scan entries for every non tx profile present in
-	 * the MBSSID tag.
-	 * util_scan_gen_txvap_scan_entry() helps in generating
-	 * scan entry for the tx profile.
-	 */
-	if (mbssid_ie) {
-		status = util_scan_parse_mbssid(pdev, frame, frame_len,
-						frm_subtype, rx_param,
-						scan_list);
-
-		if (QDF_IS_STATUS_ERROR(status)) {
-			scm_debug_rl("NonTx prof: Failed to create scan entry");
-			return status;
-		}
-
-		status = util_scan_gen_txvap_scan_entry(pdev, frame,
-							frame_len, ie_list,
-							ie_len, frm_subtype,
-							rx_param, scan_list,
-							&mbssid_info);
-		if (QDF_IS_STATUS_ERROR(status))
-			scm_debug_rl("TX prof: Failed to create scan entry");
+	eht_support = util_scan_is_platform_eht_capable(pdev);
 
+	if (eht_support) {
+		status = util_scan_parse_eht_beacon(pdev, frame, frame_len,
+						    ie_list, ie_len,
+						    frm_subtype, rx_param,
+						    scan_list, &mbssid_info,
+						    mbssid_ie);
 		return status;
 	}
 
-	/*For Non MBSSIE case*/
 	status = util_scan_gen_scan_entry(pdev, frame, frame_len,
 					  frm_subtype, rx_param,
 					  &mbssid_info,
 					  scan_list);
 
+	if (mbssid_ie)
+		status = util_scan_parse_mbssid(pdev, frame, frame_len,
+						frm_subtype, rx_param,
+						scan_list);
+
 	if (QDF_IS_STATUS_ERROR(status))
-		scm_debug_rl("Non-MBSSIE frame: Failed to create scan entry");
+		scm_debug_rl("Failed to create scan entry");
 
 	return status;
 }