Pārlūkot izejas kodu

qcacmn: Add VSIE matching with select action OUI filter

In order to identify certain vendor APs, it generated
AP beacon from MBSSID nonTx profile shall include these
Vendor Specific IEs (VSIEs).
If any matching VSIE of interest is present, copy the
IE to generated frame.

Change-Id: Ic3566ad0123c7353d7ace1b0077d6a3730d10dc8
CRs-Fixed: 3682937
Vinod Kumar Pirla 1 gadu atpakaļ
vecāks
revīzija
f26efecdf9
1 mainītis faili ar 55 papildinājumiem un 3 dzēšanām
  1. 55 3
      umac/scan/dispatcher/src/wlan_scan_utils_api.c

+ 55 - 3
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -37,6 +37,10 @@
 #endif
 #include "wlan_psoc_mlme_api.h"
 #include "reg_services_public_struct.h"
+#ifdef WLAN_FEATURE_ACTION_OUI
+#include <wlan_action_oui_main.h>
+#include <wlan_action_oui_public_struct.h>
+#endif
 
 #define MAX_IE_LEN 1024
 #define SHORT_SSID_LEN 4
@@ -2953,11 +2957,42 @@ static int util_handle_rnr_ie_for_mbssid(const uint8_t *rnr,
 }
 #endif
 
-static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
+#ifdef WLAN_FEATURE_ACTION_OUI
+static uint8_t *util_copy_reporting_ap_vendor_ies(struct wlan_objmgr_psoc *psoc,
+						  const uint8_t *ie,
+						  uint32_t ie_len,
+						  uint8_t *buf_ie)
+{
+	struct action_oui_search_attr attr;
+	enum action_oui_id oui_id = ACTION_OUI_RESTRICT_MAX_MLO_LINKS;
+
+	attr.ie_data = (uint8_t *)ie;
+	attr.ie_length = ie_len;
+
+	if (wlan_action_oui_search(psoc, &attr, oui_id)) {
+		qdf_mem_copy(buf_ie, ie, ie_len);
+		buf_ie += ie_len;
+	}
+
+	return buf_ie;
+}
+#else
+static inline uint8_t *
+util_copy_reporting_ap_vendor_ies(struct wlan_objmgr_psoc *psoc,
+				  const uint8_t *ie, uint32_t ie_len,
+				  uint8_t *buf_ie)
+{
+	return buf_ie;
+}
+#endif
+
+static uint32_t util_gen_new_ie(struct wlan_objmgr_pdev *pdev,
+				uint8_t *ie, uint32_t ielen,
 				uint8_t *subelement,
 				size_t subie_len, uint8_t *new_ie,
 				uint8_t bssid_index)
 {
+	struct wlan_objmgr_psoc *psoc;
 	uint8_t *pos, *tmp;
 	const uint8_t *tmp_old, *tmp_new;
 	uint8_t *sub_copy, *extn_elem = NULL;
@@ -2965,6 +3000,12 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
 	uint8_t *elem_list = NULL, *extn_elem_list = NULL;
 	size_t tmp_rem_len;
 
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		scm_err("NULL PSOC");
+		return 0;
+	}
+
 	/* copy subelement as we need to change its content to
 	 * mark an ie after it is processed.
 	 */
@@ -3058,6 +3099,18 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
 			tmp_rem_len = subie_len - (tmp - sub_copy);
 			if (tmp_old[0] == WLAN_ELEMID_VENDOR &&
 			    tmp_rem_len >= MIN_VENDOR_TAG_LEN) {
+				/*
+				 * In order to identify few Vendor APs the
+				 * generated frame should contain the reporting
+				 * APs matching VSIE or else the entry generated
+				 * will not have this VSIE and logic kept to
+				 * take certain action on specific Vendor APs
+				 * will fail.
+				 */
+				pos = util_copy_reporting_ap_vendor_ies(psoc,
+									tmp_old,
+									tmp_old[1] + MIN_IE_LEN,
+									pos);
 				/* If Vendor IE also presents in STA profile,
 				 * then ignore the Vendor IE which is for
 				 * reporting STA. It only needs to copy Vendor
@@ -3065,7 +3118,6 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
 				 * The copy happens when going through the
 				 * remaining IEs.
 				 */
-				;
 			} else if (tmp_old[0] == WLAN_ELEMID_EXTN_ELEM) {
 				if (tmp_old[PAYLOAD_START_POS] ==
 				    tmp[PAYLOAD_START_POS] &&
@@ -3497,7 +3549,7 @@ static QDF_STATUS util_scan_parse_mbssid(struct wlan_objmgr_pdev *pdev,
 			}
 
 			new_ie_len =
-				util_gen_new_ie(ie, ielen,
+				util_gen_new_ie(pdev, ie, ielen,
 						(nontx_profile +
 						 PAYLOAD_START_POS),
 						subie_len, new_ie,