aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/cmd.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-08-14 06:17:17 -0400
committerLuciano Coelho <coelho@ti.com>2011-08-22 05:35:26 -0400
commit251c177f886027fbce494202e44935762f103137 (patch)
treeb0bd3220df9058d2957d2d7158818977c0c65f8a /drivers/net/wireless/wl12xx/cmd.c
parent79ebec76be4e7c2ebed9fb0b9510d10d599ed63e (diff)
wl12xx: replace dummy_join with ROC/CROC commands
The ROC command asks the fw stay on the channel of the given hlid. it currently has 2 primary functions: 1. Allow tx/rx from the device role. In order to tx/rx packets while the stations is not associated (e.g. auth req/resp), the device role has to be used, along with ROC on its link. Keep the logic similiar to the one used in dummy_join. However, since we can't scan while we ROC, we add CROC before starting a scan, and ROC again (if needed) on scan complete. 2. Keeping the antenna for a specific link. We ROC until the connection was completed (after EAPOLs exchange) in order to prevent BT coex operations from taking the antenna and failing the connection (after this stage, psm can be used). During association, we ROC on the station role, and then CROC the device role, thus assuring being ROC during all the connection process. Delete the WL1271_FLAG_JOINED flag, and use a roc bitmap to indicate what roles are currently ROCed. Add wl12xx_roc/croc functions in order to wrap the roc/croc commands while taking care of the roc bitmap. The current ROC/CROC state-machine is a bit complicated. In the future we'll probably want to use wpa_supplicant to control the ROC during connection. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/cmd.c')
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 1b04102144e6..c620a9d4939c 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1554,3 +1554,42 @@ out_free:
1554out: 1554out:
1555 return ret; 1555 return ret;
1556} 1556}
1557
1558int wl12xx_roc(struct wl1271 *wl, u8 role_id)
1559{
1560 int ret = 0;
1561
1562 if (WARN_ON(test_bit(role_id, wl->roc_map)))
1563 return 0;
1564
1565 ret = wl12xx_cmd_roc(wl, role_id);
1566 if (ret < 0)
1567 goto out;
1568
1569 ret = wl1271_cmd_wait_for_event(wl,
1570 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID);
1571 if (ret < 0) {
1572 wl1271_error("cmd roc event completion error");
1573 goto out;
1574 }
1575
1576 __set_bit(role_id, wl->roc_map);
1577out:
1578 return ret;
1579}
1580
1581int wl12xx_croc(struct wl1271 *wl, u8 role_id)
1582{
1583 int ret = 0;
1584
1585 if (WARN_ON(!test_bit(role_id, wl->roc_map)))
1586 return 0;
1587
1588 ret = wl12xx_cmd_croc(wl, role_id);
1589 if (ret < 0)
1590 goto out;
1591
1592 __clear_bit(role_id, wl->roc_map);
1593out:
1594 return ret;
1595}