From 027d3efd933d87ca3d9a28365cae795c14e7a563 Mon Sep 17 00:00:00 2001 From: Jakub Sitnicki Date: Fri, 26 Jun 2015 07:50:34 +0200 Subject: [PATCH] staging: rtl8188eu: don't duplicate ieee80211 WLAN_CAPABILITY_* constants linux/ieee80211.h already defines constants for capability bits. Include it where needed, resolve discrepancies in naming, and remove the duplicated definitions. Also, make use of WLAN_CAPABILITY_IS_STA_BSS() macro to check if neither ESS nor IBSS capability bits are set. Signed-off-by: Jakub Sitnicki Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_ap.c | 2 +- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 2 ++ drivers/staging/rtl8188eu/core/rtw_mlme.c | 5 +++-- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++ drivers/staging/rtl8188eu/include/ieee80211.h | 10 ---------- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++-- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 581af88e3024..9d484cf81184 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -1584,7 +1584,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta) } } - if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT)) { + if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) { if (!psta->no_short_slot_time_set) { psta->no_short_slot_time_set = 1; diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index 11b780d6c4ab..d43e8672d86e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -19,6 +19,8 @@ ******************************************************************************/ #define _IEEE80211_C +#include + #include #include #include diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 05584515c5b4..a1ed741fc804 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -19,6 +19,7 @@ ******************************************************************************/ #define _RTW_MLME_C_ +#include #include #include @@ -352,8 +353,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst) ((!memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == true) && ((s_cap & WLAN_CAPABILITY_IBSS) == (d_cap & WLAN_CAPABILITY_IBSS)) && - ((s_cap & WLAN_CAPABILITY_BSS) == - (d_cap & WLAN_CAPABILITY_BSS))); + ((s_cap & WLAN_CAPABILITY_ESS) == + (d_cap & WLAN_CAPABILITY_ESS))); } struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue) diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 32300df7b996..077b39a41c60 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -19,6 +19,8 @@ ******************************************************************************/ #define _RTW_WLAN_UTIL_C_ +#include + #include #include #include diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h index b129ad148b47..fabb95917e8b 100644 --- a/drivers/staging/rtl8188eu/include/ieee80211.h +++ b/drivers/staging/rtl8188eu/include/ieee80211.h @@ -483,16 +483,6 @@ struct ieee80211_snap_hdr { #define WLAN_AUTH_CHALLENGE_LEN 128 -#define WLAN_CAPABILITY_BSS (1<<0) -#define WLAN_CAPABILITY_IBSS (1<<1) -#define WLAN_CAPABILITY_CF_POLLABLE (1<<2) -#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) -#define WLAN_CAPABILITY_PRIVACY (1<<4) -#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) -#define WLAN_CAPABILITY_PBCC (1<<6) -#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) -#define WLAN_CAPABILITY_SHORT_SLOT (1<<10) - /* Non standard? Not in */ #define WLAN_REASON_EXPIRATION_CHK 65535 diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 38dba1435c1e..ce756cdb817b 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -179,8 +179,8 @@ static char *translate_scan(struct adapter *padapter, cap = le16_to_cpu(le_tmp); - if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) { - if (cap & WLAN_CAPABILITY_BSS) + if (!WLAN_CAPABILITY_IS_STA_BSS(cap)) { + if (cap & WLAN_CAPABILITY_ESS) iwe.u.mode = IW_MODE_MASTER; else iwe.u.mode = IW_MODE_ADHOC; -- 2.30.2