aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_event.c10
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c69
2 files changed, 51 insertions, 28 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c
index cecbae2ded3..2803e700a75 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.c
+++ b/drivers/net/wireless/wl12xx/wl1271_event.c
@@ -92,7 +92,12 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
92 true); 92 true);
93 } else { 93 } else {
94 wl1271_error("PSM entry failed, giving up.\n"); 94 wl1271_error("PSM entry failed, giving up.\n");
95 /* make sure the firmware goes into active mode */ 95 /* FIXME: this may need to be reconsidered. for now it
96 is not possible to indicate to the mac80211
97 afterwards that PSM entry failed. To maximize
98 functionality (receiving data and remaining
99 associated) make sure that we are in sync with the
100 AP in regard of PSM mode. */
96 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, 101 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
97 false); 102 false);
98 wl->psm_entry_retry = 0; 103 wl->psm_entry_retry = 0;
@@ -124,7 +129,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
124 break; 129 break;
125 } 130 }
126 131
127 /* make sure the firmware goes to active mode */ 132 /* make sure the firmware goes to active mode - the frame to
133 be sent next will indicate to the AP, that we are active. */
128 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, 134 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
129 false); 135 false);
130 break; 136 break;
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 8b46b7069f1..a3742c8052d 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1549,6 +1549,23 @@ out:
1549 return ret; 1549 return ret;
1550} 1550}
1551 1551
1552static void wl1271_ssid_set(struct wl1271 *wl, struct sk_buff *beacon)
1553{
1554 u8 *ptr = beacon->data +
1555 offsetof(struct ieee80211_mgmt, u.beacon.variable);
1556
1557 /* find the location of the ssid in the beacon */
1558 while (ptr < beacon->data + beacon->len) {
1559 if (ptr[0] == WLAN_EID_SSID) {
1560 wl->ssid_len = ptr[1];
1561 memcpy(wl->ssid, ptr+2, wl->ssid_len);
1562 return;
1563 }
1564 ptr += ptr[1];
1565 }
1566 wl1271_error("ad-hoc beacon template has no SSID!\n");
1567}
1568
1552static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, 1569static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1553 struct ieee80211_vif *vif, 1570 struct ieee80211_vif *vif,
1554 struct ieee80211_bss_conf *bss_conf, 1571 struct ieee80211_bss_conf *bss_conf,
@@ -1566,40 +1583,17 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1566 if (ret < 0) 1583 if (ret < 0)
1567 goto out; 1584 goto out;
1568 1585
1569 if ((changed & BSS_CHANGED_BSSID) &&
1570 /*
1571 * Now we know the correct bssid, so we send a new join command
1572 * and enable the BSSID filter
1573 */
1574 memcmp(wl->bssid, bss_conf->bssid, ETH_ALEN)) {
1575 wl->rx_config |= CFG_BSSID_FILTER_EN;
1576 memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN);
1577 ret = wl1271_cmd_build_null_data(wl);
1578 if (ret < 0) {
1579 wl1271_warning("cmd buld null data failed %d",
1580 ret);
1581 goto out_sleep;
1582 }
1583 ret = wl1271_cmd_join(wl);
1584 if (ret < 0) {
1585 wl1271_warning("cmd join failed %d", ret);
1586 goto out_sleep;
1587 }
1588 set_bit(WL1271_FLAG_JOINED, &wl->flags);
1589 }
1590
1591 if (wl->bss_type == BSS_TYPE_IBSS) { 1586 if (wl->bss_type == BSS_TYPE_IBSS) {
1592 /* FIXME: This implements rudimentary ad-hoc support - 1587 /* FIXME: This implements rudimentary ad-hoc support -
1593 proper templates are on the wish list and notification 1588 proper templates are on the wish list and notification
1594 on when they change. This patch will update the templates 1589 on when they change. This patch will update the templates
1595 on every call to this function. Also, the firmware will not 1590 on every call to this function. */
1596 answer to probe-requests as it does not have the proper
1597 SSID set in the JOIN command. The probe-response template
1598 is set nevertheless, as the FW will ASSERT without it */
1599 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 1591 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
1600 1592
1601 if (beacon) { 1593 if (beacon) {
1602 struct ieee80211_hdr *hdr; 1594 struct ieee80211_hdr *hdr;
1595
1596 wl1271_ssid_set(wl, beacon);
1603 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, 1597 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON,
1604 beacon->data, 1598 beacon->data,
1605 beacon->len); 1599 beacon->len);
@@ -1624,6 +1618,29 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1624 } 1618 }
1625 } 1619 }
1626 1620
1621 if ((changed & BSS_CHANGED_BSSID) &&
1622 /*
1623 * Now we know the correct bssid, so we send a new join command
1624 * and enable the BSSID filter
1625 */
1626 memcmp(wl->bssid, bss_conf->bssid, ETH_ALEN)) {
1627 wl->rx_config |= CFG_BSSID_FILTER_EN;
1628 memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN);
1629 ret = wl1271_cmd_build_null_data(wl);
1630 if (ret < 0) {
1631 wl1271_warning("cmd buld null data failed %d",
1632 ret);
1633 goto out_sleep;
1634 }
1635
1636 ret = wl1271_cmd_join(wl);
1637 if (ret < 0) {
1638 wl1271_warning("cmd join failed %d", ret);
1639 goto out_sleep;
1640 }
1641 set_bit(WL1271_FLAG_JOINED, &wl->flags);
1642 }
1643
1627 if (changed & BSS_CHANGED_ASSOC) { 1644 if (changed & BSS_CHANGED_ASSOC) {
1628 if (bss_conf->assoc) { 1645 if (bss_conf->assoc) {
1629 wl->aid = bss_conf->aid; 1646 wl->aid = bss_conf->aid;