diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 8c8edaf1bba6..ac633aadd81e 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -32,6 +32,7 @@ source "drivers/net/wireless/rsi/Kconfig" source "drivers/net/wireless/st/Kconfig" source "drivers/net/wireless/ti/Kconfig" source "drivers/net/wireless/zydas/Kconfig" +source "drivers/net/wireless/rtl8723du/Kconfig" config PCMCIA_RAYCS tristate "Aviator/Raytheon 2.4GHz wireless support" diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile index f00d42953fb8..1e1ac3296f9d 100644 --- a/drivers/net/wireless/Makefile +++ b/drivers/net/wireless/Makefile @@ -25,3 +25,4 @@ obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o obj-$(CONFIG_USB_NET_RNDIS_WLAN) += rndis_wlan.o obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o +obj-$(CONFIG_RTL8723DU) += rtl8723du/ diff --git a/drivers/net/wireless/rtl8723du/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8723du/os_dep/linux/ioctl_cfg80211.c old mode 100644 new mode 100755 index fca94fe2359d..cd8cb0832547 --- a/drivers/net/wireless/rtl8723du/os_dep/linux/ioctl_cfg80211.c +++ b/drivers/net/wireless/rtl8723du/os_dep/linux/ioctl_cfg80211.c @@ -88,7 +88,7 @@ static const u32 rtw_cipher_suites[] = { } #define CHAN2G(_channel, _freq, _flags) { \ - .band = IEEE80211_BAND_2GHZ, \ + .band = NL80211_BAND_2GHZ, \ .center_freq = (_freq), \ .hw_value = (_channel), \ .flags = (_flags), \ @@ -97,7 +97,7 @@ static const u32 rtw_cipher_suites[] = { } #define CHAN5G(_channel, _flags) { \ - .band = IEEE80211_BAND_5GHZ, \ + .band = NL80211_BAND_5GHZ, \ .center_freq = 5000 + (5 * (_channel)), \ .hw_value = (_channel), \ .flags = (_flags), \ @@ -214,16 +214,16 @@ void rtw_5g_rates_init(struct ieee80211_rate *rates) } struct ieee80211_supported_band *rtw_spt_band_alloc( - enum ieee80211_band band + enum nl80211_band band ) { struct ieee80211_supported_band *spt_band = NULL; int n_channels, n_bitrates; - if (band == IEEE80211_BAND_2GHZ) { + if (band == NL80211_BAND_2GHZ) { n_channels = RTW_2G_CHANNELS_NUM; n_bitrates = RTW_G_RATES_NUM; - } else if (band == IEEE80211_BAND_5GHZ) { + } else if (band == NL80211_BAND_5GHZ) { n_channels = RTW_5G_CHANNELS_NUM; n_bitrates = RTW_A_RATES_NUM; } else @@ -243,10 +243,10 @@ struct ieee80211_supported_band *rtw_spt_band_alloc( spt_band->n_channels = n_channels; spt_band->n_bitrates = n_bitrates; - if (band == IEEE80211_BAND_2GHZ) { + if (band == NL80211_BAND_2GHZ) { rtw_2g_channels_init(spt_band->channels); rtw_2g_rates_init(spt_band->bitrates); - } else if (band == IEEE80211_BAND_5GHZ) { + } else if (band == NL80211_BAND_5GHZ) { rtw_5g_channels_init(spt_band->channels); rtw_5g_rates_init(spt_band->bitrates); } @@ -265,11 +265,11 @@ void rtw_spt_band_free(struct ieee80211_supported_band *spt_band) if (!spt_band) return; - if (spt_band->band == IEEE80211_BAND_2GHZ) { + if (spt_band->band == NL80211_BAND_2GHZ) { size = sizeof(struct ieee80211_supported_band) + sizeof(struct ieee80211_channel) * RTW_2G_CHANNELS_NUM + sizeof(struct ieee80211_rate) * RTW_G_RATES_NUM; - } else if (spt_band->band == IEEE80211_BAND_5GHZ) { + } else if (spt_band->band == NL80211_BAND_5GHZ) { size = sizeof(struct ieee80211_supported_band) + sizeof(struct ieee80211_channel) * RTW_5G_CHANNELS_NUM + sizeof(struct ieee80211_rate) * RTW_A_RATES_NUM; @@ -1881,8 +1881,12 @@ void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted) /* avoid WARN_ON(request != wiphy_to_dev(request->wiphy)->scan_req); */ if (pwdev_priv->scan_request->wiphy != pwdev_priv->rtw_wdev->wiphy) RTW_INFO("error wiphy compare\n"); - else - cfg80211_scan_done(pwdev_priv->scan_request, aborted); + else { + struct cfg80211_scan_info info = { + .aborted = aborted, + }; + cfg80211_scan_done(pwdev_priv->scan_request, &info); + } pwdev_priv->scan_request = NULL; } else { @@ -5984,7 +5988,7 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, } -static void rtw_cfg80211_init_ht_capab_ex(_adapter *padapter, struct ieee80211_sta_ht_cap *ht_cap, enum ieee80211_band band, u8 rf_type) +static void rtw_cfg80211_init_ht_capab_ex(_adapter *padapter, struct ieee80211_sta_ht_cap *ht_cap, enum nl80211_band band, u8 rf_type) { struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -6004,9 +6008,9 @@ static void rtw_cfg80211_init_ht_capab_ex(_adapter *padapter, struct ieee80211_s /* RX STBC */ if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_RX)) { /*rtw_rx_stbc 0: disable, bit(0):enable 2.4g, bit(1):enable 5g*/ - if (IEEE80211_BAND_2GHZ == band) + if (NL80211_BAND_2GHZ == band) stbc_rx_enable = (pregistrypriv->rx_stbc & BIT(0)) ? _TRUE : _FALSE; - if (IEEE80211_BAND_5GHZ == band) + if (NL80211_BAND_5GHZ == band) stbc_rx_enable = (pregistrypriv->rx_stbc & BIT(1)) ? _TRUE : _FALSE; if (stbc_rx_enable) { @@ -6032,7 +6036,7 @@ static void rtw_cfg80211_init_ht_capab_ex(_adapter *padapter, struct ieee80211_s } } -static void rtw_cfg80211_init_ht_capab(_adapter *padapter, struct ieee80211_sta_ht_cap *ht_cap, enum ieee80211_band band, u8 rf_type) +static void rtw_cfg80211_init_ht_capab(_adapter *padapter, struct ieee80211_sta_ht_cap *ht_cap, enum nl80211_band band, u8 rf_type) { #define MAX_BIT_RATE_40MHZ_MCS23 450 /* Mbps */ #define MAX_BIT_RATE_40MHZ_MCS15 300 /* Mbps */ @@ -6057,7 +6061,7 @@ static void rtw_cfg80211_init_ht_capab(_adapter *padapter, struct ieee80211_sta_ ht_cap->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; /* - *hw->wiphy->bands[IEEE80211_BAND_2GHZ] + *hw->wiphy->bands[NL80211_BAND_2GHZ] *base on ant_num *rx_mask: RX mask *if rx_ant =1 rx_mask[0]=0xff;==>MCS0-MCS7 @@ -6109,15 +6113,15 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter) RTW_INFO("%s:rf_type=%d\n", __func__, rf_type); if (IsSupported24G(padapter->registrypriv.wireless_mode)) { - bands = wiphy->bands[IEEE80211_BAND_2GHZ]; + bands = wiphy->bands[NL80211_BAND_2GHZ]; if (bands) - rtw_cfg80211_init_ht_capab(padapter, &bands->ht_cap, IEEE80211_BAND_2GHZ, rf_type); + rtw_cfg80211_init_ht_capab(padapter, &bands->ht_cap, NL80211_BAND_2GHZ, rf_type); } -#ifdef CONFIG_IEEE80211_BAND_5GHZ +#ifdef CONFIG_NL80211_BAND_5GHZ if (IsSupported5G(padapter->registrypriv.wireless_mode)) { - bands = wiphy->bands[IEEE80211_BAND_5GHZ]; + bands = wiphy->bands[NL80211_BAND_5GHZ]; if (bands) - rtw_cfg80211_init_ht_capab(padapter, &bands->ht_cap, IEEE80211_BAND_5GHZ, rf_type); + rtw_cfg80211_init_ht_capab(padapter, &bands->ht_cap, NL80211_BAND_5GHZ, rf_type); } #endif /* init regulary domain */ @@ -6212,11 +6216,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy) wiphy->n_cipher_suites = ARRAY_SIZE(rtw_cipher_suites); if (IsSupported24G(adapter->registrypriv.wireless_mode)) - wiphy->bands[IEEE80211_BAND_2GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_2GHZ); + wiphy->bands[NL80211_BAND_2GHZ] = rtw_spt_band_alloc(NL80211_BAND_2GHZ); -#ifdef CONFIG_IEEE80211_BAND_5GHZ +#ifdef CONFIG_NL80211_BAND_5GHZ if (IsSupported5G(adapter->registrypriv.wireless_mode)) - wiphy->bands[IEEE80211_BAND_5GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_5GHZ); + wiphy->bands[NL80211_BAND_5GHZ] = rtw_spt_band_alloc(NL80211_BAND_5GHZ); #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) @@ -6376,13 +6380,13 @@ void rtw_wiphy_free(struct wiphy *wiphy) RTW_INFO(FUNC_WIPHY_FMT"\n", FUNC_WIPHY_ARG(wiphy)); - if (wiphy->bands[IEEE80211_BAND_2GHZ]) { - rtw_spt_band_free(wiphy->bands[IEEE80211_BAND_2GHZ]); - wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; + if (wiphy->bands[NL80211_BAND_2GHZ]) { + rtw_spt_band_free(wiphy->bands[NL80211_BAND_2GHZ]); + wiphy->bands[NL80211_BAND_2GHZ] = NULL; } - if (wiphy->bands[IEEE80211_BAND_5GHZ]) { - rtw_spt_band_free(wiphy->bands[IEEE80211_BAND_5GHZ]); - wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; + if (wiphy->bands[NL80211_BAND_5GHZ]) { + rtw_spt_band_free(wiphy->bands[NL80211_BAND_5GHZ]); + wiphy->bands[NL80211_BAND_5GHZ] = NULL; } wiphy_free(wiphy); diff --git a/drivers/net/wireless/rtl8723du/os_dep/linux/wifi_regd.c b/drivers/net/wireless/rtl8723du/os_dep/linux/wifi_regd.c old mode 100644 new mode 100755 index fc58d760bca2..752419f0df72 --- a/drivers/net/wireless/rtl8723du/os_dep/linux/wifi_regd.c +++ b/drivers/net/wireless/rtl8723du/os_dep/linux/wifi_regd.c @@ -205,9 +205,9 @@ static void _rtw_reg_apply_active_scan_flags(struct wiphy *wiphy, u32 bandwidth = 0; int r; - if (!wiphy->bands[IEEE80211_BAND_2GHZ]) + if (!wiphy->bands[NL80211_BAND_2GHZ]) return; - sband = wiphy->bands[IEEE80211_BAND_2GHZ]; + sband = wiphy->bands[NL80211_BAND_2GHZ]; /* * If no country IE has been received always enable active scan @@ -258,10 +258,10 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy) struct ieee80211_channel *ch; unsigned int i; - if (!wiphy->bands[IEEE80211_BAND_5GHZ]) + if (!wiphy->bands[NL80211_BAND_5GHZ]) return; - sband = wiphy->bands[IEEE80211_BAND_5GHZ]; + sband = wiphy->bands[NL80211_BAND_5GHZ]; for (i = 0; i < sband->n_channels; i++) { ch = &sband->channels[i]; @@ -316,7 +316,7 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy) u32 freq; /* all channels disable */ - for (i = 0; i < IEEE80211_NUM_BANDS; i++) { + for (i = 0; i < NUM_NL80211_BANDS; i++) { sband = wiphy->bands[i]; if (sband) {