diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2012-02-25 00:36:04 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-29 14:11:35 -0500 |
commit | 5eb02e44adc92a71bae3ff60acb1eea5ada14e93 (patch) | |
tree | 8c78ce0c14d948ea062f84df68b774cbfd21dc27 /drivers/net/wireless/mwifiex/scan.c | |
parent | 1a907b749c0ae235ab46e3ba7834e6c143f5503e (diff) |
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.c | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 98f1ca9cd6d8..8f10038d1b45 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -196,9 +196,8 @@ static bool | |||
196 | mwifiex_is_network_compatible_for_no_sec(struct mwifiex_private *priv, | 196 | mwifiex_is_network_compatible_for_no_sec(struct mwifiex_private *priv, |
197 | struct mwifiex_bssdescriptor *bss_desc) | 197 | struct mwifiex_bssdescriptor *bss_desc) |
198 | { | 198 | { |
199 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED | 199 | if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && |
200 | && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled | 200 | !priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) || |
201 | && ((!bss_desc->bcn_wpa_ie) || | ||
202 | ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != | 201 | ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != |
203 | WLAN_EID_WPA)) | 202 | WLAN_EID_WPA)) |
204 | && ((!bss_desc->bcn_rsn_ie) || | 203 | && ((!bss_desc->bcn_rsn_ie) || |
@@ -219,9 +218,8 @@ static bool | |||
219 | mwifiex_is_network_compatible_for_static_wep(struct mwifiex_private *priv, | 218 | mwifiex_is_network_compatible_for_static_wep(struct mwifiex_private *priv, |
220 | struct mwifiex_bssdescriptor *bss_desc) | 219 | struct mwifiex_bssdescriptor *bss_desc) |
221 | { | 220 | { |
222 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED | 221 | if (priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && |
223 | && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled | 222 | !priv->sec_info.wpa2_enabled && bss_desc->privacy) { |
224 | && bss_desc->privacy) { | ||
225 | return true; | 223 | return true; |
226 | } | 224 | } |
227 | return false; | 225 | return false; |
@@ -235,10 +233,9 @@ static bool | |||
235 | mwifiex_is_network_compatible_for_wpa(struct mwifiex_private *priv, | 233 | mwifiex_is_network_compatible_for_wpa(struct mwifiex_private *priv, |
236 | struct mwifiex_bssdescriptor *bss_desc) | 234 | struct mwifiex_bssdescriptor *bss_desc) |
237 | { | 235 | { |
238 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED | 236 | if (!priv->sec_info.wep_enabled && priv->sec_info.wpa_enabled && |
239 | && priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled | 237 | !priv->sec_info.wpa2_enabled && ((bss_desc->bcn_wpa_ie) && |
240 | && ((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)).vend_hdr. | 238 | ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id == WLAN_EID_WPA)) |
241 | element_id == WLAN_EID_WPA)) | ||
242 | /* | 239 | /* |
243 | * Privacy bit may NOT be set in some APs like | 240 | * Privacy bit may NOT be set in some APs like |
244 | * LinkSys WRT54G && bss_desc->privacy | 241 | * LinkSys WRT54G && bss_desc->privacy |
@@ -253,8 +250,7 @@ mwifiex_is_network_compatible_for_wpa(struct mwifiex_private *priv, | |||
253 | (bss_desc->bcn_rsn_ie) ? | 250 | (bss_desc->bcn_rsn_ie) ? |
254 | (*(bss_desc->bcn_rsn_ie)). | 251 | (*(bss_desc->bcn_rsn_ie)). |
255 | ieee_hdr.element_id : 0, | 252 | ieee_hdr.element_id : 0, |
256 | (priv->sec_info.wep_status == | 253 | (priv->sec_info.wep_enabled) ? "e" : "d", |
257 | MWIFIEX_802_11_WEP_ENABLED) ? "e" : "d", | ||
258 | (priv->sec_info.wpa_enabled) ? "e" : "d", | 254 | (priv->sec_info.wpa_enabled) ? "e" : "d", |
259 | (priv->sec_info.wpa2_enabled) ? "e" : "d", | 255 | (priv->sec_info.wpa2_enabled) ? "e" : "d", |
260 | priv->sec_info.encryption_mode, | 256 | priv->sec_info.encryption_mode, |
@@ -272,10 +268,9 @@ static bool | |||
272 | mwifiex_is_network_compatible_for_wpa2(struct mwifiex_private *priv, | 268 | mwifiex_is_network_compatible_for_wpa2(struct mwifiex_private *priv, |
273 | struct mwifiex_bssdescriptor *bss_desc) | 269 | struct mwifiex_bssdescriptor *bss_desc) |
274 | { | 270 | { |
275 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED | 271 | if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && |
276 | && !priv->sec_info.wpa_enabled && priv->sec_info.wpa2_enabled | 272 | priv->sec_info.wpa2_enabled && ((bss_desc->bcn_rsn_ie) && |
277 | && ((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)).ieee_hdr. | 273 | ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id == WLAN_EID_RSN)) |
278 | element_id == WLAN_EID_RSN)) | ||
279 | /* | 274 | /* |
280 | * Privacy bit may NOT be set in some APs like | 275 | * Privacy bit may NOT be set in some APs like |
281 | * LinkSys WRT54G && bss_desc->privacy | 276 | * LinkSys WRT54G && bss_desc->privacy |
@@ -290,8 +285,7 @@ mwifiex_is_network_compatible_for_wpa2(struct mwifiex_private *priv, | |||
290 | (bss_desc->bcn_rsn_ie) ? | 285 | (bss_desc->bcn_rsn_ie) ? |
291 | (*(bss_desc->bcn_rsn_ie)). | 286 | (*(bss_desc->bcn_rsn_ie)). |
292 | ieee_hdr.element_id : 0, | 287 | ieee_hdr.element_id : 0, |
293 | (priv->sec_info.wep_status == | 288 | (priv->sec_info.wep_enabled) ? "e" : "d", |
294 | MWIFIEX_802_11_WEP_ENABLED) ? "e" : "d", | ||
295 | (priv->sec_info.wpa_enabled) ? "e" : "d", | 289 | (priv->sec_info.wpa_enabled) ? "e" : "d", |
296 | (priv->sec_info.wpa2_enabled) ? "e" : "d", | 290 | (priv->sec_info.wpa2_enabled) ? "e" : "d", |
297 | priv->sec_info.encryption_mode, | 291 | priv->sec_info.encryption_mode, |
@@ -309,10 +303,9 @@ static bool | |||
309 | mwifiex_is_network_compatible_for_adhoc_aes(struct mwifiex_private *priv, | 303 | mwifiex_is_network_compatible_for_adhoc_aes(struct mwifiex_private *priv, |
310 | struct mwifiex_bssdescriptor *bss_desc) | 304 | struct mwifiex_bssdescriptor *bss_desc) |
311 | { | 305 | { |
312 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED | 306 | if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && |
313 | && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled | 307 | !priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) || |
314 | && ((!bss_desc->bcn_wpa_ie) || ((*(bss_desc->bcn_wpa_ie)).vend_hdr. | 308 | ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != WLAN_EID_WPA)) |
315 | element_id != WLAN_EID_WPA)) | ||
316 | && ((!bss_desc->bcn_rsn_ie) || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr. | 309 | && ((!bss_desc->bcn_rsn_ie) || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr. |
317 | element_id != WLAN_EID_RSN)) | 310 | element_id != WLAN_EID_RSN)) |
318 | && !priv->sec_info.encryption_mode | 311 | && !priv->sec_info.encryption_mode |
@@ -330,10 +323,9 @@ static bool | |||
330 | mwifiex_is_network_compatible_for_dynamic_wep(struct mwifiex_private *priv, | 323 | mwifiex_is_network_compatible_for_dynamic_wep(struct mwifiex_private *priv, |
331 | struct mwifiex_bssdescriptor *bss_desc) | 324 | struct mwifiex_bssdescriptor *bss_desc) |
332 | { | 325 | { |
333 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED | 326 | if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && |
334 | && !priv->sec_info.wpa_enabled && !priv->sec_info.wpa2_enabled | 327 | !priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) || |
335 | && ((!bss_desc->bcn_wpa_ie) || ((*(bss_desc->bcn_wpa_ie)).vend_hdr. | 328 | ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != WLAN_EID_WPA)) |
336 | element_id != WLAN_EID_WPA)) | ||
337 | && ((!bss_desc->bcn_rsn_ie) || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr. | 329 | && ((!bss_desc->bcn_rsn_ie) || ((*(bss_desc->bcn_rsn_ie)).ieee_hdr. |
338 | element_id != WLAN_EID_RSN)) | 330 | element_id != WLAN_EID_RSN)) |
339 | && priv->sec_info.encryption_mode | 331 | && priv->sec_info.encryption_mode |
@@ -468,8 +460,7 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, | |||
468 | (bss_desc->bcn_rsn_ie) ? | 460 | (bss_desc->bcn_rsn_ie) ? |
469 | (*(bss_desc->bcn_rsn_ie)).ieee_hdr. | 461 | (*(bss_desc->bcn_rsn_ie)).ieee_hdr. |
470 | element_id : 0, | 462 | element_id : 0, |
471 | (priv->sec_info.wep_status == | 463 | (priv->sec_info.wep_enabled) ? "e" : "d", |
472 | MWIFIEX_802_11_WEP_ENABLED) ? "e" : "d", | ||
473 | (priv->sec_info.wpa_enabled) ? "e" : "d", | 464 | (priv->sec_info.wpa_enabled) ? "e" : "d", |
474 | (priv->sec_info.wpa2_enabled) ? "e" : "d", | 465 | (priv->sec_info.wpa2_enabled) ? "e" : "d", |
475 | priv->sec_info.encryption_mode, bss_desc->privacy); | 466 | priv->sec_info.encryption_mode, bss_desc->privacy); |