소스 검색

qcacld-3.0: Pack Supported channel IE based on range

In current design, each supported channel is packed
individually with range count as 1. This bloats the
size of the supported channel IE.

Instead as an optimization, break the supported channel
list into contiguous range of channels and encode only
the start frequency of the range and count of channels
in that range.

Change-Id: Ic5ba530ee6a8422ffc0c67acb621e76826775fa7
CRs-Fixed: 3467712
Surya Prakash Sivaraj 2 년 전
부모
커밋
0c49f87280
1개의 변경된 파일24개의 추가작업 그리고 6개의 파일을 삭제
  1. 24 6
      core/mac/src/sys/legacy/src/utils/src/parser_api.c

+ 24 - 6
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -2073,22 +2073,40 @@ populate_dot11f_supp_channels(struct mac_context *mac,
 			      tDot11fIESuppChannels *pDot11f,
 			      uint8_t nAssocType, struct pe_session *pe_session)
 {
-	uint8_t i;
+	uint8_t i, j = 0;
 	uint8_t *p;
 	struct supported_channels supportedChannels;
+	uint8_t channel, opclass, base_opclass;
 
 	wlan_add_supported_5Ghz_channels(mac->psoc, mac->pdev,
 					 supportedChannels.channelList,
 					 &supportedChannels.numChnl,
 					 false);
+
 	p = supportedChannels.channelList;
 	pDot11f->num_bands = supportedChannels.numChnl;
 
-	for (i = 0U; i < pDot11f->num_bands; ++i, ++p) {
-		pDot11f->bands[i][0] = *p;
-		pDot11f->bands[i][1] = 1;
-	}
-
+	for (i = 0U; i < pDot11f->num_bands; i++) {
+		base_opclass = wlan_reg_dmn_get_opclass_from_channel(
+						mac->scan.countryCodeCurrent,
+						p[i], BW20);
+		pDot11f->bands[j][0] = p[i];
+		pDot11f->bands[j][1] = 1;
+		channel = p[i];
+		while (i + 1 < pDot11f->num_bands && (p[i + 1] == channel + 4)) {
+			opclass = wlan_reg_dmn_get_opclass_from_channel(
+						mac->scan.countryCodeCurrent,
+						p[i + 1], BW20);
+			if (base_opclass != opclass)
+				goto skip;
+			pDot11f->bands[j][1]++;
+			channel = p[++i];
+		}
+skip:
+		j++;
+	}
+
+	pDot11f->num_bands = j;
 	pDot11f->present = 1;
 
 } /* End populate_dot11f_supp_channels. */