Browse Source

qcacld-3.0: Populate correct HT MCS index in station stats

HT MCS index returned by wma_get_mcs_idx function is
between 0 and 7 for both nss equal to 1 and 2. This
results in incorrect HT MCS index for nss 2 case
populated in station stats on using iw station dump
command.

Fix is to set the correct HT MCS index based on nss.

Change-Id: Id4ac51b56bc44e90ea0e7570b387450af83ee8f5
CRs-Fixed: 2182050
Yeshwanth Sriram Guntuka 7 years ago
parent
commit
d18c7a27a7
2 changed files with 10 additions and 2 deletions
  1. 6 2
      core/hdd/src/wlan_hdd_stats.c
  2. 4 0
      core/wma/src/wma_utils.c

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

@@ -4248,6 +4248,8 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 					}
 					maxSpeedMCS = 1;
 				}
+				if (nss == 2)
+					maxMCSIdx += MAX_HT_MCS_IDX;
 			}
 		}
 
@@ -4274,7 +4276,6 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 		} else {
 			sinfo->txrate.mcs = maxMCSIdx;
 			sinfo->txrate.nss = nss;
-			sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
 
 			if (rate_flags & eHAL_TX_RATE_VHT80)
 				hdd_set_rate_bw(&sinfo->txrate, HDD_RATE_BW_80);
@@ -4287,6 +4288,8 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 				if (rate_flags & eHAL_TX_RATE_HT40)
 					hdd_set_rate_bw(&sinfo->txrate,
 							HDD_RATE_BW_40);
+			} else {
+				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
 			}
 
 			if (rate_flags & eHAL_TX_RATE_SGI) {
@@ -4312,7 +4315,6 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 			/* must be MCS */
 			sinfo->txrate.mcs = mcs_index;
 			sinfo->txrate.nss = nss;
-			sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
 
 			if (rate_flags & eHAL_TX_RATE_VHT80)
 				hdd_set_rate_bw(&sinfo->txrate, HDD_RATE_BW_80);
@@ -4325,6 +4327,8 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 				if (rate_flags & eHAL_TX_RATE_HT40)
 					hdd_set_rate_bw(&sinfo->txrate,
 							HDD_RATE_BW_40);
+			} else {
+				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
 			}
 
 			if (rate_flags & eHAL_TX_RATE_SGI) {

+ 4 - 0
core/wma/src/wma_utils.c

@@ -263,6 +263,8 @@ static uint8_t wma_get_mcs_idx(uint16_t maxRate, uint8_t rate_flags,
 					mcs_nss2[index].ht40_rate[1]);
 			if (match_rate) {
 				*mcsRateFlag = eHAL_TX_RATE_HT40;
+				if (nss == 2)
+					index += MAX_HT_MCS_IDX;
 				goto rate_found;
 			}
 		}
@@ -276,6 +278,8 @@ static uint8_t wma_get_mcs_idx(uint16_t maxRate, uint8_t rate_flags,
 					mcs_nss2[index].ht20_rate[1]);
 			if (match_rate) {
 				*mcsRateFlag = eHAL_TX_RATE_HT20;
+				if (nss == 2)
+					index += MAX_HT_MCS_IDX;
 				goto rate_found;
 			}
 		}