diff options
author | Srinivas Girigowda <sgirigow@codeaurora.org> | 2017-06-12 23:00:38 -0700 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2020-02-05 00:08:51 +0100 |
commit | 86b2f67c3b4b926e6d948b5f587bb0b56573e749 (patch) | |
tree | 15871e420537f201150f8bacaed83e2d0c7ad5ca | |
parent | 9b30776ecfa7ed45bb90bd8c1f577e4600036820 (diff) |
qcacld-2.0: Fix clang warnings implicit enum nl80211_band
warning: implicit conversion from enumeration type 'enum
nl80211_band' to different enumeration type 'enum ieee80211_band'
[-Wenum-conversion]
Signed-off-by: Subhajeet Muhuri <kenny3fcb@gmail.com>
7 files changed, 59 insertions, 51 deletions
diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_main.h b/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_main.h index c5bf533f9e79..fbcdb4b877a6 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_main.h +++ b/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_main.h @@ -79,6 +79,14 @@ * the Net Device queue again */ #define HDD_TX_QUEUE_LOW_WATER_MARK (HDD_TX_QUEUE_MAX_LEN*3/4) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) +#define HDD_NL80211_BAND_2GHZ NL80211_BAND_2GHZ +#define HDD_NL80211_BAND_5GHZ NL80211_BAND_5GHZ +#else +#define HDD_NL80211_BAND_2GHZ IEEE80211_BAND_2GHZ +#define HDD_NL80211_BAND_5GHZ IEEE80211_BAND_5GHZ +#endif + /** Length of the TX queue for the netdev */ #define HDD_NETDEV_TX_QUEUE_LEN (3000) diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c index 052ea3f84fa2..aeea0895a12e 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c @@ -3184,10 +3184,10 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, if (chan_no <= 14) freq = ieee80211_channel_to_frequency(chan_no, - NL80211_BAND_2GHZ); + HDD_NL80211_BAND_2GHZ); else freq = ieee80211_channel_to_frequency(chan_no, - NL80211_BAND_5GHZ); + HDD_NL80211_BAND_5GHZ); chan = ieee80211_get_channel(pAdapter->wdev.wiphy, freq); diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c index 1269d3f2c7d5..955ad43ac9e4 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -168,7 +168,7 @@ #define IBSS_CFG_PROTECTION_ENABLE_MASK 0x8282 #define HDD2GHZCHAN(freq, chan, flag) { \ - .band = NL80211_BAND_2GHZ, \ + .band = HDD_NL80211_BAND_2GHZ, \ .center_freq = (freq), \ .hw_value = (chan),\ .flags = (flag), \ @@ -177,7 +177,7 @@ } #define HDD5GHZCHAN(freq, chan, flag) { \ - .band = NL80211_BAND_5GHZ, \ + .band = HDD_NL80211_BAND_5GHZ, \ .center_freq = (freq), \ .hw_value = (chan),\ .flags = (flag), \ @@ -376,7 +376,7 @@ static struct ieee80211_supported_band wlan_hdd_band_2_4_GHZ = { .channels = NULL, .n_channels = ARRAY_SIZE(hdd_channels_2_4_GHZ), - .band = NL80211_BAND_2GHZ, + .band = HDD_NL80211_BAND_2GHZ, .bitrates = g_mode_rates, .n_bitrates = g_mode_rates_size, .ht_cap.ht_supported = 1, @@ -406,7 +406,7 @@ static struct ieee80211_supported_band wlan_hdd_band_5_GHZ = { .channels = NULL, .n_channels = ARRAY_SIZE(hdd_channels_5_GHZ), - .band = NL80211_BAND_5GHZ, + .band = HDD_NL80211_BAND_5GHZ, .bitrates = a_mode_rates, .n_bitrates = a_mode_rates_size, .ht_cap.ht_supported = 1, @@ -16512,15 +16512,15 @@ 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[NL80211_BAND_2GHZ] = &wlan_hdd_band_2_4_GHZ; - wiphy->bands[NL80211_BAND_2GHZ]->channels = + wiphy->bands[HDD_NL80211_BAND_2GHZ] = &wlan_hdd_band_2_4_GHZ; + wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels = vos_mem_malloc(sizeof(hdd_channels_2_4_GHZ)); - if (wiphy->bands[NL80211_BAND_2GHZ]->channels == NULL) { + if (wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels == NULL) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("Not enough memory to allocate channels")); return -ENOMEM; } - vos_mem_copy(wiphy->bands[NL80211_BAND_2GHZ]->channels, + vos_mem_copy(wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels, &hdd_channels_2_4_GHZ[0], sizeof(hdd_channels_2_4_GHZ)); if (hdd_is_5g_supported(pHddCtx) && @@ -16529,52 +16529,52 @@ int wlan_hdd_cfg80211_init(struct device *dev, (eHDD_DOT11_MODE_11b_ONLY != pCfg->dot11Mode) && (eHDD_DOT11_MODE_11g_ONLY != pCfg->dot11Mode))) { - wiphy->bands[NL80211_BAND_5GHZ] = &wlan_hdd_band_5_GHZ; + wiphy->bands[HDD_NL80211_BAND_5GHZ] = &wlan_hdd_band_5_GHZ; if (pCfg->dot11p_mode) { - wiphy->bands[NL80211_BAND_5GHZ]->channels = + wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels = vos_mem_malloc(sizeof(hdd_channels_5_GHZ) + sizeof(hdd_channels_dot11p)); - if (wiphy->bands[NL80211_BAND_5GHZ]->channels == NULL) { + if (wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels == NULL) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("Not enough memory to allocate channels")); - vos_mem_free(wiphy->bands[NL80211_BAND_2GHZ]->channels); - wiphy->bands[NL80211_BAND_2GHZ]->channels = NULL; + vos_mem_free(wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels); + wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels = NULL; return -ENOMEM; } - wiphy->bands[NL80211_BAND_5GHZ]->n_channels = + wiphy->bands[HDD_NL80211_BAND_5GHZ]->n_channels = ARRAY_SIZE(hdd_channels_5_GHZ) + ARRAY_SIZE(hdd_channels_dot11p); - vos_mem_copy(wiphy->bands[NL80211_BAND_5GHZ]->channels, + vos_mem_copy(wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels, &hdd_channels_5_GHZ[0], sizeof(hdd_channels_5_GHZ)); - vos_mem_copy((char *)wiphy->bands[NL80211_BAND_5GHZ]->channels + vos_mem_copy((char *)wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels + sizeof(hdd_channels_5_GHZ), &hdd_channels_dot11p[0], sizeof(hdd_channels_dot11p)); } else { - wiphy->bands[NL80211_BAND_5GHZ]->channels = + wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels = vos_mem_malloc(sizeof(hdd_channels_5_GHZ) + sizeof(hdd_etsi_srd_chan)); - if (wiphy->bands[NL80211_BAND_5GHZ]->channels == NULL) { + if (wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels == NULL) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("Not enough memory to allocate channels")); - vos_mem_free(wiphy->bands[NL80211_BAND_2GHZ]->channels); - wiphy->bands[NL80211_BAND_2GHZ]->channels = NULL; + vos_mem_free(wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels); + wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels = NULL; return -ENOMEM; } - wiphy->bands[NL80211_BAND_5GHZ]->n_channels = + wiphy->bands[HDD_NL80211_BAND_5GHZ]->n_channels = ARRAY_SIZE(hdd_channels_5_GHZ) + ARRAY_SIZE(hdd_etsi_srd_chan); - vos_mem_copy(wiphy->bands[NL80211_BAND_5GHZ]->channels, + vos_mem_copy(wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels, &hdd_channels_5_GHZ[0], sizeof(hdd_channels_5_GHZ)); - vos_mem_copy((char *)wiphy->bands[NL80211_BAND_5GHZ]->channels + vos_mem_copy((char *)wiphy->bands[HDD_NL80211_BAND_5GHZ]->channels + sizeof(hdd_channels_5_GHZ), &hdd_etsi_srd_chan[0], sizeof(hdd_etsi_srd_chan)); @@ -16591,7 +16591,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, { struct ieee80211_supported_band *band = wiphy->bands[i]; - if (NL80211_BAND_2GHZ == i && eCSR_BAND_5G == pCfg->nBandCapability) // 5G only + if (HDD_NL80211_BAND_2GHZ == i && eCSR_BAND_5G == pCfg->nBandCapability) // 5G only { #ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY // Enable social channels for P2P @@ -16602,7 +16602,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, band->channels[j].flags |= IEEE80211_CHAN_DISABLED; continue; } - else if (NL80211_BAND_5GHZ == i && eCSR_BAND_24 == pCfg->nBandCapability) // 2G only + else if (HDD_NL80211_BAND_5GHZ == i && eCSR_BAND_24 == pCfg->nBandCapability) // 2G only { band->channels[j].flags |= IEEE80211_CHAN_DISABLED; continue; @@ -16697,10 +16697,10 @@ void wlan_hdd_update_wiphy(struct wiphy *wiphy, wiphy->max_ap_assoc_sta = ctx->max_peers; if (!sme_IsFeatureSupportedByFW(DOT11AC)) { - wiphy->bands[NL80211_BAND_2GHZ]->vht_cap.vht_supported = 0; - wiphy->bands[NL80211_BAND_2GHZ]->vht_cap.cap = 0; - wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.vht_supported = 0; - wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.cap = 0; + wiphy->bands[HDD_NL80211_BAND_2GHZ]->vht_cap.vht_supported = 0; + wiphy->bands[HDD_NL80211_BAND_2GHZ]->vht_cap.cap = 0; + wiphy->bands[HDD_NL80211_BAND_5GHZ]->vht_cap.vht_supported = 0; + wiphy->bands[HDD_NL80211_BAND_5GHZ]->vht_cap.cap = 0; } status = ccmCfgGetInt(ctx->hHal, WNI_CFG_HT_CAP_INFO, &val32); @@ -16714,11 +16714,11 @@ void wlan_hdd_update_wiphy(struct wiphy *wiphy, ht_cap_info = (tSirMacHTCapabilityInfo *)&val16; if (ht_cap_info->txSTBC == TRUE) { - if (NULL != wiphy->bands[NL80211_BAND_2GHZ]) - wiphy->bands[NL80211_BAND_2GHZ]->ht_cap.cap |= + if (NULL != wiphy->bands[HDD_NL80211_BAND_2GHZ]) + wiphy->bands[HDD_NL80211_BAND_2GHZ]->ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC; - if (NULL != wiphy->bands[NL80211_BAND_5GHZ]) - wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap |= + if (NULL != wiphy->bands[HDD_NL80211_BAND_5GHZ]) + wiphy->bands[HDD_NL80211_BAND_5GHZ]->ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC; } } @@ -21743,11 +21743,11 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, } if (chan_no <= ARRAY_SIZE(hdd_channels_2_4_GHZ) && - (wiphy->bands[NL80211_BAND_2GHZ] != NULL)) { - freq = ieee80211_channel_to_frequency(chan_no, NL80211_BAND_2GHZ); + (wiphy->bands[HDD_NL80211_BAND_2GHZ] != NULL)) { + freq = ieee80211_channel_to_frequency(chan_no, HDD_NL80211_BAND_2GHZ); } else if ((chan_no > ARRAY_SIZE(hdd_channels_2_4_GHZ)) && - (wiphy->bands[NL80211_BAND_5GHZ] != NULL)) { - freq = ieee80211_channel_to_frequency(chan_no, NL80211_BAND_5GHZ); + (wiphy->bands[HDD_NL80211_BAND_5GHZ] != NULL)) { + freq = ieee80211_channel_to_frequency(chan_no, HDD_NL80211_BAND_5GHZ); } else { hddLog(LOGE, FL("Invalid chan_no %d"), chan_no); kfree(mgmt); @@ -23477,10 +23477,10 @@ static bool wlan_hdd_sta_p2pgo_concur_handle(hdd_context_t *hdd_ctx, WLAN_HDD_GET_AP_CTX_PTR(p2pgo_adapter)->operatingChannel; if (p2pgo_channel_num <= ARRAY_SIZE(hdd_channels_2_4_GHZ)) { freq = ieee80211_channel_to_frequency(p2pgo_channel_num, - NL80211_BAND_2GHZ); + HDD_NL80211_BAND_2GHZ); } else { freq = ieee80211_channel_to_frequency(p2pgo_channel_num, - NL80211_BAND_5GHZ); + HDD_NL80211_BAND_5GHZ); } vos_mem_zero(&hdd_avoid_freq_list, sizeof(hdd_avoid_freq_list)); @@ -28892,9 +28892,9 @@ static inline void wlan_hdd_sched_scan_update_relative_rssi( { pno_request->relative_rssi_set = request->relative_rssi_set; pno_request->relative_rssi = request->relative_rssi; - if (NL80211_BAND_2GHZ == request->rssi_adjust.band) + if (HDD_NL80211_BAND_2GHZ == request->rssi_adjust.band) pno_request->band_rssi_pref.band = SIR_BAND_2_4_GHZ; - else if (NL80211_BAND_5GHZ == request->rssi_adjust.band) + else if (HDD_NL80211_BAND_5GHZ == request->rssi_adjust.band) pno_request->band_rssi_pref.band = SIR_BAND_5_GHZ; pno_request->band_rssi_pref.rssi = request->rssi_adjust.delta; } diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c index 54f4ddd52789..3a455aea26d4 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c @@ -13353,10 +13353,10 @@ void hdd_connect_result(struct net_device *dev, if (chan_no <= 14) freq = ieee80211_channel_to_frequency(chan_no, - NL80211_BAND_2GHZ); + HDD_NL80211_BAND_2GHZ); else freq = ieee80211_channel_to_frequency(chan_no, - NL80211_BAND_5GHZ); + HDD_NL80211_BAND_5GHZ); chan = ieee80211_get_channel(padapter->wdev.wiphy, freq); bss = hdd_cfg80211_get_bss(padapter->wdev.wiphy, chan, bssid, diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c index 0a21d1a2fadf..097709a78bda 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c @@ -3272,12 +3272,12 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, if( rxChan <= MAX_NO_OF_2_4_CHANNELS ) { freq = ieee80211_channel_to_frequency( rxChan, - NL80211_BAND_2GHZ); + HDD_NL80211_BAND_2GHZ); } else { freq = ieee80211_channel_to_frequency( rxChan, - NL80211_BAND_5GHZ); + HDD_NL80211_BAND_5GHZ); } cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c index 5e53207849be..55c3164cb8ef 100644 --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c @@ -5617,10 +5617,10 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, } if (phddctx->cfg_ini->nChannelBondingMode5GHz) - phddctx->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap |= + phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; else - phddctx->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap &= + phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c index 6b3a5dda0215..0fd84d4967dc 100644 --- a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c @@ -1921,7 +1921,7 @@ int vos_update_band(v_U8_t band_capability) vos_nv_getChannelEnabledState( band->channels[j].hw_value); /* 5G only */ - if (NL80211_BAND_2GHZ == i && + if (HDD_NL80211_BAND_2GHZ == i && eCSR_BAND_5G == band_capability) { #ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY /* Enable Social channels for P2P */ @@ -1936,7 +1936,7 @@ int vos_update_band(v_U8_t band_capability) band->channels[j].flags |= IEEE80211_CHAN_DISABLED; continue; - } else if (NL80211_BAND_5GHZ == i && + } else if (HDD_NL80211_BAND_5GHZ == i && eCSR_BAND_24 == band_capability) { /* 2.4G only */ band->channels[j].flags |= |