diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 7736f534e82d..1cef2d32f691 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -92,12 +92,15 @@ #define NUM_TX_QUEUES 4 #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) || \ + defined(CFG80211_REMOVE_IEEE80211_BACKPORT) #define HDD_NL80211_BAND_2GHZ NL80211_BAND_2GHZ #define HDD_NL80211_BAND_5GHZ NL80211_BAND_5GHZ +#define HDD_NUM_NL80211_BANDS NUM_NL80211_BANDS #else #define HDD_NL80211_BAND_2GHZ IEEE80211_BAND_2GHZ #define HDD_NL80211_BAND_5GHZ IEEE80211_BAND_5GHZ +#define HDD_NUM_NL80211_BANDS ((enum nl80211_band)IEEE80211_NUM_BANDS) #endif /** Length of the TX queue for the netdev */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 3cb46df4f1c1..b1f024007a25 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11370,7 +11370,8 @@ int wlan_hdd_cfg80211_update_band(hdd_context_t *hdd_ctx, struct wiphy *wiphy, enum channel_state channelEnabledState; ENTER(); - for (i = 0; i < NUM_NL80211_BANDS; i++) { + + for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) { if (NULL == wiphy->bands[i]) continue; @@ -11571,7 +11572,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, sizeof(hdd_channels_5_ghz)); } - for (i = 0; i < NUM_NL80211_BANDS; i++) { + for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) { if (NULL == wiphy->bands[i]) continue; @@ -11659,7 +11660,7 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy) { int i; - for (i = 0; i < NUM_NL80211_BANDS; i++) { + for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) { if (NULL != wiphy->bands[i] && (NULL != wiphy->bands[i]->channels)) { qdf_mem_free(wiphy->bands[i]->channels); diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index d285247e13b3..f6bbde19adc2 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -419,14 +419,6 @@ static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev, struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter, tSirBssDescription *bss_desc); -/* - * As of 4.7, ieee80211_band is removed; add shims so we can reference - * nl80211_band instead - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)) -#define NUM_NL80211_BANDS ((enum nl80211_band)IEEE80211_NUM_BANDS) -#endif - /** * hdd_rate_info_bw: an HDD internal rate bandwidth representation * @HDD_RATE_BW_5: 5MHz diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 4cbd469642c2..f477ed63795b 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -2399,7 +2399,7 @@ static void hdd_remove_passive_channels(struct wiphy *wiphy, int i, j, k; for (i = 0; i < *num_channels; i++) - for (j = 0; j < NUM_NL80211_BANDS; j++) { + for (j = 0; j < HDD_NUM_NL80211_BANDS; j++) { if (wiphy->bands[j] == NULL) continue; for (k = 0; k < wiphy->bands[j]->n_channels; k++) { diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index e467a2757d2d..dce49180c5a7 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -129,7 +129,7 @@ static int dot11p_validate_channel(struct wiphy *wiphy, struct ieee80211_supported_band *current_band; struct ieee80211_channel *current_channel; - for (band_idx = 0; band_idx < NUM_NL80211_BANDS; band_idx++) { + for (band_idx = 0; band_idx < HDD_NUM_NL80211_BANDS; band_idx++) { current_band = wiphy->bands[band_idx]; if (!current_band) continue; diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index e64702991bc1..cc1d83ae82de 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -389,7 +389,7 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx, band_capability = hdd_ctx->config->nBandCapability; - for (band_num = 0; band_num < NUM_NL80211_BANDS; band_num++) { + for (band_num = 0; band_num < HDD_NUM_NL80211_BANDS; band_num++) { if (wiphy->bands[band_num] == NULL) continue; @@ -636,7 +636,7 @@ static void hdd_restore_custom_reg_settings(struct wiphy *wiphy, (country_alpha2[1] == '0') && (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)) { - for (band = 0; band < NUM_NL80211_BANDS; band++) { + for (band = 0; band < HDD_NUM_NL80211_BANDS; band++) { sband = wiphy->bands[band]; if (!sband) continue; diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 411bdb696641..7607a90dc5f7 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1528,7 +1528,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES], tmp) n_channels++; } else { - for (band = 0; band < NUM_NL80211_BANDS; band++) + for (band = 0; band < HDD_NUM_NL80211_BANDS; band++) if (wiphy->bands[band]) n_channels += wiphy->bands[band]->n_channels; } @@ -1588,7 +1588,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, count++; } } else { - for (band = 0; band < NUM_NL80211_BANDS; band++) { + for (band = 0; band < HDD_NUM_NL80211_BANDS; band++) { if (!wiphy->bands[band]) continue; for (j = 0; j < wiphy->bands[band]->n_channels; @@ -1630,7 +1630,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, request->ie_len); } - for (count = 0; count < NUM_NL80211_BANDS; count++) + for (count = 0; count < HDD_NUM_NL80211_BANDS; count++) if (wiphy->bands[count]) request->rates[count] = (1 << wiphy->bands[count]->n_bitrates) - 1; @@ -1640,7 +1640,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES], tmp) { band = nla_type(attr); - if (band >= NUM_NL80211_BANDS) + if (band >= HDD_NUM_NL80211_BANDS) continue; if (!wiphy->bands[band]) continue; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 80943c78ff5b..87aa9eb60daa 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -3734,7 +3734,7 @@ static bool wlan_hdd_update_survey_info(struct wiphy *wiphy, mutex_lock(&pHddCtx->chan_info_lock); - for (i = 0; i < NUM_NL80211_BANDS && !filled; i++) { + for (i = 0; i < HDD_NUM_NL80211_BANDS && !filled; i++) { if (wiphy->bands[i] == NULL) continue; @@ -3795,7 +3795,6 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, if (pHddCtx->config->fEnableSNRMonitoring == 0) return -ENONET; - if (pHddStaCtx->hdd_ReassocScenario) { hdd_info("Roaming in progress, hence return"); return -ENONET;