Commit 186630c2 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville

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: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d2182b69
...@@ -500,7 +500,6 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv, ...@@ -500,7 +500,6 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv,
struct ieee80211_channel *ch; struct ieee80211_channel *ch;
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
int chan_idx = 0, i; int chan_idx = 0, i;
u8 scan_type;
for (band = 0; (band < IEEE80211_NUM_BANDS) ; band++) { for (band = 0; (band < IEEE80211_NUM_BANDS) ; band++) {
...@@ -514,19 +513,20 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv, ...@@ -514,19 +513,20 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv,
if (ch->flags & IEEE80211_CHAN_DISABLED) if (ch->flags & IEEE80211_CHAN_DISABLED)
continue; continue;
scan_chan_list[chan_idx].radio_type = band; scan_chan_list[chan_idx].radio_type = band;
scan_type = ch->flags & IEEE80211_CHAN_PASSIVE_SCAN;
if (user_scan_in && if (user_scan_in &&
user_scan_in->chan_list[0].scan_time) user_scan_in->chan_list[0].scan_time)
scan_chan_list[chan_idx].max_scan_time = scan_chan_list[chan_idx].max_scan_time =
cpu_to_le16((u16) user_scan_in-> cpu_to_le16((u16) user_scan_in->
chan_list[0].scan_time); chan_list[0].scan_time);
else if (scan_type == MWIFIEX_SCAN_TYPE_PASSIVE) else if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
scan_chan_list[chan_idx].max_scan_time = scan_chan_list[chan_idx].max_scan_time =
cpu_to_le16(adapter->passive_scan_time); cpu_to_le16(adapter->passive_scan_time);
else else
scan_chan_list[chan_idx].max_scan_time = scan_chan_list[chan_idx].max_scan_time =
cpu_to_le16(adapter->active_scan_time); cpu_to_le16(adapter->active_scan_time);
if (scan_type == MWIFIEX_SCAN_TYPE_PASSIVE)
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
scan_chan_list[chan_idx].chan_scan_mode_bitmap scan_chan_list[chan_idx].chan_scan_mode_bitmap
|= MWIFIEX_PASSIVE_SCAN; |= MWIFIEX_PASSIVE_SCAN;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment