diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-05 05:55:48 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:39 -0400 |
commit | 1fe9f1616ee0852e9422d1f676630e9a4531ace3 (patch) | |
tree | 45b8df51d369f79b7f810257b15f1a395ebdc6fb /drivers/net | |
parent | fb0e707c838ac7d8aae7ab90ea448e5ac1e29697 (diff) |
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: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 5 |
3 files changed, 21 insertions, 19 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index 096a713a8c94..1f29eab82146 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -576,8 +576,8 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
576 | cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); | 576 | cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); |
577 | cmd->sta.beacon_interval = cpu_to_le16(wl->beacon_int); | 577 | cmd->sta.beacon_interval = cpu_to_le16(wl->beacon_int); |
578 | cmd->sta.ssid_type = WL12XX_SSID_TYPE_ANY; | 578 | cmd->sta.ssid_type = WL12XX_SSID_TYPE_ANY; |
579 | cmd->sta.ssid_len = wl->ssid_len; | 579 | cmd->sta.ssid_len = wlvif->ssid_len; |
580 | memcpy(cmd->sta.ssid, wl->ssid, wl->ssid_len); | 580 | memcpy(cmd->sta.ssid, wlvif->ssid, wlvif->ssid_len); |
581 | memcpy(cmd->sta.bssid, vif->bss_conf.bssid, ETH_ALEN); | 581 | memcpy(cmd->sta.bssid, vif->bss_conf.bssid, ETH_ALEN); |
582 | cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); | 582 | cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); |
583 | 583 | ||
@@ -659,7 +659,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
659 | wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wl->role_id); | 659 | wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wl->role_id); |
660 | 660 | ||
661 | /* trying to use hidden SSID with an old hostapd version */ | 661 | /* trying to use hidden SSID with an old hostapd version */ |
662 | if (wl->ssid_len == 0 && !bss_conf->hidden_ssid) { | 662 | if (wlvif->ssid_len == 0 && !bss_conf->hidden_ssid) { |
663 | wl1271_error("got a null SSID from beacon/bss"); | 663 | wl1271_error("got a null SSID from beacon/bss"); |
664 | ret = -EINVAL; | 664 | ret = -EINVAL; |
665 | goto out; | 665 | goto out; |
@@ -693,8 +693,8 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
693 | if (!bss_conf->hidden_ssid) { | 693 | if (!bss_conf->hidden_ssid) { |
694 | /* take the SSID from the beacon for backward compatibility */ | 694 | /* take the SSID from the beacon for backward compatibility */ |
695 | cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC; | 695 | cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC; |
696 | cmd->ap.ssid_len = wl->ssid_len; | 696 | cmd->ap.ssid_len = wlvif->ssid_len; |
697 | memcpy(cmd->ap.ssid, wl->ssid, wl->ssid_len); | 697 | memcpy(cmd->ap.ssid, wlvif->ssid, wlvif->ssid_len); |
698 | } else { | 698 | } else { |
699 | cmd->ap.ssid_type = WL12XX_SSID_TYPE_HIDDEN; | 699 | cmd->ap.ssid_type = WL12XX_SSID_TYPE_HIDDEN; |
700 | cmd->ap.ssid_len = bss_conf->ssid_len; | 700 | 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 | cmd->ibss.beacon_interval = cpu_to_le16(wl->beacon_int); | 791 | cmd->ibss.beacon_interval = cpu_to_le16(wl->beacon_int); |
792 | cmd->ibss.dtim_interval = bss_conf->dtim_period; | 792 | cmd->ibss.dtim_interval = bss_conf->dtim_period; |
793 | cmd->ibss.ssid_type = WL12XX_SSID_TYPE_ANY; | 793 | cmd->ibss.ssid_type = WL12XX_SSID_TYPE_ANY; |
794 | cmd->ibss.ssid_len = wl->ssid_len; | 794 | cmd->ibss.ssid_len = wlvif->ssid_len; |
795 | memcpy(cmd->ibss.ssid, wl->ssid, wl->ssid_len); | 795 | memcpy(cmd->ibss.ssid, wlvif->ssid, wlvif->ssid_len); |
796 | memcpy(cmd->ibss.bssid, vif->bss_conf.bssid, ETH_ALEN); | 796 | memcpy(cmd->ibss.bssid, vif->bss_conf.bssid, ETH_ALEN); |
797 | cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); | 797 | cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); |
798 | 798 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 111a465ec541..0da9ddc8b6cf 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -2103,8 +2103,6 @@ deinit: | |||
2103 | wl1271_tx_reset(wl, reset_tx_queues); | 2103 | wl1271_tx_reset(wl, reset_tx_queues); |
2104 | wl1271_power_off(wl); | 2104 | wl1271_power_off(wl); |
2105 | 2105 | ||
2106 | memset(wl->ssid, 0, IEEE80211_MAX_SSID_LEN + 1); | ||
2107 | wl->ssid_len = 0; | ||
2108 | wl->band = IEEE80211_BAND_2GHZ; | 2106 | wl->band = IEEE80211_BAND_2GHZ; |
2109 | 2107 | ||
2110 | wl->rx_counter = 0; | 2108 | wl->rx_counter = 0; |
@@ -3078,9 +3076,10 @@ out: | |||
3078 | return ret; | 3076 | return ret; |
3079 | } | 3077 | } |
3080 | 3078 | ||
3081 | static int wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *skb, | 3079 | static int wl1271_ssid_set(struct ieee80211_vif *vif, struct sk_buff *skb, |
3082 | int offset) | 3080 | int offset) |
3083 | { | 3081 | { |
3082 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); | ||
3084 | u8 ssid_len; | 3083 | u8 ssid_len; |
3085 | const u8 *ptr = cfg80211_find_ie(WLAN_EID_SSID, skb->data + offset, | 3084 | const u8 *ptr = cfg80211_find_ie(WLAN_EID_SSID, skb->data + offset, |
3086 | skb->len - offset); | 3085 | skb->len - offset); |
@@ -3096,8 +3095,8 @@ static int wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *skb, | |||
3096 | return -EINVAL; | 3095 | return -EINVAL; |
3097 | } | 3096 | } |
3098 | 3097 | ||
3099 | wl->ssid_len = ssid_len; | 3098 | wlvif->ssid_len = ssid_len; |
3100 | memcpy(wl->ssid, ptr+2, ssid_len); | 3099 | memcpy(wlvif->ssid, ptr+2, ssid_len); |
3101 | return 0; | 3100 | return 0; |
3102 | } | 3101 | } |
3103 | 3102 | ||
@@ -3133,17 +3132,19 @@ static void wl12xx_remove_vendor_ie(struct sk_buff *skb, | |||
3133 | } | 3132 | } |
3134 | 3133 | ||
3135 | static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, | 3134 | static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, |
3135 | struct ieee80211_vif *vif, | ||
3136 | u8 *probe_rsp_data, | 3136 | u8 *probe_rsp_data, |
3137 | size_t probe_rsp_len, | 3137 | size_t probe_rsp_len, |
3138 | u32 rates) | 3138 | u32 rates) |
3139 | { | 3139 | { |
3140 | struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf; | 3140 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); |
3141 | struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; | ||
3141 | u8 probe_rsp_templ[WL1271_CMD_TEMPL_MAX_SIZE]; | 3142 | u8 probe_rsp_templ[WL1271_CMD_TEMPL_MAX_SIZE]; |
3142 | int ssid_ie_offset, ie_offset, templ_len; | 3143 | int ssid_ie_offset, ie_offset, templ_len; |
3143 | const u8 *ptr; | 3144 | const u8 *ptr; |
3144 | 3145 | ||
3145 | /* no need to change probe response if the SSID is set correctly */ | 3146 | /* no need to change probe response if the SSID is set correctly */ |
3146 | if (wl->ssid_len > 0) | 3147 | if (wlvif->ssid_len > 0) |
3147 | return wl1271_cmd_template_set(wl, | 3148 | return wl1271_cmd_template_set(wl, |
3148 | CMD_TEMPL_AP_PROBE_RESPONSE, | 3149 | CMD_TEMPL_AP_PROBE_RESPONSE, |
3149 | probe_rsp_data, | 3150 | probe_rsp_data, |
@@ -3256,7 +3257,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl, | |||
3256 | 3257 | ||
3257 | wl1271_debug(DEBUG_MASTER, "beacon updated"); | 3258 | wl1271_debug(DEBUG_MASTER, "beacon updated"); |
3258 | 3259 | ||
3259 | ret = wl1271_ssid_set(wl, beacon, ieoffset); | 3260 | ret = wl1271_ssid_set(vif, beacon, ieoffset); |
3260 | if (ret < 0) { | 3261 | if (ret < 0) { |
3261 | dev_kfree_skb(beacon); | 3262 | dev_kfree_skb(beacon); |
3262 | goto out; | 3263 | goto out; |
@@ -3291,7 +3292,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl, | |||
3291 | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | | 3292 | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
3292 | IEEE80211_STYPE_PROBE_RESP); | 3293 | IEEE80211_STYPE_PROBE_RESP); |
3293 | if (is_ap) | 3294 | if (is_ap) |
3294 | ret = wl1271_ap_set_probe_resp_tmpl(wl, | 3295 | ret = wl1271_ap_set_probe_resp_tmpl(wl, vif, |
3295 | beacon->data, | 3296 | beacon->data, |
3296 | beacon->len, | 3297 | beacon->len, |
3297 | min_rate); | 3298 | min_rate); |
@@ -3528,7 +3529,7 @@ sta_not_found: | |||
3528 | wl->probereq = wl1271_cmd_build_ap_probe_req(wl, NULL); | 3529 | wl->probereq = wl1271_cmd_build_ap_probe_req(wl, NULL); |
3529 | ieoffset = offsetof(struct ieee80211_mgmt, | 3530 | ieoffset = offsetof(struct ieee80211_mgmt, |
3530 | u.probe_req.variable); | 3531 | u.probe_req.variable); |
3531 | wl1271_ssid_set(wl, wl->probereq, ieoffset); | 3532 | wl1271_ssid_set(vif, wl->probereq, ieoffset); |
3532 | 3533 | ||
3533 | /* enable the connection monitoring feature */ | 3534 | /* enable the connection monitoring feature */ |
3534 | ret = wl1271_acx_conn_monit_params(wl, true); | 3535 | ret = wl1271_acx_conn_monit_params(wl, true); |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index d84c0deee36a..539cf40be535 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -400,8 +400,6 @@ struct wl1271 { | |||
400 | s8 hw_pg_ver; | 400 | s8 hw_pg_ver; |
401 | 401 | ||
402 | u8 mac_addr[ETH_ALEN]; | 402 | u8 mac_addr[ETH_ALEN]; |
403 | u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; | ||
404 | u8 ssid_len; | ||
405 | int channel; | 403 | int channel; |
406 | u8 role_id; | 404 | u8 role_id; |
407 | u8 dev_role_id; | 405 | u8 dev_role_id; |
@@ -630,6 +628,9 @@ struct wl12xx_vif { | |||
630 | u8 bss_type; | 628 | u8 bss_type; |
631 | u8 p2p; /* we are using p2p role */ | 629 | u8 p2p; /* we are using p2p role */ |
632 | 630 | ||
631 | u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; | ||
632 | u8 ssid_len; | ||
633 | |||
633 | u32 basic_rate_set; | 634 | u32 basic_rate_set; |
634 | 635 | ||
635 | /* | 636 | /* |