aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-05-02 19:49:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-11 13:03:20 -0400
commit0e4e06ae5e895864b4a4bca7eec2e3015fddca98 (patch)
treee4632ffd53eef98c302a11d732c491703368b9ed
parent9fcce61c0eddbe21f42cb47bd5a366a6eb7956ce (diff)
libertas: Convert lbs_pr_<level> to pr_<level>
Use the standard pr_<level> functions eases grep a bit. Added a few missing terminating newlines to messages. Coalesced long formats. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/cfg.c15
-rw-r--r--drivers/net/wireless/libertas/cmd.c36
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c29
-rw-r--r--drivers/net/wireless/libertas/debugfs.c6
-rw-r--r--drivers/net/wireless/libertas/defs.h7
-rw-r--r--drivers/net/wireless/libertas/if_cs.c52
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c38
-rw-r--r--drivers/net/wireless/libertas/if_spi.c74
-rw-r--r--drivers/net/wireless/libertas/if_usb.c41
-rw-r--r--drivers/net/wireless/libertas/main.c31
-rw-r--r--drivers/net/wireless/libertas/mesh.c8
-rw-r--r--drivers/net/wireless/libertas/rx.c7
12 files changed, 173 insertions, 171 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index f582dfd2927f..73c5f54c9b42 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -6,6 +6,8 @@
6 * 6 *
7 */ 7 */
8 8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10
9#include <linux/sched.h> 11#include <linux/sched.h>
10#include <linux/wait.h> 12#include <linux/wait.h>
11#include <linux/slab.h> 13#include <linux/slab.h>
@@ -1322,8 +1324,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
1322 sme->ssid, sme->ssid_len, 1324 sme->ssid, sme->ssid_len,
1323 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); 1325 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
1324 if (!bss) { 1326 if (!bss) {
1325 lbs_pr_err("assoc: bss %pM not in scan results\n", 1327 pr_err("assoc: bss %pM not in scan results\n", sme->bssid);
1326 sme->bssid);
1327 ret = -ENOENT; 1328 ret = -ENOENT;
1328 goto done; 1329 goto done;
1329 } 1330 }
@@ -1380,8 +1381,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
1380 lbs_enable_rsn(priv, sme->crypto.cipher_group != 0); 1381 lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
1381 break; 1382 break;
1382 default: 1383 default:
1383 lbs_pr_err("unsupported cipher group 0x%x\n", 1384 pr_err("unsupported cipher group 0x%x\n",
1384 sme->crypto.cipher_group); 1385 sme->crypto.cipher_group);
1385 ret = -ENOTSUPP; 1386 ret = -ENOTSUPP;
1386 goto done; 1387 goto done;
1387 } 1388 }
@@ -1499,7 +1500,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
1499 params->key, params->key_len); 1500 params->key, params->key_len);
1500 break; 1501 break;
1501 default: 1502 default:
1502 lbs_pr_err("unhandled cipher 0x%x\n", params->cipher); 1503 pr_err("unhandled cipher 0x%x\n", params->cipher);
1503 ret = -ENOTSUPP; 1504 ret = -ENOTSUPP;
1504 break; 1505 break;
1505 } 1506 }
@@ -2127,13 +2128,13 @@ int lbs_cfg_register(struct lbs_private *priv)
2127 2128
2128 ret = wiphy_register(wdev->wiphy); 2129 ret = wiphy_register(wdev->wiphy);
2129 if (ret < 0) 2130 if (ret < 0)
2130 lbs_pr_err("cannot register wiphy device\n"); 2131 pr_err("cannot register wiphy device\n");
2131 2132
2132 priv->wiphy_registered = true; 2133 priv->wiphy_registered = true;
2133 2134
2134 ret = register_netdev(priv->dev); 2135 ret = register_netdev(priv->dev);
2135 if (ret) 2136 if (ret)
2136 lbs_pr_err("cannot register network device\n"); 2137 pr_err("cannot register network device\n");
2137 2138
2138 INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker); 2139 INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
2139 2140
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);
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 03e528994a9e..45291a4c2a9f 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -2,6 +2,9 @@
2 * This file contains the handling of command 2 * This file contains the handling of command
3 * responses as well as events generated by firmware. 3 * responses as well as events generated by firmware.
4 */ 4 */
5
6#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
7
5#include <linux/slab.h> 8#include <linux/slab.h>
6#include <linux/delay.h> 9#include <linux/delay.h>
7#include <linux/sched.h> 10#include <linux/sched.h>
@@ -85,15 +88,17 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
85 lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len); 88 lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);
86 89
87 if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { 90 if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
88 lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", 91 pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
89 le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum)); 92 le16_to_cpu(resp->seqnum),
93 le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
90 spin_unlock_irqrestore(&priv->driver_lock, flags); 94 spin_unlock_irqrestore(&priv->driver_lock, flags);
91 ret = -1; 95 ret = -1;
92 goto done; 96 goto done;
93 } 97 }
94 if (respcmd != CMD_RET(curcmd) && 98 if (respcmd != CMD_RET(curcmd) &&
95 respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) { 99 respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
96 lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd); 100 pr_info("Invalid CMD_RESP %x to command %x!\n",
101 respcmd, curcmd);
97 spin_unlock_irqrestore(&priv->driver_lock, flags); 102 spin_unlock_irqrestore(&priv->driver_lock, flags);
98 ret = -1; 103 ret = -1;
99 goto done; 104 goto done;
@@ -102,8 +107,8 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
102 if (resp->result == cpu_to_le16(0x0004)) { 107 if (resp->result == cpu_to_le16(0x0004)) {
103 /* 0x0004 means -EAGAIN. Drop the response, let it time out 108 /* 0x0004 means -EAGAIN. Drop the response, let it time out
104 and be resubmitted */ 109 and be resubmitted */
105 lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n", 110 pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
106 le16_to_cpu(resp->command)); 111 le16_to_cpu(resp->command));
107 spin_unlock_irqrestore(&priv->driver_lock, flags); 112 spin_unlock_irqrestore(&priv->driver_lock, flags);
108 ret = -1; 113 ret = -1;
109 goto done; 114 goto done;
@@ -314,28 +319,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
314 lbs_deb_cmd("EVENT: ADHOC beacon lost\n"); 319 lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
315 break; 320 break;
316 case MACREG_INT_CODE_RSSI_LOW: 321 case MACREG_INT_CODE_RSSI_LOW:
317 lbs_pr_alert("EVENT: rssi low\n"); 322 pr_alert("EVENT: rssi low\n");
318 break; 323 break;
319 case MACREG_INT_CODE_SNR_LOW: 324 case MACREG_INT_CODE_SNR_LOW:
320 lbs_pr_alert("EVENT: snr low\n"); 325 pr_alert("EVENT: snr low\n");
321 break; 326 break;
322 case MACREG_INT_CODE_MAX_FAIL: 327 case MACREG_INT_CODE_MAX_FAIL:
323 lbs_pr_alert("EVENT: max fail\n"); 328 pr_alert("EVENT: max fail\n");
324 break; 329 break;
325 case MACREG_INT_CODE_RSSI_HIGH: 330 case MACREG_INT_CODE_RSSI_HIGH:
326 lbs_pr_alert("EVENT: rssi high\n"); 331 pr_alert("EVENT: rssi high\n");
327 break; 332 break;
328 case MACREG_INT_CODE_SNR_HIGH: 333 case MACREG_INT_CODE_SNR_HIGH:
329 lbs_pr_alert("EVENT: snr high\n"); 334 pr_alert("EVENT: snr high\n");
330 break; 335 break;
331 336
332 case MACREG_INT_CODE_MESH_AUTO_STARTED: 337 case MACREG_INT_CODE_MESH_AUTO_STARTED:
333 /* Ignore spurious autostart events */ 338 /* Ignore spurious autostart events */
334 lbs_pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n"); 339 pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
335 break; 340 break;
336 341
337 default: 342 default:
338 lbs_pr_alert("EVENT: unknown event id %d\n", event); 343 pr_alert("EVENT: unknown event id %d\n", event);
339 break; 344 break;
340 } 345 }
341 346
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 851fe7bd4ba4..0bd79c5f5b5b 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1,3 +1,5 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2
1#include <linux/dcache.h> 3#include <linux/dcache.h>
2#include <linux/debugfs.h> 4#include <linux/debugfs.h>
3#include <linux/delay.h> 5#include <linux/delay.h>
@@ -151,13 +153,13 @@ static ssize_t lbs_host_sleep_write(struct file *file,
151 ret = lbs_set_host_sleep(priv, 0); 153 ret = lbs_set_host_sleep(priv, 0);
152 else if (host_sleep == 1) { 154 else if (host_sleep == 1) {
153 if (priv->wol_criteria == EHS_REMOVE_WAKEUP) { 155 if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
154 lbs_pr_info("wake parameters not configured"); 156 pr_info("wake parameters not configured\n");
155 ret = -EINVAL; 157 ret = -EINVAL;
156 goto out_unlock; 158 goto out_unlock;
157 } 159 }
158 ret = lbs_set_host_sleep(priv, 1); 160 ret = lbs_set_host_sleep(priv, 1);
159 } else { 161 } else {
160 lbs_pr_err("invalid option\n"); 162 pr_err("invalid option\n");
161 ret = -EINVAL; 163 ret = -EINVAL;
162 } 164 }
163 165
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index 92b5b1f8fd75..ab966f08024a 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -89,13 +89,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \
89#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args) 89#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
90#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args) 90#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)
91 91
92#define lbs_pr_info(format, args...) \
93 printk(KERN_INFO DRV_NAME": " format, ## args)
94#define lbs_pr_err(format, args...) \
95 printk(KERN_ERR DRV_NAME": " format, ## args)
96#define lbs_pr_alert(format, args...) \
97 printk(KERN_ALERT DRV_NAME": " format, ## args)
98
99#ifdef DEBUG 92#ifdef DEBUG
100static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len) 93static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
101{ 94{
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 4dfd48fe8b6e..f2d10115f5e5 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -21,6 +21,8 @@
21 21
22*/ 22*/
23 23
24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25
24#include <linux/module.h> 26#include <linux/module.h>
25#include <linux/slab.h> 27#include <linux/slab.h>
26#include <linux/delay.h> 28#include <linux/delay.h>
@@ -362,7 +364,7 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
362 if (status & IF_CS_BIT_COMMAND) 364 if (status & IF_CS_BIT_COMMAND)
363 break; 365 break;
364 if (++loops > 100) { 366 if (++loops > 100) {
365 lbs_pr_err("card not ready for commands\n"); 367 pr_err("card not ready for commands\n");
366 goto done; 368 goto done;
367 } 369 }
368 mdelay(1); 370 mdelay(1);
@@ -432,14 +434,14 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
432 /* is hardware ready? */ 434 /* is hardware ready? */
433 status = if_cs_read16(priv->card, IF_CS_CARD_STATUS); 435 status = if_cs_read16(priv->card, IF_CS_CARD_STATUS);
434 if ((status & IF_CS_BIT_RESP) == 0) { 436 if ((status & IF_CS_BIT_RESP) == 0) {
435 lbs_pr_err("no cmd response in card\n"); 437 pr_err("no cmd response in card\n");
436 *len = 0; 438 *len = 0;
437 goto out; 439 goto out;
438 } 440 }
439 441
440 *len = if_cs_read16(priv->card, IF_CS_RESP_LEN); 442 *len = if_cs_read16(priv->card, IF_CS_RESP_LEN);
441 if ((*len == 0) || (*len > LBS_CMD_BUFFER_SIZE)) { 443 if ((*len == 0) || (*len > LBS_CMD_BUFFER_SIZE)) {
442 lbs_pr_err("card cmd buffer has invalid # of bytes (%d)\n", *len); 444 pr_err("card cmd buffer has invalid # of bytes (%d)\n", *len);
443 goto out; 445 goto out;
444 } 446 }
445 447
@@ -473,7 +475,7 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
473 475
474 len = if_cs_read16(priv->card, IF_CS_READ_LEN); 476 len = if_cs_read16(priv->card, IF_CS_READ_LEN);
475 if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) { 477 if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
476 lbs_pr_err("card data buffer has invalid # of bytes (%d)\n", len); 478 pr_err("card data buffer has invalid # of bytes (%d)\n", len);
477 priv->dev->stats.rx_dropped++; 479 priv->dev->stats.rx_dropped++;
478 goto dat_err; 480 goto dat_err;
479 } 481 }
@@ -653,8 +655,8 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw)
653 ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS, 655 ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS,
654 IF_CS_BIT_COMMAND); 656 IF_CS_BIT_COMMAND);
655 if (ret < 0) { 657 if (ret < 0) {
656 lbs_pr_err("can't download helper at 0x%x, ret %d\n", 658 pr_err("can't download helper at 0x%x, ret %d\n",
657 sent, ret); 659 sent, ret);
658 goto done; 660 goto done;
659 } 661 }
660 662
@@ -684,7 +686,7 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
684 ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW, 686 ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW,
685 IF_CS_SQ_HELPER_OK); 687 IF_CS_SQ_HELPER_OK);
686 if (ret < 0) { 688 if (ret < 0) {
687 lbs_pr_err("helper firmware doesn't answer\n"); 689 pr_err("helper firmware doesn't answer\n");
688 goto done; 690 goto done;
689 } 691 }
690 692
@@ -692,13 +694,13 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
692 len = if_cs_read16(card, IF_CS_SQ_READ_LOW); 694 len = if_cs_read16(card, IF_CS_SQ_READ_LOW);
693 if (len & 1) { 695 if (len & 1) {
694 retry++; 696 retry++;
695 lbs_pr_info("odd, need to retry this firmware block\n"); 697 pr_info("odd, need to retry this firmware block\n");
696 } else { 698 } else {
697 retry = 0; 699 retry = 0;
698 } 700 }
699 701
700 if (retry > 20) { 702 if (retry > 20) {
701 lbs_pr_err("could not download firmware\n"); 703 pr_err("could not download firmware\n");
702 ret = -ENODEV; 704 ret = -ENODEV;
703 goto done; 705 goto done;
704 } 706 }
@@ -718,14 +720,14 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
718 ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS, 720 ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS,
719 IF_CS_BIT_COMMAND); 721 IF_CS_BIT_COMMAND);
720 if (ret < 0) { 722 if (ret < 0) {
721 lbs_pr_err("can't download firmware at 0x%x\n", sent); 723 pr_err("can't download firmware at 0x%x\n", sent);
722 goto done; 724 goto done;
723 } 725 }
724 } 726 }
725 727
726 ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); 728 ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a);
727 if (ret < 0) 729 if (ret < 0)
728 lbs_pr_err("firmware download failed\n"); 730 pr_err("firmware download failed\n");
729 731
730done: 732done:
731 lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); 733 lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
@@ -759,7 +761,7 @@ static int if_cs_host_to_card(struct lbs_private *priv,
759 ret = if_cs_send_cmd(priv, buf, nb); 761 ret = if_cs_send_cmd(priv, buf, nb);
760 break; 762 break;
761 default: 763 default:
762 lbs_pr_err("%s: unsupported type %d\n", __func__, type); 764 pr_err("%s: unsupported type %d\n", __func__, type);
763 } 765 }
764 766
765 lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); 767 lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
@@ -788,7 +790,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
788 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 790 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
789 791
790 if (p_dev->resource[1]->end) { 792 if (p_dev->resource[1]->end) {
791 lbs_pr_err("wrong CIS (check number of IO windows)\n"); 793 pr_err("wrong CIS (check number of IO windows)\n");
792 return -ENODEV; 794 return -ENODEV;
793 } 795 }
794 796
@@ -809,7 +811,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
809 811
810 card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL); 812 card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
811 if (!card) { 813 if (!card) {
812 lbs_pr_err("error in kzalloc\n"); 814 pr_err("error in kzalloc\n");
813 goto out; 815 goto out;
814 } 816 }
815 card->p_dev = p_dev; 817 card->p_dev = p_dev;
@@ -818,7 +820,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
818 p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; 820 p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
819 821
820 if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) { 822 if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
821 lbs_pr_err("error in pcmcia_loop_config\n"); 823 pr_err("error in pcmcia_loop_config\n");
822 goto out1; 824 goto out1;
823 } 825 }
824 826
@@ -834,14 +836,14 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
834 card->iobase = ioport_map(p_dev->resource[0]->start, 836 card->iobase = ioport_map(p_dev->resource[0]->start,
835 resource_size(p_dev->resource[0])); 837 resource_size(p_dev->resource[0]));
836 if (!card->iobase) { 838 if (!card->iobase) {
837 lbs_pr_err("error in ioport_map\n"); 839 pr_err("error in ioport_map\n");
838 ret = -EIO; 840 ret = -EIO;
839 goto out1; 841 goto out1;
840 } 842 }
841 843
842 ret = pcmcia_enable_device(p_dev); 844 ret = pcmcia_enable_device(p_dev);
843 if (ret) { 845 if (ret) {
844 lbs_pr_err("error in pcmcia_enable_device\n"); 846 pr_err("error in pcmcia_enable_device\n");
845 goto out2; 847 goto out2;
846 } 848 }
847 849
@@ -856,8 +858,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
856 858
857 card->model = get_model(p_dev->manf_id, p_dev->card_id); 859 card->model = get_model(p_dev->manf_id, p_dev->card_id);
858 if (card->model == MODEL_UNKNOWN) { 860 if (card->model == MODEL_UNKNOWN) {
859 lbs_pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n", 861 pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
860 p_dev->manf_id, p_dev->card_id); 862 p_dev->manf_id, p_dev->card_id);
861 goto out2; 863 goto out2;
862 } 864 }
863 865
@@ -866,20 +868,20 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
866 if (card->model == MODEL_8305) { 868 if (card->model == MODEL_8305) {
867 card->align_regs = 1; 869 card->align_regs = 1;
868 if (prod_id < IF_CS_CF8305_B1_REV) { 870 if (prod_id < IF_CS_CF8305_B1_REV) {
869 lbs_pr_err("8305 rev B0 and older are not supported\n"); 871 pr_err("8305 rev B0 and older are not supported\n");
870 ret = -ENODEV; 872 ret = -ENODEV;
871 goto out2; 873 goto out2;
872 } 874 }
873 } 875 }
874 876
875 if ((card->model == MODEL_8381) && prod_id < IF_CS_CF8381_B3_REV) { 877 if ((card->model == MODEL_8381) && prod_id < IF_CS_CF8381_B3_REV) {
876 lbs_pr_err("8381 rev B2 and older are not supported\n"); 878 pr_err("8381 rev B2 and older are not supported\n");
877 ret = -ENODEV; 879 ret = -ENODEV;
878 goto out2; 880 goto out2;
879 } 881 }
880 882
881 if ((card->model == MODEL_8385) && prod_id < IF_CS_CF8385_B1_REV) { 883 if ((card->model == MODEL_8385) && prod_id < IF_CS_CF8385_B1_REV) {
882 lbs_pr_err("8385 rev B0 and older are not supported\n"); 884 pr_err("8385 rev B0 and older are not supported\n");
883 ret = -ENODEV; 885 ret = -ENODEV;
884 goto out2; 886 goto out2;
885 } 887 }
@@ -887,7 +889,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
887 ret = lbs_get_firmware(&p_dev->dev, NULL, NULL, card->model, 889 ret = lbs_get_firmware(&p_dev->dev, NULL, NULL, card->model,
888 &fw_table[0], &helper, &mainfw); 890 &fw_table[0], &helper, &mainfw);
889 if (ret) { 891 if (ret) {
890 lbs_pr_err("failed to find firmware (%d)\n", ret); 892 pr_err("failed to find firmware (%d)\n", ret);
891 goto out2; 893 goto out2;
892 } 894 }
893 895
@@ -918,7 +920,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
918 ret = request_irq(p_dev->irq, if_cs_interrupt, 920 ret = request_irq(p_dev->irq, if_cs_interrupt,
919 IRQF_SHARED, DRV_NAME, card); 921 IRQF_SHARED, DRV_NAME, card);
920 if (ret) { 922 if (ret) {
921 lbs_pr_err("error in request_irq\n"); 923 pr_err("error in request_irq\n");
922 goto out3; 924 goto out3;
923 } 925 }
924 926
@@ -931,7 +933,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
931 933
932 /* And finally bring the card up */ 934 /* And finally bring the card up */
933 if (lbs_start_card(priv) != 0) { 935 if (lbs_start_card(priv) != 0) {
934 lbs_pr_err("could not activate card\n"); 936 pr_err("could not activate card\n");
935 goto out3; 937 goto out3;
936 } 938 }
937 939
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index b4de0ca10feb..ab867795f542 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -26,6 +26,8 @@
26 * if_sdio_card_to_host() to pad the data. 26 * if_sdio_card_to_host() to pad the data.
27 */ 27 */
28 28
29#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30
29#include <linux/kernel.h> 31#include <linux/kernel.h>
30#include <linux/moduleparam.h> 32#include <linux/moduleparam.h>
31#include <linux/slab.h> 33#include <linux/slab.h>
@@ -409,7 +411,7 @@ static int if_sdio_card_to_host(struct if_sdio_card *card)
409 411
410out: 412out:
411 if (ret) 413 if (ret)
412 lbs_pr_err("problem fetching packet from firmware\n"); 414 pr_err("problem fetching packet from firmware\n");
413 415
414 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 416 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
415 417
@@ -446,7 +448,7 @@ static void if_sdio_host_to_card_worker(struct work_struct *work)
446 } 448 }
447 449
448 if (ret) 450 if (ret)
449 lbs_pr_err("error %d sending packet to firmware\n", ret); 451 pr_err("error %d sending packet to firmware\n", ret);
450 452
451 sdio_release_host(card->func); 453 sdio_release_host(card->func);
452 454
@@ -555,7 +557,7 @@ release:
555 557
556out: 558out:
557 if (ret) 559 if (ret)
558 lbs_pr_err("failed to load helper firmware\n"); 560 pr_err("failed to load helper firmware\n");
559 561
560 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 562 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
561 return ret; 563 return ret;
@@ -669,7 +671,7 @@ release:
669 671
670out: 672out:
671 if (ret) 673 if (ret)
672 lbs_pr_err("failed to load firmware\n"); 674 pr_err("failed to load firmware\n");
673 675
674 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 676 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
675 return ret; 677 return ret;
@@ -723,7 +725,7 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
723 ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name, 725 ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name,
724 card->model, &fw_table[0], &helper, &mainfw); 726 card->model, &fw_table[0], &helper, &mainfw);
725 if (ret) { 727 if (ret) {
726 lbs_pr_err("failed to find firmware (%d)\n", ret); 728 pr_err("failed to find firmware (%d)\n", ret);
727 goto out; 729 goto out;
728 } 730 }
729 731
@@ -849,7 +851,7 @@ static int if_sdio_enter_deep_sleep(struct lbs_private *priv)
849 ret = __lbs_cmd(priv, CMD_802_11_DEEP_SLEEP, &cmd, sizeof(cmd), 851 ret = __lbs_cmd(priv, CMD_802_11_DEEP_SLEEP, &cmd, sizeof(cmd),
850 lbs_cmd_copyback, (unsigned long) &cmd); 852 lbs_cmd_copyback, (unsigned long) &cmd);
851 if (ret) 853 if (ret)
852 lbs_pr_err("DEEP_SLEEP cmd failed\n"); 854 pr_err("DEEP_SLEEP cmd failed\n");
853 855
854 mdelay(200); 856 mdelay(200);
855 return ret; 857 return ret;
@@ -865,7 +867,7 @@ static int if_sdio_exit_deep_sleep(struct lbs_private *priv)
865 867
866 sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret); 868 sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret);
867 if (ret) 869 if (ret)
868 lbs_pr_err("sdio_writeb failed!\n"); 870 pr_err("sdio_writeb failed!\n");
869 871
870 sdio_release_host(card->func); 872 sdio_release_host(card->func);
871 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 873 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
@@ -882,7 +884,7 @@ static int if_sdio_reset_deep_sleep_wakeup(struct lbs_private *priv)
882 884
883 sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret); 885 sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret);
884 if (ret) 886 if (ret)
885 lbs_pr_err("sdio_writeb failed!\n"); 887 pr_err("sdio_writeb failed!\n");
886 888
887 sdio_release_host(card->func); 889 sdio_release_host(card->func);
888 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 890 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
@@ -961,7 +963,7 @@ static int if_sdio_probe(struct sdio_func *func,
961 } 963 }
962 964
963 if (i == func->card->num_info) { 965 if (i == func->card->num_info) {
964 lbs_pr_err("unable to identify card model\n"); 966 pr_err("unable to identify card model\n");
965 return -ENODEV; 967 return -ENODEV;
966 } 968 }
967 969
@@ -995,7 +997,7 @@ static int if_sdio_probe(struct sdio_func *func,
995 break; 997 break;
996 } 998 }
997 if (i == ARRAY_SIZE(fw_table)) { 999 if (i == ARRAY_SIZE(fw_table)) {
998 lbs_pr_err("unknown card model 0x%x\n", card->model); 1000 pr_err("unknown card model 0x%x\n", card->model);
999 ret = -ENODEV; 1001 ret = -ENODEV;
1000 goto free; 1002 goto free;
1001 } 1003 }
@@ -1101,7 +1103,7 @@ static int if_sdio_probe(struct sdio_func *func,
1101 lbs_deb_sdio("send function INIT command\n"); 1103 lbs_deb_sdio("send function INIT command\n");
1102 if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd), 1104 if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
1103 lbs_cmd_copyback, (unsigned long) &cmd)) 1105 lbs_cmd_copyback, (unsigned long) &cmd))
1104 lbs_pr_alert("CMD_FUNC_INIT cmd failed\n"); 1106 pr_alert("CMD_FUNC_INIT cmd failed\n");
1105 } 1107 }
1106 1108
1107 ret = lbs_start_card(priv); 1109 ret = lbs_start_card(priv);
@@ -1163,7 +1165,7 @@ static void if_sdio_remove(struct sdio_func *func)
1163 if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN, 1165 if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN,
1164 &cmd, sizeof(cmd), lbs_cmd_copyback, 1166 &cmd, sizeof(cmd), lbs_cmd_copyback,
1165 (unsigned long) &cmd)) 1167 (unsigned long) &cmd))
1166 lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n"); 1168 pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
1167 } 1169 }
1168 1170
1169 1171
@@ -1202,21 +1204,19 @@ static int if_sdio_suspend(struct device *dev)
1202 1204
1203 mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); 1205 mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
1204 1206
1205 lbs_pr_info("%s: suspend: PM flags = 0x%x\n", 1207 pr_info("%s: suspend: PM flags = 0x%x\n", sdio_func_id(func), flags);
1206 sdio_func_id(func), flags);
1207 1208
1208 /* If we aren't being asked to wake on anything, we should bail out 1209 /* If we aren't being asked to wake on anything, we should bail out
1209 * and let the SD stack power down the card. 1210 * and let the SD stack power down the card.
1210 */ 1211 */
1211 if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) { 1212 if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) {
1212 lbs_pr_info("Suspend without wake params -- " 1213 pr_info("Suspend without wake params -- powering down card\n");
1213 "powering down card.");
1214 return -ENOSYS; 1214 return -ENOSYS;
1215 } 1215 }
1216 1216
1217 if (!(flags & MMC_PM_KEEP_POWER)) { 1217 if (!(flags & MMC_PM_KEEP_POWER)) {
1218 lbs_pr_err("%s: cannot remain alive while host is suspended\n", 1218 pr_err("%s: cannot remain alive while host is suspended\n",
1219 sdio_func_id(func)); 1219 sdio_func_id(func));
1220 return -ENOSYS; 1220 return -ENOSYS;
1221 } 1221 }
1222 1222
@@ -1237,7 +1237,7 @@ static int if_sdio_resume(struct device *dev)
1237 struct if_sdio_card *card = sdio_get_drvdata(func); 1237 struct if_sdio_card *card = sdio_get_drvdata(func);
1238 int ret; 1238 int ret;
1239 1239
1240 lbs_pr_info("%s: resume: we're back\n", sdio_func_id(func)); 1240 pr_info("%s: resume: we're back\n", sdio_func_id(func));
1241 1241
1242 ret = lbs_resume(card->priv); 1242 ret = lbs_resume(card->priv);
1243 1243
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 67de5b3c68b2..4d19b5726c15 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -17,6 +17,8 @@
17 * (at your option) any later version. 17 * (at your option) any later version.
18 */ 18 */
19 19
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21
20#include <linux/moduleparam.h> 22#include <linux/moduleparam.h>
21#include <linux/firmware.h> 23#include <linux/firmware.h>
22#include <linux/jiffies.h> 24#include <linux/jiffies.h>
@@ -305,8 +307,7 @@ static int spu_wait_for_u16(struct if_spi_card *card, u16 reg,
305 } 307 }
306 udelay(100); 308 udelay(100);
307 if (time_after(jiffies, timeout)) { 309 if (time_after(jiffies, timeout)) {
308 lbs_pr_err("%s: timeout with val=%02x, " 310 pr_err("%s: timeout with val=%02x, target_mask=%02x, target=%02x\n",
309 "target_mask=%02x, target=%02x\n",
310 __func__, val, target_mask, target); 311 __func__, val, target_mask, target);
311 return -ETIMEDOUT; 312 return -ETIMEDOUT;
312 } 313 }
@@ -405,7 +406,7 @@ static int spu_set_bus_mode(struct if_spi_card *card, u16 mode)
405 if (err) 406 if (err)
406 return err; 407 return err;
407 if ((rval & 0xF) != mode) { 408 if ((rval & 0xF) != mode) {
408 lbs_pr_err("Can't read bus mode register.\n"); 409 pr_err("Can't read bus mode register\n");
409 return -EIO; 410 return -EIO;
410 } 411 }
411 return 0; 412 return 0;
@@ -534,7 +535,7 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card,
534 535
535out: 536out:
536 if (err) 537 if (err)
537 lbs_pr_err("failed to load helper firmware (err=%d)\n", err); 538 pr_err("failed to load helper firmware (err=%d)\n", err);
538 lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err); 539 lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err);
539 return err; 540 return err;
540} 541}
@@ -557,7 +558,7 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card,
557 IF_SPI_HIST_CMD_DOWNLOAD_RDY, 558 IF_SPI_HIST_CMD_DOWNLOAD_RDY,
558 IF_SPI_HIST_CMD_DOWNLOAD_RDY); 559 IF_SPI_HIST_CMD_DOWNLOAD_RDY);
559 if (err) { 560 if (err) {
560 lbs_pr_err("timed out waiting for host_int_status\n"); 561 pr_err("timed out waiting for host_int_status\n");
561 return err; 562 return err;
562 } 563 }
563 564
@@ -567,9 +568,8 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card,
567 return err; 568 return err;
568 569
569 if (len > IF_SPI_CMD_BUF_SIZE) { 570 if (len > IF_SPI_CMD_BUF_SIZE) {
570 lbs_pr_err("firmware load device requested a larger " 571 pr_err("firmware load device requested a larger transfer than we are prepared to handle (len = %d)\n",
571 "tranfer than we are prepared to " 572 len);
572 "handle. (len = %d)\n", len);
573 return -EIO; 573 return -EIO;
574 } 574 }
575 if (len & 0x1) { 575 if (len & 0x1) {
@@ -598,8 +598,8 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
598 598
599 err = spu_wait_for_u16(card, IF_SPI_SCRATCH_1_REG, 0, 0); 599 err = spu_wait_for_u16(card, IF_SPI_SCRATCH_1_REG, 0, 0);
600 if (err) { 600 if (err) {
601 lbs_pr_err("%s: timed out waiting for initial " 601 pr_err("%s: timed out waiting for initial scratch reg = 0\n",
602 "scratch reg = 0\n", __func__); 602 __func__);
603 goto out; 603 goto out;
604 } 604 }
605 605
@@ -617,15 +617,13 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
617 * If there are no more bytes left, we would normally 617 * If there are no more bytes left, we would normally
618 * expect to have terminated with len = 0 618 * expect to have terminated with len = 0
619 */ 619 */
620 lbs_pr_err("Firmware load wants more bytes " 620 pr_err("Firmware load wants more bytes than we have to offer.\n");
621 "than we have to offer.\n");
622 break; 621 break;
623 } 622 }
624 if (crc_err) { 623 if (crc_err) {
625 /* Previous transfer failed. */ 624 /* Previous transfer failed. */
626 if (++num_crc_errs > MAX_MAIN_FW_LOAD_CRC_ERR) { 625 if (++num_crc_errs > MAX_MAIN_FW_LOAD_CRC_ERR) {
627 lbs_pr_err("Too many CRC errors encountered " 626 pr_err("Too many CRC errors encountered in firmware load.\n");
628 "in firmware load.\n");
629 err = -EIO; 627 err = -EIO;
630 goto out; 628 goto out;
631 } 629 }
@@ -654,21 +652,20 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
654 prev_len = len; 652 prev_len = len;
655 } 653 }
656 if (bytes > prev_len) { 654 if (bytes > prev_len) {
657 lbs_pr_err("firmware load wants fewer bytes than " 655 pr_err("firmware load wants fewer bytes than we have to offer\n");
658 "we have to offer.\n");
659 } 656 }
660 657
661 /* Confirm firmware download */ 658 /* Confirm firmware download */
662 err = spu_wait_for_u32(card, IF_SPI_SCRATCH_4_REG, 659 err = spu_wait_for_u32(card, IF_SPI_SCRATCH_4_REG,
663 SUCCESSFUL_FW_DOWNLOAD_MAGIC); 660 SUCCESSFUL_FW_DOWNLOAD_MAGIC);
664 if (err) { 661 if (err) {
665 lbs_pr_err("failed to confirm the firmware download\n"); 662 pr_err("failed to confirm the firmware download\n");
666 goto out; 663 goto out;
667 } 664 }
668 665
669out: 666out:
670 if (err) 667 if (err)
671 lbs_pr_err("failed to load firmware (err=%d)\n", err); 668 pr_err("failed to load firmware (err=%d)\n", err);
672 lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err); 669 lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err);
673 return err; 670 return err;
674} 671}
@@ -709,14 +706,12 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
709 if (err) 706 if (err)
710 goto out; 707 goto out;
711 if (!len) { 708 if (!len) {
712 lbs_pr_err("%s: error: card has no data for host\n", 709 pr_err("%s: error: card has no data for host\n", __func__);
713 __func__);
714 err = -EINVAL; 710 err = -EINVAL;
715 goto out; 711 goto out;
716 } else if (len > IF_SPI_CMD_BUF_SIZE) { 712 } else if (len > IF_SPI_CMD_BUF_SIZE) {
717 lbs_pr_err("%s: error: response packet too large: " 713 pr_err("%s: error: response packet too large: %d bytes, but maximum is %d\n",
718 "%d bytes, but maximum is %d\n", 714 __func__, len, IF_SPI_CMD_BUF_SIZE);
719 __func__, len, IF_SPI_CMD_BUF_SIZE);
720 err = -EINVAL; 715 err = -EINVAL;
721 goto out; 716 goto out;
722 } 717 }
@@ -737,7 +732,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
737 732
738out: 733out:
739 if (err) 734 if (err)
740 lbs_pr_err("%s: err=%d\n", __func__, err); 735 pr_err("%s: err=%d\n", __func__, err);
741 lbs_deb_leave(LBS_DEB_SPI); 736 lbs_deb_leave(LBS_DEB_SPI);
742 return err; 737 return err;
743} 738}
@@ -757,14 +752,12 @@ static int if_spi_c2h_data(struct if_spi_card *card)
757 if (err) 752 if (err)
758 goto out; 753 goto out;
759 if (!len) { 754 if (!len) {
760 lbs_pr_err("%s: error: card has no data for host\n", 755 pr_err("%s: error: card has no data for host\n", __func__);
761 __func__);
762 err = -EINVAL; 756 err = -EINVAL;
763 goto out; 757 goto out;
764 } else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) { 758 } else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
765 lbs_pr_err("%s: error: card has %d bytes of data, but " 759 pr_err("%s: error: card has %d bytes of data, but our maximum skb size is %zu\n",
766 "our maximum skb size is %zu\n", 760 __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
767 __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
768 err = -EINVAL; 761 err = -EINVAL;
769 goto out; 762 goto out;
770 } 763 }
@@ -795,7 +788,7 @@ free_skb:
795 dev_kfree_skb(skb); 788 dev_kfree_skb(skb);
796out: 789out:
797 if (err) 790 if (err)
798 lbs_pr_err("%s: err=%d\n", __func__, err); 791 pr_err("%s: err=%d\n", __func__, err);
799 lbs_deb_leave(LBS_DEB_SPI); 792 lbs_deb_leave(LBS_DEB_SPI);
800 return err; 793 return err;
801} 794}
@@ -817,7 +810,7 @@ static void if_spi_h2c(struct if_spi_card *card,
817 port_reg = IF_SPI_CMD_RDWRPORT_REG; 810 port_reg = IF_SPI_CMD_RDWRPORT_REG;
818 break; 811 break;
819 default: 812 default:
820 lbs_pr_err("can't transfer buffer of type %d\n", type); 813 pr_err("can't transfer buffer of type %d\n", type);
821 err = -EINVAL; 814 err = -EINVAL;
822 goto out; 815 goto out;
823 } 816 }
@@ -831,7 +824,7 @@ out:
831 kfree(packet); 824 kfree(packet);
832 825
833 if (err) 826 if (err)
834 lbs_pr_err("%s: error %d\n", __func__, err); 827 pr_err("%s: error %d\n", __func__, err);
835} 828}
836 829
837/* Inform the host about a card event */ 830/* Inform the host about a card event */
@@ -855,7 +848,7 @@ static void if_spi_e2h(struct if_spi_card *card)
855 lbs_queue_event(priv, cause & 0xff); 848 lbs_queue_event(priv, cause & 0xff);
856out: 849out:
857 if (err) 850 if (err)
858 lbs_pr_err("%s: error %d\n", __func__, err); 851 pr_err("%s: error %d\n", __func__, err);
859} 852}
860 853
861static void if_spi_host_to_card_worker(struct work_struct *work) 854static void if_spi_host_to_card_worker(struct work_struct *work)
@@ -877,7 +870,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
877 err = spu_read_u16(card, IF_SPI_HOST_INT_STATUS_REG, 870 err = spu_read_u16(card, IF_SPI_HOST_INT_STATUS_REG,
878 &hiStatus); 871 &hiStatus);
879 if (err) { 872 if (err) {
880 lbs_pr_err("I/O error\n"); 873 pr_err("I/O error\n");
881 goto err; 874 goto err;
882 } 875 }
883 876
@@ -940,7 +933,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
940 933
941err: 934err:
942 if (err) 935 if (err)
943 lbs_pr_err("%s: got error %d\n", __func__, err); 936 pr_err("%s: got error %d\n", __func__, err);
944 937
945 lbs_deb_leave(LBS_DEB_SPI); 938 lbs_deb_leave(LBS_DEB_SPI);
946} 939}
@@ -963,7 +956,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
963 lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb); 956 lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb);
964 957
965 if (nb == 0) { 958 if (nb == 0) {
966 lbs_pr_err("%s: invalid size requested: %d\n", __func__, nb); 959 pr_err("%s: invalid size requested: %d\n", __func__, nb);
967 err = -EINVAL; 960 err = -EINVAL;
968 goto out; 961 goto out;
969 } 962 }
@@ -991,7 +984,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
991 spin_unlock_irqrestore(&card->buffer_lock, flags); 984 spin_unlock_irqrestore(&card->buffer_lock, flags);
992 break; 985 break;
993 default: 986 default:
994 lbs_pr_err("can't transfer buffer of type %d", type); 987 pr_err("can't transfer buffer of type %d\n", type);
995 err = -EINVAL; 988 err = -EINVAL;
996 break; 989 break;
997 } 990 }
@@ -1052,8 +1045,7 @@ static int if_spi_init_card(struct if_spi_card *card)
1052 break; 1045 break;
1053 } 1046 }
1054 if (i == ARRAY_SIZE(fw_table)) { 1047 if (i == ARRAY_SIZE(fw_table)) {
1055 lbs_pr_err("Unsupported chip_id: 0x%02x\n", 1048 pr_err("Unsupported chip_id: 0x%02x\n", card->card_id);
1056 card->card_id);
1057 err = -ENODEV; 1049 err = -ENODEV;
1058 goto out; 1050 goto out;
1059 } 1051 }
@@ -1062,7 +1054,7 @@ static int if_spi_init_card(struct if_spi_card *card)
1062 card->card_id, &fw_table[0], &helper, 1054 card->card_id, &fw_table[0], &helper,
1063 &mainfw); 1055 &mainfw);
1064 if (err) { 1056 if (err) {
1065 lbs_pr_err("failed to find firmware (%d)\n", err); 1057 pr_err("failed to find firmware (%d)\n", err);
1066 goto out; 1058 goto out;
1067 } 1059 }
1068 1060
@@ -1187,7 +1179,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
1187 err = request_irq(spi->irq, if_spi_host_interrupt, 1179 err = request_irq(spi->irq, if_spi_host_interrupt,
1188 IRQF_TRIGGER_FALLING, "libertas_spi", card); 1180 IRQF_TRIGGER_FALLING, "libertas_spi", card);
1189 if (err) { 1181 if (err) {
1190 lbs_pr_err("can't get host irq line-- request_irq failed\n"); 1182 pr_err("can't get host irq line-- request_irq failed\n");
1191 goto terminate_workqueue; 1183 goto terminate_workqueue;
1192 } 1184 }
1193 1185
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index e1e2128f4113..b68e162bc323 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -1,6 +1,9 @@
1/* 1/*
2 * This file contains functions used in USB interface module. 2 * This file contains functions used in USB interface module.
3 */ 3 */
4
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6
4#include <linux/delay.h> 7#include <linux/delay.h>
5#include <linux/moduleparam.h> 8#include <linux/moduleparam.h>
6#include <linux/firmware.h> 9#include <linux/firmware.h>
@@ -153,7 +156,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
153 lbs_host_to_card_done(priv); 156 lbs_host_to_card_done(priv);
154 } else { 157 } else {
155 /* print the failure status number for debug */ 158 /* print the failure status number for debug */
156 lbs_pr_info("URB in failure status: %d\n", urb->status); 159 pr_info("URB in failure status: %d\n", urb->status);
157 } 160 }
158} 161}
159 162
@@ -203,7 +206,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
203 wake_method.hdr.size = cpu_to_le16(sizeof(wake_method)); 206 wake_method.hdr.size = cpu_to_le16(sizeof(wake_method));
204 wake_method.action = cpu_to_le16(CMD_ACT_GET); 207 wake_method.action = cpu_to_le16(CMD_ACT_GET);
205 if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) { 208 if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) {
206 lbs_pr_info("Firmware does not seem to support PS mode\n"); 209 pr_info("Firmware does not seem to support PS mode\n");
207 priv->fwcapinfo &= ~FW_CAPINFO_PS; 210 priv->fwcapinfo &= ~FW_CAPINFO_PS;
208 } else { 211 } else {
209 if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) { 212 if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) {
@@ -212,7 +215,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
212 /* The versions which boot up this way don't seem to 215 /* The versions which boot up this way don't seem to
213 work even if we set it to the command interrupt */ 216 work even if we set it to the command interrupt */
214 priv->fwcapinfo &= ~FW_CAPINFO_PS; 217 priv->fwcapinfo &= ~FW_CAPINFO_PS;
215 lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n"); 218 pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n");
216 } 219 }
217 } 220 }
218} 221}
@@ -224,7 +227,7 @@ static void if_usb_fw_timeo(unsigned long priv)
224 if (cardp->fwdnldover) { 227 if (cardp->fwdnldover) {
225 lbs_deb_usb("Download complete, no event. Assuming success\n"); 228 lbs_deb_usb("Download complete, no event. Assuming success\n");
226 } else { 229 } else {
227 lbs_pr_err("Download timed out\n"); 230 pr_err("Download timed out\n");
228 cardp->surprise_removed = 1; 231 cardp->surprise_removed = 1;
229 } 232 }
230 wake_up(&cardp->fw_wq); 233 wake_up(&cardp->fw_wq);
@@ -258,7 +261,7 @@ static int if_usb_probe(struct usb_interface *intf,
258 261
259 cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL); 262 cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
260 if (!cardp) { 263 if (!cardp) {
261 lbs_pr_err("Out of memory allocating private data.\n"); 264 pr_err("Out of memory allocating private data\n");
262 goto error; 265 goto error;
263 } 266 }
264 267
@@ -348,10 +351,10 @@ static int if_usb_probe(struct usb_interface *intf,
348 usb_set_intfdata(intf, cardp); 351 usb_set_intfdata(intf, cardp);
349 352
350 if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_fw)) 353 if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_fw))
351 lbs_pr_err("cannot register lbs_flash_fw attribute\n"); 354 pr_err("cannot register lbs_flash_fw attribute\n");
352 355
353 if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2)) 356 if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2))
354 lbs_pr_err("cannot register lbs_flash_boot2 attribute\n"); 357 pr_err("cannot register lbs_flash_boot2 attribute\n");
355 358
356 /* 359 /*
357 * EHS_REMOVE_WAKEUP is not supported on all versions of the firmware. 360 * EHS_REMOVE_WAKEUP is not supported on all versions of the firmware.
@@ -536,7 +539,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
536 int ret = -1; 539 int ret = -1;
537 540
538 if (!(skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE))) { 541 if (!(skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE))) {
539 lbs_pr_err("No free skb\n"); 542 pr_err("No free skb\n");
540 goto rx_ret; 543 goto rx_ret;
541 } 544 }
542 545
@@ -595,7 +598,7 @@ static void if_usb_receive_fwload(struct urb *urb)
595 598
596 if (tmp[0] == cpu_to_le32(CMD_TYPE_INDICATION) && 599 if (tmp[0] == cpu_to_le32(CMD_TYPE_INDICATION) &&
597 tmp[1] == cpu_to_le32(MACREG_INT_CODE_FIRMWARE_READY)) { 600 tmp[1] == cpu_to_le32(MACREG_INT_CODE_FIRMWARE_READY)) {
598 lbs_pr_info("Firmware ready event received\n"); 601 pr_info("Firmware ready event received\n");
599 wake_up(&cardp->fw_wq); 602 wake_up(&cardp->fw_wq);
600 } else { 603 } else {
601 lbs_deb_usb("Waiting for confirmation; got %x %x\n", 604 lbs_deb_usb("Waiting for confirmation; got %x %x\n",
@@ -622,20 +625,20 @@ static void if_usb_receive_fwload(struct urb *urb)
622 bootcmdresp.magic == cpu_to_le32(CMD_TYPE_DATA) || 625 bootcmdresp.magic == cpu_to_le32(CMD_TYPE_DATA) ||
623 bootcmdresp.magic == cpu_to_le32(CMD_TYPE_INDICATION)) { 626 bootcmdresp.magic == cpu_to_le32(CMD_TYPE_INDICATION)) {
624 if (!cardp->bootcmdresp) 627 if (!cardp->bootcmdresp)
625 lbs_pr_info("Firmware already seems alive; resetting\n"); 628 pr_info("Firmware already seems alive; resetting\n");
626 cardp->bootcmdresp = -1; 629 cardp->bootcmdresp = -1;
627 } else { 630 } else {
628 lbs_pr_info("boot cmd response wrong magic number (0x%x)\n", 631 pr_info("boot cmd response wrong magic number (0x%x)\n",
629 le32_to_cpu(bootcmdresp.magic)); 632 le32_to_cpu(bootcmdresp.magic));
630 } 633 }
631 } else if ((bootcmdresp.cmd != BOOT_CMD_FW_BY_USB) && 634 } else if ((bootcmdresp.cmd != BOOT_CMD_FW_BY_USB) &&
632 (bootcmdresp.cmd != BOOT_CMD_UPDATE_FW) && 635 (bootcmdresp.cmd != BOOT_CMD_UPDATE_FW) &&
633 (bootcmdresp.cmd != BOOT_CMD_UPDATE_BOOT2)) { 636 (bootcmdresp.cmd != BOOT_CMD_UPDATE_BOOT2)) {
634 lbs_pr_info("boot cmd response cmd_tag error (%d)\n", 637 pr_info("boot cmd response cmd_tag error (%d)\n",
635 bootcmdresp.cmd); 638 bootcmdresp.cmd);
636 } else if (bootcmdresp.result != BOOT_CMD_RESP_OK) { 639 } else if (bootcmdresp.result != BOOT_CMD_RESP_OK) {
637 lbs_pr_info("boot cmd response result error (%d)\n", 640 pr_info("boot cmd response result error (%d)\n",
638 bootcmdresp.result); 641 bootcmdresp.result);
639 } else { 642 } else {
640 cardp->bootcmdresp = 1; 643 cardp->bootcmdresp = 1;
641 lbs_deb_usbd(&cardp->udev->dev, 644 lbs_deb_usbd(&cardp->udev->dev,
@@ -901,7 +904,7 @@ static int check_fwfile_format(const uint8_t *data, uint32_t totlen)
901 } while (!exit); 904 } while (!exit);
902 905
903 if (ret) 906 if (ret)
904 lbs_pr_err("firmware file format check FAIL\n"); 907 pr_err("firmware file format check FAIL\n");
905 else 908 else
906 lbs_deb_fw("firmware file format check PASS\n"); 909 lbs_deb_fw("firmware file format check PASS\n");
907 910
@@ -998,7 +1001,7 @@ static int __if_usb_prog_firmware(struct if_usb_card *cardp,
998 1001
999 ret = get_fw(cardp, fwname); 1002 ret = get_fw(cardp, fwname);
1000 if (ret) { 1003 if (ret) {
1001 lbs_pr_err("failed to find firmware (%d)\n", ret); 1004 pr_err("failed to find firmware (%d)\n", ret);
1002 goto done; 1005 goto done;
1003 } 1006 }
1004 1007
@@ -1073,13 +1076,13 @@ restart:
1073 usb_kill_urb(cardp->rx_urb); 1076 usb_kill_urb(cardp->rx_urb);
1074 1077
1075 if (!cardp->fwdnldover) { 1078 if (!cardp->fwdnldover) {
1076 lbs_pr_info("failed to load fw, resetting device!\n"); 1079 pr_info("failed to load fw, resetting device!\n");
1077 if (--reset_count >= 0) { 1080 if (--reset_count >= 0) {
1078 if_usb_reset_device(cardp); 1081 if_usb_reset_device(cardp);
1079 goto restart; 1082 goto restart;
1080 } 1083 }
1081 1084
1082 lbs_pr_info("FW download failure, time = %d ms\n", i * 100); 1085 pr_info("FW download failure, time = %d ms\n", i * 100);
1083 ret = -EIO; 1086 ret = -EIO;
1084 goto release_fw; 1087 goto release_fw;
1085 } 1088 }
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index ae02e6b7bc41..1144afddd5eb 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -4,6 +4,8 @@
4 * thread etc.. 4 * thread etc..
5 */ 5 */
6 6
7#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
8
7#include <linux/moduleparam.h> 9#include <linux/moduleparam.h>
8#include <linux/delay.h> 10#include <linux/delay.h>
9#include <linux/etherdevice.h> 11#include <linux/etherdevice.h>
@@ -442,7 +444,7 @@ static int lbs_thread(void *data)
442 if (priv->cmd_timed_out && priv->cur_cmd) { 444 if (priv->cmd_timed_out && priv->cur_cmd) {
443 struct cmd_ctrl_node *cmdnode = priv->cur_cmd; 445 struct cmd_ctrl_node *cmdnode = priv->cur_cmd;
444 446
445 lbs_pr_info("Timeout submitting command 0x%04x\n", 447 pr_info("Timeout submitting command 0x%04x\n",
446 le16_to_cpu(cmdnode->cmdbuf->command)); 448 le16_to_cpu(cmdnode->cmdbuf->command));
447 lbs_complete_command(priv, cmdnode, -ETIMEDOUT); 449 lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
448 if (priv->reset_card) 450 if (priv->reset_card)
@@ -470,8 +472,7 @@ static int lbs_thread(void *data)
470 * after firmware fixes it 472 * after firmware fixes it
471 */ 473 */
472 priv->psstate = PS_STATE_AWAKE; 474 priv->psstate = PS_STATE_AWAKE;
473 lbs_pr_alert("ignore PS_SleepConfirm in " 475 pr_alert("ignore PS_SleepConfirm in non-connected state\n");
474 "non-connected state\n");
475 } 476 }
476 } 477 }
477 478
@@ -565,7 +566,7 @@ int lbs_suspend(struct lbs_private *priv)
565 if (priv->is_deep_sleep) { 566 if (priv->is_deep_sleep) {
566 ret = lbs_set_deep_sleep(priv, 0); 567 ret = lbs_set_deep_sleep(priv, 0);
567 if (ret) { 568 if (ret) {
568 lbs_pr_err("deep sleep cancellation failed: %d\n", ret); 569 pr_err("deep sleep cancellation failed: %d\n", ret);
569 return ret; 570 return ret;
570 } 571 }
571 priv->deep_sleep_required = 1; 572 priv->deep_sleep_required = 1;
@@ -598,7 +599,7 @@ int lbs_resume(struct lbs_private *priv)
598 priv->deep_sleep_required = 0; 599 priv->deep_sleep_required = 0;
599 ret = lbs_set_deep_sleep(priv, 1); 600 ret = lbs_set_deep_sleep(priv, 1);
600 if (ret) 601 if (ret)
601 lbs_pr_err("deep sleep activation failed: %d\n", ret); 602 pr_err("deep sleep activation failed: %d\n", ret);
602 } 603 }
603 604
604 if (priv->setup_fw_on_resume) 605 if (priv->setup_fw_on_resume)
@@ -626,7 +627,7 @@ static void lbs_cmd_timeout_handler(unsigned long data)
626 if (!priv->cur_cmd) 627 if (!priv->cur_cmd)
627 goto out; 628 goto out;
628 629
629 lbs_pr_info("command 0x%04x timed out\n", 630 pr_info("command 0x%04x timed out\n",
630 le16_to_cpu(priv->cur_cmd->cmdbuf->command)); 631 le16_to_cpu(priv->cur_cmd->cmdbuf->command));
631 632
632 priv->cmd_timed_out = 1; 633 priv->cmd_timed_out = 1;
@@ -732,7 +733,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
732 733
733 /* Allocate the command buffers */ 734 /* Allocate the command buffers */
734 if (lbs_allocate_cmd_buffer(priv)) { 735 if (lbs_allocate_cmd_buffer(priv)) {
735 lbs_pr_err("Out of memory allocating command buffers\n"); 736 pr_err("Out of memory allocating command buffers\n");
736 ret = -ENOMEM; 737 ret = -ENOMEM;
737 goto out; 738 goto out;
738 } 739 }
@@ -742,7 +743,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
742 /* Create the event FIFO */ 743 /* Create the event FIFO */
743 ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL); 744 ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL);
744 if (ret) { 745 if (ret) {
745 lbs_pr_err("Out of memory allocating event FIFO buffer\n"); 746 pr_err("Out of memory allocating event FIFO buffer\n");
746 goto out; 747 goto out;
747 } 748 }
748 749
@@ -793,7 +794,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
793 /* Allocate an Ethernet device and register it */ 794 /* Allocate an Ethernet device and register it */
794 wdev = lbs_cfg_alloc(dmdev); 795 wdev = lbs_cfg_alloc(dmdev);
795 if (IS_ERR(wdev)) { 796 if (IS_ERR(wdev)) {
796 lbs_pr_err("cfg80211 init failed\n"); 797 pr_err("cfg80211 init failed\n");
797 goto done; 798 goto done;
798 } 799 }
799 800
@@ -802,7 +803,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
802 priv->wdev = wdev; 803 priv->wdev = wdev;
803 804
804 if (lbs_init_adapter(priv)) { 805 if (lbs_init_adapter(priv)) {
805 lbs_pr_err("failed to initialize adapter structure.\n"); 806 pr_err("failed to initialize adapter structure\n");
806 goto err_wdev; 807 goto err_wdev;
807 } 808 }
808 809
@@ -934,7 +935,7 @@ int lbs_start_card(struct lbs_private *priv)
934 goto done; 935 goto done;
935 936
936 if (lbs_cfg_register(priv)) { 937 if (lbs_cfg_register(priv)) {
937 lbs_pr_err("cannot register device\n"); 938 pr_err("cannot register device\n");
938 goto done; 939 goto done;
939 } 940 }
940 941
@@ -944,7 +945,7 @@ int lbs_start_card(struct lbs_private *priv)
944 945
945 lbs_debugfs_init_one(priv, dev); 946 lbs_debugfs_init_one(priv, dev);
946 947
947 lbs_pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name); 948 pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name);
948 949
949 ret = 0; 950 ret = 0;
950 951
@@ -1071,16 +1072,14 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
1071 if (user_helper) { 1072 if (user_helper) {
1072 ret = request_firmware(helper, user_helper, dev); 1073 ret = request_firmware(helper, user_helper, dev);
1073 if (ret) { 1074 if (ret) {
1074 lbs_pr_err("couldn't find helper firmware %s", 1075 pr_err("couldn't find helper firmware %s", user_helper);
1075 user_helper);
1076 goto fail; 1076 goto fail;
1077 } 1077 }
1078 } 1078 }
1079 if (user_mainfw) { 1079 if (user_mainfw) {
1080 ret = request_firmware(mainfw, user_mainfw, dev); 1080 ret = request_firmware(mainfw, user_mainfw, dev);
1081 if (ret) { 1081 if (ret) {
1082 lbs_pr_err("couldn't find main firmware %s", 1082 pr_err("couldn't find main firmware %s", user_mainfw);
1083 user_mainfw);
1084 goto fail; 1083 goto fail;
1085 } 1084 }
1086 } 1085 }
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index a0804d12bf20..054ac07862fd 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -1,3 +1,5 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2
1#include <linux/delay.h> 3#include <linux/delay.h>
2#include <linux/etherdevice.h> 4#include <linux/etherdevice.h>
3#include <linux/netdevice.h> 5#include <linux/netdevice.h>
@@ -267,7 +269,7 @@ int lbs_init_mesh(struct lbs_private *priv)
267 lbs_add_mesh(priv); 269 lbs_add_mesh(priv);
268 270
269 if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) 271 if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
270 lbs_pr_err("cannot register lbs_mesh attribute\n"); 272 pr_err("cannot register lbs_mesh attribute\n");
271 273
272 ret = 1; 274 ret = 1;
273 } 275 }
@@ -395,7 +397,7 @@ int lbs_add_mesh(struct lbs_private *priv)
395 /* Register virtual mesh interface */ 397 /* Register virtual mesh interface */
396 ret = register_netdev(mesh_dev); 398 ret = register_netdev(mesh_dev);
397 if (ret) { 399 if (ret) {
398 lbs_pr_err("cannot register mshX virtual interface\n"); 400 pr_err("cannot register mshX virtual interface\n");
399 goto err_free; 401 goto err_free;
400 } 402 }
401 403
@@ -973,7 +975,7 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
973 return ret; 975 return ret;
974 976
975 if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) { 977 if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) {
976 lbs_pr_err("inconsistent mesh ID length"); 978 pr_err("inconsistent mesh ID length\n");
977 defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN; 979 defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;
978 } 980 }
979 981
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index a3f4b55aa41f..24a12daa7c67 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -1,6 +1,9 @@
1/* 1/*
2 * This file contains the handling of RX in wlan driver. 2 * This file contains the handling of RX in wlan driver.
3 */ 3 */
4
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6
4#include <linux/etherdevice.h> 7#include <linux/etherdevice.h>
5#include <linux/slab.h> 8#include <linux/slab.h>
6#include <linux/types.h> 9#include <linux/types.h>
@@ -191,7 +194,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
191 case 12: /* 54 Mbps */ 194 case 12: /* 54 Mbps */
192 return 108; 195 return 108;
193 } 196 }
194 lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate); 197 pr_alert("Invalid Marvell WLAN rate %i\n", rate);
195 return 0; 198 return 0;
196} 199}
197 200
@@ -248,7 +251,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
248 /* add space for the new radio header */ 251 /* add space for the new radio header */
249 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && 252 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
250 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) { 253 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) {
251 lbs_pr_alert("%s: couldn't pskb_expand_head\n", __func__); 254 pr_alert("%s: couldn't pskb_expand_head\n", __func__);
252 ret = -ENOMEM; 255 ret = -ENOMEM;
253 kfree_skb(skb); 256 kfree_skb(skb);
254 goto done; 257 goto done;