Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225312
b: refs/heads/master
c: 2f6724b
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and Luciano Coelho committed Nov 26, 2010
1 parent 506f478 commit 5dff2f0
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 573c67cf819d52d2e12adf75a9a8cfbd216190a3
refs/heads/master: 2f6724b24525fc989c0707974b23d96b36132385
28 changes: 28 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,34 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl,
return ret;
}

struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
struct sk_buff *skb)
{
int ret;

if (!skb)
skb = ieee80211_ap_probereq_get(wl->hw, wl->vif);
if (!skb)
goto out;

wl1271_dump(DEBUG_SCAN, "AP PROBE REQ: ", skb->data, skb->len);

if (wl->band == IEEE80211_BAND_2GHZ)
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4,
skb->data, skb->len, 0,
wl->conf.tx.basic_rate);
else
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
skb->data, skb->len, 0,
wl->conf.tx.basic_rate_5);

if (ret < 0)
wl1271_error("Unable to set ap probe request template.");

out:
return skb;
}

int wl1271_build_qos_null_data(struct wl1271 *wl)
{
struct ieee80211_qos_hdr template;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
int wl1271_cmd_build_probe_req(struct wl1271 *wl,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, u8 band);
struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
struct sk_buff *skb);
int wl1271_build_qos_null_data(struct wl1271 *wl);
int wl1271_cmd_build_klv_null_data(struct wl1271 *wl);
int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id);
Expand Down
34 changes: 21 additions & 13 deletions trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1814,21 +1814,21 @@ static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
return ret;
}

static void wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *beacon)
static void wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *skb,
int offset)
{
u8 *ptr = beacon->data +
offsetof(struct ieee80211_mgmt, u.beacon.variable);
u8 *ptr = skb->data + offset;

/* find the location of the ssid in the beacon */
while (ptr < beacon->data + beacon->len) {
while (ptr < skb->data + skb->len) {
if (ptr[0] == WLAN_EID_SSID) {
wl->ssid_len = ptr[1];
memcpy(wl->ssid, ptr+2, wl->ssid_len);
return;
}
ptr += ptr[1];
ptr += (ptr[1] + 2);
}
wl1271_error("ad-hoc beacon template has no SSID!\n");
wl1271_error("No SSID in IEs!\n");
}

static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
Expand Down Expand Up @@ -1871,8 +1871,11 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,

if (beacon) {
struct ieee80211_hdr *hdr;
int ieoffset = offsetof(struct ieee80211_mgmt,
u.beacon.variable);

wl1271_ssid_set(wl, beacon, ieoffset);

wl1271_ssid_set(wl, beacon);
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON,
beacon->data,
beacon->len, 0,
Expand Down Expand Up @@ -1952,6 +1955,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_ASSOC) {
if (bss_conf->assoc) {
u32 rates;
int ieoffset;
wl->aid = bss_conf->aid;
set_assoc = true;

Expand Down Expand Up @@ -1980,13 +1984,13 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
goto out_sleep;

/*
* The SSID is intentionally set to NULL here - the
* firmware will set the probe request with a
* broadcast SSID regardless of what we set in the
* template.
* Get a template for hardware connection maintenance
*/
ret = wl1271_cmd_build_probe_req(wl, NULL, 0,
NULL, 0, wl->band);
dev_kfree_skb(wl->probereq);
wl->probereq = wl1271_cmd_build_ap_probe_req(wl, NULL);
ieoffset = offsetof(struct ieee80211_mgmt,
u.probe_req.variable);
wl1271_ssid_set(wl, wl->probereq, ieoffset);

/* enable the connection monitoring feature */
ret = wl1271_acx_conn_monit_params(wl, true);
Expand All @@ -2009,6 +2013,10 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
clear_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags);
wl->aid = 0;

/* free probe-request template */
dev_kfree_skb(wl->probereq);
wl->probereq = NULL;

/* re-enable dynamic ps - just in case */
ieee80211_enable_dyn_ps(wl->vif);

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ void wl1271_scan_complete_work(struct work_struct *work)
wl->scan.req = NULL;
ieee80211_scan_completed(wl->hw, false);

/* restore hardware connection monitoring template */
if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
wl1271_cmd_build_ap_probe_req(wl, wl->probereq);

if (wl->scan.failed) {
wl1271_info("Scan completed due to error.");
ieee80211_queue_work(wl->hw, &wl->recovery_work);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl12xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ struct wl1271 {
struct wl1271_scan scan;
struct delayed_work scan_complete_work;

/* probe-req template for the current AP */
struct sk_buff *probereq;

/* Our association ID */
u16 aid;

Expand Down

0 comments on commit 5dff2f0

Please sign in to comment.