Commit 0b932ab9 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wl12xx: AP-mode - set STA HT capabilities when adding a STA

In addition, set global HT operation mode via ACX_HT_BSS_OPERATION when
a change is detected by usermode
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 227e81e1
...@@ -1309,13 +1309,15 @@ int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl) ...@@ -1309,13 +1309,15 @@ int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl)
int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
struct ieee80211_sta_ht_cap *ht_cap, struct ieee80211_sta_ht_cap *ht_cap,
bool allow_ht_operation) bool allow_ht_operation, u8 hlid)
{ {
struct wl1271_acx_ht_capabilities *acx; struct wl1271_acx_ht_capabilities *acx;
int ret = 0; int ret = 0;
u32 ht_capabilites = 0; u32 ht_capabilites = 0;
wl1271_debug(DEBUG_ACX, "acx ht capabilities setting"); wl1271_debug(DEBUG_ACX, "acx ht capabilities setting "
"sta supp: %d sta cap: %d", ht_cap->ht_supported,
ht_cap->cap);
acx = kzalloc(sizeof(*acx), GFP_KERNEL); acx = kzalloc(sizeof(*acx), GFP_KERNEL);
if (!acx) { if (!acx) {
...@@ -1323,7 +1325,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, ...@@ -1323,7 +1325,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
goto out; goto out;
} }
if (allow_ht_operation) { if (allow_ht_operation && ht_cap->ht_supported) {
/* no need to translate capabilities - use the spec values */ /* no need to translate capabilities - use the spec values */
ht_capabilites = ht_cap->cap; ht_capabilites = ht_cap->cap;
...@@ -1338,7 +1340,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, ...@@ -1338,7 +1340,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
acx->ampdu_min_spacing = ht_cap->ampdu_density; acx->ampdu_min_spacing = ht_cap->ampdu_density;
} }
acx->hlid = wl->sta_hlid; acx->hlid = hlid;
acx->ht_capabilites = cpu_to_le32(ht_capabilites); acx->ht_capabilites = cpu_to_le32(ht_capabilites);
ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx)); ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx));
......
...@@ -1268,7 +1268,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, bool enable, ...@@ -1268,7 +1268,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, bool enable,
int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl); int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl);
int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
struct ieee80211_sta_ht_cap *ht_cap, struct ieee80211_sta_ht_cap *ht_cap,
bool allow_ht_operation); bool allow_ht_operation, u8 hlid);
int wl1271_acx_set_ht_information(struct wl1271 *wl, int wl1271_acx_set_ht_information(struct wl1271 *wl,
u16 ht_operation_mode); u16 ht_operation_mode);
int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl); int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl);
......
...@@ -3124,6 +3124,18 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, ...@@ -3124,6 +3124,18 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
ret = wl1271_bss_erp_info_changed(wl, bss_conf, changed); ret = wl1271_bss_erp_info_changed(wl, bss_conf, changed);
if (ret < 0) if (ret < 0)
goto out; goto out;
/* Handle HT information change */
if ((changed & BSS_CHANGED_HT) &&
(bss_conf->channel_type != NL80211_CHAN_NO_HT)) {
ret = wl1271_acx_set_ht_information(wl,
bss_conf->ht_operation_mode);
if (ret < 0) {
wl1271_warning("Set ht information failed %d", ret);
goto out;
}
}
out: out:
return; return;
} }
...@@ -3439,12 +3451,14 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -3439,12 +3451,14 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
} }
} }
/* Handle new association with HT. Do this only after join. */ /* Handle new association with HT. Do this after join. */
if (sta_exists) { if (sta_exists) {
if ((changed & BSS_CHANGED_HT) && if ((changed & BSS_CHANGED_HT) &&
(bss_conf->channel_type != NL80211_CHAN_NO_HT)) { (bss_conf->channel_type != NL80211_CHAN_NO_HT)) {
ret = wl1271_acx_set_ht_capabilities(wl, &sta_ht_cap, ret = wl1271_acx_set_ht_capabilities(wl,
true); &sta_ht_cap,
true,
wl->sta_hlid);
if (ret < 0) { if (ret < 0) {
wl1271_warning("Set ht cap true failed %d", wl1271_warning("Set ht cap true failed %d",
ret); ret);
...@@ -3453,8 +3467,10 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -3453,8 +3467,10 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
} }
/* handle new association without HT and disassociation */ /* handle new association without HT and disassociation */
else if (changed & BSS_CHANGED_ASSOC) { else if (changed & BSS_CHANGED_ASSOC) {
ret = wl1271_acx_set_ht_capabilities(wl, &sta_ht_cap, ret = wl1271_acx_set_ht_capabilities(wl,
false); &sta_ht_cap,
false,
wl->sta_hlid);
if (ret < 0) { if (ret < 0) {
wl1271_warning("Set ht cap false failed %d", wl1271_warning("Set ht cap false failed %d",
ret); ret);
...@@ -3463,8 +3479,8 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -3463,8 +3479,8 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
} }
} }
/* Handle HT information change. Only after join. */ /* Handle HT information change. Done after join. */
if (sta_exists && (changed & BSS_CHANGED_HT) && if ((changed & BSS_CHANGED_HT) &&
(bss_conf->channel_type != NL80211_CHAN_NO_HT)) { (bss_conf->channel_type != NL80211_CHAN_NO_HT)) {
ret = wl1271_acx_set_ht_information(wl, ret = wl1271_acx_set_ht_information(wl,
bss_conf->ht_operation_mode); bss_conf->ht_operation_mode);
...@@ -3703,6 +3719,10 @@ static int wl1271_op_sta_add(struct ieee80211_hw *hw, ...@@ -3703,6 +3719,10 @@ static int wl1271_op_sta_add(struct ieee80211_hw *hw,
if (ret < 0) if (ret < 0)
goto out_sleep; goto out_sleep;
ret = wl1271_acx_set_ht_capabilities(wl, &sta->ht_cap, true, hlid);
if (ret < 0)
goto out_sleep;
out_sleep: out_sleep:
wl1271_ps_elp_sleep(wl); wl1271_ps_elp_sleep(wl);
......
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