Răsfoiți Sursa

qcacld-3.0: Handle HE 160Mhz bandwidth rate report

Update tx rate flags to include 160Mhz bandwidth in
wma_set_bss_rate_flags_he.
Add HE 160 mcs to rate mapping for nss 1 and nss 2.
This change will fix incorrect bandwidth report via
IW command: iw wlan0 link.

Change-Id: Idd1adc4f2783b86a2a837999ea87bb38c813f213
CRs-Fixed: 2585078
Liangwei Dong 5 ani în urmă
părinte
comite
3b2fd85feb

+ 2 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -347,7 +347,8 @@ enum band_info hdd_conn_get_connected_band(struct hdd_station_ctx *sta_ctx)
 
 	if (wlan_reg_is_24ghz_ch_freq(sta_freq))
 		return BAND_2G;
-	else if (wlan_reg_is_5ghz_ch_freq(sta_freq))
+	else if (wlan_reg_is_5ghz_ch_freq(sta_freq) ||
+		 wlan_reg_is_6ghz_chan_freq(sta_freq))
 		return BAND_5G;
 	else   /* If station is not connected return as BAND_ALL */
 		return BAND_ALL;

+ 10 - 6
core/hdd/src/wlan_hdd_stats.c

@@ -3996,8 +3996,10 @@ static void wlan_hdd_fill_os_he_rateflags(struct rate_info *os_rate,
 	 * fill RATE_INFO_BW_HE_RU.
 	 */
 	if (rate_flags & (TX_RATE_HE80 | TX_RATE_HE40 |
-		TX_RATE_HE20)) {
-		if (rate_flags & TX_RATE_HE80)
+		TX_RATE_HE20 | TX_RATE_HE160)) {
+		if (rate_flags & TX_RATE_HE160)
+			hdd_set_rate_bw(os_rate, HDD_RATE_BW_160);
+		else if (rate_flags & TX_RATE_HE80)
 			hdd_set_rate_bw(os_rate, HDD_RATE_BW_80);
 		else if (rate_flags & TX_RATE_HE40)
 			hdd_set_rate_bw(os_rate, HDD_RATE_BW_40);
@@ -4197,7 +4199,8 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 		}
 		rate_flag = 0;
 
-		if (rate_flags & (TX_RATE_VHT80 | TX_RATE_HE80))
+		if (rate_flags & (TX_RATE_VHT80 | TX_RATE_HE80 |
+				TX_RATE_HE160))
 			mode = 2;
 		else if (rate_flags & (TX_RATE_HT40 |
 			 TX_RATE_VHT40 | TX_RATE_HE40))
@@ -4207,7 +4210,7 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 
 		if (rate_flags & (TX_RATE_VHT20 | TX_RATE_VHT40 |
 		    TX_RATE_VHT80 | TX_RATE_HE20 | TX_RATE_HE40 |
-		    TX_RATE_HE80)) {
+		    TX_RATE_HE80 | TX_RATE_HE160)) {
 			stat = ucfg_mlme_cfg_get_vht_tx_mcs_map(hdd_ctx->psoc,
 								&vht_mcs_map);
 			if (QDF_IS_STATUS_ERROR(stat))
@@ -4241,7 +4244,7 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 			}
 
 			if (rate_flags & (TX_RATE_HE20 | TX_RATE_HE40 |
-			    TX_RATE_HE80))
+			    TX_RATE_HE80 | TX_RATE_HE160))
 				max_mcs_idx = 11;
 
 			if (rssidx != 0) {
@@ -4312,7 +4315,8 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
 	if ((max_rate < fw_rate) || (0 == max_rate)) {
 		max_rate = fw_rate;
 	}
-
+	hdd_debug("rate_flags 0x%x, max_rate %d mcs %d nss %d",
+		  rate_flags, max_rate, max_mcs_idx, nss);
 	wlan_hdd_fill_os_rate_info(rate_flags, max_rate, rate,
 				   max_mcs_idx, nss, 0, 0);
 

+ 2 - 0
core/wma/inc/wma_internal.h

@@ -111,12 +111,14 @@ struct index_vht_data_rate_type {
  * @supported_he80_rate: he80 rate
  * @supported_he40_rate: he40 rate
  * @supported_he20_rate: he20 rate
+ * @supported_he160_rate: he160 rate
  */
 struct index_he_data_rate_type {
 	uint8_t beacon_rate_index;
 	uint16_t supported_he20_rate[MAX_HE_DCM_INDEX][3];
 	uint16_t supported_he40_rate[MAX_HE_DCM_INDEX][3];
 	uint16_t supported_he80_rate[MAX_HE_DCM_INDEX][3];
+	uint16_t supported_he160_rate[MAX_HE_DCM_INDEX][3];
 };
 #endif
 

+ 17 - 5
core/wma/src/wma_data.c

@@ -777,24 +777,35 @@ static QDF_STATUS wma_set_bss_rate_flags_he(enum tx_rate_info *rate_flags,
 
 	/*extend TX_RATE_HE160 in future*/
 	if (add_bss->ch_width == CH_WIDTH_160MHZ ||
-	    add_bss->ch_width == CH_WIDTH_80P80MHZ ||
-	    add_bss->ch_width == CH_WIDTH_80MHZ)
+	    add_bss->ch_width == CH_WIDTH_80P80MHZ)
+		*rate_flags |= TX_RATE_HE160;
+	else if (add_bss->ch_width == CH_WIDTH_80MHZ)
 		*rate_flags |= TX_RATE_HE80;
-
 	else if (add_bss->ch_width)
 		*rate_flags |= TX_RATE_HE40;
 	else
 		*rate_flags |= TX_RATE_HE20;
 
-	wma_debug("he_capable %d", add_bss->he_capable);
+	wma_debug("he_capable %d rate_flags 0x%x", add_bss->he_capable,
+		  *rate_flags);
 	return QDF_STATUS_SUCCESS;
 }
+
+static bool wma_get_bss_he_capable(struct bss_params *add_bss)
+{
+	return add_bss->he_capable;
+}
 #else
 static QDF_STATUS wma_set_bss_rate_flags_he(enum tx_rate_info *rate_flags,
 					    struct bss_params *add_bss)
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }
+
+static bool wma_get_bss_he_capable(struct bss_params *add_bss)
+{
+	return false;
+}
 #endif
 
 void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
@@ -841,7 +852,8 @@ void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
 	    add_bss->staContext.fShortGI40Mhz)
 		*rate_flags |= TX_RATE_SGI;
 
-	if (!add_bss->htCapable && !add_bss->vhtCapable)
+	if (!add_bss->htCapable && !add_bss->vhtCapable &&
+	    !wma_get_bss_he_capable(add_bss))
 		*rate_flags = TX_RATE_LEGACY;
 
 	wma_debug("capable: vht %u, ht %u, rate_flags %x, ch_width %d",

+ 71 - 29
core/wma/src/wma_utils.c

@@ -130,40 +130,52 @@ static struct index_he_data_rate_type he_mcs_nss1[] = {
 /* MCS,  {dcm0:0.8/1.6/3.2}, {dcm1:0.8/1.6/3.2} */
 	{0,  {{86,   81,   73  }, {43,   40,  36 } }, /* HE20 */
 	     {{172,  163,  146 }, {86,   81,  73 } }, /* HE40 */
-	     {{360,  340,  306 }, {180,  170, 153} } }, /* HE80 */
+	     {{360,  340,  306 }, {180,  170, 153} }, /* HE80 */
+	     {{721,  681,  613 }, {360,  340, 306} } }, /* HE160/HE80+80 */
 	{1,  {{172,  163,  146 }, {86,   81,  73 } },
 	     {{344,  325,  293 }, {172,  163, 146} },
-	     {{721,  681,  613 }, {360,  340, 306} } },
+	     {{721,  681,  613 }, {360,  340, 306} },
+	     {{1441, 1361, 1225}, {721,  681, 613} } },
 	{2,  {{258,  244,  219 }, {0} },
 	     {{516,  488,  439 }, {0} },
-	     {{1081, 1021, 919 }, {0} } },
+	     {{1081, 1021, 919 }, {0} },
+	     {{2162, 2042, 1838}, {0} } },
 	{3,  {{344,  325,  293 }, {172,  163, 146} },
 	     {{688,  650,  585 }, {344,  325, 293} },
-	     {{1441, 1361, 1225}, {721,  681, 613} } },
+	     {{1441, 1361, 1225}, {721,  681, 613} },
+	     {{2882, 2722, 2450}, {1441, 1361, 1225} } },
 	{4,  {{516,  488,  439 }, {258,  244, 219} },
 	     {{1032, 975,  878 }, {516,  488, 439} },
-	     {{2162, 2042, 1838}, {1081, 1021, 919} } },
+	     {{2162, 2042, 1838}, {1081, 1021, 919} },
+	     {{4324, 4083, 3675}, {2162, 2042, 1838} } },
 	{5,  {{688,  650,  585 }, {0} },
 	     {{1376, 1300, 1170}, {0} },
-	     {{2882, 2722, 2450}, {0} } },
+	     {{2882, 2722, 2450}, {0} },
+	     {{5765, 5444, 4900}, {0} } },
 	{6,  {{774,  731,  658 }, {0} },
 	     {{1549, 1463, 1316}, {0} },
-	     {{3243, 3063, 2756}, {0} } },
+	     {{3243, 3063, 2756}, {0} },
+	     {{6485, 6125, 5513}, {0} } },
 	{7,  {{860,  813,  731 }, {0} },
 	     {{1721, 1625, 1463}, {0} },
-	     {{3603, 3403, 3063}, {0} } },
+	     {{3603, 3403, 3063}, {0} },
+	     {{7206, 6806, 6125}, {0} } },
 	{8,  {{1032, 975,  878 }, {0} },
 	     {{2065, 1950, 1755}, {0} },
-	     {{4324, 4083, 3675}, {0} } },
+	     {{4324, 4083, 3675}, {0} },
+	     {{8647, 8167, 7350}, {0} } },
 	{9,  {{1147, 1083, 975 }, {0} },
 	     {{2294, 2167, 1950}, {0} },
-	     {{4804, 4537, 4083}, {0} } },
+	     {{4804, 4537, 4083}, {0} },
+	     {{9607, 9074, 8166}, {0} } },
 	{10, {{1290, 1219, 1097}, {0} },
 	     {{2581, 2438, 2194}, {0} },
-	     {{5404, 5104, 4594}, {0} } },
+	     {{5404, 5104, 4594}, {0} },
+	     {{10809, 10208, 9188}, {0} } },
 	{11, {{1434, 1354, 1219}, {0} },
 	     {{2868, 2708, 2438}, {0} },
-	     {{6004, 5671, 5104}, {0} } }
+	     {{6004, 5671, 5104}, {0} },
+	     {{12010, 11342, 10208}, {0} } }
 };
 
 /*MCS parameters with Nss = 2*/
@@ -171,40 +183,52 @@ static struct index_he_data_rate_type he_mcs_nss2[] = {
 /* MCS,  {dcm0:0.8/1.6/3.2}, {dcm1:0.8/1.6/3.2} */
 	{0,  {{172,   163,   146 }, {86,   81,   73 } }, /* HE20 */
 	     {{344,   325,   293 }, {172,  163,  146} }, /* HE40 */
-	     {{721,   681,   613 }, {360,  340,  306} } }, /* HE80 */
+	     {{721,   681,   613 }, {360,  340,  306} }, /* HE80 */
+	     {{1441, 1361, 1225},   {721, 681, 613} } }, /* HE160/HE80+80 */
 	{1,  {{344,   325,   293 }, {172,  163,  146} },
 	     {{688,   650,   585 }, {344,  325,  293} },
-	     {{1441,  1361,  1225}, {721,  681,  613} } },
+	     {{1441,  1361,  1225}, {721,  681,  613} },
+	     {{2882, 2722, 2450},   {1441, 1361, 1225} } },
 	{2,  {{516,   488,   439 }, {0} },
 	     {{1032,  975,   878 }, {0} },
-	     {{2162,  2042,  1838}, {0} } },
+	     {{2162,  2042,  1838}, {0} },
+	     {{4324, 4083, 3675}, {0} } },
 	{3,  {{688,   650,   585 }, {344,  325,  293 } },
 	     {{1376,  1300,  1170}, {688,  650,  585  } },
-	     {{2882,  2722,  2450}, {1441, 1361, 1225} } },
+	     {{2882,  2722,  2450}, {1441, 1361, 1225} },
+	     {{5765, 5444, 4900}, {2882, 2722, 2450} } },
 	{4,  {{1032,  975,   878 }, {516,  488,  439 } },
 	     {{2065,  1950,  1755}, {1032, 975,  878 } },
-	     {{4324,  4083,  3675}, {2162, 2042, 1838} } },
+	     {{4324,  4083,  3675}, {2162, 2042, 1838} },
+	     {{8647, 8167, 7350}, {4324, 4083, 3675} } },
 	{5,  {{1376,  1300,  1170}, {0} },
 	     {{2753,  2600,  2340}, {0} },
-	     {{5765,  5444,  4900}, {0} } },
+	     {{5765,  5444,  4900}, {0} },
+	     {{11529, 10889, 9800}, {0} } },
 	{6,  {{1549,  1463,  1316}, {0} },
 	     {{3097,  2925,  2633}, {0} },
-	     {{6485,  6125,  5513}, {0} } },
+	     {{6485,  6125,  5513}, {0} },
+	     {{12971, 12250, 11025}, {0} } },
 	{7,  {{1721,  1625,  1463}, {0} },
 	     {{3441,  3250,  2925}, {0} },
-	     {{7206,  6806,  6125}, {0} } },
+	     {{7206,  6806,  6125}, {0} },
+	     {{14412, 13611, 12250}, {0} } },
 	{8,  {{2065,  1950,  1755}, {0} },
 	     {{4129,  3900,  3510}, {0} },
-	     {{8647,  8167,  7350}, {0} } },
+	     {{8647,  8167,  7350}, {0} },
+	     {{17294, 16333, 14700}, {0} } },
 	{9,  {{2294,  2167,  1950}, {0} },
 	     {{4588,  4333,  3900}, {0} },
-	     {{9607,  9074,  8166}, {0} } },
+	     {{9607,  9074,  8166}, {0} },
+	     {{19215, 18148, 16333}, {0} } },
 	{10, {{2581,  2438,  2194}, {0} },
 	     {{5162,  4875,  4388}, {0} },
-	     {{10809, 10208, 9188}, {0} } },
+	     {{10809, 10208, 9188}, {0} },
+	     {{21618, 20417, 18375}, {0} } },
 	{11, {{2868,  2708,  2438}, {0} },
 	     {{5735,  5417,  4875}, {0} },
-	     {{12010, 11343, 10208}, {0} } }
+	     {{12010, 11343, 10208}, {0} },
+	     {{24019, 22685, 20416}, {0} } }
 };
 #endif
 
@@ -325,7 +349,7 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate,
 	uint16_t *nss2_rate;
 
 	*p_index = 0;
-	if (!(rate_flags & (TX_RATE_HE80 | TX_RATE_HE40 |
+	if (!(rate_flags & (TX_RATE_HE160 | TX_RATE_HE80 | TX_RATE_HE40 |
 		TX_RATE_HE20)))
 		return 0;
 
@@ -334,7 +358,22 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate,
 
 		for (dcm_index = 0; dcm_index < dcm_index_max;
 			 dcm_index++) {
-			if (rate_flags & TX_RATE_HE80) {
+			if (rate_flags & TX_RATE_HE160) {
+				nss1_rate = &he_mcs_nss1[index].
+					supported_he160_rate[dcm_index][0];
+				nss2_rate = &he_mcs_nss2[index].
+					supported_he160_rate[dcm_index][0];
+				/* check for he160 nss1/2 rate set */
+				match_rate = wma_mcs_rate_match(raw_rate, 1,
+								nss1_rate,
+								nss2_rate,
+								nss,
+								guard_interval);
+				if (match_rate)
+					goto rate_found;
+			}
+
+			if (rate_flags & (TX_RATE_HE80 | TX_RATE_HE160)) {
 				nss1_rate = &he_mcs_nss1[index].
 					supported_he80_rate[dcm_index][0];
 				nss2_rate = &he_mcs_nss2[index].
@@ -345,11 +384,14 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate,
 								nss2_rate,
 								nss,
 								guard_interval);
-				if (match_rate)
+				if (match_rate) {
+					*mcs_rate_flag &= ~TX_RATE_HE160;
 					goto rate_found;
+				}
 			}
 
-			if (rate_flags & (TX_RATE_HE40 | TX_RATE_HE80)) {
+			if (rate_flags & (TX_RATE_HE40 | TX_RATE_HE80 |
+					  TX_RATE_HE160)) {
 				nss1_rate = &he_mcs_nss1[index].
 					supported_he40_rate[dcm_index][0];
 				nss2_rate = &he_mcs_nss2[index].
@@ -368,7 +410,7 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate,
 			}
 
 			if (rate_flags & (TX_RATE_HE80 | TX_RATE_HE40 |
-				TX_RATE_HE20)) {
+				TX_RATE_HE20 | TX_RATE_HE160)) {
 				nss1_rate = &he_mcs_nss1[index].
 					supported_he20_rate[dcm_index][0];
 				nss2_rate = &he_mcs_nss2[index].