Commit 648cd9a6 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: fix line over 80 char in cfg_scan_result()

Refactor cfg_scan_result() API to avoid 'line over 80 chars' issue
reported by checkpatch.pl script.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d615927
...@@ -374,91 +374,97 @@ static void cfg_scan_result(enum scan_event scan_event, ...@@ -374,91 +374,97 @@ static void cfg_scan_result(enum scan_event scan_event,
struct cfg80211_bss *bss = NULL; struct cfg80211_bss *bss = NULL;
priv = user_void; priv = user_void;
if (priv->cfg_scanning) { if (!priv->cfg_scanning)
if (scan_event == SCAN_EVENT_NETWORK_FOUND) { return;
wiphy = priv->dev->ieee80211_ptr->wiphy;
if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
if (!wiphy || !network_info)
return;
if (!wiphy) if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
(((s32)network_info->rssi * 100) < 0 ||
((s32)network_info->rssi * 100) > 100))
return;
s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch,
NL80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq);
if (!channel)
return;
if (network_info->new_network) {
if (priv->rcvd_ch_cnt >= MAX_NUM_SCANNED_NETWORKS)
return; return;
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && priv->rcvd_ch_cnt++;
(((s32)network_info->rssi * 100) < 0 ||
((s32)network_info->rssi * 100) > 100)) add_network_to_shadow(network_info, priv, join_params);
if (memcmp("DIRECT-", network_info->ssid, 7))
return; return;
if (network_info) { bss = cfg80211_inform_bss(wiphy,
s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, NL80211_BAND_2GHZ); channel,
channel = ieee80211_get_channel(wiphy, s32Freq); CFG80211_BSS_FTYPE_UNKNOWN,
network_info->bssid,
if (!channel) network_info->tsf_hi,
return; network_info->cap_info,
network_info->beacon_period,
if (network_info->new_network) { (const u8 *)network_info->ies,
if (priv->rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) { (size_t)network_info->ies_len,
priv->rcvd_ch_cnt++; (s32)network_info->rssi * 100,
GFP_KERNEL);
add_network_to_shadow(network_info, priv, join_params); cfg80211_put_bss(wiphy, bss);
} else {
if (!(memcmp("DIRECT-", network_info->ssid, 7))) { u32 i;
bss = cfg80211_inform_bss(wiphy,
channel,
CFG80211_BSS_FTYPE_UNKNOWN,
network_info->bssid,
network_info->tsf_hi,
network_info->cap_info,
network_info->beacon_period,
(const u8 *)network_info->ies,
(size_t)network_info->ies_len,
(s32)network_info->rssi * 100,
GFP_KERNEL);
cfg80211_put_bss(wiphy, bss);
}
}
} else {
u32 i;
for (i = 0; i < priv->rcvd_ch_cnt; i++) { for (i = 0; i < priv->rcvd_ch_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) { if (memcmp(last_scanned_shadow[i].bssid,
last_scanned_shadow[i].rssi = network_info->rssi; network_info->bssid, 6) == 0)
last_scanned_shadow[i].time_scan = jiffies; break;
break;
}
}
}
} }
} else if (scan_event == SCAN_EVENT_DONE) {
refresh_scan(priv, false);
mutex_lock(&priv->scan_req_lock); if (i >= priv->rcvd_ch_cnt)
return;
if (priv->scan_req) { last_scanned_shadow[i].rssi = network_info->rssi;
struct cfg80211_scan_info info = { last_scanned_shadow[i].time_scan = jiffies;
.aborted = false, }
}; } else if (scan_event == SCAN_EVENT_DONE) {
refresh_scan(priv, false);
cfg80211_scan_done(priv->scan_req, &info); mutex_lock(&priv->scan_req_lock);
priv->rcvd_ch_cnt = 0;
priv->cfg_scanning = false;
priv->scan_req = NULL;
}
mutex_unlock(&priv->scan_req_lock);
} else if (scan_event == SCAN_EVENT_ABORTED) {
mutex_lock(&priv->scan_req_lock);
if (priv->scan_req) { if (priv->scan_req) {
struct cfg80211_scan_info info = { struct cfg80211_scan_info info = {
.aborted = false, .aborted = false,
}; };
update_scan_time(); cfg80211_scan_done(priv->scan_req, &info);
refresh_scan(priv, false); priv->rcvd_ch_cnt = 0;
priv->cfg_scanning = false;
priv->scan_req = NULL;
}
mutex_unlock(&priv->scan_req_lock);
} else if (scan_event == SCAN_EVENT_ABORTED) {
mutex_lock(&priv->scan_req_lock);
cfg80211_scan_done(priv->scan_req, &info); if (priv->scan_req) {
priv->cfg_scanning = false; struct cfg80211_scan_info info = {
priv->scan_req = NULL; .aborted = false,
} };
mutex_unlock(&priv->scan_req_lock);
update_scan_time();
refresh_scan(priv, false);
cfg80211_scan_done(priv->scan_req, &info);
priv->cfg_scanning = false;
priv->scan_req = NULL;
} }
mutex_unlock(&priv->scan_req_lock);
} }
} }
......
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