ソースを参照

qcacld-3.0: Update rate flags correctly

Currently driver does not update the rate flags correctly
in wma as rate flags should include all the subsets of the
lower rate sets, which is not the case today and driver only
updates the higher rate flag. Because of which it leads to
invalid computation of txrate at the kernel.

To address this issue, update the rate flags correctly in
wma.

Change-Id: I5529532b3d41b68693b5b4b8952ee0f1414354db
CRs-Fixed: 2776370
Ashish Kumar Dhanotiya 4 年 前
コミット
4218ed940a
3 ファイル変更29 行追加20 行削除
  1. 8 0
      core/wma/inc/wma_internal.h
  2. 20 10
      core/wma/src/wma_data.c
  3. 1 10
      core/wma/src/wma_dev_if.c

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

@@ -973,6 +973,14 @@ QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
 void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
 			    struct bss_params *add_bss);
 
+/**
+ * wma_get_vht_rate_flags() - Return the VHT rate flags corresponding to the BW
+ * @ch_width: BW for which rate flags is required
+ *
+ * Return: Rate flags corresponding to ch_width
+ */
+enum tx_rate_info wma_get_vht_rate_flags(enum phy_ch_width ch_width);
+
 int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
 
 /**

+ 20 - 10
core/wma/src/wma_data.c

@@ -804,6 +804,25 @@ static bool wma_get_bss_he_capable(struct bss_params *add_bss)
 }
 #endif
 
+enum tx_rate_info wma_get_vht_rate_flags(enum phy_ch_width ch_width)
+{
+	enum tx_rate_info rate_flags = 0;
+
+	if (ch_width == CH_WIDTH_80P80MHZ)
+		rate_flags |= TX_RATE_VHT160 | TX_RATE_VHT80 | TX_RATE_VHT40 |
+				TX_RATE_VHT20;
+	if (ch_width == CH_WIDTH_160MHZ)
+		rate_flags |= TX_RATE_VHT160 | TX_RATE_VHT80 | TX_RATE_VHT40 |
+				TX_RATE_VHT20;
+	if (ch_width == CH_WIDTH_80MHZ)
+		rate_flags |= TX_RATE_VHT80 | TX_RATE_VHT40 | TX_RATE_VHT20;
+	else if (ch_width)
+		rate_flags |= TX_RATE_VHT40 | TX_RATE_VHT20;
+	else
+		rate_flags |= TX_RATE_VHT20;
+	return rate_flags;
+}
+
 void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
 			    struct bss_params *add_bss)
 {
@@ -823,16 +842,7 @@ void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
 	if (QDF_STATUS_SUCCESS !=
 		wma_set_bss_rate_flags_he(rate_flags, add_bss)) {
 		if (add_bss->vhtCapable) {
-			if (add_bss->ch_width == CH_WIDTH_80P80MHZ)
-				*rate_flags |= TX_RATE_VHT160;
-			if (add_bss->ch_width == CH_WIDTH_160MHZ)
-				*rate_flags |= TX_RATE_VHT160;
-			if (add_bss->ch_width == CH_WIDTH_80MHZ)
-				*rate_flags |= TX_RATE_VHT80;
-			else if (add_bss->ch_width)
-				*rate_flags |= TX_RATE_VHT40;
-			else
-				*rate_flags |= TX_RATE_VHT20;
+			*rate_flags = wma_get_vht_rate_flags(add_bss->ch_width);
 		}
 		/* avoid to conflict with htCapable flag */
 		else if (add_bss->htCapable) {

+ 1 - 10
core/wma/src/wma_dev_if.c

@@ -981,16 +981,7 @@ void wma_update_rate_flags_after_vdev_restart(tp_wma_handle wma,
 		else
 			*rate_flags |= TX_RATE_HE20;
 	} else if (IS_WLAN_PHYMODE_VHT(bss_phymode)) {
-		if (des_chan->ch_width == CH_WIDTH_80P80MHZ)
-			*rate_flags |= TX_RATE_VHT160;
-		if (des_chan->ch_width == CH_WIDTH_160MHZ)
-			*rate_flags |= TX_RATE_VHT160;
-		if (des_chan->ch_width == CH_WIDTH_80MHZ)
-			*rate_flags |= TX_RATE_VHT80;
-		else if (des_chan->ch_width)
-			*rate_flags |= TX_RATE_VHT40;
-		else
-			*rate_flags |= TX_RATE_VHT20;
+		*rate_flags |= wma_get_vht_rate_flags(des_chan->ch_width);
 	} else if (IS_WLAN_PHYMODE_HT(bss_phymode)) {
 		if (des_chan->ch_width)
 			*rate_flags |= TX_RATE_HT40;