提交 1fe9f161 编写于 作者: E Eliad Peller 提交者: Luciano Coelho

wl12xx: move ssid and ssid_len into wlvif

move ssid and ssid_len into the per-interface data, rather than
being global.
Signed-off-by: NEliad Peller <eliad@wizery.com>
Signed-off-by: NLuciano Coelho <coelho@ti.com>
上级 fb0e707c
...@@ -576,8 +576,8 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -576,8 +576,8 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set);
cmd->sta.beacon_interval = cpu_to_le16(wl->beacon_int); cmd->sta.beacon_interval = cpu_to_le16(wl->beacon_int);
cmd->sta.ssid_type = WL12XX_SSID_TYPE_ANY; cmd->sta.ssid_type = WL12XX_SSID_TYPE_ANY;
cmd->sta.ssid_len = wl->ssid_len; cmd->sta.ssid_len = wlvif->ssid_len;
memcpy(cmd->sta.ssid, wl->ssid, wl->ssid_len); memcpy(cmd->sta.ssid, wlvif->ssid, wlvif->ssid_len);
memcpy(cmd->sta.bssid, vif->bss_conf.bssid, ETH_ALEN); memcpy(cmd->sta.bssid, vif->bss_conf.bssid, ETH_ALEN);
cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set);
...@@ -659,7 +659,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -659,7 +659,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wl->role_id); wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wl->role_id);
/* trying to use hidden SSID with an old hostapd version */ /* trying to use hidden SSID with an old hostapd version */
if (wl->ssid_len == 0 && !bss_conf->hidden_ssid) { if (wlvif->ssid_len == 0 && !bss_conf->hidden_ssid) {
wl1271_error("got a null SSID from beacon/bss"); wl1271_error("got a null SSID from beacon/bss");
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -693,8 +693,8 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -693,8 +693,8 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
if (!bss_conf->hidden_ssid) { if (!bss_conf->hidden_ssid) {
/* take the SSID from the beacon for backward compatibility */ /* take the SSID from the beacon for backward compatibility */
cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC; cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC;
cmd->ap.ssid_len = wl->ssid_len; cmd->ap.ssid_len = wlvif->ssid_len;
memcpy(cmd->ap.ssid, wl->ssid, wl->ssid_len); memcpy(cmd->ap.ssid, wlvif->ssid, wlvif->ssid_len);
} else { } else {
cmd->ap.ssid_type = WL12XX_SSID_TYPE_HIDDEN; cmd->ap.ssid_type = WL12XX_SSID_TYPE_HIDDEN;
cmd->ap.ssid_len = bss_conf->ssid_len; cmd->ap.ssid_len = bss_conf->ssid_len;
...@@ -791,8 +791,8 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -791,8 +791,8 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->ibss.beacon_interval = cpu_to_le16(wl->beacon_int); cmd->ibss.beacon_interval = cpu_to_le16(wl->beacon_int);
cmd->ibss.dtim_interval = bss_conf->dtim_period; cmd->ibss.dtim_interval = bss_conf->dtim_period;
cmd->ibss.ssid_type = WL12XX_SSID_TYPE_ANY; cmd->ibss.ssid_type = WL12XX_SSID_TYPE_ANY;
cmd->ibss.ssid_len = wl->ssid_len; cmd->ibss.ssid_len = wlvif->ssid_len;
memcpy(cmd->ibss.ssid, wl->ssid, wl->ssid_len); memcpy(cmd->ibss.ssid, wlvif->ssid, wlvif->ssid_len);
memcpy(cmd->ibss.bssid, vif->bss_conf.bssid, ETH_ALEN); memcpy(cmd->ibss.bssid, vif->bss_conf.bssid, ETH_ALEN);
cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set);
......
...@@ -2103,8 +2103,6 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, ...@@ -2103,8 +2103,6 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
wl1271_tx_reset(wl, reset_tx_queues); wl1271_tx_reset(wl, reset_tx_queues);
wl1271_power_off(wl); wl1271_power_off(wl);
memset(wl->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
wl->ssid_len = 0;
wl->band = IEEE80211_BAND_2GHZ; wl->band = IEEE80211_BAND_2GHZ;
wl->rx_counter = 0; wl->rx_counter = 0;
...@@ -3078,9 +3076,10 @@ static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value) ...@@ -3078,9 +3076,10 @@ static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
return ret; return ret;
} }
static int wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *skb, static int wl1271_ssid_set(struct ieee80211_vif *vif, struct sk_buff *skb,
int offset) int offset)
{ {
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
u8 ssid_len; u8 ssid_len;
const u8 *ptr = cfg80211_find_ie(WLAN_EID_SSID, skb->data + offset, const u8 *ptr = cfg80211_find_ie(WLAN_EID_SSID, skb->data + offset,
skb->len - offset); skb->len - offset);
...@@ -3096,8 +3095,8 @@ static int wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *skb, ...@@ -3096,8 +3095,8 @@ static int wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *skb,
return -EINVAL; return -EINVAL;
} }
wl->ssid_len = ssid_len; wlvif->ssid_len = ssid_len;
memcpy(wl->ssid, ptr+2, ssid_len); memcpy(wlvif->ssid, ptr+2, ssid_len);
return 0; return 0;
} }
...@@ -3133,17 +3132,19 @@ static void wl12xx_remove_vendor_ie(struct sk_buff *skb, ...@@ -3133,17 +3132,19 @@ static void wl12xx_remove_vendor_ie(struct sk_buff *skb,
} }
static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl,
struct ieee80211_vif *vif,
u8 *probe_rsp_data, u8 *probe_rsp_data,
size_t probe_rsp_len, size_t probe_rsp_len,
u32 rates) u32 rates)
{ {
struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf; struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
u8 probe_rsp_templ[WL1271_CMD_TEMPL_MAX_SIZE]; u8 probe_rsp_templ[WL1271_CMD_TEMPL_MAX_SIZE];
int ssid_ie_offset, ie_offset, templ_len; int ssid_ie_offset, ie_offset, templ_len;
const u8 *ptr; const u8 *ptr;
/* no need to change probe response if the SSID is set correctly */ /* no need to change probe response if the SSID is set correctly */
if (wl->ssid_len > 0) if (wlvif->ssid_len > 0)
return wl1271_cmd_template_set(wl, return wl1271_cmd_template_set(wl,
CMD_TEMPL_AP_PROBE_RESPONSE, CMD_TEMPL_AP_PROBE_RESPONSE,
probe_rsp_data, probe_rsp_data,
...@@ -3256,7 +3257,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl, ...@@ -3256,7 +3257,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
wl1271_debug(DEBUG_MASTER, "beacon updated"); wl1271_debug(DEBUG_MASTER, "beacon updated");
ret = wl1271_ssid_set(wl, beacon, ieoffset); ret = wl1271_ssid_set(vif, beacon, ieoffset);
if (ret < 0) { if (ret < 0) {
dev_kfree_skb(beacon); dev_kfree_skb(beacon);
goto out; goto out;
...@@ -3291,7 +3292,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl, ...@@ -3291,7 +3292,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_PROBE_RESP); IEEE80211_STYPE_PROBE_RESP);
if (is_ap) if (is_ap)
ret = wl1271_ap_set_probe_resp_tmpl(wl, ret = wl1271_ap_set_probe_resp_tmpl(wl, vif,
beacon->data, beacon->data,
beacon->len, beacon->len,
min_rate); min_rate);
...@@ -3528,7 +3529,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -3528,7 +3529,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
wl->probereq = wl1271_cmd_build_ap_probe_req(wl, NULL); wl->probereq = wl1271_cmd_build_ap_probe_req(wl, NULL);
ieoffset = offsetof(struct ieee80211_mgmt, ieoffset = offsetof(struct ieee80211_mgmt,
u.probe_req.variable); u.probe_req.variable);
wl1271_ssid_set(wl, wl->probereq, ieoffset); wl1271_ssid_set(vif, wl->probereq, ieoffset);
/* enable the connection monitoring feature */ /* enable the connection monitoring feature */
ret = wl1271_acx_conn_monit_params(wl, true); ret = wl1271_acx_conn_monit_params(wl, true);
......
...@@ -400,8 +400,6 @@ struct wl1271 { ...@@ -400,8 +400,6 @@ struct wl1271 {
s8 hw_pg_ver; s8 hw_pg_ver;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
u8 ssid_len;
int channel; int channel;
u8 role_id; u8 role_id;
u8 dev_role_id; u8 dev_role_id;
...@@ -630,6 +628,9 @@ struct wl12xx_vif { ...@@ -630,6 +628,9 @@ struct wl12xx_vif {
u8 bss_type; u8 bss_type;
u8 p2p; /* we are using p2p role */ u8 p2p; /* we are using p2p role */
u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
u8 ssid_len;
u32 basic_rate_set; u32 basic_rate_set;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册