diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2013-05-17 20:50:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-05-22 15:08:58 -0400 |
commit | 388ec385d5ce4916f0677918a42e592ba423092d (patch) | |
tree | 35aa5dc7b8bad196817c6558aec08cbd7a4fa013 /drivers/net/wireless/mwifiex/main.c | |
parent | 013a492ecf2e6e1dd424d589fb27170e2481733f (diff) |
mwifiex: add calibration data download feature
User can provide a text file containing calibration data in hex
format while loading mwifiex module. It will be downloaded to
firmware.
eg. insmod mwifiex.ko cal_data_cfg=cal_data.conf
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index eb8518618622..29d83f0c1fb8 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #define VERSION "1.0" | 25 | #define VERSION "1.0" |
26 | 26 | ||
27 | const char driver_version[] = "mwifiex " VERSION " (%s) "; | 27 | const char driver_version[] = "mwifiex " VERSION " (%s) "; |
28 | static char *cal_data_cfg; | ||
29 | module_param(cal_data_cfg, charp, 0); | ||
28 | 30 | ||
29 | /* | 31 | /* |
30 | * This function registers the device and performs all the necessary | 32 | * This function registers the device and performs all the necessary |
@@ -336,6 +338,13 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
336 | 338 | ||
337 | dev_notice(adapter->dev, "WLAN FW is active\n"); | 339 | dev_notice(adapter->dev, "WLAN FW is active\n"); |
338 | 340 | ||
341 | if (cal_data_cfg) { | ||
342 | if ((request_firmware(&adapter->cal_data, cal_data_cfg, | ||
343 | adapter->dev)) < 0) | ||
344 | dev_err(adapter->dev, | ||
345 | "Cal data request_firmware() failed\n"); | ||
346 | } | ||
347 | |||
339 | adapter->init_wait_q_woken = false; | 348 | adapter->init_wait_q_woken = false; |
340 | ret = mwifiex_init_fw(adapter); | 349 | ret = mwifiex_init_fw(adapter); |
341 | if (ret == -1) { | 350 | if (ret == -1) { |
@@ -390,6 +399,10 @@ err_init_fw: | |||
390 | pr_debug("info: %s: unregister device\n", __func__); | 399 | pr_debug("info: %s: unregister device\n", __func__); |
391 | adapter->if_ops.unregister_dev(adapter); | 400 | adapter->if_ops.unregister_dev(adapter); |
392 | done: | 401 | done: |
402 | if (adapter->cal_data) { | ||
403 | release_firmware(adapter->cal_data); | ||
404 | adapter->cal_data = NULL; | ||
405 | } | ||
393 | release_firmware(adapter->firmware); | 406 | release_firmware(adapter->firmware); |
394 | complete(&adapter->fw_load); | 407 | complete(&adapter->fw_load); |
395 | return; | 408 | return; |