Get rid of the unnecessary local ieee80211_band enum

This commit is contained in:
Maxim Buzdalov 2019-07-08 04:03:08 +03:00
parent 01b808713a
commit 5342dd8f29

View File

@ -31,14 +31,18 @@
#define STATION_INFO_ASSOC_REQ_IES 0 #define STATION_INFO_ASSOC_REQ_IES 0
#endif /* Linux kernel >= 4.0.0 */ #endif /* Linux kernel >= 4.0.0 */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
enum ieee80211_band {
IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
IEEE80211_BAND_60GHZ = NL80211_BAND_60GHZ,
/* keep last */ // Creating your own enum to compare with another one is not very accurate.
IEEE80211_NUM_BANDS // I have rewritten this through defines, so that it means the same, while keeping compilers happy.
}; #define ieee80211_band nl80211_band
#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
#define IEEE80211_BAND_60GHZ NL80211_BAND_60GHZ
// this was not used in the entire *.c file, so I just safely drop it
/* keep last */
// IEEE80211_NUM_BANDS
#endif /* Linux kernel >= 4.7.0 */ #endif /* Linux kernel >= 4.7.0 */
#include <rtw_wifi_regd.h> #include <rtw_wifi_regd.h>
@ -224,9 +228,7 @@ void rtw_5g_rates_init(struct ieee80211_rate *rates)
); );
} }
struct ieee80211_supported_band *rtw_spt_band_alloc( struct ieee80211_supported_band *rtw_spt_band_alloc(enum ieee80211_band band)
enum ieee80211_band band
)
{ {
struct ieee80211_supported_band *spt_band = NULL; struct ieee80211_supported_band *spt_band = NULL;
int n_channels, n_bitrates; int n_channels, n_bitrates;
@ -805,17 +807,17 @@ check_bss:
struct wiphy *wiphy = pwdev->wiphy; struct wiphy *wiphy = pwdev->wiphy;
struct ieee80211_channel *notify_channel; struct ieee80211_channel *notify_channel;
u32 freq; u32 freq;
u16 channel = cur_network->network.Configuration.DSConfig; u16 channel = cur_network->network.Configuration.DSConfig;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
struct cfg80211_roam_info roam_info = {}; struct cfg80211_roam_info roam_info = {};
#endif #endif
freq = rtw_ch2freq(channel); freq = rtw_ch2freq(channel);
notify_channel = ieee80211_get_channel(wiphy, freq); notify_channel = ieee80211_get_channel(wiphy, freq);
#endif #endif
DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
{ {
struct cfg80211_roam_info roam_info = { struct cfg80211_roam_info roam_info = {
.channel = notify_channel, .channel = notify_channel,
@ -3983,8 +3985,8 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
mon_ndev->priv_destructor = rtw_ndev_destructor; mon_ndev->priv_destructor = rtw_ndev_destructor;
#else #else
mon_ndev->destructor = rtw_ndev_destructor; mon_ndev->destructor = rtw_ndev_destructor;
#endif #endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops; mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops;
#else #else