add .gitignore and make it buildable on current linux-next

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
This commit is contained in:
Icenowy Zheng 2017-02-25 18:31:16 +08:00
parent d019573693
commit 89c045ff47
10 changed files with 188 additions and 70 deletions

View file

@ -89,7 +89,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), \
@ -98,7 +98,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), \
@ -215,18 +215,18 @@ void rtw_5g_rates_init(struct ieee80211_rate *rates)
}
struct ieee80211_supported_band *rtw_spt_band_alloc(
enum ieee80211_band band
int 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;
@ -250,12 +250,12 @@ 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);
@ -275,13 +275,13 @@ 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
@ -874,7 +874,11 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0,
WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/);
else if(pwdev->sme_state==CFG80211_SME_CONNECTED)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
#else
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, false, GFP_ATOMIC);
#endif
//else
//DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state);
@ -883,7 +887,11 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
DBG_871X(FUNC_ADPT_FMT" call cfg80211_disconnected\n", FUNC_ADPT_ARG(padapter));
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
#else
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, false, GFP_ATOMIC);
#endif
} else {
DBG_871X(FUNC_ADPT_FMT" call cfg80211_connect_result\n", FUNC_ADPT_ARG(padapter));
cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0,
@ -2017,6 +2025,9 @@ exit:
void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted)
{
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(adapter);
#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 7, 0)
struct cfg80211_scan_info scan_info;
#endif
_irqL irqL;
_enter_critical_bh(&pwdev_priv->scan_req_lock, &irqL);
@ -2032,7 +2043,13 @@ void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted)
}
else
{
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 7, 0)
cfg80211_scan_done(pwdev_priv->scan_request, aborted);
#else
memset(&scan_info, 0, sizeof(scan_info));
scan_info.aborted = aborted;
cfg80211_scan_done(pwdev_priv->scan_request, &scan_info);
#endif
}
pwdev_priv->scan_request = NULL;
@ -6237,7 +6254,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, int band, u8 rf_type)
{
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -6257,9 +6274,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) {
@ -6285,7 +6302,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, int band, u8 rf_type)
{
#define MAX_BIT_RATE_40MHZ_MCS23 450 /* Mbps */
#define MAX_BIT_RATE_40MHZ_MCS15 300 /* Mbps */
@ -6310,7 +6327,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
@ -6353,15 +6370,15 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter)
DBG_8192C("%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 */
@ -6449,11 +6466,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))
@ -6605,13 +6622,13 @@ void rtw_wiphy_free(struct wiphy *wiphy)
DBG_871X(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);
@ -6727,7 +6744,11 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
if (wdev->current_bss) {
DBG_871X(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
cfg80211_disconnected(adapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
#else
cfg80211_disconnected(adapter->pnetdev, 0, NULL, 0, false, GFP_ATOMIC);
#endif
}
#endif

View file

@ -151,7 +151,7 @@ static void _rtw_reg_apply_beaconing_flags(struct wiphy *wiphy,
u32 bandwidth = 0;
int r;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
for (band = 0; band < NUM_NL80211_BANDS; band++) {
if (!wiphy->bands[band])
continue;
@ -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) {
@ -364,7 +364,7 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
u16 channel;
u32 freq;
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
for (i = 0; i < NUM_NL80211_BANDS; i++) {
sband = wiphy->bands[i];
if (sband)