aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/testmode.c
diff options
context:
space:
mode:
authorYair Shapira <yair.shapira@ti.com>2013-09-17 18:41:21 +0300
committerLuciano Coelho <luciano.coelho@intel.com>2013-09-30 21:12:18 +0300
commitdd491ffbaad83ccd6c99851a3c2d4b1ed75211fc (patch)
tree49851cdc90eecaf04806043d2ceaacc129180dd9 /drivers/net/wireless/ti/wlcore/testmode.c
parentwlcore: ROC on AP channel before auth reply (diff)
downloadlinux-dev-dd491ffbaad83ccd6c99851a3c2d4b1ed75211fc.tar.xz
linux-dev-dd491ffbaad83ccd6c99851a3c2d4b1ed75211fc.zip
wlcore: add new plt power-mode: CHIP_AWAKE
Under this mode the chip is powered on including sdio but no FW is downloaded and run, interrupts are not enabled, etc... This mode is intended to allow RTTT to bridge sdio as a transport to the chip. Driver only provides sdio access using the dev_mem debugfs file. Some fixes done to the code that ensures that PLT mode and normal driver power mode (ifconfig/add_interface) are mutually excluded. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/testmode.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/testmode.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c
index 527590f2adfb..a3b7d950d8e9 100644
--- a/drivers/net/wireless/ti/wlcore/testmode.c
+++ b/drivers/net/wireless/ti/wlcore/testmode.c
@@ -297,7 +297,8 @@ static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[])
ret = wl1271_plt_stop(wl);
break;
case PLT_ON:
- ret = wl1271_plt_start(wl, PLT_ON);
+ case PLT_CHIP_AWAKE:
+ ret = wl1271_plt_start(wl, val);
break;
case PLT_FEM_DETECT:
ret = wl1271_tm_detect_fem(wl, tb);
@@ -361,6 +362,7 @@ int wl1271_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
{
struct wl1271 *wl = hw->priv;
struct nlattr *tb[WL1271_TM_ATTR_MAX + 1];
+ u32 nla_cmd;
int err;
err = nla_parse(tb, WL1271_TM_ATTR_MAX, data, len, wl1271_tm_policy);
@@ -370,7 +372,14 @@ int wl1271_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (!tb[WL1271_TM_ATTR_CMD_ID])
return -EINVAL;
- switch (nla_get_u32(tb[WL1271_TM_ATTR_CMD_ID])) {
+ nla_cmd = nla_get_u32(tb[WL1271_TM_ATTR_CMD_ID]);
+
+ /* Only SET_PLT_MODE is allowed in case of mode PLT_CHIP_AWAKE */
+ if (wl->plt_mode == PLT_CHIP_AWAKE &&
+ nla_cmd != WL1271_TM_CMD_SET_PLT_MODE)
+ return -EOPNOTSUPP;
+
+ switch (nla_cmd) {
case WL1271_TM_CMD_TEST:
return wl1271_tm_cmd_test(wl, tb);
case WL1271_TM_CMD_INTERROGATE: