Bladeren bron

qcacmn: copy the right Vendor IE for reported STA

If Vendor IE also presents in STA profile, it only needs
to copy the vendor IE from STA profile for link specific
frame and reported BSSID.

Change-Id: I48ed4e88f097fe6570b3f3df764cd707c4b758d3
CRs-Fixed: 3136382
Paul Zhang 3 jaren geleden
bovenliggende
commit
648757b8ca
2 gewijzigde bestanden met toevoegingen van 16 en 97 verwijderingen
  1. 8 61
      umac/mlo_mgr/src/utils_mlo.c
  2. 8 36
      umac/scan/dispatcher/src/wlan_scan_utils_api.c

+ 8 - 61
umac/mlo_mgr/src/utils_mlo.c

@@ -1849,67 +1849,14 @@ QDF_STATUS util_gen_link_assoc_reqrsp_cmn(uint8_t *frame, qdf_size_t frame_len,
 
 			if ((reportingsta_ie[ID_POS] == WLAN_ELEMID_VENDOR) &&
 			    (sta_prof_iesection_remlen >= MIN_VENDOR_TAG_LEN)) {
-				if (!qdf_mem_cmp(reportingsta_ie +
-							PAYLOAD_START_POS,
-						 sta_prof_ie +
-							PAYLOAD_START_POS,
-						 OUI_LEN)) {
-					/* Same vendor IE, copy from STA profile
-					 */
-					if ((link_frame_currpos +
-							sta_prof_ie_size) <=
-						(link_frame +
-							link_frame_maxsize)) {
-						qdf_mem_copy(link_frame_currpos,
-							     sta_prof_ie,
-							     sta_prof_ie_size);
-
-						link_frame_currpos +=
-							sta_prof_ie_size;
-						link_frame_currlen +=
-							sta_prof_ie_size;
-
-						mlo_debug("Vendor IE (%zu octets) for reporting STA also present in STA profile. Copied IE from STA profile to link specific frame",
-							  sta_prof_ie_size);
-
-						sta_prof_ie[0] = 0;
-					} else {
-						mlo_err_rl("Insufficent space in link specific frame for IE with element ID : %u. Required: %zu octets, available: %zu octets",
-							   sta_prof_ie[ID_POS],
-							   sta_prof_ie_size,
-							   link_frame_maxsize -
-							   link_frame_currlen);
-
-						qdf_mem_free(mlieseqpayload_copy);
-						return QDF_STATUS_E_NOMEM;
-					}
-				} else {
-					if ((link_frame_currpos +
-							reportingsta_ie_size) <=
-						(link_frame +
-							link_frame_maxsize)) {
-						qdf_mem_copy(link_frame_currpos,
-							     reportingsta_ie,
-							     reportingsta_ie_size);
-
-						link_frame_currpos +=
-							reportingsta_ie_size;
-						link_frame_currlen +=
-							reportingsta_ie_size;
-
-						mlo_debug("Vendor IE (%zu octets) present for reporting STA but not present in STA profile. Copied IE from reporting frame to link specific frame",
-							  reportingsta_ie_size);
-					} else {
-						mlo_err_rl("Insufficent space in link specific frame for IE with element ID : %u. Required: %zu octets, available: %zu octets",
-							   reportingsta_ie[ID_POS],
-							   reportingsta_ie_size,
-							   link_frame_maxsize -
-							   link_frame_currlen);
-
-						qdf_mem_free(mlieseqpayload_copy);
-						return QDF_STATUS_E_NOMEM;
-					}
-				}
+				/* If Vendor IE also presents in STA profile,
+				 * then ignore the Vendor IE which is for
+				 * reporting STA. It only needs to copy Vendor
+				 * IE from STA profile to link specific frame.
+				 * The copy happens when going through the
+				 * remaining IEs.
+				 */
+				;
 			} else {
 				/* Copy IE from STA profile into link specific
 				 * frame.

+ 8 - 36
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -2373,16 +2373,6 @@ static void util_parse_noninheritance_list(uint8_t *extn_elem,
 	}
 }
 
-static size_t util_oui_header_len(uint8_t *ie)
-{
-	/* Cisco Vendor Specific IEs doesn't have subtype in
-	 * their VSIE header, therefore skip subtype
-	 */
-	if (ie[0] == 0x00 && ie[1] == 0x40 && ie[2] == 0x96)
-		return OUI_LEN - 1;
-	return OUI_LEN;
-}
-
 static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
 				uint8_t *subelement,
 				size_t subie_len, uint8_t *new_ie)
@@ -2480,32 +2470,14 @@ 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) {
-				if (!qdf_mem_cmp(tmp_old + PAYLOAD_START_POS,
-						 tmp + PAYLOAD_START_POS,
-						 util_oui_header_len(tmp +
-								     PAYLOAD_START_POS))) {
-					/* same vendor ie, copy from
-					 * subelement
-					 */
-					if ((pos + tmp[1] + MIN_IE_LEN) <=
-					    (new_ie + ielen)) {
-						qdf_mem_copy(pos, tmp,
-							     tmp[1] +
-							     MIN_IE_LEN);
-						pos += tmp[1] + MIN_IE_LEN;
-						tmp[0] = 0;
-					}
-				} else {
-					if ((pos + tmp_old[1] +
-					     MIN_IE_LEN) <=
-					    (new_ie + ielen)) {
-						qdf_mem_copy(pos, tmp_old,
-							     tmp_old[1] +
-							     MIN_IE_LEN);
-						pos += tmp_old[1] +
-							MIN_IE_LEN;
-					}
-				}
+				/* If Vendor IE also presents in STA profile,
+				 * then ignore the Vendor IE which is for
+				 * reporting STA. It only needs to copy Vendor
+				 * IE from STA profile for reported BSSID.
+				 * 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]) {