aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r--drivers/net/wireless/libertas/cmd.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 6a96fc9c1cea..af8ef90a122a 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -3,6 +3,8 @@
3 * It prepares command and sends it to firmware when it is ready. 3 * It prepares command and sends it to firmware when it is ready.
4 */ 4 */
5 5
6#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
7
6#include <linux/kfifo.h> 8#include <linux/kfifo.h>
7#include <linux/sched.h> 9#include <linux/sched.h>
8#include <linux/slab.h> 10#include <linux/slab.h>
@@ -110,7 +112,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
110 * CF card firmware 5.0.16p0: cap 0x00000303 112 * CF card firmware 5.0.16p0: cap 0x00000303
111 * USB dongle firmware 5.110.17p2: cap 0x00000303 113 * USB dongle firmware 5.110.17p2: cap 0x00000303
112 */ 114 */
113 lbs_pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n", 115 pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
114 cmd.permanentaddr, 116 cmd.permanentaddr,
115 priv->fwrelease >> 24 & 0xff, 117 priv->fwrelease >> 24 & 0xff,
116 priv->fwrelease >> 16 & 0xff, 118 priv->fwrelease >> 16 & 0xff,
@@ -141,7 +143,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
141 /* if it's unidentified region code, use the default (USA) */ 143 /* if it's unidentified region code, use the default (USA) */
142 if (i >= MRVDRV_MAX_REGION_CODE) { 144 if (i >= MRVDRV_MAX_REGION_CODE) {
143 priv->regioncode = 0x10; 145 priv->regioncode = 0x10;
144 lbs_pr_info("unidentified region code; using the default (USA)\n"); 146 pr_info("unidentified region code; using the default (USA)\n");
145 } 147 }
146 148
147 if (priv->current_addr[0] == 0xff) 149 if (priv->current_addr[0] == 0xff)
@@ -211,7 +213,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
211 (uint8_t *)&cmd_config.wol_conf, 213 (uint8_t *)&cmd_config.wol_conf,
212 sizeof(struct wol_config)); 214 sizeof(struct wol_config));
213 } else { 215 } else {
214 lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret); 216 pr_info("HOST_SLEEP_CFG failed %d\n", ret);
215 } 217 }
216 218
217 return ret; 219 return ret;
@@ -314,7 +316,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
314 if (priv->is_deep_sleep) { 316 if (priv->is_deep_sleep) {
315 if (!wait_event_interruptible_timeout(priv->ds_awake_q, 317 if (!wait_event_interruptible_timeout(priv->ds_awake_q,
316 !priv->is_deep_sleep, (10 * HZ))) { 318 !priv->is_deep_sleep, (10 * HZ))) {
317 lbs_pr_err("ds_awake_q: timer expired\n"); 319 pr_err("ds_awake_q: timer expired\n");
318 ret = -1; 320 ret = -1;
319 } 321 }
320 } 322 }
@@ -339,7 +341,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
339 netif_carrier_off(priv->dev); 341 netif_carrier_off(priv->dev);
340 } 342 }
341 } else { 343 } else {
342 lbs_pr_err("deep sleep: already enabled\n"); 344 pr_err("deep sleep: already enabled\n");
343 } 345 }
344 } else { 346 } else {
345 if (priv->is_deep_sleep) { 347 if (priv->is_deep_sleep) {
@@ -349,8 +351,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
349 if (!ret) { 351 if (!ret) {
350 ret = lbs_wait_for_ds_awake(priv); 352 ret = lbs_wait_for_ds_awake(priv);
351 if (ret) 353 if (ret)
352 lbs_pr_err("deep sleep: wakeup" 354 pr_err("deep sleep: wakeup failed\n");
353 "failed\n");
354 } 355 }
355 } 356 }
356 } 357 }
@@ -384,8 +385,8 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
384 ret = lbs_host_sleep_cfg(priv, priv->wol_criteria, 385 ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
385 (struct wol_config *)NULL); 386 (struct wol_config *)NULL);
386 if (ret) { 387 if (ret) {
387 lbs_pr_info("Host sleep configuration failed: " 388 pr_info("Host sleep configuration failed: %d\n",
388 "%d\n", ret); 389 ret);
389 return ret; 390 return ret;
390 } 391 }
391 if (priv->psstate == PS_STATE_FULL_POWER) { 392 if (priv->psstate == PS_STATE_FULL_POWER) {
@@ -395,19 +396,19 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
395 sizeof(cmd), 396 sizeof(cmd),
396 lbs_ret_host_sleep_activate, 0); 397 lbs_ret_host_sleep_activate, 0);
397 if (ret) 398 if (ret)
398 lbs_pr_info("HOST_SLEEP_ACTIVATE " 399 pr_info("HOST_SLEEP_ACTIVATE failed: %d\n",
399 "failed: %d\n", ret); 400 ret);
400 } 401 }
401 402
402 if (!wait_event_interruptible_timeout( 403 if (!wait_event_interruptible_timeout(
403 priv->host_sleep_q, 404 priv->host_sleep_q,
404 priv->is_host_sleep_activated, 405 priv->is_host_sleep_activated,
405 (10 * HZ))) { 406 (10 * HZ))) {
406 lbs_pr_err("host_sleep_q: timer expired\n"); 407 pr_err("host_sleep_q: timer expired\n");
407 ret = -1; 408 ret = -1;
408 } 409 }
409 } else { 410 } else {
410 lbs_pr_err("host sleep: already enabled\n"); 411 pr_err("host sleep: already enabled\n");
411 } 412 }
412 } else { 413 } else {
413 if (priv->is_host_sleep_activated) 414 if (priv->is_host_sleep_activated)
@@ -1007,7 +1008,7 @@ static void lbs_submit_command(struct lbs_private *priv,
1007 ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize); 1008 ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);
1008 1009
1009 if (ret) { 1010 if (ret) {
1010 lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret); 1011 pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
1011 /* Let the timer kick in and retry, and potentially reset 1012 /* Let the timer kick in and retry, and potentially reset
1012 the whole thing if the condition persists */ 1013 the whole thing if the condition persists */
1013 timeo = HZ/4; 1014 timeo = HZ/4;
@@ -1276,7 +1277,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
1276 spin_lock_irqsave(&priv->driver_lock, flags); 1277 spin_lock_irqsave(&priv->driver_lock, flags);
1277 1278
1278 if (priv->cur_cmd) { 1279 if (priv->cur_cmd) {
1279 lbs_pr_alert( "EXEC_NEXT_CMD: already processing command!\n"); 1280 pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
1280 spin_unlock_irqrestore(&priv->driver_lock, flags); 1281 spin_unlock_irqrestore(&priv->driver_lock, flags);
1281 ret = -1; 1282 ret = -1;
1282 goto done; 1283 goto done;
@@ -1438,7 +1439,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
1438 ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep, 1439 ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
1439 sizeof(confirm_sleep)); 1440 sizeof(confirm_sleep));
1440 if (ret) { 1441 if (ret) {
1441 lbs_pr_alert("confirm_sleep failed\n"); 1442 pr_alert("confirm_sleep failed\n");
1442 goto out; 1443 goto out;
1443 } 1444 }
1444 1445
@@ -1664,8 +1665,7 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
1664 spin_lock_irqsave(&priv->driver_lock, flags); 1665 spin_lock_irqsave(&priv->driver_lock, flags);
1665 ret = cmdnode->result; 1666 ret = cmdnode->result;
1666 if (ret) 1667 if (ret)
1667 lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n", 1668 pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);
1668 command, ret);
1669 1669
1670 __lbs_cleanup_and_insert_cmd(priv, cmdnode); 1670 __lbs_cleanup_and_insert_cmd(priv, cmdnode);
1671 spin_unlock_irqrestore(&priv->driver_lock, flags); 1671 spin_unlock_irqrestore(&priv->driver_lock, flags);