Explorar el Código

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 hace 2 años
padre
commit
0c49f87280
Se han modificado 1 ficheros con 24 adiciones y 6 borrados
  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. */