diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2016-10-12 17:28:36 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-28 18:08:23 -0700 |
| commit | a30892e7849874e5dceab5b17122e58f93ee930f (patch) | |
| tree | 946603378f9c847fff8444e201e5206a96706649 | |
| parent | 17098c8d86cc2e796e37692781b04ee401c5bc36 (diff) | |
qcacld-3.0: 4.8 Kernel Migration - Remove ieee80211_band
Update references from enum ieee80211_band to nl80211_band, as
ieee80211_band was removed in version 4.7 of the Linux Kernel.
Change-Id: Id42cf6e20c3ebe921546d11fd22c3909aeb84ddd
CRs-Fixed: 1077221
(cherry picked from commit 8e62ee9836406b81fe3e418028cdb2ae8f5ec039)
| -rw-r--r-- | core/cds/src/cds_concurrency.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_assoc.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 54 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.h | 9 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ext_scan.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 6 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ocb.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_p2p.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_regulatory.c | 6 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_scan.c | 10 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_stats.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_wext.c | 4 |
12 files changed, 58 insertions, 49 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 562daefdad2d..db2594c4cdef 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -6661,11 +6661,11 @@ static bool cds_sta_p2pgo_concur_handle(hdd_adapter_t *sta_adapter, if (p2pgo_channel_num <= 14) { freq = ieee80211_channel_to_frequency( p2pgo_channel_num, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); } else { freq = ieee80211_channel_to_frequency( p2pgo_channel_num, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); } qdf_mem_zero(&hdd_avoid_freq_list, sizeof(hdd_avoid_freq_list)); diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 84b87a32d1ce..cd90e9f817cd 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3004,10 +3004,10 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, if (chan_no <= 14) freq = ieee80211_channel_to_frequency(chan_no, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); else freq = ieee80211_channel_to_frequency(chan_no, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); chan = ieee80211_get_channel(pAdapter->wdev.wiphy, freq); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b8ed55b67718..6da8f4542d97 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -118,7 +118,7 @@ #define IBSS_CFG_PROTECTION_ENABLE_MASK 0x8282 #define HDD2GHZCHAN(freq, chan, flag) { \ - .band = IEEE80211_BAND_2GHZ, \ + .band = NL80211_BAND_2GHZ, \ .center_freq = (freq), \ .hw_value = (chan), \ .flags = (flag), \ @@ -127,7 +127,7 @@ } #define HDD5GHZCHAN(freq, chan, flag) { \ - .band = IEEE80211_BAND_5GHZ, \ + .band = NL80211_BAND_5GHZ, \ .center_freq = (freq), \ .hw_value = (chan), \ .flags = (flag), \ @@ -265,7 +265,7 @@ static struct ieee80211_rate a_mode_rates[] = { static struct ieee80211_supported_band wlan_hdd_band_2_4_ghz = { .channels = NULL, .n_channels = ARRAY_SIZE(hdd_channels_2_4_ghz), - .band = IEEE80211_BAND_2GHZ, + .band = NL80211_BAND_2GHZ, .bitrates = g_mode_rates, .n_bitrates = g_mode_rates_size, .ht_cap.ht_supported = 1, @@ -284,7 +284,7 @@ static struct ieee80211_supported_band wlan_hdd_band_2_4_ghz = { static struct ieee80211_supported_band wlan_hdd_band_5_ghz = { .channels = NULL, .n_channels = ARRAY_SIZE(hdd_channels_5_ghz), - .band = IEEE80211_BAND_5GHZ, + .band = NL80211_BAND_5GHZ, .bitrates = a_mode_rates, .n_bitrates = a_mode_rates_size, .ht_cap.ht_supported = 1, @@ -5265,11 +5265,11 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy, if (pcl[i] <= ARRAY_SIZE(hdd_channels_2_4_ghz)) freq_list[i] = ieee80211_channel_to_frequency(pcl[i], - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); else freq_list[i] = ieee80211_channel_to_frequency(pcl[i], - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); } /* send the freq_list back to supplicant */ @@ -8625,7 +8625,7 @@ int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand) ENTER(); - for (i = 0; i < IEEE80211_NUM_BANDS; i++) { + for (i = 0; i < NUM_NL80211_BANDS; i++) { if (NULL == wiphy->bands[i]) continue; @@ -8637,7 +8637,7 @@ int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand) cds_get_channel_state(band->channels[j]. hw_value); - if (IEEE80211_BAND_2GHZ == i && eCSR_BAND_5G == eBand) { + if (NL80211_BAND_2GHZ == i && eCSR_BAND_5G == eBand) { /* 5G only */ #ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY /* Enable Social channels for P2P */ @@ -8652,7 +8652,7 @@ int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand) band->channels[j].flags |= IEEE80211_CHAN_DISABLED; continue; - } else if (IEEE80211_BAND_5GHZ == i && + } else if (NL80211_BAND_5GHZ == i && eCSR_BAND_24 == eBand) { /* 2G only */ band->channels[j].flags |= @@ -8812,14 +8812,14 @@ int wlan_hdd_cfg80211_init(struct device *dev, * wiphy flags don't get reset because of static memory. * It's better not to store channel in static memory. */ - wiphy->bands[IEEE80211_BAND_2GHZ] = &wlan_hdd_band_2_4_ghz; - wiphy->bands[IEEE80211_BAND_2GHZ]->channels = + wiphy->bands[NL80211_BAND_2GHZ] = &wlan_hdd_band_2_4_ghz; + wiphy->bands[NL80211_BAND_2GHZ]->channels = qdf_mem_malloc(sizeof(hdd_channels_2_4_ghz)); - if (wiphy->bands[IEEE80211_BAND_2GHZ]->channels == NULL) { + if (wiphy->bands[NL80211_BAND_2GHZ]->channels == NULL) { hdd_err("Not enough memory to allocate channels"); return -ENOMEM; } - qdf_mem_copy(wiphy->bands[IEEE80211_BAND_2GHZ]->channels, + qdf_mem_copy(wiphy->bands[NL80211_BAND_2GHZ]->channels, &hdd_channels_2_4_ghz[0], sizeof(hdd_channels_2_4_ghz)); if ((hdd_is_5g_supported(pHddCtx)) && @@ -8827,22 +8827,22 @@ int wlan_hdd_cfg80211_init(struct device *dev, (eHDD_DOT11_MODE_11g != pCfg->dot11Mode) && (eHDD_DOT11_MODE_11b_ONLY != pCfg->dot11Mode) && (eHDD_DOT11_MODE_11g_ONLY != pCfg->dot11Mode))) { - wiphy->bands[IEEE80211_BAND_5GHZ] = &wlan_hdd_band_5_ghz; - wiphy->bands[IEEE80211_BAND_5GHZ]->channels = + wiphy->bands[NL80211_BAND_5GHZ] = &wlan_hdd_band_5_ghz; + wiphy->bands[NL80211_BAND_5GHZ]->channels = qdf_mem_malloc(sizeof(hdd_channels_5_ghz)); - if (wiphy->bands[IEEE80211_BAND_5GHZ]->channels == NULL) { + if (wiphy->bands[NL80211_BAND_5GHZ]->channels == NULL) { hdd_err("Not enough memory to allocate channels"); qdf_mem_free(wiphy-> - bands[IEEE80211_BAND_2GHZ]->channels); - wiphy->bands[IEEE80211_BAND_2GHZ]->channels = NULL; + bands[NL80211_BAND_2GHZ]->channels); + wiphy->bands[NL80211_BAND_2GHZ]->channels = NULL; return -ENOMEM; } - qdf_mem_copy(wiphy->bands[IEEE80211_BAND_5GHZ]->channels, + qdf_mem_copy(wiphy->bands[NL80211_BAND_5GHZ]->channels, &hdd_channels_5_ghz[0], sizeof(hdd_channels_5_ghz)); } - for (i = 0; i < IEEE80211_NUM_BANDS; i++) { + for (i = 0; i < NUM_NL80211_BANDS; i++) { if (NULL == wiphy->bands[i]) continue; @@ -8850,7 +8850,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, for (j = 0; j < wiphy->bands[i]->n_channels; j++) { struct ieee80211_supported_band *band = wiphy->bands[i]; - if (IEEE80211_BAND_2GHZ == i && + if (NL80211_BAND_2GHZ == i && eCSR_BAND_5G == pCfg->nBandCapability) { /* 5G only */ #ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY @@ -8864,7 +8864,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, band->channels[j].flags |= IEEE80211_CHAN_DISABLED; continue; - } else if (IEEE80211_BAND_5GHZ == i && + } else if (NL80211_BAND_5GHZ == i && eCSR_BAND_24 == pCfg->nBandCapability) { /* 2G only */ band->channels[j].flags |= @@ -8921,7 +8921,7 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy) { int i; - for (i = 0; i < IEEE80211_NUM_BANDS; i++) { + for (i = 0; i < NUM_NL80211_BANDS; i++) { if (NULL != wiphy->bands[i] && (NULL != wiphy->bands[i]->channels)) { qdf_mem_free(wiphy->bands[i]->channels); @@ -10698,15 +10698,15 @@ struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter, } if (chan_no <= ARRAY_SIZE(hdd_channels_2_4_ghz) && - (wiphy->bands[IEEE80211_BAND_2GHZ] != NULL)) { + (wiphy->bands[NL80211_BAND_2GHZ] != NULL)) { freq = ieee80211_channel_to_frequency(chan_no, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); } else if ((chan_no > ARRAY_SIZE(hdd_channels_2_4_ghz)) - && (wiphy->bands[IEEE80211_BAND_5GHZ] != NULL)) { + && (wiphy->bands[NL80211_BAND_5GHZ] != NULL)) { freq = ieee80211_channel_to_frequency(chan_no, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); } else { hdd_err("Invalid chan_no %d", chan_no); kfree(mgmt); diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 602bef0c651c..5cdaad826294 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -3224,4 +3224,13 @@ static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev, #endif 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 + #endif diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index d0a968daf69c..558b15fdd0df 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -2455,7 +2455,7 @@ static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, int i, j, k; for (i = 0; i < *num_channels; i++) - for (j = 0; j < IEEE80211_NUM_BANDS; j++) { + for (j = 0; j < 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_main.c b/core/hdd/src/wlan_hdd_main.c index 1cc03ca266d5..eaa8287ecccd 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -998,7 +998,7 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, struct hdd_config *pconfig = hdd_ctx->config; struct wiphy *wiphy = hdd_ctx->wiphy; struct ieee80211_supported_band *band_5g = - wiphy->bands[IEEE80211_BAND_5GHZ]; + wiphy->bands[NL80211_BAND_5GHZ]; uint32_t temp = 0; if (!band_5g) { @@ -3992,10 +3992,10 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid, if (chan_no <= 14) freq = ieee80211_channel_to_frequency(chan_no, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); else freq = ieee80211_channel_to_frequency(chan_no, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); chan = ieee80211_get_channel(padapter->wdev.wiphy, freq); bss = hdd_cfg80211_get_bss(padapter->wdev.wiphy, chan, bssid, diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index f86a6f11f6dc..78d25b3c25fa 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -145,7 +145,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 < IEEE80211_NUM_BANDS; band_idx++) { + for (band_idx = 0; band_idx < NUM_NL80211_BANDS; band_idx++) { current_band = wiphy->bands[band_idx]; if (!current_band) continue; diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index f74f14243399..486bc6eea3c5 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -2309,10 +2309,10 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, /* Indicate an action frame. */ if (rxChan <= MAX_NO_OF_2_4_CHANNELS) freq = ieee80211_channel_to_frequency(rxChan, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); else freq = ieee80211_channel_to_frequency(rxChan, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter); diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 2c237469c234..b64a4ac7c3b5 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -386,7 +386,7 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx, band_capability = hdd_ctx->config->nBandCapability; hdd_ctx->isVHT80Allowed = 0; - for (band_num = 0; band_num < IEEE80211_NUM_BANDS; band_num++) { + for (band_num = 0; band_num < NUM_NL80211_BANDS; band_num++) { if (wiphy->bands[band_num] == NULL) continue; @@ -570,7 +570,7 @@ static void hdd_restore_custom_reg_settings(struct wiphy *wiphy, bool *reset) { struct ieee80211_supported_band *sband; - enum ieee80211_band band; + enum nl80211_band band; struct ieee80211_channel *chan; int i; @@ -578,7 +578,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 < IEEE80211_NUM_BANDS; band++) { + for (band = 0; band < 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 a52f9ae6b0aa..729f0519ccfd 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1798,7 +1798,7 @@ int wlan_hdd_cfg80211_scan(struct wiphy *wiphy, * Return: o for failure, rate bitmap for success */ static uint32_t wlan_hdd_get_rates(struct wiphy *wiphy, - enum ieee80211_band band, + enum nl80211_band band, const u8 *rates, unsigned int rate_count) { uint32_t j, count, rate_bitmap = 0; @@ -1885,7 +1885,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SCAN_MAX + 1]; struct cfg80211_scan_request *request = NULL; struct nlattr *attr; - enum ieee80211_band band; + enum nl80211_band band; uint8_t n_channels = 0, n_ssid = 0, ie_len = 0; uint32_t tmp, count, j; unsigned int len; @@ -1910,7 +1910,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 < IEEE80211_NUM_BANDS; band++) + for (band = 0; band < NUM_NL80211_BANDS; band++) if (wiphy->bands[band]) n_channels += wiphy->bands[band]->n_channels; } @@ -1965,7 +1965,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, count++; } } else { - for (band = 0; band < IEEE80211_NUM_BANDS; band++) { + for (band = 0; band < NUM_NL80211_BANDS; band++) { if (!wiphy->bands[band]) continue; for (j = 0; j < wiphy->bands[band]->n_channels; @@ -2001,7 +2001,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, request->ie_len); } - for (count = 0; count < IEEE80211_NUM_BANDS; count++) + for (count = 0; count < NUM_NL80211_BANDS; count++) if (wiphy->bands[count]) request->rates[count] = (1 << wiphy->bands[count]->n_bitrates) - 1; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 9061136c7940..d03a97c50299 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -2355,7 +2355,7 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, sme_get_operation_channel(halHandle, &channel, pAdapter->sessionId); hdd_wlan_get_freq(channel, &freq); - for (i = 0; i < IEEE80211_NUM_BANDS; i++) { + for (i = 0; i < NUM_NL80211_BANDS; i++) { if (NULL == wiphy->bands[i]) continue; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 2761f9e7b65d..9beba4fc996a 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -5086,10 +5086,10 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, return -EIO; } if (phddctx->config->nChannelBondingMode5GHz) - phddctx->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap + phddctx->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; else - phddctx->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap + phddctx->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; hdd_warn("New_Phymode= %d ch_bonding=%d band=%d VHT_ch_width=%u", |
