Commit 468f3386 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: improve readability of association processing

The statements in wfx_bss_info_changed() has no particular order.

For better readability, group and sort the statements relative to the
association processing.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-2-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 414b804a
...@@ -547,19 +547,6 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -547,19 +547,6 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
mutex_lock(&wdev->conf_mutex); mutex_lock(&wdev->conf_mutex);
/* TODO: BSS_CHANGED_QOS */
if (changed & BSS_CHANGED_ARP_FILTER) {
for (i = 0; i < HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES; i++) {
__be32 *arp_addr = &info->arp_addr_list[i];
if (info->arp_addr_cnt > HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES)
arp_addr = NULL;
if (i >= info->arp_addr_cnt)
arp_addr = NULL;
hif_set_arp_ipv4_filter(wvif, i, arp_addr);
}
}
if (changed & BSS_CHANGED_BASIC_RATES || if (changed & BSS_CHANGED_BASIC_RATES ||
changed & BSS_CHANGED_BEACON_INT || changed & BSS_CHANGED_BEACON_INT ||
changed & BSS_CHANGED_BSSID) { changed & BSS_CHANGED_BSSID) {
...@@ -567,12 +554,15 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -567,12 +554,15 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
wfx_do_join(wvif); wfx_do_join(wvif);
} }
if (changed & BSS_CHANGED_AP_PROBE_RESP || if (changed & BSS_CHANGED_ASSOC) {
changed & BSS_CHANGED_BEACON) if (info->assoc || info->ibss_joined)
wfx_upload_ap_templates(wvif); wfx_join_finalize(wvif, info);
else if (!info->assoc && vif->type == NL80211_IFTYPE_STATION)
if (changed & BSS_CHANGED_BEACON_ENABLED) wfx_reset(wvif);
wfx_enable_beacon(wvif, info->enable_beacon); else
dev_warn(wdev->dev, "%s: misunderstood change: ASSOC\n",
__func__);
}
if (changed & BSS_CHANGED_BEACON_INFO) { if (changed & BSS_CHANGED_BEACON_INFO) {
if (vif->type != NL80211_IFTYPE_STATION) if (vif->type != NL80211_IFTYPE_STATION)
...@@ -585,16 +575,25 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -585,16 +575,25 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
wfx_filter_beacon(wvif, true); wfx_filter_beacon(wvif, true);
} }
if (changed & BSS_CHANGED_ASSOC) { if (changed & BSS_CHANGED_ARP_FILTER) {
if (info->assoc || info->ibss_joined) for (i = 0; i < HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES; i++) {
wfx_join_finalize(wvif, info); __be32 *arp_addr = &info->arp_addr_list[i];
else if (!info->assoc && vif->type == NL80211_IFTYPE_STATION)
wfx_reset(wvif); if (info->arp_addr_cnt > HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES)
else arp_addr = NULL;
dev_warn(wdev->dev, "%s: misunderstood change: ASSOC\n", if (i >= info->arp_addr_cnt)
__func__); arp_addr = NULL;
hif_set_arp_ipv4_filter(wvif, i, arp_addr);
}
} }
if (changed & BSS_CHANGED_AP_PROBE_RESP ||
changed & BSS_CHANGED_BEACON)
wfx_upload_ap_templates(wvif);
if (changed & BSS_CHANGED_BEACON_ENABLED)
wfx_enable_beacon(wvif, info->enable_beacon);
if (changed & BSS_CHANGED_KEEP_ALIVE) if (changed & BSS_CHANGED_KEEP_ALIVE)
hif_keep_alive_period(wvif, info->max_idle_period * hif_keep_alive_period(wvif, info->max_idle_period *
USEC_PER_TU / USEC_PER_MSEC); USEC_PER_TU / USEC_PER_MSEC);
......
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