Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+18 −30
Original line number Diff line number Diff line
@@ -4009,43 +4009,31 @@ sta_not_found:
	}

	/* Handle new association with HT. Do this after join. */
	if (sta_exists) {
		if ((changed & BSS_CHANGED_HT) &&
		    (bss_conf->channel_type != NL80211_CHAN_NO_HT)) {
	if (sta_exists &&
	    (changed & BSS_CHANGED_HT)) {
		bool enabled =
			bss_conf->channel_type != NL80211_CHAN_NO_HT;

		ret = wl1271_acx_set_ht_capabilities(wl,
						     &sta_ht_cap,
							     true,
						     enabled,
						     wlvif->sta.hlid);
		if (ret < 0) {
				wl1271_warning("Set ht cap true failed %d",
					       ret);
			wl1271_warning("Set ht cap failed %d", ret);
			goto out;
			}
		}
		/* handle new association without HT and disassociation */
		else if (changed & BSS_CHANGED_ASSOC) {
			ret = wl1271_acx_set_ht_capabilities(wl,
							     &sta_ht_cap,
							     false,
							     wlvif->sta.hlid);
			if (ret < 0) {
				wl1271_warning("Set ht cap false failed %d",
					       ret);
				goto out;
			}
		}

		}

	/* Handle HT information change. Done after join. */
	if ((changed & BSS_CHANGED_HT) &&
	    (bss_conf->channel_type != NL80211_CHAN_NO_HT)) {
		if (enabled) {
			ret = wl1271_acx_set_ht_information(wl, wlvif,
						bss_conf->ht_operation_mode);
			if (ret < 0) {
			wl1271_warning("Set ht information failed %d", ret);
				wl1271_warning("Set ht information failed %d",
					       ret);
				goto out;
			}
		}
	}

	/* Handle arp filtering. Done after join. */
	if ((changed & BSS_CHANGED_ARP_FILTER) ||