diff options
author | Ido Reis <idor@ti.com> | 2013-09-09 05:24:36 -0400 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@intel.com> | 2013-10-23 02:47:40 -0400 |
commit | 93ac8488a24932e2a9a6309c144cf2126082416a (patch) | |
tree | d1fd0fddbecdf21e629bd4e479f63e6a4c21bb7d | |
parent | 4b6741443264d20aa7a1cb52185a7d13589590fe (diff) |
wlcore: fwlog dynamic mem_block control
number of fwlog mem_blocks can be configured using module param.
this is a fw debug feature: in case a large fw log data is busrted during
a short period of time, the memory get filled and data is lost.
this allows us to dynamicly set the fw log mem_block usage, although
configuring more mem_block for logger comes at the expense of TP.
Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/ti/wlcore/conf.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 16 |
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h index 2b96ff821341..40995c42bef8 100644 --- a/drivers/net/wireless/ti/wlcore/conf.h +++ b/drivers/net/wireless/ti/wlcore/conf.h | |||
@@ -1274,6 +1274,9 @@ struct conf_rx_streaming_settings { | |||
1274 | u8 always; | 1274 | u8 always; |
1275 | } __packed; | 1275 | } __packed; |
1276 | 1276 | ||
1277 | #define CONF_FWLOG_MIN_MEM_BLOCKS 2 | ||
1278 | #define CONF_FWLOG_MAX_MEM_BLOCKS 16 | ||
1279 | |||
1277 | struct conf_fwlog { | 1280 | struct conf_fwlog { |
1278 | /* Continuous or on-demand */ | 1281 | /* Continuous or on-demand */ |
1279 | u8 mode; | 1282 | u8 mode; |
@@ -1281,7 +1284,7 @@ struct conf_fwlog { | |||
1281 | /* | 1284 | /* |
1282 | * Number of memory blocks dedicated for the FW logger | 1285 | * Number of memory blocks dedicated for the FW logger |
1283 | * | 1286 | * |
1284 | * Range: 1-3, or 0 to disable the FW logger | 1287 | * Range: 2-16, or 0 to disable the FW logger |
1285 | */ | 1288 | */ |
1286 | u8 mem_blocks; | 1289 | u8 mem_blocks; |
1287 | 1290 | ||
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 31476656ac81..9a07f4f67885 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #define WL1271_BOOT_RETRIES 3 | 44 | #define WL1271_BOOT_RETRIES 3 |
45 | 45 | ||
46 | static char *fwlog_param; | 46 | static char *fwlog_param; |
47 | static int fwlog_mem_blocks = -1; | ||
47 | static int bug_on_recovery = -1; | 48 | static int bug_on_recovery = -1; |
48 | static int no_recovery = -1; | 49 | static int no_recovery = -1; |
49 | 50 | ||
@@ -291,6 +292,18 @@ static void wlcore_adjust_conf(struct wl1271 *wl) | |||
291 | { | 292 | { |
292 | /* Adjust settings according to optional module parameters */ | 293 | /* Adjust settings according to optional module parameters */ |
293 | 294 | ||
295 | /* Firmware Logger params */ | ||
296 | if (fwlog_mem_blocks != -1) { | ||
297 | if (fwlog_mem_blocks >= CONF_FWLOG_MIN_MEM_BLOCKS && | ||
298 | fwlog_mem_blocks <= CONF_FWLOG_MAX_MEM_BLOCKS) { | ||
299 | wl->conf.fwlog.mem_blocks = fwlog_mem_blocks; | ||
300 | } else { | ||
301 | wl1271_error( | ||
302 | "Illegal fwlog_mem_blocks=%d using default %d", | ||
303 | fwlog_mem_blocks, wl->conf.fwlog.mem_blocks); | ||
304 | } | ||
305 | } | ||
306 | |||
294 | if (fwlog_param) { | 307 | if (fwlog_param) { |
295 | if (!strcmp(fwlog_param, "continuous")) { | 308 | if (!strcmp(fwlog_param, "continuous")) { |
296 | wl->conf.fwlog.mode = WL12XX_FWLOG_CONTINUOUS; | 309 | wl->conf.fwlog.mode = WL12XX_FWLOG_CONTINUOUS; |
@@ -6158,6 +6171,9 @@ module_param_named(fwlog, fwlog_param, charp, 0); | |||
6158 | MODULE_PARM_DESC(fwlog, | 6171 | MODULE_PARM_DESC(fwlog, |
6159 | "FW logger options: continuous, ondemand, dbgpins or disable"); | 6172 | "FW logger options: continuous, ondemand, dbgpins or disable"); |
6160 | 6173 | ||
6174 | module_param(fwlog_mem_blocks, int, S_IRUSR | S_IWUSR); | ||
6175 | MODULE_PARM_DESC(fwlog_mem_blocks, "fwlog mem_blocks"); | ||
6176 | |||
6161 | module_param(bug_on_recovery, int, S_IRUSR | S_IWUSR); | 6177 | module_param(bug_on_recovery, int, S_IRUSR | S_IWUSR); |
6162 | MODULE_PARM_DESC(bug_on_recovery, "BUG() on fw recovery"); | 6178 | MODULE_PARM_DESC(bug_on_recovery, "BUG() on fw recovery"); |
6163 | 6179 | ||