aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorYair Shapira <yair.shapira@ti.com>2012-07-11 11:48:04 -0400
committerLuciano Coelho <coelho@ti.com>2012-07-18 08:08:22 -0400
commit7019c80eead86d246a7b6697011bc37b2bdd8539 (patch)
treefe56e71ade82d25159da1cbbd826687e0f170b30 /drivers/net/wireless
parent4340d1cf5f1a967074f5dabec09a06fc0ae52ac7 (diff)
wlcore: add plt_mode including new PLT_FEM_DETECT
add wl->plt_mode that is used to indicate different plt working modes: this will be used to implement calibrator side auto fem detection where driver asks firmware to detect the wlan fem radio type and returns it to calibrator. this is not implemented yet and plt_modes: PLT_ON and PLT_FEM_DETECT currently behave the same. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c21
-rw-r--r--drivers/net/wireless/ti/wlcore/testmode.c7
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h1
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore_i.h8
4 files changed, 30 insertions, 7 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 05c3912c3e4..72548609f71 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1064,10 +1064,17 @@ out:
1064 return ret; 1064 return ret;
1065} 1065}
1066 1066
1067int wl1271_plt_start(struct wl1271 *wl) 1067int wl1271_plt_start(struct wl1271 *wl, const enum plt_mode plt_mode)
1068{ 1068{
1069 int retries = WL1271_BOOT_RETRIES; 1069 int retries = WL1271_BOOT_RETRIES;
1070 struct wiphy *wiphy = wl->hw->wiphy; 1070 struct wiphy *wiphy = wl->hw->wiphy;
1071
1072 static const char* const PLT_MODE[] = {
1073 "PLT_OFF",
1074 "PLT_ON",
1075 "PLT_FEM_DETECT"
1076 };
1077
1071 int ret; 1078 int ret;
1072 1079
1073 mutex_lock(&wl->mutex); 1080 mutex_lock(&wl->mutex);
@@ -1081,6 +1088,10 @@ int wl1271_plt_start(struct wl1271 *wl)
1081 goto out; 1088 goto out;
1082 } 1089 }
1083 1090
1091 /* Indicate to lower levels that we are now in PLT mode */
1092 wl->plt = true;
1093 wl->plt_mode = plt_mode;
1094
1084 while (retries) { 1095 while (retries) {
1085 retries--; 1096 retries--;
1086 ret = wl12xx_chip_wakeup(wl, true); 1097 ret = wl12xx_chip_wakeup(wl, true);
@@ -1091,9 +1102,9 @@ int wl1271_plt_start(struct wl1271 *wl)
1091 if (ret < 0) 1102 if (ret < 0)
1092 goto power_off; 1103 goto power_off;
1093 1104
1094 wl->plt = true;
1095 wl->state = WL1271_STATE_ON; 1105 wl->state = WL1271_STATE_ON;
1096 wl1271_notice("firmware booted in PLT mode (%s)", 1106 wl1271_notice("firmware booted in PLT mode %s (%s)",
1107 PLT_MODE[plt_mode],
1097 wl->chip.fw_ver_str); 1108 wl->chip.fw_ver_str);
1098 1109
1099 /* update hw/fw version info in wiphy struct */ 1110 /* update hw/fw version info in wiphy struct */
@@ -1107,6 +1118,9 @@ power_off:
1107 wl1271_power_off(wl); 1118 wl1271_power_off(wl);
1108 } 1119 }
1109 1120
1121 wl->plt = false;
1122 wl->plt_mode = PLT_OFF;
1123
1110 wl1271_error("firmware boot in PLT mode failed despite %d retries", 1124 wl1271_error("firmware boot in PLT mode failed despite %d retries",
1111 WL1271_BOOT_RETRIES); 1125 WL1271_BOOT_RETRIES);
1112out: 1126out:
@@ -1159,6 +1173,7 @@ int wl1271_plt_stop(struct wl1271 *wl)
1159 wl->sleep_auth = WL1271_PSM_ILLEGAL; 1173 wl->sleep_auth = WL1271_PSM_ILLEGAL;
1160 wl->state = WL1271_STATE_OFF; 1174 wl->state = WL1271_STATE_OFF;
1161 wl->plt = false; 1175 wl->plt = false;
1176 wl->plt_mode = PLT_OFF;
1162 wl->rx_counter = 0; 1177 wl->rx_counter = 0;
1163 mutex_unlock(&wl->mutex); 1178 mutex_unlock(&wl->mutex);
1164 1179
diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c
index d6f57e2c03c..a204c938c79 100644
--- a/drivers/net/wireless/ti/wlcore/testmode.c
+++ b/drivers/net/wireless/ti/wlcore/testmode.c
@@ -258,11 +258,12 @@ static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[])
258 val = nla_get_u32(tb[WL1271_TM_ATTR_PLT_MODE]); 258 val = nla_get_u32(tb[WL1271_TM_ATTR_PLT_MODE]);
259 259
260 switch (val) { 260 switch (val) {
261 case 0: 261 case PLT_OFF:
262 ret = wl1271_plt_stop(wl); 262 ret = wl1271_plt_stop(wl);
263 break; 263 break;
264 case 1: 264 case PLT_ON:
265 ret = wl1271_plt_start(wl); 265 case PLT_FEM_DETECT:
266 ret = wl1271_plt_start(wl, val);
266 break; 267 break;
267 default: 268 default:
268 ret = -EINVAL; 269 ret = -EINVAL;
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 27ccc275a1c..4f8b4199d3b 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -156,6 +156,7 @@ struct wl1271 {
156 enum wl1271_state state; 156 enum wl1271_state state;
157 enum wl12xx_fw_type fw_type; 157 enum wl12xx_fw_type fw_type;
158 bool plt; 158 bool plt;
159 enum plt_mode plt_mode;
159 u8 last_vif_count; 160 u8 last_vif_count;
160 struct mutex mutex; 161 struct mutex mutex;
161 162
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 0187eef4fb0..c0505635bb0 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -293,6 +293,12 @@ enum rx_filter_action {
293 FILTER_FW_HANDLE = 2 293 FILTER_FW_HANDLE = 2
294}; 294};
295 295
296enum plt_mode {
297 PLT_OFF = 0,
298 PLT_ON = 1,
299 PLT_FEM_DETECT = 2,
300};
301
296struct wl12xx_rx_filter_field { 302struct wl12xx_rx_filter_field {
297 __le16 offset; 303 __le16 offset;
298 u8 len; 304 u8 len;
@@ -459,7 +465,7 @@ struct ieee80211_vif *wl12xx_wlvif_to_vif(struct wl12xx_vif *wlvif)
459#define wl12xx_for_each_wlvif_ap(wl, wlvif) \ 465#define wl12xx_for_each_wlvif_ap(wl, wlvif) \
460 wl12xx_for_each_wlvif_bss_type(wl, wlvif, BSS_TYPE_AP_BSS) 466 wl12xx_for_each_wlvif_bss_type(wl, wlvif, BSS_TYPE_AP_BSS)
461 467
462int wl1271_plt_start(struct wl1271 *wl); 468int wl1271_plt_start(struct wl1271 *wl, const enum plt_mode plt_mode);
463int wl1271_plt_stop(struct wl1271 *wl); 469int wl1271_plt_stop(struct wl1271 *wl);
464int wl1271_recalc_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif); 470int wl1271_recalc_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif);
465void wl12xx_queue_recovery_work(struct wl1271 *wl); 471void wl12xx_queue_recovery_work(struct wl1271 *wl);