summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/testmode.c
diff options
context:
space:
mode:
authorShahar Levi <shahar_levi@ti.com>2011-03-06 16:32:10 +0200
committerLuciano Coelho <coelho@ti.com>2011-04-19 16:48:10 +0300
commitbc765bf3b9a095b3e41c8cda80643901884c3dd4 (patch)
treedebb36120cb682b9fb848f0876454547f285495f /drivers/net/wireless/wl12xx/testmode.c
parent49d750ca14cd49e76ab039b33b5a621e0a92b9fd (diff)
downloadop-kernel-dev-bc765bf3b9a095b3e41c8cda80643901884c3dd4.zip
op-kernel-dev-bc765bf3b9a095b3e41c8cda80643901884c3dd4.tar.gz
wl12xx: 1281/1283 support - Loading FW & NVS
Take care of FW & NVS with the auto-detection between wl127x and wl128x. [Moved some common code outside if statements and added notes about NVS structure assumptions; Fixed a bug when checking the nvs size: if the size was incorrect, the local nvs variable was set to NULL, it should be wl->nvs instead. -- Luca] [Merged with potential buffer overflow fix -- Luca] Signed-off-by: Shahar Levi <shahar_levi@ti.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/testmode.c')
-rw-r--r--drivers/net/wireless/wl12xx/testmode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c
index 6ec06a4..da351d7 100644
--- a/drivers/net/wireless/wl12xx/testmode.c
+++ b/drivers/net/wireless/wl12xx/testmode.c
@@ -27,6 +27,7 @@
#include "wl12xx.h"
#include "acx.h"
+#include "reg.h"
#define WL1271_TM_MAX_DATA_LENGTH 1024
@@ -204,7 +205,10 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
kfree(wl->nvs);
- if (len != sizeof(struct wl1271_nvs_file))
+ if ((wl->chip.id == CHIP_ID_1283_PG20) &&
+ (len != sizeof(struct wl128x_nvs_file)))
+ return -EINVAL;
+ else if (len != sizeof(struct wl1271_nvs_file))
return -EINVAL;
wl->nvs = kzalloc(len, GFP_KERNEL);
OpenPOWER on IntegriCloud