aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorYair Shapira <yair.shapira@ti.com>2012-11-26 11:05:50 -0500
committerLuciano Coelho <coelho@ti.com>2012-12-04 09:36:09 -0500
commit7230341f254c9bce39e9576362f18b94854bc779 (patch)
treebadca2648dfefefeb9bb0d1f3190b17429878e49 /drivers/net/wireless/ti
parentc108c90535ae29099de88187a90b8411bc1fe9a1 (diff)
wlcore/wl18xx/wl12xx: add recovery settings to conf
add support for recovery settings including bug_on_recovery and no_recovery options. These options can now be set using wl18xx-conf.bin file and wlconf tool. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c4
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c4
-rw-r--r--drivers/net/wireless/ti/wlcore/conf.h11
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c19
4 files changed, 31 insertions, 7 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 97cc79c1bcf0..aa73ada06463 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -370,6 +370,10 @@ static struct wlcore_conf wl12xx_conf = {
370 .increase_time = 1, 370 .increase_time = 1,
371 .window_size = 16, 371 .window_size = 16,
372 }, 372 },
373 .recovery = {
374 .bug_on_recovery = 0,
375 .no_recovery = 0,
376 },
373}; 377};
374 378
375static struct wl12xx_priv_conf wl12xx_default_priv_conf = { 379static struct wl12xx_priv_conf wl12xx_default_priv_conf = {
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 18a01b404ea5..98d034b4530d 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -492,6 +492,10 @@ static struct wlcore_conf wl18xx_conf = {
492 .increase_time = 1, 492 .increase_time = 1,
493 .window_size = 16, 493 .window_size = 16,
494 }, 494 },
495 .recovery = {
496 .bug_on_recovery = 0,
497 .no_recovery = 0,
498 },
495}; 499};
496 500
497static struct wl18xx_priv_conf wl18xx_default_priv_conf = { 501static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h
index c9de4d5c8965..1bd831c9e843 100644
--- a/drivers/net/wireless/ti/wlcore/conf.h
+++ b/drivers/net/wireless/ti/wlcore/conf.h
@@ -1268,12 +1268,20 @@ struct conf_hangover_settings {
1268 u8 window_size; 1268 u8 window_size;
1269} __packed; 1269} __packed;
1270 1270
1271struct conf_recovery_settings {
1272 /* BUG() on fw recovery */
1273 u8 bug_on_recovery;
1274
1275 /* Prevent HW recovery. FW will remain stuck. */
1276 u8 no_recovery;
1277} __packed;
1278
1271/* 1279/*
1272 * The conf version consists of 4 bytes. The two MSB are the wlcore 1280 * The conf version consists of 4 bytes. The two MSB are the wlcore
1273 * version, the two LSB are the lower driver's private conf 1281 * version, the two LSB are the lower driver's private conf
1274 * version. 1282 * version.
1275 */ 1283 */
1276#define WLCORE_CONF_VERSION (0x0003 << 16) 1284#define WLCORE_CONF_VERSION (0x0004 << 16)
1277#define WLCORE_CONF_MASK 0xffff0000 1285#define WLCORE_CONF_MASK 0xffff0000
1278#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \ 1286#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \
1279 sizeof(struct wlcore_conf)) 1287 sizeof(struct wlcore_conf))
@@ -1301,6 +1309,7 @@ struct wlcore_conf {
1301 struct conf_fwlog fwlog; 1309 struct conf_fwlog fwlog;
1302 struct conf_rate_policy_settings rate; 1310 struct conf_rate_policy_settings rate;
1303 struct conf_hangover_settings hangover; 1311 struct conf_hangover_settings hangover;
1312 struct conf_recovery_settings recovery;
1304} __packed; 1313} __packed;
1305 1314
1306struct wlcore_conf_file { 1315struct wlcore_conf_file {
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 615b40dc981e..4dfd533a81c1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -56,8 +56,8 @@
56#define WL1271_BOOT_RETRIES 3 56#define WL1271_BOOT_RETRIES 3
57 57
58static char *fwlog_param; 58static char *fwlog_param;
59static bool bug_on_recovery; 59static int bug_on_recovery = -1;
60static bool no_recovery; 60static int no_recovery = -1;
61 61
62static void __wl1271_op_remove_interface(struct wl1271 *wl, 62static void __wl1271_op_remove_interface(struct wl1271 *wl,
63 struct ieee80211_vif *vif, 63 struct ieee80211_vif *vif,
@@ -306,6 +306,7 @@ out:
306static void wlcore_adjust_conf(struct wl1271 *wl) 306static void wlcore_adjust_conf(struct wl1271 *wl)
307{ 307{
308 /* Adjust settings according to optional module parameters */ 308 /* Adjust settings according to optional module parameters */
309
309 if (fwlog_param) { 310 if (fwlog_param) {
310 if (!strcmp(fwlog_param, "continuous")) { 311 if (!strcmp(fwlog_param, "continuous")) {
311 wl->conf.fwlog.mode = WL12XX_FWLOG_CONTINUOUS; 312 wl->conf.fwlog.mode = WL12XX_FWLOG_CONTINUOUS;
@@ -321,6 +322,12 @@ static void wlcore_adjust_conf(struct wl1271 *wl)
321 wl1271_error("Unknown fwlog parameter %s", fwlog_param); 322 wl1271_error("Unknown fwlog parameter %s", fwlog_param);
322 } 323 }
323 } 324 }
325
326 if (bug_on_recovery != -1)
327 wl->conf.recovery.bug_on_recovery = (u8) bug_on_recovery;
328
329 if (no_recovery != -1)
330 wl->conf.recovery.no_recovery = (u8) no_recovery;
324} 331}
325 332
326static void wl12xx_irq_ps_regulate_link(struct wl1271 *wl, 333static void wl12xx_irq_ps_regulate_link(struct wl1271 *wl,
@@ -903,10 +910,10 @@ static void wl1271_recovery_work(struct work_struct *work)
903 wlcore_print_recovery(wl); 910 wlcore_print_recovery(wl);
904 } 911 }
905 912
906 BUG_ON(bug_on_recovery && 913 BUG_ON(wl->conf.recovery.bug_on_recovery &&
907 !test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)); 914 !test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags));
908 915
909 if (no_recovery) { 916 if (wl->conf.recovery.no_recovery) {
910 wl1271_info("No recovery (chosen on module load). Fw will remain stuck."); 917 wl1271_info("No recovery (chosen on module load). Fw will remain stuck.");
911 goto out_unlock; 918 goto out_unlock;
912 } 919 }
@@ -6013,10 +6020,10 @@ module_param_named(fwlog, fwlog_param, charp, 0);
6013MODULE_PARM_DESC(fwlog, 6020MODULE_PARM_DESC(fwlog,
6014 "FW logger options: continuous, ondemand, dbgpins or disable"); 6021 "FW logger options: continuous, ondemand, dbgpins or disable");
6015 6022
6016module_param(bug_on_recovery, bool, S_IRUSR | S_IWUSR); 6023module_param(bug_on_recovery, int, S_IRUSR | S_IWUSR);
6017MODULE_PARM_DESC(bug_on_recovery, "BUG() on fw recovery"); 6024MODULE_PARM_DESC(bug_on_recovery, "BUG() on fw recovery");
6018 6025
6019module_param(no_recovery, bool, S_IRUSR | S_IWUSR); 6026module_param(no_recovery, int, S_IRUSR | S_IWUSR);
6020MODULE_PARM_DESC(no_recovery, "Prevent HW recovery. FW will remain stuck."); 6027MODULE_PARM_DESC(no_recovery, "Prevent HW recovery. FW will remain stuck.");
6021 6028
6022MODULE_LICENSE("GPL"); 6029MODULE_LICENSE("GPL");