diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2011-12-16 00:00:37 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-19 14:37:14 -0500 |
commit | 186630c2809bc87fba6e49896fa2279c43f512d2 (patch) | |
tree | 400c4910c3177c54bfd2e3b1303fa5f19f21ccaa /drivers/net/wireless/mwifiex/scan.c | |
parent | d2182b69dcb6a68b1ef6070b2efd094e13dea3f1 (diff) |
mwifiex: cleanup work in scan.c
Scan type derived from IEEE80211_CHAN_PASSIVE_SCAN bit is a boolean
flag representing passive scanning. We should not again compare it
with driver specific macro MWIFIEX_SCAN_TYPE_PASSIVE to determine
passive or active scan. We can also avoid the use of local variable
by using the flag directly.
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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index e2e715666bca..6396d3318ead 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -500,7 +500,6 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv, | |||
500 | struct ieee80211_channel *ch; | 500 | struct ieee80211_channel *ch; |
501 | struct mwifiex_adapter *adapter = priv->adapter; | 501 | struct mwifiex_adapter *adapter = priv->adapter; |
502 | int chan_idx = 0, i; | 502 | int chan_idx = 0, i; |
503 | u8 scan_type; | ||
504 | 503 | ||
505 | for (band = 0; (band < IEEE80211_NUM_BANDS) ; band++) { | 504 | for (band = 0; (band < IEEE80211_NUM_BANDS) ; band++) { |
506 | 505 | ||
@@ -514,19 +513,20 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv, | |||
514 | if (ch->flags & IEEE80211_CHAN_DISABLED) | 513 | if (ch->flags & IEEE80211_CHAN_DISABLED) |
515 | continue; | 514 | continue; |
516 | scan_chan_list[chan_idx].radio_type = band; | 515 | scan_chan_list[chan_idx].radio_type = band; |
517 | scan_type = ch->flags & IEEE80211_CHAN_PASSIVE_SCAN; | 516 | |
518 | if (user_scan_in && | 517 | if (user_scan_in && |
519 | user_scan_in->chan_list[0].scan_time) | 518 | user_scan_in->chan_list[0].scan_time) |
520 | scan_chan_list[chan_idx].max_scan_time = | 519 | scan_chan_list[chan_idx].max_scan_time = |
521 | cpu_to_le16((u16) user_scan_in-> | 520 | cpu_to_le16((u16) user_scan_in-> |
522 | chan_list[0].scan_time); | 521 | chan_list[0].scan_time); |
523 | else if (scan_type == MWIFIEX_SCAN_TYPE_PASSIVE) | 522 | else if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) |
524 | scan_chan_list[chan_idx].max_scan_time = | 523 | scan_chan_list[chan_idx].max_scan_time = |
525 | cpu_to_le16(adapter->passive_scan_time); | 524 | cpu_to_le16(adapter->passive_scan_time); |
526 | else | 525 | else |
527 | scan_chan_list[chan_idx].max_scan_time = | 526 | scan_chan_list[chan_idx].max_scan_time = |
528 | cpu_to_le16(adapter->active_scan_time); | 527 | cpu_to_le16(adapter->active_scan_time); |
529 | if (scan_type == MWIFIEX_SCAN_TYPE_PASSIVE) | 528 | |
529 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) | ||
530 | scan_chan_list[chan_idx].chan_scan_mode_bitmap | 530 | scan_chan_list[chan_idx].chan_scan_mode_bitmap |
531 | |= MWIFIEX_PASSIVE_SCAN; | 531 | |= MWIFIEX_PASSIVE_SCAN; |
532 | else | 532 | else |