Commit 4fb26fa9 authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by John W. Linville

wl1271: Fix scan parameter handling for 5GHz

The 5GHz bands were scanned without the proper IE's in place, preventing
proper 5GHz scanning. This patches fixes the problem by storing a pointer
to the scan request (with the IE's) for all iterations of scan.
Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5da54f94
...@@ -299,6 +299,7 @@ struct wl1271_rx_mem_pool_addr { ...@@ -299,6 +299,7 @@ struct wl1271_rx_mem_pool_addr {
}; };
struct wl1271_scan { struct wl1271_scan {
struct cfg80211_scan_request *req;
u8 state; u8 state;
u8 ssid[IW_ESSID_MAX_SIZE+1]; u8 ssid[IW_ESSID_MAX_SIZE+1];
size_t ssid_len; size_t ssid_len;
......
...@@ -568,7 +568,7 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, ...@@ -568,7 +568,7 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
} }
int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, u8 active_scan, struct cfg80211_scan_request *req, u8 active_scan,
u8 high_prio, u8 band, u8 probe_requests) u8 high_prio, u8 band, u8 probe_requests)
{ {
...@@ -649,7 +649,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, ...@@ -649,7 +649,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
} }
ret = wl1271_cmd_build_probe_req(wl, ssid, ssid_len, ret = wl1271_cmd_build_probe_req(wl, ssid, ssid_len,
ie, ie_len, ieee_band); req->ie, req->ie_len, ieee_band);
if (ret < 0) { if (ret < 0) {
wl1271_error("PROBE request template failed"); wl1271_error("PROBE request template failed");
goto out; goto out;
...@@ -685,7 +685,9 @@ int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, ...@@ -685,7 +685,9 @@ int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
memcpy(wl->scan.ssid, ssid, ssid_len); memcpy(wl->scan.ssid, ssid, ssid_len);
} else } else
wl->scan.ssid_len = 0; wl->scan.ssid_len = 0;
} wl->scan.req = req;
} else
wl->scan.req = NULL;
} }
ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params), 0); ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params), 0);
......
...@@ -42,7 +42,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send); ...@@ -42,7 +42,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send);
int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
size_t len); size_t len);
int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, u8 active_scan, struct cfg80211_scan_request *req, u8 active_scan,
u8 high_prio, u8 band, u8 probe_requests); u8 high_prio, u8 band, u8 probe_requests);
int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
void *buf, size_t buf_len, int index, u32 rates); void *buf, size_t buf_len, int index, u32 rates);
......
...@@ -43,11 +43,11 @@ static int wl1271_event_scan_complete(struct wl1271 *wl, ...@@ -43,11 +43,11 @@ static int wl1271_event_scan_complete(struct wl1271 *wl,
clear_bit(WL1271_FLAG_SCANNING, &wl->flags); clear_bit(WL1271_FLAG_SCANNING, &wl->flags);
/* FIXME: ie missing! */ /* FIXME: ie missing! */
wl1271_cmd_scan(wl, wl->scan.ssid, wl->scan.ssid_len, wl1271_cmd_scan(wl, wl->scan.ssid, wl->scan.ssid_len,
NULL, 0, wl->scan.req,
wl->scan.active, wl->scan.active,
wl->scan.high_prio, wl->scan.high_prio,
WL1271_SCAN_BAND_5_GHZ, WL1271_SCAN_BAND_5_GHZ,
wl->scan.probe_requests); wl->scan.probe_requests);
} else { } else {
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
ieee80211_scan_completed(wl->hw, false); ieee80211_scan_completed(wl->hw, false);
......
...@@ -1634,13 +1634,11 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw, ...@@ -1634,13 +1634,11 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
goto out; goto out;
if (wl1271_11a_enabled()) if (wl1271_11a_enabled())
ret = wl1271_cmd_scan(hw->priv, ssid, len, ret = wl1271_cmd_scan(hw->priv, ssid, len, req,
req->ie, req->ie_len, 1, 0, 1, 0, WL1271_SCAN_BAND_DUAL, 3);
WL1271_SCAN_BAND_DUAL, 3);
else else
ret = wl1271_cmd_scan(hw->priv, ssid, len, ret = wl1271_cmd_scan(hw->priv, ssid, len, req,
req->ie, req->ie_len, 1, 0, 1, 0, WL1271_SCAN_BAND_2_4_GHZ, 3);
WL1271_SCAN_BAND_2_4_GHZ, 3);
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