aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorIdo Yariv <ido@wizery.com>2011-08-22 16:19:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-23 15:54:19 -0400
commit80900d0140a7648587982c8f299830e900e49165 (patch)
treed734bf9eeaa125d8ea07e80c2ea8a9761ea82a35 /drivers/net
parent886b66ef2f2d4984f6c72d86a9d8a3ffe4344fa5 (diff)
wl12xx: Remove obsolete testmode NVS push command
The testmode NVS push command is no longer in use. In addition, it has several implementation issues that prevent it from working correctly: 1. wl1271_tm_cmd_configure relies on wl->chip.id being set. However, since the device was not necessarily booted by the time the function is called, wl->chip.id will be initialized to 0. 2. The NVS file is fetched by calling request_firmware() before it is possible to push an NVS file. 3. The maximum allowed size of nl binary payloads is not sufficient for pushing NVS files. 4. Pushing 128x NVS files will always fail due to a bug in the validation code. 5. In case the pushed NVS file is found invalid, the mutex will be kept locked and the nvs member will become a dangling pointer. Since this feature is not being used, remove it completely instead of fixing it. Signed-off-by: Ido Yariv <ido@wizery.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/testmode.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c
index 88add68bd9ac..4ae8effaee22 100644
--- a/drivers/net/wireless/wl12xx/testmode.c
+++ b/drivers/net/wireless/wl12xx/testmode.c
@@ -36,7 +36,6 @@ enum wl1271_tm_commands {
36 WL1271_TM_CMD_TEST, 36 WL1271_TM_CMD_TEST,
37 WL1271_TM_CMD_INTERROGATE, 37 WL1271_TM_CMD_INTERROGATE,
38 WL1271_TM_CMD_CONFIGURE, 38 WL1271_TM_CMD_CONFIGURE,
39 WL1271_TM_CMD_NVS_PUSH,
40 WL1271_TM_CMD_SET_PLT_MODE, 39 WL1271_TM_CMD_SET_PLT_MODE,
41 WL1271_TM_CMD_RECOVER, 40 WL1271_TM_CMD_RECOVER,
42 41
@@ -190,48 +189,6 @@ static int wl1271_tm_cmd_configure(struct wl1271 *wl, struct nlattr *tb[])
190 return 0; 189 return 0;
191} 190}
192 191
193static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
194{
195 int ret = 0;
196 size_t len;
197 void *buf;
198
199 wl1271_debug(DEBUG_TESTMODE, "testmode cmd nvs push");
200
201 if (!tb[WL1271_TM_ATTR_DATA])
202 return -EINVAL;
203
204 buf = nla_data(tb[WL1271_TM_ATTR_DATA]);
205 len = nla_len(tb[WL1271_TM_ATTR_DATA]);
206
207 mutex_lock(&wl->mutex);
208
209 kfree(wl->nvs);
210
211 if ((wl->chip.id == CHIP_ID_1283_PG20) &&
212 (len != sizeof(struct wl128x_nvs_file)))
213 return -EINVAL;
214 else if (len != sizeof(struct wl1271_nvs_file))
215 return -EINVAL;
216
217 wl->nvs = kzalloc(len, GFP_KERNEL);
218 if (!wl->nvs) {
219 wl1271_error("could not allocate memory for the nvs file");
220 ret = -ENOMEM;
221 goto out;
222 }
223
224 memcpy(wl->nvs, buf, len);
225 wl->nvs_len = len;
226
227 wl1271_debug(DEBUG_TESTMODE, "testmode pushed nvs");
228
229out:
230 mutex_unlock(&wl->mutex);
231
232 return ret;
233}
234
235static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[]) 192static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[])
236{ 193{
237 u32 val; 194 u32 val;
@@ -288,8 +245,6 @@ int wl1271_tm_cmd(struct ieee80211_hw *hw, void *data, int len)
288 return wl1271_tm_cmd_interrogate(wl, tb); 245 return wl1271_tm_cmd_interrogate(wl, tb);
289 case WL1271_TM_CMD_CONFIGURE: 246 case WL1271_TM_CMD_CONFIGURE:
290 return wl1271_tm_cmd_configure(wl, tb); 247 return wl1271_tm_cmd_configure(wl, tb);
291 case WL1271_TM_CMD_NVS_PUSH:
292 return wl1271_tm_cmd_nvs_push(wl, tb);
293 case WL1271_TM_CMD_SET_PLT_MODE: 248 case WL1271_TM_CMD_SET_PLT_MODE:
294 return wl1271_tm_cmd_set_plt_mode(wl, tb); 249 return wl1271_tm_cmd_set_plt_mode(wl, tb);
295 case WL1271_TM_CMD_RECOVER: 250 case WL1271_TM_CMD_RECOVER: