diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-05 05:55:39 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:31 -0400 |
commit | 784f694d0f3ca927361aa0c26de1aa340eb5b275 (patch) | |
tree | 23d7d89a03be2a1df23e3b97d3b9889fd43e2462 | |
parent | 694440d93b9963a2c426708cb11494236c0b2552 (diff) |
wl12xx: replace wl->mac_addr with vif->addr
The mac address of the interface already exists in vif->addr.
Use it instead of wl->mac_addr.
It seems that due to some fw bug, we still need to set nvs->mac
to the actual mac addresss, otherwise the fw doesn't function
well (e.g. can't get dhcp address).
Thus, use wl->mac_addr for this purpose, and don't delete it yet.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/event.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/init.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/init.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/scan.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/scan.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 1 |
9 files changed, 62 insertions, 44 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index a52299e548fa..bee44c7d67fd 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -358,7 +358,8 @@ static int wl1271_cmd_wait_for_event(struct wl1271 *wl, u32 mask) | |||
358 | return 0; | 358 | return 0; |
359 | } | 359 | } |
360 | 360 | ||
361 | int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 role_type, u8 *role_id) | 361 | int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 *addr, u8 role_type, |
362 | u8 *role_id) | ||
362 | { | 363 | { |
363 | struct wl12xx_cmd_role_enable *cmd; | 364 | struct wl12xx_cmd_role_enable *cmd; |
364 | int ret; | 365 | int ret; |
@@ -381,7 +382,7 @@ int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 role_type, u8 *role_id) | |||
381 | goto out_free; | 382 | goto out_free; |
382 | } | 383 | } |
383 | 384 | ||
384 | memcpy(cmd->mac_address, wl->mac_addr, ETH_ALEN); | 385 | memcpy(cmd->mac_address, addr, ETH_ALEN); |
385 | cmd->role_type = role_type; | 386 | cmd->role_type = role_type; |
386 | 387 | ||
387 | ret = wl1271_cmd_send(wl, CMD_ROLE_ENABLE, cmd, sizeof(*cmd), 0); | 388 | ret = wl1271_cmd_send(wl, CMD_ROLE_ENABLE, cmd, sizeof(*cmd), 0); |
@@ -1200,14 +1201,14 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr) | |||
1200 | return ret; | 1201 | return ret; |
1201 | } | 1202 | } |
1202 | 1203 | ||
1203 | int wl1271_build_qos_null_data(struct wl1271 *wl) | 1204 | int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif) |
1204 | { | 1205 | { |
1205 | struct ieee80211_qos_hdr template; | 1206 | struct ieee80211_qos_hdr template; |
1206 | 1207 | ||
1207 | memset(&template, 0, sizeof(template)); | 1208 | memset(&template, 0, sizeof(template)); |
1208 | 1209 | ||
1209 | memcpy(template.addr1, wl->bssid, ETH_ALEN); | 1210 | memcpy(template.addr1, wl->bssid, ETH_ALEN); |
1210 | memcpy(template.addr2, wl->mac_addr, ETH_ALEN); | 1211 | memcpy(template.addr2, vif->addr, ETH_ALEN); |
1211 | memcpy(template.addr3, wl->bssid, ETH_ALEN); | 1212 | memcpy(template.addr3, wl->bssid, ETH_ALEN); |
1212 | 1213 | ||
1213 | template.frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA | | 1214 | template.frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA | |
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h index b7bd42769aa7..1ae949f00c14 100644 --- a/drivers/net/wireless/wl12xx/cmd.h +++ b/drivers/net/wireless/wl12xx/cmd.h | |||
@@ -36,7 +36,8 @@ int wl128x_cmd_general_parms(struct wl1271 *wl); | |||
36 | int wl1271_cmd_radio_parms(struct wl1271 *wl); | 36 | int wl1271_cmd_radio_parms(struct wl1271 *wl); |
37 | int wl128x_cmd_radio_parms(struct wl1271 *wl); | 37 | int wl128x_cmd_radio_parms(struct wl1271 *wl); |
38 | int wl1271_cmd_ext_radio_parms(struct wl1271 *wl); | 38 | int wl1271_cmd_ext_radio_parms(struct wl1271 *wl); |
39 | int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 role_type, u8 *role_id); | 39 | int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 *addr, u8 role_type, |
40 | u8 *role_id); | ||
40 | int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id); | 41 | int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id); |
41 | int wl12xx_cmd_role_start_dev(struct wl1271 *wl); | 42 | int wl12xx_cmd_role_start_dev(struct wl1271 *wl); |
42 | int wl12xx_cmd_role_stop_dev(struct wl1271 *wl); | 43 | int wl12xx_cmd_role_stop_dev(struct wl1271 *wl); |
@@ -62,7 +63,7 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl, | |||
62 | struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl, | 63 | struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl, |
63 | struct sk_buff *skb); | 64 | struct sk_buff *skb); |
64 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr); | 65 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr); |
65 | int wl1271_build_qos_null_data(struct wl1271 *wl); | 66 | int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif); |
66 | int wl1271_cmd_build_klv_null_data(struct wl1271 *wl); | 67 | int wl1271_cmd_build_klv_null_data(struct wl1271 *wl); |
67 | int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid); | 68 | int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid); |
68 | int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | 69 | int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c index 674ad2a9e409..7e3ff808feef 100644 --- a/drivers/net/wireless/wl12xx/event.c +++ b/drivers/net/wireless/wl12xx/event.c | |||
@@ -234,7 +234,7 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) | |||
234 | wl1271_debug(DEBUG_EVENT, "status: 0x%x", | 234 | wl1271_debug(DEBUG_EVENT, "status: 0x%x", |
235 | mbox->scheduled_scan_status); | 235 | mbox->scheduled_scan_status); |
236 | 236 | ||
237 | wl1271_scan_stm(wl); | 237 | wl1271_scan_stm(wl, wl->scan_vif); |
238 | } | 238 | } |
239 | 239 | ||
240 | if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) { | 240 | if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) { |
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c index 04db64c94e9a..4692a91ca737 100644 --- a/drivers/net/wireless/wl12xx/init.c +++ b/drivers/net/wireless/wl12xx/init.c | |||
@@ -123,7 +123,8 @@ out: | |||
123 | return ret; | 123 | return ret; |
124 | } | 124 | } |
125 | 125 | ||
126 | static int wl1271_ap_init_null_template(struct wl1271 *wl) | 126 | static int wl1271_ap_init_null_template(struct wl1271 *wl, |
127 | struct ieee80211_vif *vif) | ||
127 | { | 128 | { |
128 | struct ieee80211_hdr_3addr *nullfunc; | 129 | struct ieee80211_hdr_3addr *nullfunc; |
129 | int ret; | 130 | int ret; |
@@ -141,8 +142,8 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl) | |||
141 | 142 | ||
142 | /* nullfunc->addr1 is filled by FW */ | 143 | /* nullfunc->addr1 is filled by FW */ |
143 | 144 | ||
144 | memcpy(nullfunc->addr2, wl->mac_addr, ETH_ALEN); | 145 | memcpy(nullfunc->addr2, vif->addr, ETH_ALEN); |
145 | memcpy(nullfunc->addr3, wl->mac_addr, ETH_ALEN); | 146 | memcpy(nullfunc->addr3, vif->addr, ETH_ALEN); |
146 | 147 | ||
147 | rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set); | 148 | rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set); |
148 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, nullfunc, | 149 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, nullfunc, |
@@ -153,7 +154,8 @@ out: | |||
153 | return ret; | 154 | return ret; |
154 | } | 155 | } |
155 | 156 | ||
156 | static int wl1271_ap_init_qos_null_template(struct wl1271 *wl) | 157 | static int wl1271_ap_init_qos_null_template(struct wl1271 *wl, |
158 | struct ieee80211_vif *vif) | ||
157 | { | 159 | { |
158 | struct ieee80211_qos_hdr *qosnull; | 160 | struct ieee80211_qos_hdr *qosnull; |
159 | int ret; | 161 | int ret; |
@@ -171,8 +173,8 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl) | |||
171 | 173 | ||
172 | /* qosnull->addr1 is filled by FW */ | 174 | /* qosnull->addr1 is filled by FW */ |
173 | 175 | ||
174 | memcpy(qosnull->addr2, wl->mac_addr, ETH_ALEN); | 176 | memcpy(qosnull->addr2, vif->addr, ETH_ALEN); |
175 | memcpy(qosnull->addr3, wl->mac_addr, ETH_ALEN); | 177 | memcpy(qosnull->addr3, vif->addr, ETH_ALEN); |
176 | 178 | ||
177 | rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set); | 179 | rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set); |
178 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, qosnull, | 180 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, qosnull, |
@@ -449,7 +451,7 @@ static int wl1271_ap_hw_init(struct wl1271 *wl) | |||
449 | return 0; | 451 | return 0; |
450 | } | 452 | } |
451 | 453 | ||
452 | int wl1271_ap_init_templates(struct wl1271 *wl) | 454 | int wl1271_ap_init_templates(struct wl1271 *wl, struct ieee80211_vif *vif) |
453 | { | 455 | { |
454 | int ret; | 456 | int ret; |
455 | 457 | ||
@@ -457,11 +459,11 @@ int wl1271_ap_init_templates(struct wl1271 *wl) | |||
457 | if (ret < 0) | 459 | if (ret < 0) |
458 | return ret; | 460 | return ret; |
459 | 461 | ||
460 | ret = wl1271_ap_init_null_template(wl); | 462 | ret = wl1271_ap_init_null_template(wl, vif); |
461 | if (ret < 0) | 463 | if (ret < 0) |
462 | return ret; | 464 | return ret; |
463 | 465 | ||
464 | ret = wl1271_ap_init_qos_null_template(wl); | 466 | ret = wl1271_ap_init_qos_null_template(wl, vif); |
465 | if (ret < 0) | 467 | if (ret < 0) |
466 | return ret; | 468 | return ret; |
467 | 469 | ||
@@ -476,9 +478,10 @@ int wl1271_ap_init_templates(struct wl1271 *wl) | |||
476 | return 0; | 478 | return 0; |
477 | } | 479 | } |
478 | 480 | ||
479 | static int wl1271_ap_hw_init_post_mem(struct wl1271 *wl) | 481 | static int wl1271_ap_hw_init_post_mem(struct wl1271 *wl, |
482 | struct ieee80211_vif *vif) | ||
480 | { | 483 | { |
481 | return wl1271_ap_init_templates(wl); | 484 | return wl1271_ap_init_templates(wl, vif); |
482 | } | 485 | } |
483 | 486 | ||
484 | int wl1271_init_ap_rates(struct wl1271 *wl) | 487 | int wl1271_init_ap_rates(struct wl1271 *wl) |
@@ -576,7 +579,7 @@ out: | |||
576 | } | 579 | } |
577 | 580 | ||
578 | 581 | ||
579 | int wl1271_hw_init(struct wl1271 *wl) | 582 | int wl1271_hw_init(struct wl1271 *wl, struct ieee80211_vif *vif) |
580 | { | 583 | { |
581 | struct conf_tx_ac_category *conf_ac; | 584 | struct conf_tx_ac_category *conf_ac; |
582 | struct conf_tx_tid *conf_tid; | 585 | struct conf_tx_tid *conf_tid; |
@@ -694,7 +697,7 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
694 | 697 | ||
695 | /* Mode specific init - post mem init */ | 698 | /* Mode specific init - post mem init */ |
696 | if (is_ap) | 699 | if (is_ap) |
697 | ret = wl1271_ap_hw_init_post_mem(wl); | 700 | ret = wl1271_ap_hw_init_post_mem(wl, vif); |
698 | else | 701 | else |
699 | ret = wl1271_sta_hw_init_post_mem(wl); | 702 | ret = wl1271_sta_hw_init_post_mem(wl); |
700 | 703 | ||
diff --git a/drivers/net/wireless/wl12xx/init.h b/drivers/net/wireless/wl12xx/init.h index 3a3c230fd292..b1f97bcc47c0 100644 --- a/drivers/net/wireless/wl12xx/init.h +++ b/drivers/net/wireless/wl12xx/init.h | |||
@@ -32,8 +32,8 @@ int wl1271_init_phy_config(struct wl1271 *wl); | |||
32 | int wl1271_init_pta(struct wl1271 *wl); | 32 | int wl1271_init_pta(struct wl1271 *wl); |
33 | int wl1271_init_energy_detection(struct wl1271 *wl); | 33 | int wl1271_init_energy_detection(struct wl1271 *wl); |
34 | int wl1271_chip_specific_init(struct wl1271 *wl); | 34 | int wl1271_chip_specific_init(struct wl1271 *wl); |
35 | int wl1271_hw_init(struct wl1271 *wl); | 35 | int wl1271_hw_init(struct wl1271 *wl, struct ieee80211_vif *vif); |
36 | int wl1271_init_ap_rates(struct wl1271 *wl); | 36 | int wl1271_init_ap_rates(struct wl1271 *wl); |
37 | int wl1271_ap_init_templates(struct wl1271 *wl); | 37 | int wl1271_ap_init_templates(struct wl1271 *wl, struct ieee80211_vif *vif); |
38 | 38 | ||
39 | #endif | 39 | #endif |
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 884f82b63219..652471e8c61b 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1896,6 +1896,10 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, | |||
1896 | ret = -EINVAL; | 1896 | ret = -EINVAL; |
1897 | goto out; | 1897 | goto out; |
1898 | } | 1898 | } |
1899 | /* | ||
1900 | * we still need this in order to configure the fw | ||
1901 | * while uploading the nvs | ||
1902 | */ | ||
1899 | memcpy(wl->mac_addr, vif->addr, ETH_ALEN); | 1903 | memcpy(wl->mac_addr, vif->addr, ETH_ALEN); |
1900 | 1904 | ||
1901 | if (wl->state != WL1271_STATE_OFF) { | 1905 | if (wl->state != WL1271_STATE_OFF) { |
@@ -1923,18 +1927,19 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, | |||
1923 | * the STA role can get packets only from | 1927 | * the STA role can get packets only from |
1924 | * its associated bssid) | 1928 | * its associated bssid) |
1925 | */ | 1929 | */ |
1926 | ret = wl12xx_cmd_role_enable(wl, | 1930 | ret = wl12xx_cmd_role_enable(wl, vif->addr, |
1927 | WL1271_ROLE_DEVICE, | 1931 | WL1271_ROLE_DEVICE, |
1928 | &wl->dev_role_id); | 1932 | &wl->dev_role_id); |
1929 | if (ret < 0) | 1933 | if (ret < 0) |
1930 | goto irq_disable; | 1934 | goto irq_disable; |
1931 | } | 1935 | } |
1932 | 1936 | ||
1933 | ret = wl12xx_cmd_role_enable(wl, role_type, &wl->role_id); | 1937 | ret = wl12xx_cmd_role_enable(wl, vif->addr, |
1938 | role_type, &wl->role_id); | ||
1934 | if (ret < 0) | 1939 | if (ret < 0) |
1935 | goto irq_disable; | 1940 | goto irq_disable; |
1936 | 1941 | ||
1937 | ret = wl1271_hw_init(wl); | 1942 | ret = wl1271_hw_init(wl, vif); |
1938 | if (ret < 0) | 1943 | if (ret < 0) |
1939 | goto irq_disable; | 1944 | goto irq_disable; |
1940 | 1945 | ||
@@ -2019,6 +2024,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, | |||
2019 | if (wl->scan.state != WL1271_SCAN_STATE_IDLE) { | 2024 | if (wl->scan.state != WL1271_SCAN_STATE_IDLE) { |
2020 | wl->scan.state = WL1271_SCAN_STATE_IDLE; | 2025 | wl->scan.state = WL1271_SCAN_STATE_IDLE; |
2021 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); | 2026 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); |
2027 | wl->scan_vif = NULL; | ||
2022 | wl->scan.req = NULL; | 2028 | wl->scan.req = NULL; |
2023 | ieee80211_scan_completed(wl->hw, true); | 2029 | ieee80211_scan_completed(wl->hw, true); |
2024 | } | 2030 | } |
@@ -2885,7 +2891,7 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw, | |||
2885 | wl12xx_cmd_role_stop_dev(wl); | 2891 | wl12xx_cmd_role_stop_dev(wl); |
2886 | } | 2892 | } |
2887 | 2893 | ||
2888 | ret = wl1271_scan(hw->priv, ssid, len, req); | 2894 | ret = wl1271_scan(hw->priv, vif, ssid, len, req); |
2889 | out_sleep: | 2895 | out_sleep: |
2890 | wl1271_ps_elp_sleep(wl); | 2896 | wl1271_ps_elp_sleep(wl); |
2891 | out: | 2897 | out: |
@@ -2921,6 +2927,7 @@ static void wl1271_op_cancel_hw_scan(struct ieee80211_hw *hw, | |||
2921 | } | 2927 | } |
2922 | wl->scan.state = WL1271_SCAN_STATE_IDLE; | 2928 | wl->scan.state = WL1271_SCAN_STATE_IDLE; |
2923 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); | 2929 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); |
2930 | wl->scan_vif = NULL; | ||
2924 | wl->scan.req = NULL; | 2931 | wl->scan.req = NULL; |
2925 | ieee80211_scan_completed(wl->hw, true); | 2932 | ieee80211_scan_completed(wl->hw, true); |
2926 | 2933 | ||
@@ -3295,7 +3302,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, | |||
3295 | goto out; | 3302 | goto out; |
3296 | } | 3303 | } |
3297 | 3304 | ||
3298 | ret = wl1271_ap_init_templates(wl); | 3305 | ret = wl1271_ap_init_templates(wl, vif); |
3299 | if (ret < 0) | 3306 | if (ret < 0) |
3300 | goto out; | 3307 | goto out; |
3301 | } | 3308 | } |
@@ -3428,7 +3435,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, | |||
3428 | if (ret < 0) | 3435 | if (ret < 0) |
3429 | goto out; | 3436 | goto out; |
3430 | 3437 | ||
3431 | ret = wl1271_build_qos_null_data(wl); | 3438 | ret = wl1271_build_qos_null_data(wl, vif); |
3432 | if (ret < 0) | 3439 | if (ret < 0) |
3433 | goto out; | 3440 | goto out; |
3434 | 3441 | ||
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c index 128ccb79318c..a8576181ab7f 100644 --- a/drivers/net/wireless/wl12xx/scan.c +++ b/drivers/net/wireless/wl12xx/scan.c | |||
@@ -53,6 +53,7 @@ void wl1271_scan_complete_work(struct work_struct *work) | |||
53 | wl->scan.state = WL1271_SCAN_STATE_IDLE; | 53 | wl->scan.state = WL1271_SCAN_STATE_IDLE; |
54 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); | 54 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); |
55 | wl->scan.req = NULL; | 55 | wl->scan.req = NULL; |
56 | wl->scan_vif = NULL; | ||
56 | 57 | ||
57 | ret = wl1271_ps_elp_wakeup(wl); | 58 | ret = wl1271_ps_elp_wakeup(wl); |
58 | if (ret < 0) | 59 | if (ret < 0) |
@@ -155,8 +156,9 @@ static int wl1271_get_scan_channels(struct wl1271 *wl, | |||
155 | 156 | ||
156 | #define WL1271_NOTHING_TO_SCAN 1 | 157 | #define WL1271_NOTHING_TO_SCAN 1 |
157 | 158 | ||
158 | static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band, | 159 | static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif, |
159 | bool passive, u32 basic_rate) | 160 | enum ieee80211_band band, |
161 | bool passive, u32 basic_rate) | ||
160 | { | 162 | { |
161 | struct wl1271_cmd_scan *cmd; | 163 | struct wl1271_cmd_scan *cmd; |
162 | struct wl1271_cmd_trigger_scan_to *trigger; | 164 | struct wl1271_cmd_trigger_scan_to *trigger; |
@@ -208,7 +210,7 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band, | |||
208 | memcpy(cmd->params.ssid, wl->scan.ssid, wl->scan.ssid_len); | 210 | memcpy(cmd->params.ssid, wl->scan.ssid, wl->scan.ssid_len); |
209 | } | 211 | } |
210 | 212 | ||
211 | memcpy(cmd->addr, wl->mac_addr, ETH_ALEN); | 213 | memcpy(cmd->addr, vif->addr, ETH_ALEN); |
212 | 214 | ||
213 | ret = wl1271_cmd_build_probe_req(wl, wl->scan.ssid, wl->scan.ssid_len, | 215 | ret = wl1271_cmd_build_probe_req(wl, wl->scan.ssid, wl->scan.ssid_len, |
214 | wl->scan.req->ie, wl->scan.req->ie_len, | 216 | wl->scan.req->ie, wl->scan.req->ie_len, |
@@ -241,7 +243,7 @@ out: | |||
241 | return ret; | 243 | return ret; |
242 | } | 244 | } |
243 | 245 | ||
244 | void wl1271_scan_stm(struct wl1271 *wl) | 246 | void wl1271_scan_stm(struct wl1271 *wl, struct ieee80211_vif *vif) |
245 | { | 247 | { |
246 | int ret = 0; | 248 | int ret = 0; |
247 | enum ieee80211_band band; | 249 | enum ieee80211_band band; |
@@ -254,10 +256,10 @@ void wl1271_scan_stm(struct wl1271 *wl) | |||
254 | case WL1271_SCAN_STATE_2GHZ_ACTIVE: | 256 | case WL1271_SCAN_STATE_2GHZ_ACTIVE: |
255 | band = IEEE80211_BAND_2GHZ; | 257 | band = IEEE80211_BAND_2GHZ; |
256 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); | 258 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); |
257 | ret = wl1271_scan_send(wl, band, false, rate); | 259 | ret = wl1271_scan_send(wl, vif, band, false, rate); |
258 | if (ret == WL1271_NOTHING_TO_SCAN) { | 260 | if (ret == WL1271_NOTHING_TO_SCAN) { |
259 | wl->scan.state = WL1271_SCAN_STATE_2GHZ_PASSIVE; | 261 | wl->scan.state = WL1271_SCAN_STATE_2GHZ_PASSIVE; |
260 | wl1271_scan_stm(wl); | 262 | wl1271_scan_stm(wl, vif); |
261 | } | 263 | } |
262 | 264 | ||
263 | break; | 265 | break; |
@@ -265,13 +267,13 @@ void wl1271_scan_stm(struct wl1271 *wl) | |||
265 | case WL1271_SCAN_STATE_2GHZ_PASSIVE: | 267 | case WL1271_SCAN_STATE_2GHZ_PASSIVE: |
266 | band = IEEE80211_BAND_2GHZ; | 268 | band = IEEE80211_BAND_2GHZ; |
267 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); | 269 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); |
268 | ret = wl1271_scan_send(wl, band, true, rate); | 270 | ret = wl1271_scan_send(wl, vif, band, true, rate); |
269 | if (ret == WL1271_NOTHING_TO_SCAN) { | 271 | if (ret == WL1271_NOTHING_TO_SCAN) { |
270 | if (wl->enable_11a) | 272 | if (wl->enable_11a) |
271 | wl->scan.state = WL1271_SCAN_STATE_5GHZ_ACTIVE; | 273 | wl->scan.state = WL1271_SCAN_STATE_5GHZ_ACTIVE; |
272 | else | 274 | else |
273 | wl->scan.state = WL1271_SCAN_STATE_DONE; | 275 | wl->scan.state = WL1271_SCAN_STATE_DONE; |
274 | wl1271_scan_stm(wl); | 276 | wl1271_scan_stm(wl, vif); |
275 | } | 277 | } |
276 | 278 | ||
277 | break; | 279 | break; |
@@ -279,10 +281,10 @@ void wl1271_scan_stm(struct wl1271 *wl) | |||
279 | case WL1271_SCAN_STATE_5GHZ_ACTIVE: | 281 | case WL1271_SCAN_STATE_5GHZ_ACTIVE: |
280 | band = IEEE80211_BAND_5GHZ; | 282 | band = IEEE80211_BAND_5GHZ; |
281 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); | 283 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); |
282 | ret = wl1271_scan_send(wl, band, false, rate); | 284 | ret = wl1271_scan_send(wl, vif, band, false, rate); |
283 | if (ret == WL1271_NOTHING_TO_SCAN) { | 285 | if (ret == WL1271_NOTHING_TO_SCAN) { |
284 | wl->scan.state = WL1271_SCAN_STATE_5GHZ_PASSIVE; | 286 | wl->scan.state = WL1271_SCAN_STATE_5GHZ_PASSIVE; |
285 | wl1271_scan_stm(wl); | 287 | wl1271_scan_stm(wl, vif); |
286 | } | 288 | } |
287 | 289 | ||
288 | break; | 290 | break; |
@@ -290,10 +292,10 @@ void wl1271_scan_stm(struct wl1271 *wl) | |||
290 | case WL1271_SCAN_STATE_5GHZ_PASSIVE: | 292 | case WL1271_SCAN_STATE_5GHZ_PASSIVE: |
291 | band = IEEE80211_BAND_5GHZ; | 293 | band = IEEE80211_BAND_5GHZ; |
292 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); | 294 | rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]); |
293 | ret = wl1271_scan_send(wl, band, true, rate); | 295 | ret = wl1271_scan_send(wl, vif, band, true, rate); |
294 | if (ret == WL1271_NOTHING_TO_SCAN) { | 296 | if (ret == WL1271_NOTHING_TO_SCAN) { |
295 | wl->scan.state = WL1271_SCAN_STATE_DONE; | 297 | wl->scan.state = WL1271_SCAN_STATE_DONE; |
296 | wl1271_scan_stm(wl); | 298 | wl1271_scan_stm(wl, vif); |
297 | } | 299 | } |
298 | 300 | ||
299 | break; | 301 | break; |
@@ -317,7 +319,8 @@ void wl1271_scan_stm(struct wl1271 *wl) | |||
317 | } | 319 | } |
318 | } | 320 | } |
319 | 321 | ||
320 | int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, | 322 | int wl1271_scan(struct wl1271 *wl, struct ieee80211_vif *vif, |
323 | const u8 *ssid, size_t ssid_len, | ||
321 | struct cfg80211_scan_request *req) | 324 | struct cfg80211_scan_request *req) |
322 | { | 325 | { |
323 | /* | 326 | /* |
@@ -338,6 +341,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, | |||
338 | wl->scan.ssid_len = 0; | 341 | wl->scan.ssid_len = 0; |
339 | } | 342 | } |
340 | 343 | ||
344 | wl->scan_vif = vif; | ||
341 | wl->scan.req = req; | 345 | wl->scan.req = req; |
342 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); | 346 | memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); |
343 | 347 | ||
@@ -346,7 +350,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, | |||
346 | ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work, | 350 | ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work, |
347 | msecs_to_jiffies(WL1271_SCAN_TIMEOUT)); | 351 | msecs_to_jiffies(WL1271_SCAN_TIMEOUT)); |
348 | 352 | ||
349 | wl1271_scan_stm(wl); | 353 | wl1271_scan_stm(wl, vif); |
350 | 354 | ||
351 | return 0; | 355 | return 0; |
352 | } | 356 | } |
diff --git a/drivers/net/wireless/wl12xx/scan.h b/drivers/net/wireless/wl12xx/scan.h index 92115156522f..15177bdfb542 100644 --- a/drivers/net/wireless/wl12xx/scan.h +++ b/drivers/net/wireless/wl12xx/scan.h | |||
@@ -26,13 +26,14 @@ | |||
26 | 26 | ||
27 | #include "wl12xx.h" | 27 | #include "wl12xx.h" |
28 | 28 | ||
29 | int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, | 29 | int wl1271_scan(struct wl1271 *wl, struct ieee80211_vif *vif, |
30 | const u8 *ssid, size_t ssid_len, | ||
30 | struct cfg80211_scan_request *req); | 31 | struct cfg80211_scan_request *req); |
31 | int wl1271_scan_stop(struct wl1271 *wl); | 32 | int wl1271_scan_stop(struct wl1271 *wl); |
32 | int wl1271_scan_build_probe_req(struct wl1271 *wl, | 33 | int wl1271_scan_build_probe_req(struct wl1271 *wl, |
33 | const u8 *ssid, size_t ssid_len, | 34 | const u8 *ssid, size_t ssid_len, |
34 | const u8 *ie, size_t ie_len, u8 band); | 35 | const u8 *ie, size_t ie_len, u8 band); |
35 | void wl1271_scan_stm(struct wl1271 *wl); | 36 | void wl1271_scan_stm(struct wl1271 *wl, struct ieee80211_vif *vif); |
36 | void wl1271_scan_complete_work(struct work_struct *work); | 37 | void wl1271_scan_complete_work(struct work_struct *work); |
37 | int wl1271_scan_sched_scan_config(struct wl1271 *wl, | 38 | int wl1271_scan_sched_scan_config(struct wl1271 *wl, |
38 | struct cfg80211_sched_scan_request *req, | 39 | struct cfg80211_sched_scan_request *req, |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 1ec90fc7505e..b8de2f5e052b 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -507,6 +507,7 @@ struct wl1271 { | |||
507 | u32 mbox_ptr[2]; | 507 | u32 mbox_ptr[2]; |
508 | 508 | ||
509 | /* Are we currently scanning */ | 509 | /* Are we currently scanning */ |
510 | struct ieee80211_vif *scan_vif; | ||
510 | struct wl1271_scan scan; | 511 | struct wl1271_scan scan; |
511 | struct delayed_work scan_complete_work; | 512 | struct delayed_work scan_complete_work; |
512 | 513 | ||