wl12xx: add device role commands
The device role is a special role used for rx and tx frames
prior to association (as the STA role can get packets only
from its associated bssid)
Since this role is required for the sta association process,
we enable it when a new sta interface is created.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 3e77f59..7b0b7c3 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1866,6 +1866,20 @@
if (ret < 0)
goto power_off;
+ if (wl->bss_type == BSS_TYPE_STA_BSS) {
+ /*
+ * The device role is a special role used for
+ * rx and tx frames prior to association (as
+ * the STA role can get packets only from
+ * its associated bssid)
+ */
+ ret = wl12xx_cmd_role_enable(wl,
+ WL1271_ROLE_DEVICE,
+ &wl->dev_role_id);
+ if (ret < 0)
+ goto irq_disable;
+ }
+
ret = wl12xx_cmd_role_enable(wl, role_type, &wl->role_id);
if (ret < 0)
goto irq_disable;
@@ -1965,6 +1979,12 @@
if (ret < 0)
goto deinit;
+ if (wl->bss_type == BSS_TYPE_STA_BSS) {
+ ret = wl12xx_cmd_role_disable(wl, &wl->dev_role_id);
+ if (ret < 0)
+ goto deinit;
+ }
+
ret = wl12xx_cmd_role_disable(wl, &wl->role_id);
if (ret < 0)
goto deinit;
@@ -1973,6 +1993,7 @@
}
deinit:
wl->sta_hlid = WL12XX_INVALID_LINK_ID;
+ wl->dev_hlid = WL12XX_INVALID_LINK_ID;
/*
* this must be before the cancel_work calls below, so that the work
@@ -2023,6 +2044,7 @@
wl->ap_ps_map = 0;
wl->sched_scanning = false;
wl->role_id = WL12XX_INVALID_ROLE_ID;
+ wl->dev_role_id = WL12XX_INVALID_ROLE_ID;
memset(wl->roles_map, 0, sizeof(wl->roles_map));
memset(wl->links_map, 0, sizeof(wl->links_map));
@@ -4365,7 +4387,8 @@
wl->tx_security_last_seq_lsb = 0;
wl->role_id = WL12XX_INVALID_ROLE_ID;
wl->sta_hlid = WL12XX_INVALID_LINK_ID;
-
+ wl->dev_role_id = WL12XX_INVALID_ROLE_ID;
+ wl->dev_hlid = WL12XX_INVALID_LINK_ID;
setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer,
(unsigned long) wl);
wl->fwlog_size = 0;