Commit 62c2e579 authored by Luciano Coelho's avatar Luciano Coelho

wlcore: update beacon and probe_resp templates when rates change

When the data rates change, we get BSS_CHANGED_BASIC_RATES.  At this
point, we should update all the templates to match the new rates.  We
were changing some of the templates, but the beacon and the probe
response templates were missing.

[Remove redundant min_rate variable - Arik]
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
parent 7ae25da3
...@@ -3277,8 +3277,15 @@ static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, u32 rates, ...@@ -3277,8 +3277,15 @@ static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, u32 rates,
skb->data, skb->data,
skb->len, 0, skb->len, 0,
rates); rates);
dev_kfree_skb(skb); dev_kfree_skb(skb);
if (ret < 0)
goto out;
wl1271_debug(DEBUG_AP, "probe response updated");
set_bit(WLVIF_FLAG_AP_PROBE_RESP_SET, &wlvif->flags);
out:
return ret; return ret;
} }
...@@ -3383,33 +3390,14 @@ static int wl1271_bss_erp_info_changed(struct wl1271 *wl, ...@@ -3383,33 +3390,14 @@ static int wl1271_bss_erp_info_changed(struct wl1271 *wl,
return ret; return ret;
} }
static int wl1271_bss_beacon_info_changed(struct wl1271 *wl, static int wlcore_set_beacon_template(struct wl1271 *wl,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf, bool is_ap)
u32 changed)
{ {
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS);
int ret = 0;
if ((changed & BSS_CHANGED_BEACON_INT)) {
wl1271_debug(DEBUG_MASTER, "beacon interval updated: %d",
bss_conf->beacon_int);
wlvif->beacon_int = bss_conf->beacon_int;
}
if ((changed & BSS_CHANGED_AP_PROBE_RESP) && is_ap) {
u32 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
if (!wl1271_ap_set_probe_resp_tmpl(wl, rate, vif)) {
wl1271_debug(DEBUG_AP, "probe response updated");
set_bit(WLVIF_FLAG_AP_PROBE_RESP_SET, &wlvif->flags);
}
}
if ((changed & BSS_CHANGED_BEACON)) {
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u32 min_rate; u32 min_rate;
int ret;
int ieoffset = offsetof(struct ieee80211_mgmt, int ieoffset = offsetof(struct ieee80211_mgmt,
u.beacon.variable); u.beacon.variable);
struct sk_buff *beacon = ieee80211_beacon_get(wl->hw, vif); struct sk_buff *beacon = ieee80211_beacon_get(wl->hw, vif);
...@@ -3478,6 +3466,37 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl, ...@@ -3478,6 +3466,37 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
dev_kfree_skb(beacon); dev_kfree_skb(beacon);
if (ret < 0) if (ret < 0)
goto out; goto out;
out:
return ret;
}
static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
u32 changed)
{
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS);
int ret = 0;
if ((changed & BSS_CHANGED_BEACON_INT)) {
wl1271_debug(DEBUG_MASTER, "beacon interval updated: %d",
bss_conf->beacon_int);
wlvif->beacon_int = bss_conf->beacon_int;
}
if ((changed & BSS_CHANGED_AP_PROBE_RESP) && is_ap) {
u32 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
wl1271_ap_set_probe_resp_tmpl(wl, rate, vif);
}
if ((changed & BSS_CHANGED_BEACON)) {
ret = wlcore_set_beacon_template(wl, vif, is_ap);
if (ret < 0)
goto out;
} }
out: out:
...@@ -3512,6 +3531,14 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, ...@@ -3512,6 +3531,14 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
ret = wl1271_ap_init_templates(wl, vif); ret = wl1271_ap_init_templates(wl, vif);
if (ret < 0) if (ret < 0)
goto out; goto out;
ret = wl1271_ap_set_probe_resp_tmpl(wl, wlvif->basic_rate, vif);
if (ret < 0)
goto out;
ret = wlcore_set_beacon_template(wl, vif, true);
if (ret < 0)
goto out;
} }
ret = wl1271_bss_beacon_info_changed(wl, vif, bss_conf, changed); ret = wl1271_bss_beacon_info_changed(wl, vif, bss_conf, changed);
......
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