aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/fw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/fw.c')
-rw-r--r--drivers/net/wireless/libertas/fw.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/wireless/libertas/fw.c b/drivers/net/wireless/libertas/fw.c
index 5c63c9b1659c..48c3d8545966 100644
--- a/drivers/net/wireless/libertas/fw.c
+++ b/drivers/net/wireless/libertas/fw.c
@@ -20,8 +20,8 @@
20char *libertas_fw_name = NULL; 20char *libertas_fw_name = NULL;
21module_param_named(fw_name, libertas_fw_name, charp, 0644); 21module_param_named(fw_name, libertas_fw_name, charp, 0644);
22 22
23unsigned int libertas_debug = 0; 23unsigned int libertas_debug_flags = 0;
24module_param(libertas_debug, int, 0); 24module_param_named(debug, libertas_debug_flags, int, 0);
25 25
26/** 26/**
27 * @brief This function checks the validity of Boot2/FW image. 27 * @brief This function checks the validity of Boot2/FW image.
@@ -61,9 +61,9 @@ static int check_fwfile_format(u8 *data, u32 totlen)
61 } while (!exit); 61 } while (!exit);
62 62
63 if (ret) 63 if (ret)
64 lbs_pr_err("bin file format check FAIL...\n"); 64 lbs_pr_err("firmware file format check FAIL\n");
65 else 65 else
66 lbs_pr_debug(1, "bin file format check PASS...\n"); 66 lbs_deb_fw("firmware file format check PASS\n");
67 67
68 return ret; 68 return ret;
69} 69}
@@ -81,13 +81,13 @@ static int wlan_setup_station_hw(wlan_private * priv)
81 int ret = -1; 81 int ret = -1;
82 wlan_adapter *adapter = priv->adapter; 82 wlan_adapter *adapter = priv->adapter;
83 83
84 ENTER(); 84 lbs_deb_enter(LBS_DEB_FW);
85 85
86 if ((ret = request_firmware(&priv->firmware, libertas_fw_name, 86 if ((ret = request_firmware(&priv->firmware, libertas_fw_name,
87 priv->hotplug_device)) < 0) { 87 priv->hotplug_device)) < 0) {
88 lbs_pr_err("request_firmware() failed, error code = %#x\n", 88 lbs_pr_err("request_firmware() failed with %#x\n",
89 ret); 89 ret);
90 lbs_pr_err("%s not found in /lib/firmware\n", libertas_fw_name); 90 lbs_pr_err("firmware %s not found\n", libertas_fw_name);
91 goto done; 91 goto done;
92 } 92 }
93 93
@@ -101,7 +101,7 @@ static int wlan_setup_station_hw(wlan_private * priv)
101 release_firmware(priv->firmware); 101 release_firmware(priv->firmware);
102 102
103 if (ret) { 103 if (ret) {
104 lbs_pr_debug(1, "Bootloader in invalid state!\n"); 104 lbs_deb_fw("bootloader in invalid state\n");
105 ret = -1; 105 ret = -1;
106 goto done; 106 goto done;
107 } 107 }
@@ -133,9 +133,8 @@ static int wlan_setup_station_hw(wlan_private * priv)
133 133
134 ret = 0; 134 ret = 0;
135done: 135done:
136 LEAVE(); 136 lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
137 137 return ret;
138 return (ret);
139} 138}
140 139
141static int wlan_allocate_adapter(wlan_private * priv) 140static int wlan_allocate_adapter(wlan_private * priv)
@@ -264,7 +263,7 @@ int libertas_init_fw(wlan_private * priv)
264 int ret = -1; 263 int ret = -1;
265 wlan_adapter *adapter = priv->adapter; 264 wlan_adapter *adapter = priv->adapter;
266 265
267 ENTER(); 266 lbs_deb_enter(LBS_DEB_FW);
268 267
269 /* Allocate adapter structure */ 268 /* Allocate adapter structure */
270 if ((ret = wlan_allocate_adapter(priv)) != 0) 269 if ((ret = wlan_allocate_adapter(priv)) != 0)
@@ -288,7 +287,7 @@ int libertas_init_fw(wlan_private * priv)
288 287
289 ret = 0; 288 ret = 0;
290done: 289done:
291 LEAVE(); 290 lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
292 return ret; 291 return ret;
293} 292}
294 293
@@ -297,25 +296,24 @@ void libertas_free_adapter(wlan_private * priv)
297 wlan_adapter *adapter = priv->adapter; 296 wlan_adapter *adapter = priv->adapter;
298 297
299 if (!adapter) { 298 if (!adapter) {
300 lbs_pr_debug(1, "Why double free adapter?:)\n"); 299 lbs_deb_fw("why double free adapter?\n");
301 return; 300 return;
302 } 301 }
303 302
304 lbs_pr_debug(1, "Free command buffer\n"); 303 lbs_deb_fw("free command buffer\n");
305 libertas_free_cmd_buffer(priv); 304 libertas_free_cmd_buffer(priv);
306 305
307 lbs_pr_debug(1, "Free commandTimer\n"); 306 lbs_deb_fw("free command_timer\n");
308 del_timer(&adapter->command_timer); 307 del_timer(&adapter->command_timer);
309 308
310 lbs_pr_debug(1, "Free scantable\n"); 309 lbs_deb_fw("free scantable\n");
311 if (adapter->scantable) { 310 if (adapter->scantable) {
312 kfree(adapter->scantable); 311 kfree(adapter->scantable);
313 adapter->scantable = NULL; 312 adapter->scantable = NULL;
314 } 313 }
315 314
316 lbs_pr_debug(1, "Free adapter\n");
317
318 /* Free the adapter object itself */ 315 /* Free the adapter object itself */
316 lbs_deb_fw("free adapter\n");
319 kfree(adapter); 317 kfree(adapter);
320 priv->adapter = NULL; 318 priv->adapter = NULL;
321} 319}
@@ -334,17 +332,17 @@ static void command_timer_fn(unsigned long data)
334 332
335 ptempnode = adapter->cur_cmd; 333 ptempnode = adapter->cur_cmd;
336 if (ptempnode == NULL) { 334 if (ptempnode == NULL) {
337 lbs_pr_debug(1, "PTempnode Empty\n"); 335 lbs_deb_fw("ptempnode empty\n");
338 return; 336 return;
339 } 337 }
340 338
341 cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr; 339 cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr;
342 if (!cmd) { 340 if (!cmd) {
343 lbs_pr_debug(1, "cmd is NULL\n"); 341 lbs_deb_fw("cmd is NULL\n");
344 return; 342 return;
345 } 343 }
346 344
347 lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command); 345 lbs_deb_fw("command_timer_fn fired, cmd %x\n", cmd->command);
348 346
349 if (!adapter->fw_ready) 347 if (!adapter->fw_ready)
350 return; 348 return;
@@ -353,7 +351,7 @@ static void command_timer_fn(unsigned long data)
353 adapter->cur_cmd = NULL; 351 adapter->cur_cmd = NULL;
354 spin_unlock_irqrestore(&adapter->driver_lock, flags); 352 spin_unlock_irqrestore(&adapter->driver_lock, flags);
355 353
356 lbs_pr_debug(1, "Re-sending same command as it timeout...!\n"); 354 lbs_deb_fw("re-sending same command because of timeout\n");
357 libertas_queue_cmd(adapter, ptempnode, 0); 355 libertas_queue_cmd(adapter, ptempnode, 0);
358 356
359 wake_up_interruptible(&priv->mainthread.waitq); 357 wake_up_interruptible(&priv->mainthread.waitq);