Parcourir la source

qcacld-3.0: Update rate_info_flag for Kernel upgrade

Commit: b51f3be ("cfg80211: change bandwidth reporting to explicit field")

Above commit clean up the rate flag and bandwidth info and is merged since
Kernel 4.0.

Remove bandwidth info from rate_info flag, and use a separate bw field
instead.

Change-Id: I655ed919f1069cc04ed71ee1f3d457e228734d33
CRs-fixed: 966065
Ryan Hsu il y a 9 ans
Parent
commit
3a0f5230d6
2 fichiers modifiés avec 30 ajouts et 0 suppressions
  1. 6 0
      core/hdd/src/wlan_hdd_cfg80211.c
  2. 24 0
      core/hdd/src/wlan_hdd_stats.c

+ 6 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -4447,18 +4447,24 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
 	if (!(rate_flags & eHAL_TX_RATE_LEGACY)) {
 		if (rate_flags & eHAL_TX_RATE_VHT80) {
 			final_rate_flags |= RATE_INFO_FLAGS_VHT_MCS;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) && !defined(WITH_BACKPORTS)
 			final_rate_flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH;
+#endif
 		} else if (rate_flags & eHAL_TX_RATE_VHT40) {
 			final_rate_flags |= RATE_INFO_FLAGS_VHT_MCS;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) && !defined(WITH_BACKPORTS)
 			final_rate_flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
+#endif
 		} else if (rate_flags & eHAL_TX_RATE_VHT20) {
 			final_rate_flags |= RATE_INFO_FLAGS_VHT_MCS;
 		} else if (rate_flags &
 				(eHAL_TX_RATE_HT20 | eHAL_TX_RATE_HT40)) {
 			final_rate_flags |= RATE_INFO_FLAGS_MCS;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) && !defined(WITH_BACKPORTS)
 			if (rate_flags & eHAL_TX_RATE_HT40)
 				final_rate_flags |=
 					RATE_INFO_FLAGS_40_MHZ_WIDTH;
+#endif
 		}
 
 		if (rate_flags & eHAL_TX_RATE_SGI) {

+ 24 - 0
core/hdd/src/wlan_hdd_stats.c

@@ -2046,12 +2046,20 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 			sinfo->txrate.nss = nss;
 			if (rate_flags & eHAL_TX_RATE_VHT80) {
 				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS)
+				sinfo->txrate.bw = RATE_INFO_BW_80;
+#else
 				sinfo->txrate.flags |=
 					RATE_INFO_FLAGS_80_MHZ_WIDTH;
+#endif
 			} else if (rate_flags & eHAL_TX_RATE_VHT40) {
 				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS)
+				sinfo->txrate.bw = RATE_INFO_BW_40;
+#else
 				sinfo->txrate.flags |=
 					RATE_INFO_FLAGS_40_MHZ_WIDTH;
+#endif
 			} else if (rate_flags & eHAL_TX_RATE_VHT20) {
 				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
 			} else
@@ -2061,8 +2069,12 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 			    (eHAL_TX_RATE_HT20 | eHAL_TX_RATE_HT40)) {
 				sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
 				if (rate_flags & eHAL_TX_RATE_HT40) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS)
+					sinfo->txrate.bw = RATE_INFO_BW_40;
+#else
 					sinfo->txrate.flags |=
 						RATE_INFO_FLAGS_40_MHZ_WIDTH;
+#endif
 				}
 			}
 			if (rate_flags & eHAL_TX_RATE_SGI) {
@@ -2096,19 +2108,31 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 			sinfo->txrate.nss = nss;
 			sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
 			if (rate_flags & eHAL_TX_RATE_VHT80) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS)
+				sinfo->txrate.bw = RATE_INFO_BW_80;
+#else
 				sinfo->txrate.flags |=
 					RATE_INFO_FLAGS_80_MHZ_WIDTH;
+#endif
 			} else if (rate_flags & eHAL_TX_RATE_VHT40) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS)
+				sinfo->txrate.bw = RATE_INFO_BW_40;
+#else
 				sinfo->txrate.flags |=
 					RATE_INFO_FLAGS_40_MHZ_WIDTH;
+#endif
 			}
 #endif /* WLAN_FEATURE_11AC */
 			if (rate_flags &
 			    (eHAL_TX_RATE_HT20 | eHAL_TX_RATE_HT40)) {
 				sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
 				if (rate_flags & eHAL_TX_RATE_HT40) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS)
+					sinfo->txrate.bw = RATE_INFO_BW_40;
+#else
 					sinfo->txrate.flags |=
 						RATE_INFO_FLAGS_40_MHZ_WIDTH;
+#endif
 				}
 			}
 			if (rate_flags & eHAL_TX_RATE_SGI) {