Commit 58321b29 authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wlcore: refactor CHANGED_HT handling

Pass a variable indicating whether HT is enabled,
instead of duplicating the function call with
different arguments.
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Reviewed-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent ec87011a
...@@ -4009,44 +4009,32 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -4009,44 +4009,32 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
} }
/* Handle new association with HT. Do this after join. */ /* Handle new association with HT. Do this after join. */
if (sta_exists) { if (sta_exists &&
if ((changed & BSS_CHANGED_HT) && (changed & BSS_CHANGED_HT)) {
(bss_conf->channel_type != NL80211_CHAN_NO_HT)) { bool enabled =
ret = wl1271_acx_set_ht_capabilities(wl, bss_conf->channel_type != NL80211_CHAN_NO_HT;
&sta_ht_cap,
true, ret = wl1271_acx_set_ht_capabilities(wl,
wlvif->sta.hlid); &sta_ht_cap,
if (ret < 0) { enabled,
wl1271_warning("Set ht cap true failed %d", wlvif->sta.hlid);
ret); if (ret < 0) {
goto out; wl1271_warning("Set ht cap failed %d", ret);
} goto out;
} }
/* handle new association without HT and disassociation */
else if (changed & BSS_CHANGED_ASSOC) { if (enabled) {
ret = wl1271_acx_set_ht_capabilities(wl, ret = wl1271_acx_set_ht_information(wl, wlvif,
&sta_ht_cap, bss_conf->ht_operation_mode);
false,
wlvif->sta.hlid);
if (ret < 0) { if (ret < 0) {
wl1271_warning("Set ht cap false failed %d", wl1271_warning("Set ht information failed %d",
ret); ret);
goto out; goto out;
} }
} }
} }
/* Handle HT information change. Done after join. */
if ((changed & BSS_CHANGED_HT) &&
(bss_conf->channel_type != NL80211_CHAN_NO_HT)) {
ret = wl1271_acx_set_ht_information(wl, wlvif,
bss_conf->ht_operation_mode);
if (ret < 0) {
wl1271_warning("Set ht information failed %d", ret);
goto out;
}
}
/* Handle arp filtering. Done after join. */ /* Handle arp filtering. Done after join. */
if ((changed & BSS_CHANGED_ARP_FILTER) || if ((changed & BSS_CHANGED_ARP_FILTER) ||
(!is_ibss && (changed & BSS_CHANGED_QOS))) { (!is_ibss && (changed & BSS_CHANGED_QOS))) {
......
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