summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-02-25 05:36:04 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2012-02-29 19:11:35 (GMT)
commit5eb02e44adc92a71bae3ff60acb1eea5ada14e93 (patch)
tree8c78ce0c14d948ea062f84df68b774cbfd21dc27 /drivers/net/wireless/mwifiex/scan.c
parent1a907b749c0ae235ab46e3ba7834e6c143f5503e (diff)
downloadlinux-fsl-qoriq-5eb02e44adc92a71bae3ff60acb1eea5ada14e93.tar.xz
mwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS
Instead of defining an 'enum', we can simply use 'u8' flag for WEP status. Rename 'wep_status' to 'wep_enabled' to match with 'wpa_enabled' and 'wpa2_enabled'. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c47
1 files changed, 19 insertions, 28 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 98f1ca9..8f10038 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -196,9 +196,8 @@ static bool
mwifiex_is_network_compatible_for_no_sec(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
- if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED
- && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled
- && ((!bss_desc->bcn_wpa_ie) ||
+ if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
+ !priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) ||
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id !=
WLAN_EID_WPA))
&& ((!bss_desc->bcn_rsn_ie) ||
@@ -219,9 +218,8 @@ static bool
mwifiex_is_network_compatible_for_static_wep(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
- if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED
- && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled
- && bss_desc->privacy) {
+ if (priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
+ !priv->sec_info.wpa2_enabled && bss_desc->privacy) {
return true;
}
return false;
@@ -235,10 +233,9 @@ static bool
mwifiex_is_network_compatible_for_wpa(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
- if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED
- && priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled
- && ((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)).vend_hdr.
- element_id == WLAN_EID_WPA))
+ if (!priv->sec_info.wep_enabled && priv->sec_info.wpa_enabled &&
+ !priv->sec_info.wpa2_enabled && ((bss_desc->bcn_wpa_ie) &&
+ ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id == WLAN_EID_WPA))
/*
* Privacy bit may NOT be set in some APs like
* LinkSys WRT54G && bss_desc->privacy
@@ -253,8 +250,7 @@ mwifiex_is_network_compatible_for_wpa(struct mwifiex_private *priv,
(bss_desc->bcn_rsn_ie) ?
(*(bss_desc->bcn_rsn_ie)).
ieee_hdr.element_id : 0,
- (priv->sec_info.wep_status ==
- MWIFIEX_802_11_WEP_ENABLED) ? "e" : "d",
+ (priv->sec_info.wep_enabled) ? "e" : "d",
(priv->sec_info.wpa_enabled) ? "e" : "d",
(priv->sec_info.wpa2_enabled) ? "e" : "d",
priv->sec_info.encryption_mode,
@@ -272,10 +268,9 @@ static bool
mwifiex_is_network_compatible_for_wpa2(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
- if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED
- && !priv->sec_info.wpa_enabled && priv->sec_info.wpa2_enabled
- && ((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.
- element_id == WLAN_EID_RSN))
+ if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
+ priv->sec_info.wpa2_enabled && ((bss_desc->bcn_rsn_ie) &&
+ ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id == WLAN_EID_RSN))
/*
* Privacy bit may NOT be set in some APs like
* LinkSys WRT54G && bss_desc->privacy
@@ -290,8 +285,7 @@ mwifiex_is_network_compatible_for_wpa2(struct mwifiex_private *priv,
(bss_desc->bcn_rsn_ie) ?
(*(bss_desc->bcn_rsn_ie)).
ieee_hdr.element_id : 0,
- (priv->sec_info.wep_status ==
- MWIFIEX_802_11_WEP_ENABLED) ? "e" : "d",
+ (priv->sec_info.wep_enabled) ? "e" : "d",
(priv->sec_info.wpa_enabled) ? "e" : "d",
(priv->sec_info.wpa2_enabled) ? "e" : "d",
priv->sec_info.encryption_mode,
@@ -309,10 +303,9 @@ static bool
mwifiex_is_network_compatible_for_adhoc_aes(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
- if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED
- && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled
- && ((!bss_desc->bcn_wpa_ie) || ((*(bss_desc->bcn_wpa_ie)).vend_hdr.
- element_id != WLAN_EID_WPA))
+ if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
+ !priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) ||
+ ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != WLAN_EID_WPA))
&& ((!bss_desc->bcn_rsn_ie) || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.
element_id != WLAN_EID_RSN))
&& !priv->sec_info.encryption_mode
@@ -330,10 +323,9 @@ static bool
mwifiex_is_network_compatible_for_dynamic_wep(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
- if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED
- && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled
- && ((!bss_desc->bcn_wpa_ie) || ((*(bss_desc->bcn_wpa_ie)).vend_hdr.
- element_id != WLAN_EID_WPA))
+ if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
+ !priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) ||
+ ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != WLAN_EID_WPA))
&& ((!bss_desc->bcn_rsn_ie) || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.
element_id != WLAN_EID_RSN))
&& priv->sec_info.encryption_mode
@@ -468,8 +460,7 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
(bss_desc->bcn_rsn_ie) ?
(*(bss_desc->bcn_rsn_ie)).ieee_hdr.
element_id : 0,
- (priv->sec_info.wep_status ==
- MWIFIEX_802_11_WEP_ENABLED) ? "e" : "d",
+ (priv->sec_info.wep_enabled) ? "e" : "d",
(priv->sec_info.wpa_enabled) ? "e" : "d",
(priv->sec_info.wpa2_enabled) ? "e" : "d",
priv->sec_info.encryption_mode, bss_desc->privacy);