Commit 0e4e06ae authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

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: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9fcce61c
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -1322,8 +1324,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1322,8 +1324,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
sme->ssid, sme->ssid_len, sme->ssid, sme->ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!bss) { if (!bss) {
lbs_pr_err("assoc: bss %pM not in scan results\n", pr_err("assoc: bss %pM not in scan results\n", sme->bssid);
sme->bssid);
ret = -ENOENT; ret = -ENOENT;
goto done; goto done;
} }
...@@ -1380,8 +1381,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1380,8 +1381,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
lbs_enable_rsn(priv, sme->crypto.cipher_group != 0); lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
break; break;
default: default:
lbs_pr_err("unsupported cipher group 0x%x\n", pr_err("unsupported cipher group 0x%x\n",
sme->crypto.cipher_group); sme->crypto.cipher_group);
ret = -ENOTSUPP; ret = -ENOTSUPP;
goto done; goto done;
} }
...@@ -1499,7 +1500,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -1499,7 +1500,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
params->key, params->key_len); params->key, params->key_len);
break; break;
default: default:
lbs_pr_err("unhandled cipher 0x%x\n", params->cipher); pr_err("unhandled cipher 0x%x\n", params->cipher);
ret = -ENOTSUPP; ret = -ENOTSUPP;
break; break;
} }
...@@ -2127,13 +2128,13 @@ int lbs_cfg_register(struct lbs_private *priv) ...@@ -2127,13 +2128,13 @@ int lbs_cfg_register(struct lbs_private *priv)
ret = wiphy_register(wdev->wiphy); ret = wiphy_register(wdev->wiphy);
if (ret < 0) if (ret < 0)
lbs_pr_err("cannot register wiphy device\n"); pr_err("cannot register wiphy device\n");
priv->wiphy_registered = true; priv->wiphy_registered = true;
ret = register_netdev(priv->dev); ret = register_netdev(priv->dev);
if (ret) if (ret)
lbs_pr_err("cannot register network device\n"); pr_err("cannot register network device\n");
INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker); INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* It prepares command and sends it to firmware when it is ready. * It prepares command and sends it to firmware when it is ready.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kfifo.h> #include <linux/kfifo.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -110,7 +112,7 @@ int lbs_update_hw_spec(struct lbs_private *priv) ...@@ -110,7 +112,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
* CF card firmware 5.0.16p0: cap 0x00000303 * CF card firmware 5.0.16p0: cap 0x00000303
* USB dongle firmware 5.110.17p2: cap 0x00000303 * USB dongle firmware 5.110.17p2: cap 0x00000303
*/ */
lbs_pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n", pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
cmd.permanentaddr, cmd.permanentaddr,
priv->fwrelease >> 24 & 0xff, priv->fwrelease >> 24 & 0xff,
priv->fwrelease >> 16 & 0xff, priv->fwrelease >> 16 & 0xff,
...@@ -141,7 +143,7 @@ int lbs_update_hw_spec(struct lbs_private *priv) ...@@ -141,7 +143,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
/* if it's unidentified region code, use the default (USA) */ /* if it's unidentified region code, use the default (USA) */
if (i >= MRVDRV_MAX_REGION_CODE) { if (i >= MRVDRV_MAX_REGION_CODE) {
priv->regioncode = 0x10; priv->regioncode = 0x10;
lbs_pr_info("unidentified region code; using the default (USA)\n"); pr_info("unidentified region code; using the default (USA)\n");
} }
if (priv->current_addr[0] == 0xff) if (priv->current_addr[0] == 0xff)
...@@ -211,7 +213,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria, ...@@ -211,7 +213,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
(uint8_t *)&cmd_config.wol_conf, (uint8_t *)&cmd_config.wol_conf,
sizeof(struct wol_config)); sizeof(struct wol_config));
} else { } else {
lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret); pr_info("HOST_SLEEP_CFG failed %d\n", ret);
} }
return ret; return ret;
...@@ -314,7 +316,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv) ...@@ -314,7 +316,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
if (priv->is_deep_sleep) { if (priv->is_deep_sleep) {
if (!wait_event_interruptible_timeout(priv->ds_awake_q, if (!wait_event_interruptible_timeout(priv->ds_awake_q,
!priv->is_deep_sleep, (10 * HZ))) { !priv->is_deep_sleep, (10 * HZ))) {
lbs_pr_err("ds_awake_q: timer expired\n"); pr_err("ds_awake_q: timer expired\n");
ret = -1; ret = -1;
} }
} }
...@@ -339,7 +341,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep) ...@@ -339,7 +341,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
netif_carrier_off(priv->dev); netif_carrier_off(priv->dev);
} }
} else { } else {
lbs_pr_err("deep sleep: already enabled\n"); pr_err("deep sleep: already enabled\n");
} }
} else { } else {
if (priv->is_deep_sleep) { if (priv->is_deep_sleep) {
...@@ -349,8 +351,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep) ...@@ -349,8 +351,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
if (!ret) { if (!ret) {
ret = lbs_wait_for_ds_awake(priv); ret = lbs_wait_for_ds_awake(priv);
if (ret) if (ret)
lbs_pr_err("deep sleep: wakeup" pr_err("deep sleep: wakeup failed\n");
"failed\n");
} }
} }
} }
...@@ -384,8 +385,8 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep) ...@@ -384,8 +385,8 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
ret = lbs_host_sleep_cfg(priv, priv->wol_criteria, ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
(struct wol_config *)NULL); (struct wol_config *)NULL);
if (ret) { if (ret) {
lbs_pr_info("Host sleep configuration failed: " pr_info("Host sleep configuration failed: %d\n",
"%d\n", ret); ret);
return ret; return ret;
} }
if (priv->psstate == PS_STATE_FULL_POWER) { if (priv->psstate == PS_STATE_FULL_POWER) {
...@@ -395,19 +396,19 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep) ...@@ -395,19 +396,19 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
sizeof(cmd), sizeof(cmd),
lbs_ret_host_sleep_activate, 0); lbs_ret_host_sleep_activate, 0);
if (ret) if (ret)
lbs_pr_info("HOST_SLEEP_ACTIVATE " pr_info("HOST_SLEEP_ACTIVATE failed: %d\n",
"failed: %d\n", ret); ret);
} }
if (!wait_event_interruptible_timeout( if (!wait_event_interruptible_timeout(
priv->host_sleep_q, priv->host_sleep_q,
priv->is_host_sleep_activated, priv->is_host_sleep_activated,
(10 * HZ))) { (10 * HZ))) {
lbs_pr_err("host_sleep_q: timer expired\n"); pr_err("host_sleep_q: timer expired\n");
ret = -1; ret = -1;
} }
} else { } else {
lbs_pr_err("host sleep: already enabled\n"); pr_err("host sleep: already enabled\n");
} }
} else { } else {
if (priv->is_host_sleep_activated) if (priv->is_host_sleep_activated)
...@@ -1007,7 +1008,7 @@ static void lbs_submit_command(struct lbs_private *priv, ...@@ -1007,7 +1008,7 @@ static void lbs_submit_command(struct lbs_private *priv,
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize); ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);
if (ret) { if (ret) {
lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret); pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
/* Let the timer kick in and retry, and potentially reset /* Let the timer kick in and retry, and potentially reset
the whole thing if the condition persists */ the whole thing if the condition persists */
timeo = HZ/4; timeo = HZ/4;
...@@ -1276,7 +1277,7 @@ int lbs_execute_next_command(struct lbs_private *priv) ...@@ -1276,7 +1277,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->cur_cmd) { if (priv->cur_cmd) {
lbs_pr_alert( "EXEC_NEXT_CMD: already processing command!\n"); pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1; ret = -1;
goto done; goto done;
...@@ -1438,7 +1439,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv) ...@@ -1438,7 +1439,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep, ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
sizeof(confirm_sleep)); sizeof(confirm_sleep));
if (ret) { if (ret) {
lbs_pr_alert("confirm_sleep failed\n"); pr_alert("confirm_sleep failed\n");
goto out; goto out;
} }
...@@ -1664,8 +1665,7 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command, ...@@ -1664,8 +1665,7 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
ret = cmdnode->result; ret = cmdnode->result;
if (ret) if (ret)
lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n", pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);
command, ret);
__lbs_cleanup_and_insert_cmd(priv, cmdnode); __lbs_cleanup_and_insert_cmd(priv, cmdnode);
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* This file contains the handling of command * This file contains the handling of command
* responses as well as events generated by firmware. * responses as well as events generated by firmware.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -85,15 +88,17 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) ...@@ -85,15 +88,17 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len); lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);
if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum)); le16_to_cpu(resp->seqnum),
le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1; ret = -1;
goto done; goto done;
} }
if (respcmd != CMD_RET(curcmd) && if (respcmd != CMD_RET(curcmd) &&
respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) { respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd); pr_info("Invalid CMD_RESP %x to command %x!\n",
respcmd, curcmd);
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1; ret = -1;
goto done; goto done;
...@@ -102,8 +107,8 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) ...@@ -102,8 +107,8 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
if (resp->result == cpu_to_le16(0x0004)) { if (resp->result == cpu_to_le16(0x0004)) {
/* 0x0004 means -EAGAIN. Drop the response, let it time out /* 0x0004 means -EAGAIN. Drop the response, let it time out
and be resubmitted */ and be resubmitted */
lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n", pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
le16_to_cpu(resp->command)); le16_to_cpu(resp->command));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1; ret = -1;
goto done; goto done;
...@@ -314,28 +319,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event) ...@@ -314,28 +319,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
lbs_deb_cmd("EVENT: ADHOC beacon lost\n"); lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
break; break;
case MACREG_INT_CODE_RSSI_LOW: case MACREG_INT_CODE_RSSI_LOW:
lbs_pr_alert("EVENT: rssi low\n"); pr_alert("EVENT: rssi low\n");
break; break;
case MACREG_INT_CODE_SNR_LOW: case MACREG_INT_CODE_SNR_LOW:
lbs_pr_alert("EVENT: snr low\n"); pr_alert("EVENT: snr low\n");
break; break;
case MACREG_INT_CODE_MAX_FAIL: case MACREG_INT_CODE_MAX_FAIL:
lbs_pr_alert("EVENT: max fail\n"); pr_alert("EVENT: max fail\n");
break; break;
case MACREG_INT_CODE_RSSI_HIGH: case MACREG_INT_CODE_RSSI_HIGH:
lbs_pr_alert("EVENT: rssi high\n"); pr_alert("EVENT: rssi high\n");
break; break;
case MACREG_INT_CODE_SNR_HIGH: case MACREG_INT_CODE_SNR_HIGH:
lbs_pr_alert("EVENT: snr high\n"); pr_alert("EVENT: snr high\n");
break; break;
case MACREG_INT_CODE_MESH_AUTO_STARTED: case MACREG_INT_CODE_MESH_AUTO_STARTED:
/* Ignore spurious autostart events */ /* Ignore spurious autostart events */
lbs_pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n"); pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
break; break;
default: default:
lbs_pr_alert("EVENT: unknown event id %d\n", event); pr_alert("EVENT: unknown event id %d\n", event);
break; break;
} }
......
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/dcache.h> #include <linux/dcache.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -151,13 +153,13 @@ static ssize_t lbs_host_sleep_write(struct file *file, ...@@ -151,13 +153,13 @@ static ssize_t lbs_host_sleep_write(struct file *file,
ret = lbs_set_host_sleep(priv, 0); ret = lbs_set_host_sleep(priv, 0);
else if (host_sleep == 1) { else if (host_sleep == 1) {
if (priv->wol_criteria == EHS_REMOVE_WAKEUP) { if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
lbs_pr_info("wake parameters not configured"); pr_info("wake parameters not configured\n");
ret = -EINVAL; ret = -EINVAL;
goto out_unlock; goto out_unlock;
} }
ret = lbs_set_host_sleep(priv, 1); ret = lbs_set_host_sleep(priv, 1);
} else { } else {
lbs_pr_err("invalid option\n"); pr_err("invalid option\n");
ret = -EINVAL; ret = -EINVAL;
} }
......
...@@ -89,13 +89,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \ ...@@ -89,13 +89,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \
#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args) #define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args) #define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)
#define lbs_pr_info(format, args...) \
printk(KERN_INFO DRV_NAME": " format, ## args)
#define lbs_pr_err(format, args...) \
printk(KERN_ERR DRV_NAME": " format, ## args)
#define lbs_pr_alert(format, args...) \
printk(KERN_ALERT DRV_NAME": " format, ## args)
#ifdef DEBUG #ifdef DEBUG
static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len) static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
{ {
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -362,7 +364,7 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb) ...@@ -362,7 +364,7 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
if (status & IF_CS_BIT_COMMAND) if (status & IF_CS_BIT_COMMAND)
break; break;
if (++loops > 100) { if (++loops > 100) {
lbs_pr_err("card not ready for commands\n"); pr_err("card not ready for commands\n");
goto done; goto done;
} }
mdelay(1); mdelay(1);
...@@ -432,14 +434,14 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len) ...@@ -432,14 +434,14 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
/* is hardware ready? */ /* is hardware ready? */
status = if_cs_read16(priv->card, IF_CS_CARD_STATUS); status = if_cs_read16(priv->card, IF_CS_CARD_STATUS);
if ((status & IF_CS_BIT_RESP) == 0) { if ((status & IF_CS_BIT_RESP) == 0) {
lbs_pr_err("no cmd response in card\n"); pr_err("no cmd response in card\n");
*len = 0; *len = 0;
goto out; goto out;
} }
*len = if_cs_read16(priv->card, IF_CS_RESP_LEN); *len = if_cs_read16(priv->card, IF_CS_RESP_LEN);
if ((*len == 0) || (*len > LBS_CMD_BUFFER_SIZE)) { if ((*len == 0) || (*len > LBS_CMD_BUFFER_SIZE)) {
lbs_pr_err("card cmd buffer has invalid # of bytes (%d)\n", *len); pr_err("card cmd buffer has invalid # of bytes (%d)\n", *len);
goto out; goto out;
} }
...@@ -473,7 +475,7 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv) ...@@ -473,7 +475,7 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
len = if_cs_read16(priv->card, IF_CS_READ_LEN); len = if_cs_read16(priv->card, IF_CS_READ_LEN);
if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) { if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
lbs_pr_err("card data buffer has invalid # of bytes (%d)\n", len); pr_err("card data buffer has invalid # of bytes (%d)\n", len);
priv->dev->stats.rx_dropped++; priv->dev->stats.rx_dropped++;
goto dat_err; goto dat_err;
} }
...@@ -653,8 +655,8 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw) ...@@ -653,8 +655,8 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw)
ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS, ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS,
IF_CS_BIT_COMMAND); IF_CS_BIT_COMMAND);
if (ret < 0) { if (ret < 0) {
lbs_pr_err("can't download helper at 0x%x, ret %d\n", pr_err("can't download helper at 0x%x, ret %d\n",
sent, ret); sent, ret);
goto done; goto done;
} }
...@@ -684,7 +686,7 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw) ...@@ -684,7 +686,7 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW, ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW,
IF_CS_SQ_HELPER_OK); IF_CS_SQ_HELPER_OK);
if (ret < 0) { if (ret < 0) {
lbs_pr_err("helper firmware doesn't answer\n"); pr_err("helper firmware doesn't answer\n");
goto done; goto done;
} }
...@@ -692,13 +694,13 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw) ...@@ -692,13 +694,13 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
len = if_cs_read16(card, IF_CS_SQ_READ_LOW); len = if_cs_read16(card, IF_CS_SQ_READ_LOW);
if (len & 1) { if (len & 1) {
retry++; retry++;
lbs_pr_info("odd, need to retry this firmware block\n"); pr_info("odd, need to retry this firmware block\n");
} else { } else {
retry = 0; retry = 0;
} }
if (retry > 20) { if (retry > 20) {
lbs_pr_err("could not download firmware\n"); pr_err("could not download firmware\n");
ret = -ENODEV; ret = -ENODEV;
goto done; goto done;
} }
...@@ -718,14 +720,14 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw) ...@@ -718,14 +720,14 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS, ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS,
IF_CS_BIT_COMMAND); IF_CS_BIT_COMMAND);
if (ret < 0) { if (ret < 0) {
lbs_pr_err("can't download firmware at 0x%x\n", sent); pr_err("can't download firmware at 0x%x\n", sent);
goto done; goto done;
} }
} }
ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a);
if (ret < 0) if (ret < 0)
lbs_pr_err("firmware download failed\n"); pr_err("firmware download failed\n");
done: done:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); 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,7 +761,7 @@ static int if_cs_host_to_card(struct lbs_private *priv,
ret = if_cs_send_cmd(priv, buf, nb); ret = if_cs_send_cmd(priv, buf, nb);
break; break;
default: default:
lbs_pr_err("%s: unsupported type %d\n", __func__, type); pr_err("%s: unsupported type %d\n", __func__, type);
} }
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); 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,7 +790,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
if (p_dev->resource[1]->end) { if (p_dev->resource[1]->end) {
lbs_pr_err("wrong CIS (check number of IO windows)\n"); pr_err("wrong CIS (check number of IO windows)\n");
return -ENODEV; return -ENODEV;
} }
...@@ -809,7 +811,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -809,7 +811,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL); card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
if (!card) { if (!card) {
lbs_pr_err("error in kzalloc\n"); pr_err("error in kzalloc\n");
goto out; goto out;
} }
card->p_dev = p_dev; card->p_dev = p_dev;
...@@ -818,7 +820,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -818,7 +820,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) { if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
lbs_pr_err("error in pcmcia_loop_config\n"); pr_err("error in pcmcia_loop_config\n");
goto out1; goto out1;
} }
...@@ -834,14 +836,14 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -834,14 +836,14 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card->iobase = ioport_map(p_dev->resource[0]->start, card->iobase = ioport_map(p_dev->resource[0]->start,
resource_size(p_dev->resource[0])); resource_size(p_dev->resource[0]));
if (!card->iobase) { if (!card->iobase) {
lbs_pr_err("error in ioport_map\n"); pr_err("error in ioport_map\n");
ret = -EIO; ret = -EIO;
goto out1; goto out1;
} }
ret = pcmcia_enable_device(p_dev); ret = pcmcia_enable_device(p_dev);
if (ret) { if (ret) {
lbs_pr_err("error in pcmcia_enable_device\n"); pr_err("error in pcmcia_enable_device\n");
goto out2; goto out2;
} }
...@@ -856,8 +858,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -856,8 +858,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card->model = get_model(p_dev->manf_id, p_dev->card_id); card->model = get_model(p_dev->manf_id, p_dev->card_id);
if (card->model == MODEL_UNKNOWN) { if (card->model == MODEL_UNKNOWN) {
lbs_pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n", pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
p_dev->manf_id, p_dev->card_id); p_dev->manf_id, p_dev->card_id);
goto out2; goto out2;
} }
...@@ -866,20 +868,20 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -866,20 +868,20 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
if (card->model == MODEL_8305) { if (card->model == MODEL_8305) {
card->align_regs = 1; card->align_regs = 1;
if (prod_id < IF_CS_CF8305_B1_REV) { if (prod_id < IF_CS_CF8305_B1_REV) {
lbs_pr_err("8305 rev B0 and older are not supported\n"); pr_err("8305 rev B0 and older are not supported\n");
ret = -ENODEV; ret = -ENODEV;
goto out2; goto out2;
} }
} }
if ((card->model == MODEL_8381) && prod_id < IF_CS_CF8381_B3_REV) { if ((card->model == MODEL_8381) && prod_id < IF_CS_CF8381_B3_REV) {
lbs_pr_err("8381 rev B2 and older are not supported\n"); pr_err("8381 rev B2 and older are not supported\n");
ret = -ENODEV; ret = -ENODEV;
goto out2; goto out2;
} }
if ((card->model == MODEL_8385) && prod_id < IF_CS_CF8385_B1_REV) { if ((card->model == MODEL_8385) && prod_id < IF_CS_CF8385_B1_REV) {
lbs_pr_err("8385 rev B0 and older are not supported\n"); pr_err("8385 rev B0 and older are not supported\n");
ret = -ENODEV; ret = -ENODEV;
goto out2; goto out2;
} }
...@@ -887,7 +889,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -887,7 +889,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
ret = lbs_get_firmware(&p_dev->dev, NULL, NULL, card->model, ret = lbs_get_firmware(&p_dev->dev, NULL, NULL, card->model,
&fw_table[0], &helper, &mainfw); &fw_table[0], &helper, &mainfw);
if (ret) { if (ret) {
lbs_pr_err("failed to find firmware (%d)\n", ret); pr_err("failed to find firmware (%d)\n", ret);
goto out2; goto out2;
} }
...@@ -918,7 +920,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -918,7 +920,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
ret = request_irq(p_dev->irq, if_cs_interrupt, ret = request_irq(p_dev->irq, if_cs_interrupt,
IRQF_SHARED, DRV_NAME, card); IRQF_SHARED, DRV_NAME, card);
if (ret) { if (ret) {
lbs_pr_err("error in request_irq\n"); pr_err("error in request_irq\n");
goto out3; goto out3;
} }
...@@ -931,7 +933,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -931,7 +933,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
/* And finally bring the card up */ /* And finally bring the card up */
if (lbs_start_card(priv) != 0) { if (lbs_start_card(priv) != 0) {
lbs_pr_err("could not activate card\n"); pr_err("could not activate card\n");
goto out3; goto out3;
} }
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
* if_sdio_card_to_host() to pad the data. * if_sdio_card_to_host() to pad the data.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -409,7 +411,7 @@ static int if_sdio_card_to_host(struct if_sdio_card *card) ...@@ -409,7 +411,7 @@ static int if_sdio_card_to_host(struct if_sdio_card *card)
out: out:
if (ret) if (ret)
lbs_pr_err("problem fetching packet from firmware\n"); pr_err("problem fetching packet from firmware\n");
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
...@@ -446,7 +448,7 @@ static void if_sdio_host_to_card_worker(struct work_struct *work) ...@@ -446,7 +448,7 @@ static void if_sdio_host_to_card_worker(struct work_struct *work)
} }
if (ret) if (ret)
lbs_pr_err("error %d sending packet to firmware\n", ret); pr_err("error %d sending packet to firmware\n", ret);
sdio_release_host(card->func); sdio_release_host(card->func);
...@@ -555,7 +557,7 @@ static int if_sdio_prog_helper(struct if_sdio_card *card, ...@@ -555,7 +557,7 @@ static int if_sdio_prog_helper(struct if_sdio_card *card,
out: out:
if (ret) if (ret)
lbs_pr_err("failed to load helper firmware\n"); pr_err("failed to load helper firmware\n");
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
return ret; return ret;
...@@ -669,7 +671,7 @@ static int if_sdio_prog_real(struct if_sdio_card *card, ...@@ -669,7 +671,7 @@ static int if_sdio_prog_real(struct if_sdio_card *card,
out: out:
if (ret) if (ret)
lbs_pr_err("failed to load firmware\n"); pr_err("failed to load firmware\n");
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
return ret; return ret;
...@@ -723,7 +725,7 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card) ...@@ -723,7 +725,7 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name, ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name,
card->model, &fw_table[0], &helper, &mainfw); card->model, &fw_table[0], &helper, &mainfw);
if (ret) { if (ret) {
lbs_pr_err("failed to find firmware (%d)\n", ret); pr_err("failed to find firmware (%d)\n", ret);
goto out; goto out;
} }
...@@ -849,7 +851,7 @@ static int if_sdio_enter_deep_sleep(struct lbs_private *priv) ...@@ -849,7 +851,7 @@ static int if_sdio_enter_deep_sleep(struct lbs_private *priv)
ret = __lbs_cmd(priv, CMD_802_11_DEEP_SLEEP, &cmd, sizeof(cmd), ret = __lbs_cmd(priv, CMD_802_11_DEEP_SLEEP, &cmd, sizeof(cmd),
lbs_cmd_copyback, (unsigned long) &cmd); lbs_cmd_copyback, (unsigned long) &cmd);
if (ret) if (ret)
lbs_pr_err("DEEP_SLEEP cmd failed\n"); pr_err("DEEP_SLEEP cmd failed\n");
mdelay(200); mdelay(200);
return ret; return ret;
...@@ -865,7 +867,7 @@ static int if_sdio_exit_deep_sleep(struct lbs_private *priv) ...@@ -865,7 +867,7 @@ static int if_sdio_exit_deep_sleep(struct lbs_private *priv)
sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret); sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret);
if (ret) if (ret)
lbs_pr_err("sdio_writeb failed!\n"); pr_err("sdio_writeb failed!\n");
sdio_release_host(card->func); sdio_release_host(card->func);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 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,7 +884,7 @@ static int if_sdio_reset_deep_sleep_wakeup(struct lbs_private *priv)
sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret); sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret);
if (ret) if (ret)
lbs_pr_err("sdio_writeb failed!\n"); pr_err("sdio_writeb failed!\n");
sdio_release_host(card->func); sdio_release_host(card->func);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
...@@ -961,7 +963,7 @@ static int if_sdio_probe(struct sdio_func *func, ...@@ -961,7 +963,7 @@ static int if_sdio_probe(struct sdio_func *func,
} }
if (i == func->card->num_info) { if (i == func->card->num_info) {
lbs_pr_err("unable to identify card model\n"); pr_err("unable to identify card model\n");
return -ENODEV; return -ENODEV;
} }
...@@ -995,7 +997,7 @@ static int if_sdio_probe(struct sdio_func *func, ...@@ -995,7 +997,7 @@ static int if_sdio_probe(struct sdio_func *func,
break; break;
} }
if (i == ARRAY_SIZE(fw_table)) { if (i == ARRAY_SIZE(fw_table)) {
lbs_pr_err("unknown card model 0x%x\n", card->model); pr_err("unknown card model 0x%x\n", card->model);
ret = -ENODEV; ret = -ENODEV;
goto free; goto free;
} }
...@@ -1101,7 +1103,7 @@ static int if_sdio_probe(struct sdio_func *func, ...@@ -1101,7 +1103,7 @@ static int if_sdio_probe(struct sdio_func *func,
lbs_deb_sdio("send function INIT command\n"); lbs_deb_sdio("send function INIT command\n");
if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd), if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
lbs_cmd_copyback, (unsigned long) &cmd)) lbs_cmd_copyback, (unsigned long) &cmd))
lbs_pr_alert("CMD_FUNC_INIT cmd failed\n"); pr_alert("CMD_FUNC_INIT cmd failed\n");
} }
ret = lbs_start_card(priv); ret = lbs_start_card(priv);
...@@ -1163,7 +1165,7 @@ static void if_sdio_remove(struct sdio_func *func) ...@@ -1163,7 +1165,7 @@ static void if_sdio_remove(struct sdio_func *func)
if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN, if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN,
&cmd, sizeof(cmd), lbs_cmd_copyback, &cmd, sizeof(cmd), lbs_cmd_copyback,
(unsigned long) &cmd)) (unsigned long) &cmd))
lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n"); pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
} }
...@@ -1202,21 +1204,19 @@ static int if_sdio_suspend(struct device *dev) ...@@ -1202,21 +1204,19 @@ static int if_sdio_suspend(struct device *dev)
mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
lbs_pr_info("%s: suspend: PM flags = 0x%x\n", pr_info("%s: suspend: PM flags = 0x%x\n", sdio_func_id(func), flags);
sdio_func_id(func), flags);
/* If we aren't being asked to wake on anything, we should bail out /* If we aren't being asked to wake on anything, we should bail out
* and let the SD stack power down the card. * and let the SD stack power down the card.
*/ */
if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) { if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) {
lbs_pr_info("Suspend without wake params -- " pr_info("Suspend without wake params -- powering down card\n");
"powering down card.");
return -ENOSYS; return -ENOSYS;
} }
if (!(flags & MMC_PM_KEEP_POWER)) { if (!(flags & MMC_PM_KEEP_POWER)) {
lbs_pr_err("%s: cannot remain alive while host is suspended\n", pr_err("%s: cannot remain alive while host is suspended\n",
sdio_func_id(func)); sdio_func_id(func));
return -ENOSYS; return -ENOSYS;
} }
...@@ -1237,7 +1237,7 @@ static int if_sdio_resume(struct device *dev) ...@@ -1237,7 +1237,7 @@ static int if_sdio_resume(struct device *dev)
struct if_sdio_card *card = sdio_get_drvdata(func); struct if_sdio_card *card = sdio_get_drvdata(func);
int ret; int ret;
lbs_pr_info("%s: resume: we're back\n", sdio_func_id(func)); pr_info("%s: resume: we're back\n", sdio_func_id(func));
ret = lbs_resume(card->priv); ret = lbs_resume(card->priv);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
...@@ -305,8 +307,7 @@ static int spu_wait_for_u16(struct if_spi_card *card, u16 reg, ...@@ -305,8 +307,7 @@ static int spu_wait_for_u16(struct if_spi_card *card, u16 reg,
} }
udelay(100); udelay(100);
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
lbs_pr_err("%s: timeout with val=%02x, " pr_err("%s: timeout with val=%02x, target_mask=%02x, target=%02x\n",
"target_mask=%02x, target=%02x\n",
__func__, val, target_mask, target); __func__, val, target_mask, target);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -405,7 +406,7 @@ static int spu_set_bus_mode(struct if_spi_card *card, u16 mode) ...@@ -405,7 +406,7 @@ static int spu_set_bus_mode(struct if_spi_card *card, u16 mode)
if (err) if (err)
return err; return err;
if ((rval & 0xF) != mode) { if ((rval & 0xF) != mode) {
lbs_pr_err("Can't read bus mode register.\n"); pr_err("Can't read bus mode register\n");
return -EIO; return -EIO;
} }
return 0; return 0;
...@@ -534,7 +535,7 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card, ...@@ -534,7 +535,7 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card,
out: out:
if (err) if (err)
lbs_pr_err("failed to load helper firmware (err=%d)\n", err); pr_err("failed to load helper firmware (err=%d)\n", err);
lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err); lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err);
return err; return err;
} }
...@@ -557,7 +558,7 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card, ...@@ -557,7 +558,7 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card,
IF_SPI_HIST_CMD_DOWNLOAD_RDY, IF_SPI_HIST_CMD_DOWNLOAD_RDY,
IF_SPI_HIST_CMD_DOWNLOAD_RDY); IF_SPI_HIST_CMD_DOWNLOAD_RDY);
if (err) { if (err) {
lbs_pr_err("timed out waiting for host_int_status\n"); pr_err("timed out waiting for host_int_status\n");
return err; return err;
} }
...@@ -567,9 +568,8 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card, ...@@ -567,9 +568,8 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card,
return err; return err;
if (len > IF_SPI_CMD_BUF_SIZE) { if (len > IF_SPI_CMD_BUF_SIZE) {
lbs_pr_err("firmware load device requested a larger " pr_err("firmware load device requested a larger transfer than we are prepared to handle (len = %d)\n",
"tranfer than we are prepared to " len);
"handle. (len = %d)\n", len);
return -EIO; return -EIO;
} }
if (len & 0x1) { if (len & 0x1) {
...@@ -598,8 +598,8 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card, ...@@ -598,8 +598,8 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
err = spu_wait_for_u16(card, IF_SPI_SCRATCH_1_REG, 0, 0); err = spu_wait_for_u16(card, IF_SPI_SCRATCH_1_REG, 0, 0);
if (err) { if (err) {
lbs_pr_err("%s: timed out waiting for initial " pr_err("%s: timed out waiting for initial scratch reg = 0\n",
"scratch reg = 0\n", __func__); __func__);
goto out; goto out;
} }
...@@ -617,15 +617,13 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card, ...@@ -617,15 +617,13 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
* If there are no more bytes left, we would normally * If there are no more bytes left, we would normally
* expect to have terminated with len = 0 * expect to have terminated with len = 0
*/ */
lbs_pr_err("Firmware load wants more bytes " pr_err("Firmware load wants more bytes than we have to offer.\n");
"than we have to offer.\n");
break; break;
} }
if (crc_err) { if (crc_err) {
/* Previous transfer failed. */ /* Previous transfer failed. */
if (++num_crc_errs > MAX_MAIN_FW_LOAD_CRC_ERR) { if (++num_crc_errs > MAX_MAIN_FW_LOAD_CRC_ERR) {
lbs_pr_err("Too many CRC errors encountered " pr_err("Too many CRC errors encountered in firmware load.\n");
"in firmware load.\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -654,21 +652,20 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card, ...@@ -654,21 +652,20 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
prev_len = len; prev_len = len;
} }
if (bytes > prev_len) { if (bytes > prev_len) {
lbs_pr_err("firmware load wants fewer bytes than " pr_err("firmware load wants fewer bytes than we have to offer\n");
"we have to offer.\n");
} }
/* Confirm firmware download */ /* Confirm firmware download */
err = spu_wait_for_u32(card, IF_SPI_SCRATCH_4_REG, err = spu_wait_for_u32(card, IF_SPI_SCRATCH_4_REG,
SUCCESSFUL_FW_DOWNLOAD_MAGIC); SUCCESSFUL_FW_DOWNLOAD_MAGIC);
if (err) { if (err) {
lbs_pr_err("failed to confirm the firmware download\n"); pr_err("failed to confirm the firmware download\n");
goto out; goto out;
} }
out: out:
if (err) if (err)
lbs_pr_err("failed to load firmware (err=%d)\n", err); pr_err("failed to load firmware (err=%d)\n", err);
lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err); lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err);
return err; return err;
} }
...@@ -709,14 +706,12 @@ static int if_spi_c2h_cmd(struct if_spi_card *card) ...@@ -709,14 +706,12 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
if (err) if (err)
goto out; goto out;
if (!len) { if (!len) {
lbs_pr_err("%s: error: card has no data for host\n", pr_err("%s: error: card has no data for host\n", __func__);
__func__);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} else if (len > IF_SPI_CMD_BUF_SIZE) { } else if (len > IF_SPI_CMD_BUF_SIZE) {
lbs_pr_err("%s: error: response packet too large: " pr_err("%s: error: response packet too large: %d bytes, but maximum is %d\n",
"%d bytes, but maximum is %d\n", __func__, len, IF_SPI_CMD_BUF_SIZE);
__func__, len, IF_SPI_CMD_BUF_SIZE);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
...@@ -737,7 +732,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card) ...@@ -737,7 +732,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
out: out:
if (err) if (err)
lbs_pr_err("%s: err=%d\n", __func__, err); pr_err("%s: err=%d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI); lbs_deb_leave(LBS_DEB_SPI);
return err; return err;
} }
...@@ -757,14 +752,12 @@ static int if_spi_c2h_data(struct if_spi_card *card) ...@@ -757,14 +752,12 @@ static int if_spi_c2h_data(struct if_spi_card *card)
if (err) if (err)
goto out; goto out;
if (!len) { if (!len) {
lbs_pr_err("%s: error: card has no data for host\n", pr_err("%s: error: card has no data for host\n", __func__);
__func__);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) { } else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
lbs_pr_err("%s: error: card has %d bytes of data, but " pr_err("%s: error: card has %d bytes of data, but our maximum skb size is %zu\n",
"our maximum skb size is %zu\n", __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
__func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
...@@ -795,7 +788,7 @@ static int if_spi_c2h_data(struct if_spi_card *card) ...@@ -795,7 +788,7 @@ static int if_spi_c2h_data(struct if_spi_card *card)
dev_kfree_skb(skb); dev_kfree_skb(skb);
out: out:
if (err) if (err)
lbs_pr_err("%s: err=%d\n", __func__, err); pr_err("%s: err=%d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI); lbs_deb_leave(LBS_DEB_SPI);
return err; return err;
} }
...@@ -817,7 +810,7 @@ static void if_spi_h2c(struct if_spi_card *card, ...@@ -817,7 +810,7 @@ static void if_spi_h2c(struct if_spi_card *card,
port_reg = IF_SPI_CMD_RDWRPORT_REG; port_reg = IF_SPI_CMD_RDWRPORT_REG;
break; break;
default: default:
lbs_pr_err("can't transfer buffer of type %d\n", type); pr_err("can't transfer buffer of type %d\n", type);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
...@@ -831,7 +824,7 @@ static void if_spi_h2c(struct if_spi_card *card, ...@@ -831,7 +824,7 @@ static void if_spi_h2c(struct if_spi_card *card,
kfree(packet); kfree(packet);
if (err) if (err)
lbs_pr_err("%s: error %d\n", __func__, err); pr_err("%s: error %d\n", __func__, err);
} }
/* Inform the host about a card event */ /* Inform the host about a card event */
...@@ -855,7 +848,7 @@ static void if_spi_e2h(struct if_spi_card *card) ...@@ -855,7 +848,7 @@ static void if_spi_e2h(struct if_spi_card *card)
lbs_queue_event(priv, cause & 0xff); lbs_queue_event(priv, cause & 0xff);
out: out:
if (err) if (err)
lbs_pr_err("%s: error %d\n", __func__, err); pr_err("%s: error %d\n", __func__, err);
} }
static void if_spi_host_to_card_worker(struct work_struct *work) static 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,7 +870,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
err = spu_read_u16(card, IF_SPI_HOST_INT_STATUS_REG, err = spu_read_u16(card, IF_SPI_HOST_INT_STATUS_REG,
&hiStatus); &hiStatus);
if (err) { if (err) {
lbs_pr_err("I/O error\n"); pr_err("I/O error\n");
goto err; goto err;
} }
...@@ -940,7 +933,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work) ...@@ -940,7 +933,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
err: err:
if (err) if (err)
lbs_pr_err("%s: got error %d\n", __func__, err); pr_err("%s: got error %d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI); lbs_deb_leave(LBS_DEB_SPI);
} }
...@@ -963,7 +956,7 @@ static int if_spi_host_to_card(struct lbs_private *priv, ...@@ -963,7 +956,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb); lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb);
if (nb == 0) { if (nb == 0) {
lbs_pr_err("%s: invalid size requested: %d\n", __func__, nb); pr_err("%s: invalid size requested: %d\n", __func__, nb);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
...@@ -991,7 +984,7 @@ static int if_spi_host_to_card(struct lbs_private *priv, ...@@ -991,7 +984,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
spin_unlock_irqrestore(&card->buffer_lock, flags); spin_unlock_irqrestore(&card->buffer_lock, flags);
break; break;
default: default:
lbs_pr_err("can't transfer buffer of type %d", type); pr_err("can't transfer buffer of type %d\n", type);
err = -EINVAL; err = -EINVAL;
break; break;
} }
...@@ -1052,8 +1045,7 @@ static int if_spi_init_card(struct if_spi_card *card) ...@@ -1052,8 +1045,7 @@ static int if_spi_init_card(struct if_spi_card *card)
break; break;
} }
if (i == ARRAY_SIZE(fw_table)) { if (i == ARRAY_SIZE(fw_table)) {
lbs_pr_err("Unsupported chip_id: 0x%02x\n", pr_err("Unsupported chip_id: 0x%02x\n", card->card_id);
card->card_id);
err = -ENODEV; err = -ENODEV;
goto out; goto out;
} }
...@@ -1062,7 +1054,7 @@ static int if_spi_init_card(struct if_spi_card *card) ...@@ -1062,7 +1054,7 @@ static int if_spi_init_card(struct if_spi_card *card)
card->card_id, &fw_table[0], &helper, card->card_id, &fw_table[0], &helper,
&mainfw); &mainfw);
if (err) { if (err) {
lbs_pr_err("failed to find firmware (%d)\n", err); pr_err("failed to find firmware (%d)\n", err);
goto out; goto out;
} }
...@@ -1187,7 +1179,7 @@ static int __devinit if_spi_probe(struct spi_device *spi) ...@@ -1187,7 +1179,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
err = request_irq(spi->irq, if_spi_host_interrupt, err = request_irq(spi->irq, if_spi_host_interrupt,
IRQF_TRIGGER_FALLING, "libertas_spi", card); IRQF_TRIGGER_FALLING, "libertas_spi", card);
if (err) { if (err) {
lbs_pr_err("can't get host irq line-- request_irq failed\n"); pr_err("can't get host irq line-- request_irq failed\n");
goto terminate_workqueue; goto terminate_workqueue;
} }
......
/* /*
* This file contains functions used in USB interface module. * This file contains functions used in USB interface module.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/firmware.h> #include <linux/firmware.h>
...@@ -153,7 +156,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) ...@@ -153,7 +156,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
lbs_host_to_card_done(priv); lbs_host_to_card_done(priv);
} else { } else {
/* print the failure status number for debug */ /* print the failure status number for debug */
lbs_pr_info("URB in failure status: %d\n", urb->status); pr_info("URB in failure status: %d\n", urb->status);
} }
} }
...@@ -203,7 +206,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv) ...@@ -203,7 +206,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
wake_method.hdr.size = cpu_to_le16(sizeof(wake_method)); wake_method.hdr.size = cpu_to_le16(sizeof(wake_method));
wake_method.action = cpu_to_le16(CMD_ACT_GET); wake_method.action = cpu_to_le16(CMD_ACT_GET);
if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) { if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) {
lbs_pr_info("Firmware does not seem to support PS mode\n"); pr_info("Firmware does not seem to support PS mode\n");
priv->fwcapinfo &= ~FW_CAPINFO_PS; priv->fwcapinfo &= ~FW_CAPINFO_PS;
} else { } else {
if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) { 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,7 +215,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
/* The versions which boot up this way don't seem to /* The versions which boot up this way don't seem to
work even if we set it to the command interrupt */ work even if we set it to the command interrupt */
priv->fwcapinfo &= ~FW_CAPINFO_PS; priv->fwcapinfo &= ~FW_CAPINFO_PS;
lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n"); pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n");
} }
} }
} }
...@@ -224,7 +227,7 @@ static void if_usb_fw_timeo(unsigned long priv) ...@@ -224,7 +227,7 @@ static void if_usb_fw_timeo(unsigned long priv)
if (cardp->fwdnldover) { if (cardp->fwdnldover) {
lbs_deb_usb("Download complete, no event. Assuming success\n"); lbs_deb_usb("Download complete, no event. Assuming success\n");
} else { } else {
lbs_pr_err("Download timed out\n"); pr_err("Download timed out\n");
cardp->surprise_removed = 1; cardp->surprise_removed = 1;
} }
wake_up(&cardp->fw_wq); wake_up(&cardp->fw_wq);
...@@ -258,7 +261,7 @@ static int if_usb_probe(struct usb_interface *intf, ...@@ -258,7 +261,7 @@ static int if_usb_probe(struct usb_interface *intf,
cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL); cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
if (!cardp) { if (!cardp) {
lbs_pr_err("Out of memory allocating private data.\n"); pr_err("Out of memory allocating private data\n");
goto error; goto error;
} }
...@@ -348,10 +351,10 @@ static int if_usb_probe(struct usb_interface *intf, ...@@ -348,10 +351,10 @@ static int if_usb_probe(struct usb_interface *intf,
usb_set_intfdata(intf, cardp); usb_set_intfdata(intf, cardp);
if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_fw)) if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_fw))
lbs_pr_err("cannot register lbs_flash_fw attribute\n"); pr_err("cannot register lbs_flash_fw attribute\n");
if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2)) if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2))
lbs_pr_err("cannot register lbs_flash_boot2 attribute\n"); pr_err("cannot register lbs_flash_boot2 attribute\n");
/* /*
* EHS_REMOVE_WAKEUP is not supported on all versions of the firmware. * 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,7 +539,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
int ret = -1; int ret = -1;
if (!(skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE))) { if (!(skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE))) {
lbs_pr_err("No free skb\n"); pr_err("No free skb\n");
goto rx_ret; goto rx_ret;
} }
...@@ -595,7 +598,7 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -595,7 +598,7 @@ static void if_usb_receive_fwload(struct urb *urb)
if (tmp[0] == cpu_to_le32(CMD_TYPE_INDICATION) && if (tmp[0] == cpu_to_le32(CMD_TYPE_INDICATION) &&
tmp[1] == cpu_to_le32(MACREG_INT_CODE_FIRMWARE_READY)) { tmp[1] == cpu_to_le32(MACREG_INT_CODE_FIRMWARE_READY)) {
lbs_pr_info("Firmware ready event received\n"); pr_info("Firmware ready event received\n");
wake_up(&cardp->fw_wq); wake_up(&cardp->fw_wq);
} else { } else {
lbs_deb_usb("Waiting for confirmation; got %x %x\n", lbs_deb_usb("Waiting for confirmation; got %x %x\n",
...@@ -622,20 +625,20 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -622,20 +625,20 @@ static void if_usb_receive_fwload(struct urb *urb)
bootcmdresp.magic == cpu_to_le32(CMD_TYPE_DATA) || bootcmdresp.magic == cpu_to_le32(CMD_TYPE_DATA) ||
bootcmdresp.magic == cpu_to_le32(CMD_TYPE_INDICATION)) { bootcmdresp.magic == cpu_to_le32(CMD_TYPE_INDICATION)) {
if (!cardp->bootcmdresp) if (!cardp->bootcmdresp)
lbs_pr_info("Firmware already seems alive; resetting\n"); pr_info("Firmware already seems alive; resetting\n");
cardp->bootcmdresp = -1; cardp->bootcmdresp = -1;
} else { } else {
lbs_pr_info("boot cmd response wrong magic number (0x%x)\n", pr_info("boot cmd response wrong magic number (0x%x)\n",
le32_to_cpu(bootcmdresp.magic)); le32_to_cpu(bootcmdresp.magic));
} }
} else if ((bootcmdresp.cmd != BOOT_CMD_FW_BY_USB) && } else if ((bootcmdresp.cmd != BOOT_CMD_FW_BY_USB) &&
(bootcmdresp.cmd != BOOT_CMD_UPDATE_FW) && (bootcmdresp.cmd != BOOT_CMD_UPDATE_FW) &&
(bootcmdresp.cmd != BOOT_CMD_UPDATE_BOOT2)) { (bootcmdresp.cmd != BOOT_CMD_UPDATE_BOOT2)) {
lbs_pr_info("boot cmd response cmd_tag error (%d)\n", pr_info("boot cmd response cmd_tag error (%d)\n",
bootcmdresp.cmd); bootcmdresp.cmd);
} else if (bootcmdresp.result != BOOT_CMD_RESP_OK) { } else if (bootcmdresp.result != BOOT_CMD_RESP_OK) {
lbs_pr_info("boot cmd response result error (%d)\n", pr_info("boot cmd response result error (%d)\n",
bootcmdresp.result); bootcmdresp.result);
} else { } else {
cardp->bootcmdresp = 1; cardp->bootcmdresp = 1;
lbs_deb_usbd(&cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
...@@ -901,7 +904,7 @@ static int check_fwfile_format(const uint8_t *data, uint32_t totlen) ...@@ -901,7 +904,7 @@ static int check_fwfile_format(const uint8_t *data, uint32_t totlen)
} while (!exit); } while (!exit);
if (ret) if (ret)
lbs_pr_err("firmware file format check FAIL\n"); pr_err("firmware file format check FAIL\n");
else else
lbs_deb_fw("firmware file format check PASS\n"); lbs_deb_fw("firmware file format check PASS\n");
...@@ -998,7 +1001,7 @@ static int __if_usb_prog_firmware(struct if_usb_card *cardp, ...@@ -998,7 +1001,7 @@ static int __if_usb_prog_firmware(struct if_usb_card *cardp,
ret = get_fw(cardp, fwname); ret = get_fw(cardp, fwname);
if (ret) { if (ret) {
lbs_pr_err("failed to find firmware (%d)\n", ret); pr_err("failed to find firmware (%d)\n", ret);
goto done; goto done;
} }
...@@ -1073,13 +1076,13 @@ static int __if_usb_prog_firmware(struct if_usb_card *cardp, ...@@ -1073,13 +1076,13 @@ static int __if_usb_prog_firmware(struct if_usb_card *cardp,
usb_kill_urb(cardp->rx_urb); usb_kill_urb(cardp->rx_urb);
if (!cardp->fwdnldover) { if (!cardp->fwdnldover) {
lbs_pr_info("failed to load fw, resetting device!\n"); pr_info("failed to load fw, resetting device!\n");
if (--reset_count >= 0) { if (--reset_count >= 0) {
if_usb_reset_device(cardp); if_usb_reset_device(cardp);
goto restart; goto restart;
} }
lbs_pr_info("FW download failure, time = %d ms\n", i * 100); pr_info("FW download failure, time = %d ms\n", i * 100);
ret = -EIO; ret = -EIO;
goto release_fw; goto release_fw;
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* thread etc.. * thread etc..
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
...@@ -442,7 +444,7 @@ static int lbs_thread(void *data) ...@@ -442,7 +444,7 @@ static int lbs_thread(void *data)
if (priv->cmd_timed_out && priv->cur_cmd) { if (priv->cmd_timed_out && priv->cur_cmd) {
struct cmd_ctrl_node *cmdnode = priv->cur_cmd; struct cmd_ctrl_node *cmdnode = priv->cur_cmd;
lbs_pr_info("Timeout submitting command 0x%04x\n", pr_info("Timeout submitting command 0x%04x\n",
le16_to_cpu(cmdnode->cmdbuf->command)); le16_to_cpu(cmdnode->cmdbuf->command));
lbs_complete_command(priv, cmdnode, -ETIMEDOUT); lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
if (priv->reset_card) if (priv->reset_card)
...@@ -470,8 +472,7 @@ static int lbs_thread(void *data) ...@@ -470,8 +472,7 @@ static int lbs_thread(void *data)
* after firmware fixes it * after firmware fixes it
*/ */
priv->psstate = PS_STATE_AWAKE; priv->psstate = PS_STATE_AWAKE;
lbs_pr_alert("ignore PS_SleepConfirm in " pr_alert("ignore PS_SleepConfirm in non-connected state\n");
"non-connected state\n");
} }
} }
...@@ -565,7 +566,7 @@ int lbs_suspend(struct lbs_private *priv) ...@@ -565,7 +566,7 @@ int lbs_suspend(struct lbs_private *priv)
if (priv->is_deep_sleep) { if (priv->is_deep_sleep) {
ret = lbs_set_deep_sleep(priv, 0); ret = lbs_set_deep_sleep(priv, 0);
if (ret) { if (ret) {
lbs_pr_err("deep sleep cancellation failed: %d\n", ret); pr_err("deep sleep cancellation failed: %d\n", ret);
return ret; return ret;
} }
priv->deep_sleep_required = 1; priv->deep_sleep_required = 1;
...@@ -598,7 +599,7 @@ int lbs_resume(struct lbs_private *priv) ...@@ -598,7 +599,7 @@ int lbs_resume(struct lbs_private *priv)
priv->deep_sleep_required = 0; priv->deep_sleep_required = 0;
ret = lbs_set_deep_sleep(priv, 1); ret = lbs_set_deep_sleep(priv, 1);
if (ret) if (ret)
lbs_pr_err("deep sleep activation failed: %d\n", ret); pr_err("deep sleep activation failed: %d\n", ret);
} }
if (priv->setup_fw_on_resume) if (priv->setup_fw_on_resume)
...@@ -626,7 +627,7 @@ static void lbs_cmd_timeout_handler(unsigned long data) ...@@ -626,7 +627,7 @@ static void lbs_cmd_timeout_handler(unsigned long data)
if (!priv->cur_cmd) if (!priv->cur_cmd)
goto out; goto out;
lbs_pr_info("command 0x%04x timed out\n", pr_info("command 0x%04x timed out\n",
le16_to_cpu(priv->cur_cmd->cmdbuf->command)); le16_to_cpu(priv->cur_cmd->cmdbuf->command));
priv->cmd_timed_out = 1; priv->cmd_timed_out = 1;
...@@ -732,7 +733,7 @@ static int lbs_init_adapter(struct lbs_private *priv) ...@@ -732,7 +733,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
/* Allocate the command buffers */ /* Allocate the command buffers */
if (lbs_allocate_cmd_buffer(priv)) { if (lbs_allocate_cmd_buffer(priv)) {
lbs_pr_err("Out of memory allocating command buffers\n"); pr_err("Out of memory allocating command buffers\n");
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
...@@ -742,7 +743,7 @@ static int lbs_init_adapter(struct lbs_private *priv) ...@@ -742,7 +743,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
/* Create the event FIFO */ /* Create the event FIFO */
ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL); ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL);
if (ret) { if (ret) {
lbs_pr_err("Out of memory allocating event FIFO buffer\n"); pr_err("Out of memory allocating event FIFO buffer\n");
goto out; goto out;
} }
...@@ -793,7 +794,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev) ...@@ -793,7 +794,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
/* Allocate an Ethernet device and register it */ /* Allocate an Ethernet device and register it */
wdev = lbs_cfg_alloc(dmdev); wdev = lbs_cfg_alloc(dmdev);
if (IS_ERR(wdev)) { if (IS_ERR(wdev)) {
lbs_pr_err("cfg80211 init failed\n"); pr_err("cfg80211 init failed\n");
goto done; goto done;
} }
...@@ -802,7 +803,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev) ...@@ -802,7 +803,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
priv->wdev = wdev; priv->wdev = wdev;
if (lbs_init_adapter(priv)) { if (lbs_init_adapter(priv)) {
lbs_pr_err("failed to initialize adapter structure.\n"); pr_err("failed to initialize adapter structure\n");
goto err_wdev; goto err_wdev;
} }
...@@ -934,7 +935,7 @@ int lbs_start_card(struct lbs_private *priv) ...@@ -934,7 +935,7 @@ int lbs_start_card(struct lbs_private *priv)
goto done; goto done;
if (lbs_cfg_register(priv)) { if (lbs_cfg_register(priv)) {
lbs_pr_err("cannot register device\n"); pr_err("cannot register device\n");
goto done; goto done;
} }
...@@ -944,7 +945,7 @@ int lbs_start_card(struct lbs_private *priv) ...@@ -944,7 +945,7 @@ int lbs_start_card(struct lbs_private *priv)
lbs_debugfs_init_one(priv, dev); lbs_debugfs_init_one(priv, dev);
lbs_pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name); pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name);
ret = 0; ret = 0;
...@@ -1071,16 +1072,14 @@ int lbs_get_firmware(struct device *dev, const char *user_helper, ...@@ -1071,16 +1072,14 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
if (user_helper) { if (user_helper) {
ret = request_firmware(helper, user_helper, dev); ret = request_firmware(helper, user_helper, dev);
if (ret) { if (ret) {
lbs_pr_err("couldn't find helper firmware %s", pr_err("couldn't find helper firmware %s", user_helper);
user_helper);
goto fail; goto fail;
} }
} }
if (user_mainfw) { if (user_mainfw) {
ret = request_firmware(mainfw, user_mainfw, dev); ret = request_firmware(mainfw, user_mainfw, dev);
if (ret) { if (ret) {
lbs_pr_err("couldn't find main firmware %s", pr_err("couldn't find main firmware %s", user_mainfw);
user_mainfw);
goto fail; goto fail;
} }
} }
......
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -267,7 +269,7 @@ int lbs_init_mesh(struct lbs_private *priv) ...@@ -267,7 +269,7 @@ int lbs_init_mesh(struct lbs_private *priv)
lbs_add_mesh(priv); lbs_add_mesh(priv);
if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
lbs_pr_err("cannot register lbs_mesh attribute\n"); pr_err("cannot register lbs_mesh attribute\n");
ret = 1; ret = 1;
} }
...@@ -395,7 +397,7 @@ int lbs_add_mesh(struct lbs_private *priv) ...@@ -395,7 +397,7 @@ int lbs_add_mesh(struct lbs_private *priv)
/* Register virtual mesh interface */ /* Register virtual mesh interface */
ret = register_netdev(mesh_dev); ret = register_netdev(mesh_dev);
if (ret) { if (ret) {
lbs_pr_err("cannot register mshX virtual interface\n"); pr_err("cannot register mshX virtual interface\n");
goto err_free; goto err_free;
} }
...@@ -973,7 +975,7 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr, ...@@ -973,7 +975,7 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
return ret; return ret;
if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) { if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) {
lbs_pr_err("inconsistent mesh ID length"); pr_err("inconsistent mesh ID length\n");
defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN; defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;
} }
......
/* /*
* This file contains the handling of RX in wlan driver. * This file contains the handling of RX in wlan driver.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -191,7 +194,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate) ...@@ -191,7 +194,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
case 12: /* 54 Mbps */ case 12: /* 54 Mbps */
return 108; return 108;
} }
lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate); pr_alert("Invalid Marvell WLAN rate %i\n", rate);
return 0; return 0;
} }
...@@ -248,7 +251,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, ...@@ -248,7 +251,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
/* add space for the new radio header */ /* add space for the new radio header */
if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) { pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) {
lbs_pr_alert("%s: couldn't pskb_expand_head\n", __func__); pr_alert("%s: couldn't pskb_expand_head\n", __func__);
ret = -ENOMEM; ret = -ENOMEM;
kfree_skb(skb); kfree_skb(skb);
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment