* [PATCH 2/2] libertas: Use netdev_<level> or dev_<level> where possible
From: Joe Perches @ 2011-05-02 23:49 UTC (permalink / raw)
To: Dan Williams
Cc: John W. Linville, libertas-dev, linux-wireless, netdev,
linux-kernel
In-Reply-To: <cover.1304379925.git.joe@perches.com>
Using the more descriptive logging styles gives a bit
more information about the device being operated on.
Makes the object trivially smaller too.
$ size drivers/net/wireless/libertas/built-in.o.*
187730 2973 38488 229191 37f47 drivers/net/wireless/libertas/built-in.o.new
188195 2973 38488 229656 38118 drivers/net/wireless/libertas/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/libertas/cfg.c | 9 +++--
drivers/net/wireless/libertas/cmd.c | 42 +++++++++++++----------
drivers/net/wireless/libertas/cmdresp.c | 32 +++++++++---------
drivers/net/wireless/libertas/debugfs.c | 7 ++--
drivers/net/wireless/libertas/if_cs.c | 15 +++++---
drivers/net/wireless/libertas/if_sdio.c | 19 +++++-----
drivers/net/wireless/libertas/if_spi.c | 57 ++++++++++++++++++++-----------
drivers/net/wireless/libertas/if_usb.c | 11 ++++--
drivers/net/wireless/libertas/main.c | 27 +++++++++------
drivers/net/wireless/libertas/mesh.c | 4 +-
drivers/net/wireless/libertas/rx.c | 2 +-
11 files changed, 131 insertions(+), 94 deletions(-)
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index d6e0656..47b7f17 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -1316,7 +1316,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
sme->ssid, sme->ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!bss) {
- pr_err("assoc: bss %pM not in scan results\n", sme->bssid);
+ wiphy_err(wiphy, "assoc: bss %pM not in scan results\n",
+ sme->bssid);
ret = -ENOENT;
goto done;
}
@@ -1373,8 +1374,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
break;
default:
- pr_err("unsupported cipher group 0x%x\n",
- sme->crypto.cipher_group);
+ wiphy_err(wiphy, "unsupported cipher group 0x%x\n",
+ sme->crypto.cipher_group);
ret = -ENOTSUPP;
goto done;
}
@@ -1492,7 +1493,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
params->key, params->key_len);
break;
default:
- pr_err("unhandled cipher 0x%x\n", params->cipher);
+ wiphy_err(wiphy, "unhandled cipher 0x%x\n", params->cipher);
ret = -ENOTSUPP;
break;
}
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 10ca485..f11c656 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -3,8 +3,6 @@
* 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/sched.h>
#include <linux/slab.h>
@@ -110,7 +108,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
* CF card firmware 5.0.16p0: cap 0x00000303
* USB dongle firmware 5.110.17p2: cap 0x00000303
*/
- pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
+ netdev_info(priv->dev, "%pM, fw %u.%u.%up%u, cap 0x%08x\n",
cmd.permanentaddr,
priv->fwrelease >> 24 & 0xff,
priv->fwrelease >> 16 & 0xff,
@@ -141,7 +139,8 @@ int lbs_update_hw_spec(struct lbs_private *priv)
/* if it's unidentified region code, use the default (USA) */
if (i >= MRVDRV_MAX_REGION_CODE) {
priv->regioncode = 0x10;
- pr_info("unidentified region code; using the default (USA)\n");
+ netdev_info(priv->dev,
+ "unidentified region code; using the default (USA)\n");
}
if (priv->current_addr[0] == 0xff)
@@ -211,7 +210,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
(uint8_t *)&cmd_config.wol_conf,
sizeof(struct wol_config));
} else {
- pr_info("HOST_SLEEP_CFG failed %d\n", ret);
+ netdev_info(priv->dev, "HOST_SLEEP_CFG failed %d\n", ret);
}
return ret;
@@ -314,7 +313,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
if (priv->is_deep_sleep) {
if (!wait_event_interruptible_timeout(priv->ds_awake_q,
!priv->is_deep_sleep, (10 * HZ))) {
- pr_err("ds_awake_q: timer expired\n");
+ netdev_err(priv->dev, "ds_awake_q: timer expired\n");
ret = -1;
}
}
@@ -339,7 +338,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
netif_carrier_off(priv->dev);
}
} else {
- pr_err("deep sleep: already enabled\n");
+ netdev_err(priv->dev, "deep sleep: already enabled\n");
}
} else {
if (priv->is_deep_sleep) {
@@ -349,7 +348,8 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
if (!ret) {
ret = lbs_wait_for_ds_awake(priv);
if (ret)
- pr_err("deep sleep: wakeup failed\n");
+ netdev_err(priv->dev,
+ "deep sleep: wakeup failed\n");
}
}
}
@@ -383,8 +383,9 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
(struct wol_config *)NULL);
if (ret) {
- pr_info("Host sleep configuration failed: %d\n",
- ret);
+ netdev_info(priv->dev,
+ "Host sleep configuration failed: %d\n",
+ ret);
return ret;
}
if (priv->psstate == PS_STATE_FULL_POWER) {
@@ -394,19 +395,21 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
sizeof(cmd),
lbs_ret_host_sleep_activate, 0);
if (ret)
- pr_info("HOST_SLEEP_ACTIVATE failed: %d\n",
- ret);
+ netdev_info(priv->dev,
+ "HOST_SLEEP_ACTIVATE failed: %d\n",
+ ret);
}
if (!wait_event_interruptible_timeout(
priv->host_sleep_q,
priv->is_host_sleep_activated,
(10 * HZ))) {
- pr_err("host_sleep_q: timer expired\n");
+ netdev_err(priv->dev,
+ "host_sleep_q: timer expired\n");
ret = -1;
}
} else {
- pr_err("host sleep: already enabled\n");
+ netdev_err(priv->dev, "host sleep: already enabled\n");
}
} else {
if (priv->is_host_sleep_activated)
@@ -1003,7 +1006,8 @@ static void lbs_submit_command(struct lbs_private *priv,
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);
if (ret) {
- pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
+ netdev_info(priv->dev, "DNLD_CMD: hw_host_to_card failed: %d\n",
+ ret);
/* Let the timer kick in and retry, and potentially reset
the whole thing if the condition persists */
timeo = HZ/4;
@@ -1268,7 +1272,8 @@ int lbs_execute_next_command(struct lbs_private *priv)
spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->cur_cmd) {
- pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
+ netdev_alert(priv->dev,
+ "EXEC_NEXT_CMD: already processing command!\n");
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
@@ -1430,7 +1435,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
sizeof(confirm_sleep));
if (ret) {
- pr_alert("confirm_sleep failed\n");
+ netdev_alert(priv->dev, "confirm_sleep failed\n");
goto out;
}
@@ -1656,7 +1661,8 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
spin_lock_irqsave(&priv->driver_lock, flags);
ret = cmdnode->result;
if (ret)
- pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);
+ netdev_info(priv->dev, "PREP_CMD: command 0x%04x failed: %d\n",
+ command, ret);
__lbs_cleanup_and_insert_cmd(priv, cmdnode);
spin_unlock_irqrestore(&priv->driver_lock, flags);
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 2cb6f5f..4352e92 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -3,8 +3,6 @@
* responses as well as events generated by firmware.
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/sched.h>
@@ -87,17 +85,18 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);
if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
- 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));
+ netdev_info(priv->dev,
+ "Received CMD_RESP with invalid sequence %d (expected %d)\n",
+ le16_to_cpu(resp->seqnum),
+ le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
}
if (respcmd != CMD_RET(curcmd) &&
respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
- pr_info("Invalid CMD_RESP %x to command %x!\n",
- respcmd, curcmd);
+ netdev_info(priv->dev, "Invalid CMD_RESP %x to command %x!\n",
+ respcmd, curcmd);
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
@@ -106,8 +105,9 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
if (resp->result == cpu_to_le16(0x0004)) {
/* 0x0004 means -EAGAIN. Drop the response, let it time out
and be resubmitted */
- pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
- le16_to_cpu(resp->command));
+ netdev_info(priv->dev,
+ "Firmware returns DEFER to command %x. Will let it time out...\n",
+ le16_to_cpu(resp->command));
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
@@ -318,28 +318,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
break;
case MACREG_INT_CODE_RSSI_LOW:
- pr_alert("EVENT: rssi low\n");
+ netdev_alert(priv->dev, "EVENT: rssi low\n");
break;
case MACREG_INT_CODE_SNR_LOW:
- pr_alert("EVENT: snr low\n");
+ netdev_alert(priv->dev, "EVENT: snr low\n");
break;
case MACREG_INT_CODE_MAX_FAIL:
- pr_alert("EVENT: max fail\n");
+ netdev_alert(priv->dev, "EVENT: max fail\n");
break;
case MACREG_INT_CODE_RSSI_HIGH:
- pr_alert("EVENT: rssi high\n");
+ netdev_alert(priv->dev, "EVENT: rssi high\n");
break;
case MACREG_INT_CODE_SNR_HIGH:
- pr_alert("EVENT: snr high\n");
+ netdev_alert(priv->dev, "EVENT: snr high\n");
break;
case MACREG_INT_CODE_MESH_AUTO_STARTED:
/* Ignore spurious autostart events */
- pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
+ netdev_info(priv->dev, "EVENT: MESH_AUTO_STARTED (ignoring)\n");
break;
default:
- pr_alert("EVENT: unknown event id %d\n", event);
+ netdev_alert(priv->dev, "EVENT: unknown event id %d\n", event);
break;
}
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index c179094..f2f65bc 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1,5 +1,3 @@
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#include <linux/dcache.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
@@ -153,13 +151,14 @@ static ssize_t lbs_host_sleep_write(struct file *file,
ret = lbs_set_host_sleep(priv, 0);
else if (host_sleep == 1) {
if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
- pr_info("wake parameters not configured\n");
+ netdev_info(priv->dev,
+ "wake parameters not configured\n");
ret = -EINVAL;
goto out_unlock;
}
ret = lbs_set_host_sleep(priv, 1);
} else {
- pr_err("invalid option\n");
+ netdev_err(priv->dev, "invalid option\n");
ret = -EINVAL;
}
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index eb88d9a..d6f757e 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -363,7 +363,7 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
if (status & IF_CS_BIT_COMMAND)
break;
if (++loops > 100) {
- pr_err("card not ready for commands\n");
+ netdev_err(priv->dev, "card not ready for commands\n");
goto done;
}
mdelay(1);
@@ -433,14 +433,16 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
/* is hardware ready? */
status = if_cs_read16(priv->card, IF_CS_CARD_STATUS);
if ((status & IF_CS_BIT_RESP) == 0) {
- pr_err("no cmd response in card\n");
+ netdev_err(priv->dev, "no cmd response in card\n");
*len = 0;
goto out;
}
*len = if_cs_read16(priv->card, IF_CS_RESP_LEN);
if ((*len == 0) || (*len > LBS_CMD_BUFFER_SIZE)) {
- pr_err("card cmd buffer has invalid # of bytes (%d)\n", *len);
+ netdev_err(priv->dev,
+ "card cmd buffer has invalid # of bytes (%d)\n",
+ *len);
goto out;
}
@@ -474,7 +476,9 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
len = if_cs_read16(priv->card, IF_CS_READ_LEN);
if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
- pr_err("card data buffer has invalid # of bytes (%d)\n", len);
+ netdev_err(priv->dev,
+ "card data buffer has invalid # of bytes (%d)\n",
+ len);
priv->dev->stats.rx_dropped++;
goto dat_err;
}
@@ -752,7 +756,8 @@ static int if_cs_host_to_card(struct lbs_private *priv,
ret = if_cs_send_cmd(priv, buf, nb);
break;
default:
- pr_err("%s: unsupported type %d\n", __func__, type);
+ netdev_err(priv->dev, "%s: unsupported type %d\n",
+ __func__, type);
}
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index ab86779..a7b5cb0 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -851,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),
lbs_cmd_copyback, (unsigned long) &cmd);
if (ret)
- pr_err("DEEP_SLEEP cmd failed\n");
+ netdev_err(priv->dev, "DEEP_SLEEP cmd failed\n");
mdelay(200);
return ret;
@@ -867,7 +867,7 @@ static int if_sdio_exit_deep_sleep(struct lbs_private *priv)
sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret);
if (ret)
- pr_err("sdio_writeb failed!\n");
+ netdev_err(priv->dev, "sdio_writeb failed!\n");
sdio_release_host(card->func);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
@@ -884,7 +884,7 @@ static int if_sdio_reset_deep_sleep_wakeup(struct lbs_private *priv)
sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret);
if (ret)
- pr_err("sdio_writeb failed!\n");
+ netdev_err(priv->dev, "sdio_writeb failed!\n");
sdio_release_host(card->func);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
@@ -1103,7 +1103,7 @@ static int if_sdio_probe(struct sdio_func *func,
lbs_deb_sdio("send function INIT command\n");
if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
lbs_cmd_copyback, (unsigned long) &cmd))
- pr_alert("CMD_FUNC_INIT cmd failed\n");
+ netdev_alert(priv->dev, "CMD_FUNC_INIT cmd failed\n");
}
ret = lbs_start_card(priv);
@@ -1204,19 +1204,20 @@ static int if_sdio_suspend(struct device *dev)
mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
- pr_info("%s: suspend: PM flags = 0x%x\n", sdio_func_id(func), flags);
+ dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
+ sdio_func_id(func), flags);
/* If we aren't being asked to wake on anything, we should bail out
* and let the SD stack power down the card.
*/
if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) {
- pr_info("Suspend without wake params -- powering down card\n");
+ dev_info(dev, "Suspend without wake params -- powering down card\n");
return -ENOSYS;
}
if (!(flags & MMC_PM_KEEP_POWER)) {
- pr_err("%s: cannot remain alive while host is suspended\n",
- sdio_func_id(func));
+ dev_err(dev, "%s: cannot remain alive while host is suspended\n",
+ sdio_func_id(func));
return -ENOSYS;
}
@@ -1237,7 +1238,7 @@ static int if_sdio_resume(struct device *dev)
struct if_sdio_card *card = sdio_get_drvdata(func);
int ret;
- pr_info("%s: resume: we're back\n", sdio_func_id(func));
+ dev_info(dev, "%s: resume: we're back\n", sdio_func_id(func));
ret = lbs_resume(card->priv);
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index bebd9f0..30f21b1 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -559,6 +559,7 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card,
static int if_spi_prog_main_firmware(struct if_spi_card *card,
const struct firmware *firmware)
{
+ struct lbs_private *priv = card->priv;
int len, prev_len;
int bytes, crc_err = 0, err = 0;
const u8 *fw;
@@ -572,8 +573,9 @@ 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);
if (err) {
- pr_err("%s: timed out waiting for initial scratch reg = 0\n",
- __func__);
+ netdev_err(priv->dev,
+ "%s: timed out waiting for initial scratch reg = 0\n",
+ __func__);
goto out;
}
@@ -589,7 +591,8 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
if (bytes < 0) {
/* If there are no more bytes left, we would normally
* expect to have terminated with len = 0 */
- pr_err("Firmware load wants more bytes than we have to offer\n");
+ netdev_err(priv->dev,
+ "Firmware load wants more bytes than we have to offer\n");
break;
}
if (crc_err) {
@@ -674,12 +677,14 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
if (err)
goto out;
if (!len) {
- pr_err("%s: error: card has no data for host\n", __func__);
+ netdev_err(priv->dev, "%s: error: card has no data for host\n",
+ __func__);
err = -EINVAL;
goto out;
} else if (len > IF_SPI_CMD_BUF_SIZE) {
- pr_err("%s: error: response packet too large: %d bytes, but maximum is %d\n",
- __func__, len, IF_SPI_CMD_BUF_SIZE);
+ netdev_err(priv->dev,
+ "%s: error: response packet too large: %d bytes, but maximum is %d\n",
+ __func__, len, IF_SPI_CMD_BUF_SIZE);
err = -EINVAL;
goto out;
}
@@ -700,7 +705,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
out:
if (err)
- pr_err("%s: err=%d\n", __func__, err);
+ netdev_err(priv->dev, "%s: err=%d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI);
return err;
}
@@ -708,6 +713,7 @@ out:
/* Move data from the card to the host */
static int if_spi_c2h_data(struct if_spi_card *card)
{
+ struct lbs_private *priv = card->priv;
struct sk_buff *skb;
char *data;
u16 len;
@@ -720,12 +726,14 @@ static int if_spi_c2h_data(struct if_spi_card *card)
if (err)
goto out;
if (!len) {
- pr_err("%s: error: card has no data for host\n", __func__);
+ netdev_err(priv->dev, "%s: error: card has no data for host\n",
+ __func__);
err = -EINVAL;
goto out;
} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
- pr_err("%s: error: card has %d bytes of data, but our maximum skb size is %zu\n",
- __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
+ netdev_err(priv->dev,
+ "%s: error: card has %d bytes of data, but our maximum skb size is %zu\n",
+ __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
err = -EINVAL;
goto out;
}
@@ -756,7 +764,7 @@ free_skb:
dev_kfree_skb(skb);
out:
if (err)
- pr_err("%s: err=%d\n", __func__, err);
+ netdev_err(priv->dev, "%s: err=%d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI);
return err;
}
@@ -765,6 +773,7 @@ out:
static void if_spi_h2c(struct if_spi_card *card,
struct if_spi_packet *packet, int type)
{
+ struct lbs_private *priv = card->priv;
int err = 0;
u16 int_type, port_reg;
@@ -778,7 +787,8 @@ static void if_spi_h2c(struct if_spi_card *card,
port_reg = IF_SPI_CMD_RDWRPORT_REG;
break;
default:
- pr_err("can't transfer buffer of type %d\n", type);
+ netdev_err(priv->dev, "can't transfer buffer of type %d\n",
+ type);
err = -EINVAL;
goto out;
}
@@ -792,7 +802,7 @@ out:
kfree(packet);
if (err)
- pr_err("%s: error %d\n", __func__, err);
+ netdev_err(priv->dev, "%s: error %d\n", __func__, err);
}
/* Inform the host about a card event */
@@ -816,7 +826,7 @@ static void if_spi_e2h(struct if_spi_card *card)
lbs_queue_event(priv, cause & 0xff);
out:
if (err)
- pr_err("%s: error %d\n", __func__, err);
+ netdev_err(priv->dev, "%s: error %d\n", __func__, err);
}
static void if_spi_host_to_card_worker(struct work_struct *work)
@@ -826,8 +836,10 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
u16 hiStatus;
unsigned long flags;
struct if_spi_packet *packet;
+ struct lbs_private *priv;
card = container_of(work, struct if_spi_card, packet_work);
+ priv = card->priv;
lbs_deb_enter(LBS_DEB_SPI);
@@ -836,7 +848,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
err = spu_read_u16(card, IF_SPI_HOST_INT_STATUS_REG,
&hiStatus);
if (err) {
- pr_err("I/O error\n");
+ netdev_err(priv->dev, "I/O error\n");
goto err;
}
@@ -898,7 +910,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
err:
if (err)
- pr_err("%s: got error %d\n", __func__, err);
+ netdev_err(priv->dev, "%s: got error %d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI);
}
@@ -920,7 +932,8 @@ static int if_spi_host_to_card(struct lbs_private *priv,
lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb);
if (nb == 0) {
- pr_err("%s: invalid size requested: %d\n", __func__, nb);
+ netdev_err(priv->dev, "%s: invalid size requested: %d\n",
+ __func__, nb);
err = -EINVAL;
goto out;
}
@@ -948,7 +961,8 @@ static int if_spi_host_to_card(struct lbs_private *priv,
spin_unlock_irqrestore(&card->buffer_lock, flags);
break;
default:
- pr_err("can't transfer buffer of type %d\n", type);
+ netdev_err(priv->dev, "can't transfer buffer of type %d\n",
+ type);
err = -EINVAL;
break;
}
@@ -981,6 +995,7 @@ static irqreturn_t if_spi_host_interrupt(int irq, void *dev_id)
static int if_spi_init_card(struct if_spi_card *card)
{
+ struct lbs_private *priv = card->priv;
struct spi_device *spi = card->spi;
int err, i;
u32 scratch;
@@ -1009,7 +1024,8 @@ static int if_spi_init_card(struct if_spi_card *card)
break;
}
if (i == ARRAY_SIZE(fw_table)) {
- pr_err("Unsupported chip_id: 0x%02x\n", card->card_id);
+ netdev_err(priv->dev, "Unsupported chip_id: 0x%02x\n",
+ card->card_id);
err = -ENODEV;
goto out;
}
@@ -1018,7 +1034,8 @@ static int if_spi_init_card(struct if_spi_card *card)
card->card_id, &fw_table[0], &helper,
&mainfw);
if (err) {
- pr_err("failed to find firmware (%d)\n", err);
+ netdev_err(priv->dev, "failed to find firmware (%d)\n",
+ err);
goto out;
}
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 7260791..63e7e2c 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -198,7 +198,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
wake_method.hdr.size = cpu_to_le16(sizeof(wake_method));
wake_method.action = cpu_to_le16(CMD_ACT_GET);
if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) {
- pr_info("Firmware does not seem to support PS mode\n");
+ netdev_info(priv->dev, "Firmware does not seem to support PS mode\n");
priv->fwcapinfo &= ~FW_CAPINFO_PS;
} else {
if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) {
@@ -207,7 +207,8 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
/* The versions which boot up this way don't seem to
work even if we set it to the command interrupt */
priv->fwcapinfo &= ~FW_CAPINFO_PS;
- pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n");
+ netdev_info(priv->dev,
+ "Firmware doesn't wake via command interrupt; disabling PS mode\n");
}
}
}
@@ -343,10 +344,12 @@ static int if_usb_probe(struct usb_interface *intf,
usb_set_intfdata(intf, cardp);
if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_fw))
- pr_err("cannot register lbs_flash_fw attribute\n");
+ netdev_err(priv->dev,
+ "cannot register lbs_flash_fw attribute\n");
if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2))
- pr_err("cannot register lbs_flash_boot2 attribute\n");
+ netdev_err(priv->dev,
+ "cannot register lbs_flash_boot2 attribute\n");
/*
* EHS_REMOVE_WAKEUP is not supported on all versions of the firmware.
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 639461b..84ffafe 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -155,7 +155,7 @@ static void lbs_tx_timeout(struct net_device *dev)
lbs_deb_enter(LBS_DEB_TX);
- pr_err("tx watch dog timeout\n");
+ netdev_err(dev, "tx watch dog timeout\n");
dev->trans_start = jiffies; /* prevent tx timeout */
@@ -464,8 +464,8 @@ static int lbs_thread(void *data)
if (priv->cmd_timed_out && priv->cur_cmd) {
struct cmd_ctrl_node *cmdnode = priv->cur_cmd;
- pr_info("Timeout submitting command 0x%04x\n",
- le16_to_cpu(cmdnode->cmdbuf->command));
+ netdev_info(dev, "Timeout submitting command 0x%04x\n",
+ le16_to_cpu(cmdnode->cmdbuf->command));
lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
if (priv->reset_card)
priv->reset_card(priv);
@@ -492,7 +492,8 @@ static int lbs_thread(void *data)
* after firmware fixes it
*/
priv->psstate = PS_STATE_AWAKE;
- pr_alert("ignore PS_SleepConfirm in non-connected state\n");
+ netdev_alert(dev,
+ "ignore PS_SleepConfirm in non-connected state\n");
}
}
@@ -586,7 +587,8 @@ int lbs_suspend(struct lbs_private *priv)
if (priv->is_deep_sleep) {
ret = lbs_set_deep_sleep(priv, 0);
if (ret) {
- pr_err("deep sleep cancellation failed: %d\n", ret);
+ netdev_err(priv->dev,
+ "deep sleep cancellation failed: %d\n", ret);
return ret;
}
priv->deep_sleep_required = 1;
@@ -619,7 +621,8 @@ int lbs_resume(struct lbs_private *priv)
priv->deep_sleep_required = 0;
ret = lbs_set_deep_sleep(priv, 1);
if (ret)
- pr_err("deep sleep activation failed: %d\n", ret);
+ netdev_err(priv->dev,
+ "deep sleep activation failed: %d\n", ret);
}
if (priv->setup_fw_on_resume)
@@ -645,8 +648,8 @@ static void lbs_cmd_timeout_handler(unsigned long data)
if (!priv->cur_cmd)
goto out;
- pr_info("command 0x%04x timed out\n",
- le16_to_cpu(priv->cur_cmd->cmdbuf->command));
+ netdev_info(priv->dev, "command 0x%04x timed out\n",
+ le16_to_cpu(priv->cur_cmd->cmdbuf->command));
priv->cmd_timed_out = 1;
wake_up_interruptible(&priv->waitq);
@@ -961,7 +964,7 @@ int lbs_start_card(struct lbs_private *priv)
lbs_debugfs_init_one(priv, dev);
- pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name);
+ netdev_info(dev, "Marvell WLAN 802.11 adapter\n");
ret = 0;
@@ -1088,14 +1091,16 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
if (user_helper) {
ret = request_firmware(helper, user_helper, dev);
if (ret) {
- pr_err("couldn't find helper firmware %s", user_helper);
+ dev_err(dev, "couldn't find helper firmware %s\n",
+ user_helper);
goto fail;
}
}
if (user_mainfw) {
ret = request_firmware(mainfw, user_mainfw, dev);
if (ret) {
- pr_err("couldn't find main firmware %s", user_mainfw);
+ dev_err(dev, "couldn't find main firmware %s\n",
+ user_mainfw);
goto fail;
}
}
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index f7c51cb..f4c4f1c 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -248,7 +248,7 @@ int lbs_init_mesh(struct lbs_private *priv)
lbs_add_mesh(priv);
if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
- pr_err("cannot register lbs_mesh attribute\n");
+ netdev_err(dev, "cannot register lbs_mesh attribute\n");
ret = 1;
}
@@ -928,7 +928,7 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
return ret;
if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) {
- pr_err("inconsistent mesh ID length\n");
+ dev_err(dev, "inconsistent mesh ID length\n");
defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;
}
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index fd045aa..f2ef0ae 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -251,7 +251,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
/* add space for the new radio header */
if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) {
- pr_alert("%s: couldn't pskb_expand_head\n", __func__);
+ netdev_alert(dev, "%s: couldn't pskb_expand_head\n", __func__);
ret = -ENOMEM;
kfree_skb(skb);
goto done;
--
1.7.5.rc3.dirty
^ permalink raw reply related
* [PATCH 1/2] libertas: Convert lbs_pr_<level> to pr_<level>
From: Joe Perches @ 2011-05-02 23:49 UTC (permalink / raw)
To: Dan Williams
Cc: John W. Linville, libertas-dev, linux-wireless, netdev,
linux-kernel
In-Reply-To: <cover.1304379925.git.joe@perches.com>
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>
---
drivers/net/wireless/libertas/cfg.c | 15 +++---
drivers/net/wireless/libertas/cmd.c | 36 +++++++-------
drivers/net/wireless/libertas/cmdresp.c | 29 +++++++-----
drivers/net/wireless/libertas/debugfs.c | 6 ++-
drivers/net/wireless/libertas/defs.h | 7 ---
drivers/net/wireless/libertas/if_cs.c | 52 +++++++++++----------
drivers/net/wireless/libertas/if_sdio.c | 38 ++++++++--------
drivers/net/wireless/libertas/if_spi.c | 74 ++++++++++++++-----------------
drivers/net/wireless/libertas/if_usb.c | 41 +++++++++--------
drivers/net/wireless/libertas/main.c | 33 +++++++-------
drivers/net/wireless/libertas/mesh.c | 8 ++-
drivers/net/wireless/libertas/rx.c | 7 ++-
12 files changed, 174 insertions(+), 172 deletions(-)
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 5caa2ac..d6e0656 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -6,6 +6,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/slab.h>
@@ -1314,8 +1316,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
sme->ssid, sme->ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!bss) {
- lbs_pr_err("assoc: bss %pM not in scan results\n",
- sme->bssid);
+ pr_err("assoc: bss %pM not in scan results\n", sme->bssid);
ret = -ENOENT;
goto done;
}
@@ -1372,8 +1373,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
break;
default:
- lbs_pr_err("unsupported cipher group 0x%x\n",
- sme->crypto.cipher_group);
+ pr_err("unsupported cipher group 0x%x\n",
+ sme->crypto.cipher_group);
ret = -ENOTSUPP;
goto done;
}
@@ -1491,7 +1492,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
params->key, params->key_len);
break;
default:
- lbs_pr_err("unhandled cipher 0x%x\n", params->cipher);
+ pr_err("unhandled cipher 0x%x\n", params->cipher);
ret = -ENOTSUPP;
break;
}
@@ -2118,13 +2119,13 @@ int lbs_cfg_register(struct lbs_private *priv)
ret = wiphy_register(wdev->wiphy);
if (ret < 0)
- lbs_pr_err("cannot register wiphy device\n");
+ pr_err("cannot register wiphy device\n");
priv->wiphy_registered = true;
ret = register_netdev(priv->dev);
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);
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 7e8a658..10ca485 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -3,6 +3,8 @@
* 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/sched.h>
#include <linux/slab.h>
@@ -108,7 +110,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
* CF card firmware 5.0.16p0: 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,
priv->fwrelease >> 24 & 0xff,
priv->fwrelease >> 16 & 0xff,
@@ -139,7 +141,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
/* if it's unidentified region code, use the default (USA) */
if (i >= MRVDRV_MAX_REGION_CODE) {
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)
@@ -209,7 +211,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
(uint8_t *)&cmd_config.wol_conf,
sizeof(struct wol_config));
} else {
- lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret);
+ pr_info("HOST_SLEEP_CFG failed %d\n", ret);
}
return ret;
@@ -312,7 +314,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
if (priv->is_deep_sleep) {
if (!wait_event_interruptible_timeout(priv->ds_awake_q,
!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;
}
}
@@ -337,7 +339,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
netif_carrier_off(priv->dev);
}
} else {
- lbs_pr_err("deep sleep: already enabled\n");
+ pr_err("deep sleep: already enabled\n");
}
} else {
if (priv->is_deep_sleep) {
@@ -347,8 +349,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
if (!ret) {
ret = lbs_wait_for_ds_awake(priv);
if (ret)
- lbs_pr_err("deep sleep: wakeup"
- "failed\n");
+ pr_err("deep sleep: wakeup failed\n");
}
}
}
@@ -382,8 +383,8 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
(struct wol_config *)NULL);
if (ret) {
- lbs_pr_info("Host sleep configuration failed: "
- "%d\n", ret);
+ pr_info("Host sleep configuration failed: %d\n",
+ ret);
return ret;
}
if (priv->psstate == PS_STATE_FULL_POWER) {
@@ -393,19 +394,19 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
sizeof(cmd),
lbs_ret_host_sleep_activate, 0);
if (ret)
- lbs_pr_info("HOST_SLEEP_ACTIVATE "
- "failed: %d\n", ret);
+ pr_info("HOST_SLEEP_ACTIVATE failed: %d\n",
+ ret);
}
if (!wait_event_interruptible_timeout(
priv->host_sleep_q,
priv->is_host_sleep_activated,
(10 * HZ))) {
- lbs_pr_err("host_sleep_q: timer expired\n");
+ pr_err("host_sleep_q: timer expired\n");
ret = -1;
}
} else {
- lbs_pr_err("host sleep: already enabled\n");
+ pr_err("host sleep: already enabled\n");
}
} else {
if (priv->is_host_sleep_activated)
@@ -1002,7 +1003,7 @@ static void lbs_submit_command(struct lbs_private *priv,
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);
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
the whole thing if the condition persists */
timeo = HZ/4;
@@ -1267,7 +1268,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
spin_lock_irqsave(&priv->driver_lock, flags);
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);
ret = -1;
goto done;
@@ -1429,7 +1430,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
sizeof(confirm_sleep));
if (ret) {
- lbs_pr_alert("confirm_sleep failed\n");
+ pr_alert("confirm_sleep failed\n");
goto out;
}
@@ -1655,8 +1656,7 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
spin_lock_irqsave(&priv->driver_lock, flags);
ret = cmdnode->result;
if (ret)
- lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n",
- command, ret);
+ pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);
__lbs_cleanup_and_insert_cmd(priv, cmdnode);
spin_unlock_irqrestore(&priv->driver_lock, flags);
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 5e95da9..2cb6f5f 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -2,6 +2,9 @@
* This file contains the handling of command
* responses as well as events generated by firmware.
*/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/sched.h>
@@ -84,15 +87,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);
if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
- lbs_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));
+ 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));
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
}
if (respcmd != CMD_RET(curcmd) &&
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);
ret = -1;
goto done;
@@ -101,8 +106,8 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
if (resp->result == cpu_to_le16(0x0004)) {
/* 0x0004 means -EAGAIN. Drop the response, let it time out
and be resubmitted */
- lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
- le16_to_cpu(resp->command));
+ pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
+ le16_to_cpu(resp->command));
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
@@ -313,28 +318,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
break;
case MACREG_INT_CODE_RSSI_LOW:
- lbs_pr_alert("EVENT: rssi low\n");
+ pr_alert("EVENT: rssi low\n");
break;
case MACREG_INT_CODE_SNR_LOW:
- lbs_pr_alert("EVENT: snr low\n");
+ pr_alert("EVENT: snr low\n");
break;
case MACREG_INT_CODE_MAX_FAIL:
- lbs_pr_alert("EVENT: max fail\n");
+ pr_alert("EVENT: max fail\n");
break;
case MACREG_INT_CODE_RSSI_HIGH:
- lbs_pr_alert("EVENT: rssi high\n");
+ pr_alert("EVENT: rssi high\n");
break;
case MACREG_INT_CODE_SNR_HIGH:
- lbs_pr_alert("EVENT: snr high\n");
+ pr_alert("EVENT: snr high\n");
break;
case MACREG_INT_CODE_MESH_AUTO_STARTED:
/* Ignore spurious autostart events */
- lbs_pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
+ pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
break;
default:
- lbs_pr_alert("EVENT: unknown event id %d\n", event);
+ pr_alert("EVENT: unknown event id %d\n", event);
break;
}
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index fbf3b033..c179094 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/dcache.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
@@ -151,13 +153,13 @@ static ssize_t lbs_host_sleep_write(struct file *file,
ret = lbs_set_host_sleep(priv, 0);
else if (host_sleep == 1) {
if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
- lbs_pr_info("wake parameters not configured");
+ pr_info("wake parameters not configured\n");
ret = -EINVAL;
goto out_unlock;
}
ret = lbs_set_host_sleep(priv, 1);
} else {
- lbs_pr_err("invalid option\n");
+ pr_err("invalid option\n");
ret = -EINVAL;
}
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index d00c728..c9b89b0 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)) \
#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_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
static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
{
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 8712cb2..eb88d9a 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -21,6 +21,8 @@
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/delay.h>
@@ -361,7 +363,7 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
if (status & IF_CS_BIT_COMMAND)
break;
if (++loops > 100) {
- lbs_pr_err("card not ready for commands\n");
+ pr_err("card not ready for commands\n");
goto done;
}
mdelay(1);
@@ -431,14 +433,14 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
/* is hardware ready? */
status = if_cs_read16(priv->card, IF_CS_CARD_STATUS);
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;
goto out;
}
*len = if_cs_read16(priv->card, IF_CS_RESP_LEN);
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;
}
@@ -472,7 +474,7 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
len = if_cs_read16(priv->card, IF_CS_READ_LEN);
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++;
goto dat_err;
}
@@ -644,8 +646,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,
IF_CS_BIT_COMMAND);
if (ret < 0) {
- lbs_pr_err("can't download helper at 0x%x, ret %d\n",
- sent, ret);
+ pr_err("can't download helper at 0x%x, ret %d\n",
+ sent, ret);
goto done;
}
@@ -675,7 +677,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,
IF_CS_SQ_HELPER_OK);
if (ret < 0) {
- lbs_pr_err("helper firmware doesn't answer\n");
+ pr_err("helper firmware doesn't answer\n");
goto done;
}
@@ -683,13 +685,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);
if (len & 1) {
retry++;
- lbs_pr_info("odd, need to retry this firmware block\n");
+ pr_info("odd, need to retry this firmware block\n");
} else {
retry = 0;
}
if (retry > 20) {
- lbs_pr_err("could not download firmware\n");
+ pr_err("could not download firmware\n");
ret = -ENODEV;
goto done;
}
@@ -709,14 +711,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,
IF_CS_BIT_COMMAND);
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;
}
}
ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a);
if (ret < 0)
- lbs_pr_err("firmware download failed\n");
+ pr_err("firmware download failed\n");
done:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
@@ -750,7 +752,7 @@ static int if_cs_host_to_card(struct lbs_private *priv,
ret = if_cs_send_cmd(priv, buf, nb);
break;
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);
@@ -779,7 +781,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
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;
}
@@ -800,7 +802,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
if (!card) {
- lbs_pr_err("error in kzalloc\n");
+ pr_err("error in kzalloc\n");
goto out;
}
card->p_dev = p_dev;
@@ -809,7 +811,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
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;
}
@@ -825,14 +827,14 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card->iobase = ioport_map(p_dev->resource[0]->start,
resource_size(p_dev->resource[0]));
if (!card->iobase) {
- lbs_pr_err("error in ioport_map\n");
+ pr_err("error in ioport_map\n");
ret = -EIO;
goto out1;
}
ret = pcmcia_enable_device(p_dev);
if (ret) {
- lbs_pr_err("error in pcmcia_enable_device\n");
+ pr_err("error in pcmcia_enable_device\n");
goto out2;
}
@@ -847,8 +849,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card->model = get_model(p_dev->manf_id, p_dev->card_id);
if (card->model == MODEL_UNKNOWN) {
- lbs_pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
- p_dev->manf_id, p_dev->card_id);
+ pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
+ p_dev->manf_id, p_dev->card_id);
goto out2;
}
@@ -857,20 +859,20 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
if (card->model == MODEL_8305) {
card->align_regs = 1;
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;
goto out2;
}
}
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;
goto out2;
}
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;
goto out2;
}
@@ -878,7 +880,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
ret = lbs_get_firmware(&p_dev->dev, NULL, NULL, card->model,
&fw_table[0], &helper, &mainfw);
if (ret) {
- lbs_pr_err("failed to find firmware (%d)\n", ret);
+ pr_err("failed to find firmware (%d)\n", ret);
goto out2;
}
@@ -909,7 +911,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
ret = request_irq(p_dev->irq, if_cs_interrupt,
IRQF_SHARED, DRV_NAME, card);
if (ret) {
- lbs_pr_err("error in request_irq\n");
+ pr_err("error in request_irq\n");
goto out3;
}
@@ -920,7 +922,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
/* And finally bring the card up */
if (lbs_start_card(priv) != 0) {
- lbs_pr_err("could not activate card\n");
+ pr_err("could not activate card\n");
goto out3;
}
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index b4de0ca..ab86779 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -26,6 +26,8 @@
* if_sdio_card_to_host() to pad the data.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
@@ -409,7 +411,7 @@ static int if_sdio_card_to_host(struct if_sdio_card *card)
out:
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);
@@ -446,7 +448,7 @@ static void if_sdio_host_to_card_worker(struct work_struct *work)
}
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);
@@ -555,7 +557,7 @@ release:
out:
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);
return ret;
@@ -669,7 +671,7 @@ release:
out:
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);
return ret;
@@ -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,
card->model, &fw_table[0], &helper, &mainfw);
if (ret) {
- lbs_pr_err("failed to find firmware (%d)\n", ret);
+ pr_err("failed to find firmware (%d)\n", ret);
goto out;
}
@@ -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),
lbs_cmd_copyback, (unsigned long) &cmd);
if (ret)
- lbs_pr_err("DEEP_SLEEP cmd failed\n");
+ pr_err("DEEP_SLEEP cmd failed\n");
mdelay(200);
return ret;
@@ -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);
if (ret)
- lbs_pr_err("sdio_writeb failed!\n");
+ pr_err("sdio_writeb failed!\n");
sdio_release_host(card->func);
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)
sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret);
if (ret)
- lbs_pr_err("sdio_writeb failed!\n");
+ pr_err("sdio_writeb failed!\n");
sdio_release_host(card->func);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
@@ -961,7 +963,7 @@ static int if_sdio_probe(struct sdio_func *func,
}
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;
}
@@ -995,7 +997,7 @@ static int if_sdio_probe(struct sdio_func *func,
break;
}
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;
goto free;
}
@@ -1101,7 +1103,7 @@ static int if_sdio_probe(struct sdio_func *func,
lbs_deb_sdio("send function INIT command\n");
if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(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);
@@ -1163,7 +1165,7 @@ static void if_sdio_remove(struct sdio_func *func)
if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN,
&cmd, sizeof(cmd), lbs_cmd_copyback,
(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)
mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
- lbs_pr_info("%s: suspend: PM flags = 0x%x\n",
- sdio_func_id(func), flags);
+ pr_info("%s: suspend: PM flags = 0x%x\n", sdio_func_id(func), flags);
/* If we aren't being asked to wake on anything, we should bail out
* and let the SD stack power down the card.
*/
if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) {
- lbs_pr_info("Suspend without wake params -- "
- "powering down card.");
+ pr_info("Suspend without wake params -- powering down card\n");
return -ENOSYS;
}
if (!(flags & MMC_PM_KEEP_POWER)) {
- lbs_pr_err("%s: cannot remain alive while host is suspended\n",
- sdio_func_id(func));
+ pr_err("%s: cannot remain alive while host is suspended\n",
+ sdio_func_id(func));
return -ENOSYS;
}
@@ -1237,7 +1237,7 @@ static int if_sdio_resume(struct device *dev)
struct if_sdio_card *card = sdio_get_drvdata(func);
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);
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 078ef43..bebd9f0 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -17,6 +17,8 @@
* (at your option) any later version.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/moduleparam.h>
#include <linux/firmware.h>
#include <linux/jiffies.h>
@@ -297,8 +299,7 @@ static int spu_wait_for_u16(struct if_spi_card *card, u16 reg,
}
udelay(100);
if (time_after(jiffies, timeout)) {
- lbs_pr_err("%s: timeout with val=%02x, "
- "target_mask=%02x, target=%02x\n",
+ pr_err("%s: timeout with val=%02x, target_mask=%02x, target=%02x\n",
__func__, val, target_mask, target);
return -ETIMEDOUT;
}
@@ -391,7 +392,7 @@ static int spu_set_bus_mode(struct if_spi_card *card, u16 mode)
if (err)
return err;
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 0;
@@ -512,7 +513,7 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card,
out:
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);
return err;
}
@@ -531,7 +532,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 (err) {
- lbs_pr_err("timed out waiting for host_int_status\n");
+ pr_err("timed out waiting for host_int_status\n");
return err;
}
@@ -541,9 +542,8 @@ static int if_spi_prog_main_firmware_check_len(struct if_spi_card *card,
return err;
if (len > IF_SPI_CMD_BUF_SIZE) {
- lbs_pr_err("firmware load device requested a larger "
- "tranfer than we are prepared to "
- "handle. (len = %d)\n", len);
+ pr_err("firmware load device requested a larger transfer than we are prepared to handle (len = %d)\n",
+ len);
return -EIO;
}
if (len & 0x1) {
@@ -572,8 +572,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);
if (err) {
- lbs_pr_err("%s: timed out waiting for initial "
- "scratch reg = 0\n", __func__);
+ pr_err("%s: timed out waiting for initial scratch reg = 0\n",
+ __func__);
goto out;
}
@@ -589,15 +589,13 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
if (bytes < 0) {
/* If there are no more bytes left, we would normally
* expect to have terminated with len = 0 */
- lbs_pr_err("Firmware load wants more bytes "
- "than we have to offer.\n");
+ pr_err("Firmware load wants more bytes than we have to offer\n");
break;
}
if (crc_err) {
/* Previous transfer failed. */
if (++num_crc_errs > MAX_MAIN_FW_LOAD_CRC_ERR) {
- lbs_pr_err("Too many CRC errors encountered "
- "in firmware load.\n");
+ pr_err("Too many CRC errors encountered in firmware load\n");
err = -EIO;
goto out;
}
@@ -626,21 +624,20 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
prev_len = len;
}
if (bytes > prev_len) {
- lbs_pr_err("firmware load wants fewer bytes than "
- "we have to offer.\n");
+ pr_err("firmware load wants fewer bytes than we have to offer\n");
}
/* Confirm firmware download */
err = spu_wait_for_u32(card, IF_SPI_SCRATCH_4_REG,
SUCCESSFUL_FW_DOWNLOAD_MAGIC);
if (err) {
- lbs_pr_err("failed to confirm the firmware download\n");
+ pr_err("failed to confirm the firmware download\n");
goto out;
}
out:
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);
return err;
}
@@ -677,14 +674,12 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
if (err)
goto out;
if (!len) {
- lbs_pr_err("%s: error: card has no data for host\n",
- __func__);
+ pr_err("%s: error: card has no data for host\n", __func__);
err = -EINVAL;
goto out;
} else if (len > IF_SPI_CMD_BUF_SIZE) {
- lbs_pr_err("%s: error: response packet too large: "
- "%d bytes, but maximum is %d\n",
- __func__, len, IF_SPI_CMD_BUF_SIZE);
+ pr_err("%s: error: response packet too large: %d bytes, but maximum is %d\n",
+ __func__, len, IF_SPI_CMD_BUF_SIZE);
err = -EINVAL;
goto out;
}
@@ -705,7 +700,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
out:
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);
return err;
}
@@ -725,14 +720,12 @@ static int if_spi_c2h_data(struct if_spi_card *card)
if (err)
goto out;
if (!len) {
- lbs_pr_err("%s: error: card has no data for host\n",
- __func__);
+ pr_err("%s: error: card has no data for host\n", __func__);
err = -EINVAL;
goto out;
} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
- lbs_pr_err("%s: error: card has %d bytes of data, but "
- "our maximum skb size is %zu\n",
- __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
+ pr_err("%s: error: card has %d bytes of data, but our maximum skb size is %zu\n",
+ __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
err = -EINVAL;
goto out;
}
@@ -763,7 +756,7 @@ free_skb:
dev_kfree_skb(skb);
out:
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);
return err;
}
@@ -785,7 +778,7 @@ static void if_spi_h2c(struct if_spi_card *card,
port_reg = IF_SPI_CMD_RDWRPORT_REG;
break;
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;
goto out;
}
@@ -799,7 +792,7 @@ out:
kfree(packet);
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 */
@@ -823,7 +816,7 @@ static void if_spi_e2h(struct if_spi_card *card)
lbs_queue_event(priv, cause & 0xff);
out:
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)
@@ -843,7 +836,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
err = spu_read_u16(card, IF_SPI_HOST_INT_STATUS_REG,
&hiStatus);
if (err) {
- lbs_pr_err("I/O error\n");
+ pr_err("I/O error\n");
goto err;
}
@@ -905,7 +898,7 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
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);
}
@@ -927,7 +920,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);
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;
goto out;
}
@@ -955,7 +948,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
spin_unlock_irqrestore(&card->buffer_lock, flags);
break;
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;
break;
}
@@ -1016,8 +1009,7 @@ static int if_spi_init_card(struct if_spi_card *card)
break;
}
if (i == ARRAY_SIZE(fw_table)) {
- lbs_pr_err("Unsupported chip_id: 0x%02x\n",
- card->card_id);
+ pr_err("Unsupported chip_id: 0x%02x\n", card->card_id);
err = -ENODEV;
goto out;
}
@@ -1026,7 +1018,7 @@ static int if_spi_init_card(struct if_spi_card *card)
card->card_id, &fw_table[0], &helper,
&mainfw);
if (err) {
- lbs_pr_err("failed to find firmware (%d)\n", err);
+ pr_err("failed to find firmware (%d)\n", err);
goto out;
}
@@ -1149,7 +1141,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
err = request_irq(spi->irq, if_spi_host_interrupt,
IRQF_TRIGGER_FALLING, "libertas_spi", card);
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;
}
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 6524c70..7260791 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -1,6 +1,9 @@
/**
* This file contains functions used in USB interface module.
*/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/delay.h>
#include <linux/moduleparam.h>
#include <linux/firmware.h>
@@ -145,7 +148,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
lbs_host_to_card_done(priv);
} else {
/* 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);
}
}
@@ -195,7 +198,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
wake_method.hdr.size = cpu_to_le16(sizeof(wake_method));
wake_method.action = cpu_to_le16(CMD_ACT_GET);
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;
} else {
if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) {
@@ -204,7 +207,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
/* The versions which boot up this way don't seem to
work even if we set it to the command interrupt */
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");
}
}
}
@@ -216,7 +219,7 @@ static void if_usb_fw_timeo(unsigned long priv)
if (cardp->fwdnldover) {
lbs_deb_usb("Download complete, no event. Assuming success\n");
} else {
- lbs_pr_err("Download timed out\n");
+ pr_err("Download timed out\n");
cardp->surprise_removed = 1;
}
wake_up(&cardp->fw_wq);
@@ -250,7 +253,7 @@ static int if_usb_probe(struct usb_interface *intf,
cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
if (!cardp) {
- lbs_pr_err("Out of memory allocating private data.\n");
+ pr_err("Out of memory allocating private data\n");
goto error;
}
@@ -340,10 +343,10 @@ static int if_usb_probe(struct usb_interface *intf,
usb_set_intfdata(intf, cardp);
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))
- 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.
@@ -528,7 +531,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
int ret = -1;
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;
}
@@ -587,7 +590,7 @@ static void if_usb_receive_fwload(struct urb *urb)
if (tmp[0] == cpu_to_le32(CMD_TYPE_INDICATION) &&
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);
} else {
lbs_deb_usb("Waiting for confirmation; got %x %x\n",
@@ -614,20 +617,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_INDICATION)) {
if (!cardp->bootcmdresp)
- lbs_pr_info("Firmware already seems alive; resetting\n");
+ pr_info("Firmware already seems alive; resetting\n");
cardp->bootcmdresp = -1;
} 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));
}
} else if ((bootcmdresp.cmd != BOOT_CMD_FW_BY_USB) &&
(bootcmdresp.cmd != BOOT_CMD_UPDATE_FW) &&
(bootcmdresp.cmd != BOOT_CMD_UPDATE_BOOT2)) {
- lbs_pr_info("boot cmd response cmd_tag error (%d)\n",
- bootcmdresp.cmd);
+ pr_info("boot cmd response cmd_tag error (%d)\n",
+ bootcmdresp.cmd);
} else if (bootcmdresp.result != BOOT_CMD_RESP_OK) {
- lbs_pr_info("boot cmd response result error (%d)\n",
- bootcmdresp.result);
+ pr_info("boot cmd response result error (%d)\n",
+ bootcmdresp.result);
} else {
cardp->bootcmdresp = 1;
lbs_deb_usbd(&cardp->udev->dev,
@@ -892,7 +895,7 @@ static int check_fwfile_format(const uint8_t *data, uint32_t totlen)
} while (!exit);
if (ret)
- lbs_pr_err("firmware file format check FAIL\n");
+ pr_err("firmware file format check FAIL\n");
else
lbs_deb_fw("firmware file format check PASS\n");
@@ -989,7 +992,7 @@ static int __if_usb_prog_firmware(struct if_usb_card *cardp,
ret = get_fw(cardp, fwname);
if (ret) {
- lbs_pr_err("failed to find firmware (%d)\n", ret);
+ pr_err("failed to find firmware (%d)\n", ret);
goto done;
}
@@ -1064,13 +1067,13 @@ restart:
usb_kill_urb(cardp->rx_urb);
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_usb_reset_device(cardp);
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;
goto release_fw;
}
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index ca8149c..639461b 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -4,6 +4,8 @@
* thread etc..
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/moduleparam.h>
#include <linux/delay.h>
#include <linux/etherdevice.h>
@@ -153,7 +155,7 @@ static void lbs_tx_timeout(struct net_device *dev)
lbs_deb_enter(LBS_DEB_TX);
- lbs_pr_err("tx watch dog timeout\n");
+ pr_err("tx watch dog timeout\n");
dev->trans_start = jiffies; /* prevent tx timeout */
@@ -462,7 +464,7 @@ static int lbs_thread(void *data)
if (priv->cmd_timed_out && 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));
lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
if (priv->reset_card)
@@ -490,8 +492,7 @@ static int lbs_thread(void *data)
* after firmware fixes it
*/
priv->psstate = PS_STATE_AWAKE;
- lbs_pr_alert("ignore PS_SleepConfirm in "
- "non-connected state\n");
+ pr_alert("ignore PS_SleepConfirm in non-connected state\n");
}
}
@@ -585,7 +586,7 @@ int lbs_suspend(struct lbs_private *priv)
if (priv->is_deep_sleep) {
ret = lbs_set_deep_sleep(priv, 0);
if (ret) {
- lbs_pr_err("deep sleep cancellation failed: %d\n", ret);
+ pr_err("deep sleep cancellation failed: %d\n", ret);
return ret;
}
priv->deep_sleep_required = 1;
@@ -618,7 +619,7 @@ int lbs_resume(struct lbs_private *priv)
priv->deep_sleep_required = 0;
ret = lbs_set_deep_sleep(priv, 1);
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)
@@ -644,7 +645,7 @@ static void lbs_cmd_timeout_handler(unsigned long data)
if (!priv->cur_cmd)
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));
priv->cmd_timed_out = 1;
@@ -748,7 +749,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
/* Allocate the command buffers */
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;
goto out;
}
@@ -758,7 +759,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
/* Create the event FIFO */
ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL);
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;
}
@@ -809,7 +810,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
/* Allocate an Ethernet device and register it */
wdev = lbs_cfg_alloc(dmdev);
if (IS_ERR(wdev)) {
- lbs_pr_err("cfg80211 init failed\n");
+ pr_err("cfg80211 init failed\n");
goto done;
}
@@ -818,7 +819,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
priv->wdev = wdev;
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;
}
@@ -950,7 +951,7 @@ int lbs_start_card(struct lbs_private *priv)
goto done;
if (lbs_cfg_register(priv)) {
- lbs_pr_err("cannot register device\n");
+ pr_err("cannot register device\n");
goto done;
}
@@ -960,7 +961,7 @@ int lbs_start_card(struct lbs_private *priv)
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;
@@ -1087,16 +1088,14 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
if (user_helper) {
ret = request_firmware(helper, user_helper, dev);
if (ret) {
- lbs_pr_err("couldn't find helper firmware %s",
- user_helper);
+ pr_err("couldn't find helper firmware %s", user_helper);
goto fail;
}
}
if (user_mainfw) {
ret = request_firmware(mainfw, user_mainfw, dev);
if (ret) {
- lbs_pr_err("couldn't find main firmware %s",
- user_mainfw);
+ pr_err("couldn't find main firmware %s", user_mainfw);
goto fail;
}
}
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index 9d097b9..f7c51cb 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/delay.h>
#include <linux/etherdevice.h>
#include <linux/netdevice.h>
@@ -246,7 +248,7 @@ int lbs_init_mesh(struct lbs_private *priv)
lbs_add_mesh(priv);
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;
}
@@ -374,7 +376,7 @@ int lbs_add_mesh(struct lbs_private *priv)
/* Register virtual mesh interface */
ret = register_netdev(mesh_dev);
if (ret) {
- lbs_pr_err("cannot register mshX virtual interface\n");
+ pr_err("cannot register mshX virtual interface\n");
goto err_free;
}
@@ -926,7 +928,7 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
return ret;
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;
}
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index a2b1df2..fd045aa 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -1,6 +1,9 @@
/**
* This file contains the handling of RX in wlan driver.
*/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <linux/types.h>
@@ -191,7 +194,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
case 12: /* 54 Mbps */
return 108;
}
- lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate);
+ pr_alert("Invalid Marvell WLAN rate %i\n", rate);
return 0;
}
@@ -248,7 +251,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
/* add space for the new radio header */
if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
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;
kfree_skb(skb);
goto done;
--
1.7.5.rc3.dirty
^ permalink raw reply related
* [PATCH 0/2] libertas: cleanup logging styles
From: Joe Perches @ 2011-05-02 23:49 UTC (permalink / raw)
To: Dan Williams, libertas-dev
Cc: John W. Linville, linux-wireless, netdev, linux-kernel
Joe Perches (2):
libertas: Convert lbs_pr_<level> to pr_<level>
libertas: Use netdev_<level> or dev_<level> where possible
Compiled but otherwise untested.
drivers/net/wireless/libertas/cfg.c | 16 +++---
drivers/net/wireless/libertas/cmd.c | 40 +++++++++------
drivers/net/wireless/libertas/cmdresp.c | 27 ++++++----
drivers/net/wireless/libertas/debugfs.c | 5 +-
drivers/net/wireless/libertas/defs.h | 7 ---
drivers/net/wireless/libertas/if_cs.c | 57 ++++++++++++---------
drivers/net/wireless/libertas/if_sdio.c | 37 +++++++-------
drivers/net/wireless/libertas/if_spi.c | 83 +++++++++++++++++--------------
drivers/net/wireless/libertas/if_usb.c | 44 +++++++++-------
drivers/net/wireless/libertas/main.c | 42 +++++++++-------
drivers/net/wireless/libertas/mesh.c | 8 ++-
drivers/net/wireless/libertas/rx.c | 7 ++-
12 files changed, 206 insertions(+), 167 deletions(-)
--
1.7.5.rc3.dirty
^ permalink raw reply
* [ethtool PATCH] FW dump support
From: anirban.chakraborty @ 2011-05-02 23:29 UTC (permalink / raw)
To: netdev; +Cc: --no-chain-reply-to, bhutchings, davem, Anirban Chakraborty
From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Added support to take FW dump via ethtool.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
ethtool-copy.h | 17 ++++++++-
ethtool.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 127 insertions(+), 3 deletions(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 5b45442..0c0e847 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -76,6 +76,19 @@ struct ethtool_drvinfo {
__u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
};
+/* dump struct
+ * cmd: commnad to identify type of operation
+ * flag: specify dump related options
+ * len: length of dumped data
+ * data: dump data
+ */
+struct ethtool_dump {
+ __u32 cmd;
+ __u32 flag;
+ __u32 len;
+ __u8 data[0];
+};
+
#define SOPASS_MAX 6
/* wake-on-lan settings */
struct ethtool_wolinfo {
@@ -538,7 +551,6 @@ struct ethtool_flash {
char data[ETHTOOL_FLASH_MAX_FILENAME];
};
-
/* CMDs currently supported */
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
#define ETHTOOL_SSET 0x00000002 /* Set settings. */
@@ -599,6 +611,9 @@ struct ethtool_flash {
#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
+#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
+#define ETHTOOL_GET_DUMP 0x0000003f /* Get dump settings */
+#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/ethtool.c b/ethtool.c
index cfdac65..1a826ae 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
+#include <stddef.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@@ -110,6 +111,9 @@ static int do_srxntuple(int fd, struct ifreq *ifr);
static int do_grxntuple(int fd, struct ifreq *ifr);
static int do_flash(int fd, struct ifreq *ifr);
static int do_permaddr(int fd, struct ifreq *ifr);
+static int do_getdump(int fd, struct ifreq *ifr);
+static int do_getdumpdata(int fd, struct ifreq *ifr);
+static int do_setdump(int fd, struct ifreq *ifr);
static int send_ioctl(int fd, struct ifreq *ifr);
@@ -142,6 +146,9 @@ static enum {
MODE_GNTUPLE,
MODE_FLASHDEV,
MODE_PERMADDR,
+ MODE_SET_DUMP,
+ MODE_GET_DUMP,
+ MODE_GET_DUMP_DATA,
} mode = MODE_GSET;
static struct option {
@@ -263,6 +270,12 @@ static struct option {
"Get Rx ntuple filters and actions\n" },
{ "-P", "--show-permaddr", MODE_PERMADDR,
"Show permanent hardware address" },
+ { "-W", "--get-dump", MODE_GET_DUMP,
+ "Get dump level\n" },
+ { "-Wd", "--get-dump-data", MODE_GET_DUMP_DATA,
+ "Get dump data", "FILENAME " "Name of the dump file\n" },
+ { "-w", "--set-dump", MODE_SET_DUMP,
+ "Set dump level", "DUMPLEVEL " "Dump level for the device\n" },
{ "-h", "--help", MODE_HELP, "Show this help" },
{ NULL, "--version", MODE_VERSION, "Show version number" },
{}
@@ -413,6 +426,8 @@ static int flash_region = -1;
static int msglvl_changed;
static u32 msglvl_wanted = 0;
static u32 msglvl_mask = 0;
+static u32 dump_flag;
+static char *dump_file = NULL;
static enum {
ONLINE=0,
@@ -852,7 +867,10 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_GNTUPLE) ||
(mode == MODE_PHYS_ID) ||
(mode == MODE_FLASHDEV) ||
- (mode == MODE_PERMADDR)) {
+ (mode == MODE_PERMADDR) ||
+ (mode == MODE_SET_DUMP) ||
+ (mode == MODE_GET_DUMP_DATA) ||
+ (mode == MODE_GET_DUMP)) {
devname = argp[i];
break;
}
@@ -874,6 +892,12 @@ static void parse_cmdline(int argc, char **argp)
flash_file = argp[i];
flash = 1;
break;
+ } else if (mode == MODE_SET_DUMP) {
+ dump_flag = get_u32(argp[i], 0);
+ break;
+ } else if (mode == MODE_GET_DUMP_DATA) {
+ dump_file = argp[i];
+ break;
}
/* fallthrough */
default:
@@ -2042,6 +2066,12 @@ static int doit(void)
return do_flash(fd, &ifr);
} else if (mode == MODE_PERMADDR) {
return do_permaddr(fd, &ifr);
+ } else if (mode == MODE_GET_DUMP_DATA) {
+ return do_getdumpdata(fd, &ifr);
+ } else if (mode == MODE_GET_DUMP) {
+ return do_getdump(fd, &ifr);
+ } else if (mode == MODE_SET_DUMP) {
+ return do_setdump(fd, &ifr);
}
return 69;
@@ -2679,7 +2709,6 @@ static int do_gregs(int fd, struct ifreq *ifr)
perror("Cannot get driver information");
return 72;
}
-
regs = calloc(1, sizeof(*regs)+drvinfo.regdump_len);
if (!regs) {
perror("Cannot allocate memory for register dump");
@@ -3241,6 +3270,86 @@ static int do_grxntuple(int fd, struct ifreq *ifr)
return 0;
}
+static void do_writedump(struct ethtool_dump *dump)
+{
+ FILE *f = fopen(dump_file, "wb+");
+ size_t bytes;
+
+ if (!f ) {
+ fprintf(stderr, "Can't open file %s: %s\n",
+ dump_file, strerror(errno));
+ return;
+ }
+
+ bytes = fwrite(dump->data, 1, dump->len, f);
+ fclose(f);
+}
+
+static int do_getdump(int fd, struct ifreq *ifr)
+{
+ struct ethtool_dump ddata;
+ int err;
+
+ ddata.cmd = ETHTOOL_GET_DUMP;
+ ifr->ifr_data = (caddr_t) &ddata;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not get dump flag");
+ return 74;
+ }
+ fprintf(stdout, "Dump flag: 0x%x\n", ddata.flag);
+ return 0;
+}
+
+static int do_getdumpdata(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_dump edata;
+ struct ethtool_dump *data;
+
+ edata.cmd = ETHTOOL_GET_DUMP;
+
+ ifr->ifr_data = (caddr_t) &edata;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not get dump level");
+ return 74;
+ }
+ data = calloc(1, offsetof(struct ethtool_dump, data)+edata.len);
+ if (!data) {
+ perror("Can not allocate enough memory");
+ return 0;
+ }
+ data->cmd = ETHTOOL_GET_DUMP_DATA;
+ data->len = edata.len;
+ ifr->ifr_data = (caddr_t) data;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not get dump data\n");
+ goto free;
+ }
+ do_writedump(data);
+free:
+ free(data);
+ return 0;
+}
+
+static int do_setdump(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_dump dump;
+
+ dump.cmd = ETHTOOL_SET_DUMP;
+ dump.flag = dump_flag;
+ ifr->ifr_data = (caddr_t)&dump;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not set dump level");
+ return 74;
+ }
+ return 0;
+}
+
static int send_ioctl(int fd, struct ifreq *ifr)
{
return ioctl(fd, SIOCETHTOOL, ifr);
--
1.7.4.1
^ permalink raw reply related
* [net-next-2.6 PATCH] ethtool: Support to take FW dump
From: anirban.chakraborty @ 2011-05-02 23:29 UTC (permalink / raw)
To: netdev; +Cc: --no-chain-reply-to, bhutchings, davem, Anirban Chakraborty
In-Reply-To: <1304378957-24123-1-git-send-email-anirban.chakraborty@qlogic.com>
From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Added code to take FW dump via ethtool. A pair of set and get functions are
added to configure dump level and fetch it from the driver respectively. A
third function is added to retrieve the dumped FW data from the driver.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
include/linux/ethtool.h | 20 ++++++++++++
net/core/ethtool.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 0 deletions(-)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9de3127..3dd91a5 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -595,6 +595,19 @@ struct ethtool_flash {
char data[ETHTOOL_FLASH_MAX_FILENAME];
};
+/**
+ * struct ethtool_dump - used for retrieving, setting device dump
+ * @flag: flag for dump setting
+ * @len: length of dump data
+ * @data: data collected for this command
+ */
+struct ethtool_dump {
+ __u32 cmd;
+ __u32 flag;
+ __u32 len;
+ u8 data[0];
+};
+
/* for returning and changing feature sets */
/**
@@ -926,6 +939,10 @@ struct ethtool_ops {
const struct ethtool_rxfh_indir *);
void (*get_channels)(struct net_device *, struct ethtool_channels *);
int (*set_channels)(struct net_device *, struct ethtool_channels *);
+ int (*set_dump)(struct net_device *, struct ethtool_dump *);
+ int (*get_dump)(struct net_device *, struct ethtool_dump *);
+ int (*get_dump_data)(struct net_device *,
+ struct ethtool_dump *, void *);
};
#endif /* __KERNEL__ */
@@ -997,6 +1014,9 @@ struct ethtool_ops {
#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
#define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
#define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
+#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
+#define ETHTOOL_GET_DUMP 0x0000003f /* Get dump settings */
+#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index d8b1a8d..dce547c 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1827,6 +1827,73 @@ static noinline_for_stack int ethtool_flash_device(struct net_device *dev,
return dev->ethtool_ops->flash_device(dev, &efl);
}
+static int ethtool_set_dump(struct net_device *dev,
+ void __user *useraddr)
+{
+ struct ethtool_dump dump;
+
+ if (!dev->ethtool_ops->set_dump)
+ return -EOPNOTSUPP;
+
+ if (copy_from_user(&dump, useraddr, sizeof(dump)))
+ return -EFAULT;
+
+ return dev->ethtool_ops->set_dump(dev, &dump);
+}
+
+static int ethtool_get_dump(struct net_device *dev,
+ void __user *useraddr)
+{
+ struct ethtool_dump dump;
+ const struct ethtool_ops *ops = dev->ethtool_ops;
+
+ if (!dev->ethtool_ops->get_dump)
+ return -EOPNOTSUPP;
+
+ if (copy_from_user(&dump, useraddr, sizeof(dump)))
+ return -EFAULT;
+
+ if (ops->get_dump(dev, &dump))
+ return -EFAULT;
+
+ if (copy_to_user(useraddr, &dump, sizeof(dump)))
+ return -EFAULT;
+ return 0;
+}
+
+static int ethtool_get_dump_data(struct net_device *dev,
+ void __user *useraddr)
+{
+ int ret;
+ void *data;
+ struct ethtool_dump dump;
+ const struct ethtool_ops *ops = dev->ethtool_ops;
+
+ if (!dev->ethtool_ops->get_dump_data)
+ return -EOPNOTSUPP;
+
+ if (copy_from_user(&dump, useraddr, sizeof(dump)))
+ return -EFAULT;
+ data = vzalloc(dump.len);
+ if (!data)
+ return -ENOMEM;
+ ret = ops->get_dump_data(dev, &dump, data);
+ if (ret) {
+ ret = -EFAULT;
+ goto out;
+ }
+ if (copy_to_user(useraddr, &dump, sizeof(dump))) {
+ ret = -EFAULT;
+ goto out;
+ }
+ useraddr += offsetof(struct ethtool_dump, data);
+ if (copy_to_user(useraddr, data, dump.len))
+ ret = -EFAULT;
+out:
+ vfree(data);
+ return ret;
+}
+
/* The main entry point in this file. Called from net/core/dev.c */
int dev_ethtool(struct net *net, struct ifreq *ifr)
@@ -2043,6 +2110,15 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
case ETHTOOL_SCHANNELS:
rc = ethtool_set_channels(dev, useraddr);
break;
+ case ETHTOOL_SET_DUMP:
+ rc = ethtool_set_dump(dev, useraddr);
+ break;
+ case ETHTOOL_GET_DUMP:
+ rc = ethtool_get_dump(dev, useraddr);
+ break;
+ case ETHTOOL_GET_DUMP_DATA:
+ rc = ethtool_get_dump_data(dev, useraddr);
+ break;
default:
rc = -EOPNOTSUPP;
}
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH] sysctl: net: call unregister_net_sysctl_table where needed
From: David Miller @ 2011-05-02 23:12 UTC (permalink / raw)
To: lucian.grijincu; +Cc: netdev
In-Reply-To: <BANLkTi=0-2aHDBtY2P794upF9brrW48aNA@mail.gmail.com>
From: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Date: Sun, 1 May 2011 13:48:04 +0200
> On Sun, May 1, 2011 at 1:44 PM, Lucian Adrian Grijincu
> <lucian.grijincu@gmail.com> wrote:
>> ctl_table_headers registered with register_net_sysctl_table should
>> have been unregistered with the equivalent unregister_net_sysctl_table
>>
>> Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
>
>
> David: I sent you this patch a while back but it was mixed with other
> unrelated patches that were mostly ignored.
>
> Again, to clarify: it does not matter at the moment if
> register_net_sysctl_table or unregister_sysctl_table is called because
> both to the same thing:
...
> We should either get rid of unregister_net_sysctl_table or use it consistently.
Applied to net-2.6, thanks Lucian.
^ permalink raw reply
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
From: David Miller @ 2011-05-02 22:55 UTC (permalink / raw)
To: jpirko; +Cc: mirqus, netdev, xemul
In-Reply-To: <20110430112817.GD2658@psychotron.orion>
From: Jiri Pirko <jpirko@redhat.com>
Date: Sat, 30 Apr 2011 13:28:17 +0200
> Fri, Apr 22, 2011 at 11:43:10AM CEST, mirqus@gmail.com wrote:
>>2011/1/24 Jiri Pirko <jpirko@redhat.com>:
>>> The code is not needed because tb[IFLA_IFNAME] is already
>>> processed in rtnl_newlink(). Remove this redundancy.
>>>
>>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>>
>>Hi. This patch broke creation of veth devices. Reverting it fixes the issue.
>
> Sorry for troubles.
>
> For net-next-2.6 this is fixed by:
> http://patchwork.ozlabs.org/patch/93498/
>
> For net-2.6 I suggest to revert this patch:
>
> Subject: [PATCH net-2.6] Revert: veth: remove unneeded ifname code from veth_newlink()
>
> 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 caused regression on veth
> creation. This patch reverts the original one.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Applied, with "Reported-by: " added to give credit to Michał Mirosław.
^ permalink raw reply
* Re: [PATCH] usbnet: runtime pm: fix out of memory
From: David Miller @ 2011-05-02 22:52 UTC (permalink / raw)
To: tom.leiming; +Cc: netdev, linux-usb, oneukum
In-Reply-To: <1304066229-30875-1-git-send-email-tom.leiming@gmail.com>
From: tom.leiming@gmail.com
Date: Fri, 29 Apr 2011 16:37:09 +0800
> From: Ming Lei <tom.leiming@gmail.com>
>
> This patch makes use of the EVENT_DEV_OPEN flag introduced recently to
> fix one out of memory issue, which can be reproduced on omap3/4 based
> pandaboard/beagle XM easily with steps below:
...
Oliver please review this patch. Thanks!
> - enable runtime pm
> echo auto > /sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-1/1-1.1/power/control
>
> - ifconfig eth0 up
>
> - then out of memroy happened, see [1] for kernel message.
>
> Follows my analysis:
> - 'ifconfig eth0 up' brings eth0 out of suspend, and usbnet_resume
> is called to schedule dev->bh, then rx urbs are submited to prepare for
> recieving data;
>
> - some usbnet devices will produce garbage rx packets flood if
> info->reset is not called in usbnet_open.
>
> - so there is no enough chances for usbnet_bh to handle and release
> recieved skb buffers since many rx interrupts consumes cpu, so out of memory
> for atomic allocation in rx_submit happened.
>
> This patch fixes the issue by simply not allowing schedule of usbnet_bh until device
> is opened.
>
> [1], dmesg
> [ 234.712005] smsc95xx 1-1.1:1.0: rpm_resume flags 0x4
> [ 234.712066] usb 1-1.1: rpm_resume flags 0x0
> [ 234.712066] usb 1-1: rpm_resume flags 0x0
> [ 234.712097] usb usb1: rpm_resume flags 0x0
> [ 234.712127] usb usb1: usb auto-resume
> [ 234.712158] ehci-omap ehci-omap.0: resume root hub
> [ 234.754028] hub 1-0:1.0: hub_resume
> [ 234.754821] hub 1-0:1.0: port 1: status 0507 change 0000
> [ 234.756011] hub 1-0:1.0: state 7 ports 3 chg 0000 evt 0000
> [ 234.756042] hub 1-0:1.0: rpm_resume flags 0x4
> [ 234.756072] usb usb1: rpm_resume flags 0x0
> [ 234.756164] usb usb1: rpm_resume returns 1
> [ 234.756195] hub 1-0:1.0: rpm_resume returns 0
> [ 234.756195] hub 1-0:1.0: rpm_suspend flags 0x4
> [ 234.756225] hub 1-0:1.0: rpm_suspend returns 0
> [ 234.756256] usb usb1: rpm_resume returns 0
> [ 234.757141] usb 1-1: usb auto-resume
> [ 234.793151] ehci-omap ehci-omap.0: GetStatus port:1 status 001005 0 ACK POWER sig=se0 PE CONNECT
> [ 234.816558] usb 1-1: finish resume
> [ 234.817871] hub 1-1:1.0: hub_resume
> [ 234.818420] hub 1-1:1.0: port 1: status 0507 change 0000
> [ 234.820495] ehci-omap ehci-omap.0: reused qh eec50220 schedule
> [ 234.820495] usb 1-1: link qh256-0001/eec50220 start 1 [1/0 us]
> [ 234.820587] usb 1-1: rpm_resume returns 0
> [ 234.820800] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0000
> [ 234.820800] hub 1-1:1.0: rpm_resume flags 0x4
> [ 234.820831] hub 1-1:1.0: rpm_resume returns 0
> [ 234.820861] hub 1-1:1.0: rpm_suspend flags 0x4
> [ 234.820861] hub 1-1:1.0: rpm_suspend returns 0
> [ 234.821777] usb 1-1.1: usb auto-resume
> [ 234.868591] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0002
> [ 234.868591] hub 1-1:1.0: rpm_resume flags 0x4
> [ 234.868621] hub 1-1:1.0: rpm_resume returns 0
> [ 234.868652] hub 1-1:1.0: rpm_suspend flags 0x4
> [ 234.868652] hub 1-1:1.0: rpm_suspend returns 0
> [ 234.879486] usb 1-1.1: finish resume
> [ 234.880279] usb 1-1.1: rpm_resume returns 0
> [ 234.880310] smsc95xx 1-1.1:1.0: rpm_resume returns 0
> [ 238.880187] ksoftirqd/0: page allocation failure. order:0, mode:0x20
> [ 238.880218] Backtrace:
> [ 238.880249] [<c01b9800>] (dump_backtrace+0x0/0xf8) from [<c065e1dc>] (dump_stack+0x18/0x1c)
> [ 238.880249] r6:00000000 r5:00000000 r4:00000020 r3:00000002
> [ 238.880310] [<c065e1c4>] (dump_stack+0x0/0x1c) from [<c026ece4>] (__alloc_pages_nodemask+0x620/0x724)
> [ 238.880340] [<c026e6c4>] (__alloc_pages_nodemask+0x0/0x724) from [<c02986d4>] (kmem_getpages.clone.34+0x34/0xc8)
> [ 238.880371] [<c02986a0>] (kmem_getpages.clone.34+0x0/0xc8) from [<c02988f8>] (cache_grow.clone.42+0x84/0x154)
> [ 238.880371] r6:ef871aa4 r5:ef871a80 r4:ef81fd40 r3:00000020
> [ 238.880401] [<c0298874>] (cache_grow.clone.42+0x0/0x154) from [<c0298b64>] (cache_alloc_refill+0x19c/0x1f0)
> [ 238.880432] [<c02989c8>] (cache_alloc_refill+0x0/0x1f0) from [<c0299804>] (kmem_cache_alloc+0x90/0x190)
> [ 238.880462] [<c0299774>] (kmem_cache_alloc+0x0/0x190) from [<c052e260>] (__alloc_skb+0x34/0xe8)
> [ 238.880493] [<c052e22c>] (__alloc_skb+0x0/0xe8) from [<bf0509f4>] (rx_submit+0x2c/0x1d4 [usbnet])
> [ 238.880523] [<bf0509c8>] (rx_submit+0x0/0x1d4 [usbnet]) from [<bf050d38>] (rx_complete+0x19c/0x1b0 [usbnet])
> [ 238.880737] [<bf050b9c>] (rx_complete+0x0/0x1b0 [usbnet]) from [<bf006fd0>] (usb_hcd_giveback_urb+0xa8/0xf4 [usbcore])
> [ 238.880737] r8:eeeced34 r7:eeecec00 r6:eeecec00 r5:00000000 r4:eec2dd20
> [ 238.880767] r3:bf050b9c
> [ 238.880859] [<bf006f28>] (usb_hcd_giveback_urb+0x0/0xf4 [usbcore]) from [<bf03c8f8>] (ehci_urb_done+0xb0/0xbc [ehci_hcd])
> [ 238.880859] r6:00000000 r5:eec2dd20 r4:eeeced44 r3:eec2dd34
> [ 238.880920] [<bf03c848>] (ehci_urb_done+0x0/0xbc [ehci_hcd]) from [<bf040204>] (qh_completions+0x308/0x3bc [ehci_hcd])
> [ 238.880920] r7:00000000 r6:eeda21a0 r5:ffdfe3c0 r4:eeda21ac
> [ 238.880981] [<bf03fefc>] (qh_completions+0x0/0x3bc [ehci_hcd]) from [<bf040ef8>] (scan_async+0xb0/0x16c [ehci_hcd])
> [ 238.881011] [<bf040e48>] (scan_async+0x0/0x16c [ehci_hcd]) from [<bf040fec>] (ehci_work+0x38/0x90 [ehci_hcd])
> [ 238.881042] [<bf040fb4>] (ehci_work+0x0/0x90 [ehci_hcd]) from [<bf042940>] (ehci_irq+0x300/0x34c [ehci_hcd])
> [ 238.881072] r4:eeeced34 r3:00000001
> [ 238.881134] [<bf042640>] (ehci_irq+0x0/0x34c [ehci_hcd]) from [<bf006828>] (usb_hcd_irq+0x40/0xac [usbcore])
> [ 238.881195] [<bf0067e8>] (usb_hcd_irq+0x0/0xac [usbcore]) from [<c0239764>] (handle_irq_event_percpu+0xb8/0x240)
> [ 238.881225] r6:eec504e0 r5:0000006d r4:eec504e0 r3:bf0067e8
> [ 238.881256] [<c02396ac>] (handle_irq_event_percpu+0x0/0x240) from [<c0239930>] (handle_irq_event+0x44/0x64)
> [ 238.881256] [<c02398ec>] (handle_irq_event+0x0/0x64) from [<c023bbd0>] (handle_level_irq+0xe0/0x114)
> [ 238.881286] r6:0000006d r5:c080c14c r4:c080c100 r3:00020000
> [ 238.881317] [<c023baf0>] (handle_level_irq+0x0/0x114) from [<c01ab090>] (asm_do_IRQ+0x90/0xd0)
> [ 238.881317] r5:00000000 r4:0000006d
> [ 238.881347] [<c01ab000>] (asm_do_IRQ+0x0/0xd0) from [<c06624d0>] (__irq_svc+0x50/0x134)
> [ 238.881378] Exception stack(0xef837e20 to 0xef837e68)
> [ 238.881378] 7e20: 00000001 00185610 016cc000 c00490c0 eb380000 ef800540 00000020 00004ae0
> [ 238.881408] 7e40: 00000020 bf0509f4 60000013 ef837e9c ef837e40 ef837e68 c0226f0c c0298ca0
> [ 238.881408] 7e60: 20000013 ffffffff
> [ 238.881408] r5:fa240100 r4:ffffffff
> [ 238.881439] [<c0298bb8>] (__kmalloc_track_caller+0x0/0x1d0) from [<c052e284>] (__alloc_skb+0x58/0xe8)
> [ 238.881469] [<c052e22c>] (__alloc_skb+0x0/0xe8) from [<bf0509f4>] (rx_submit+0x2c/0x1d4 [usbnet])
> [ 238.881500] [<bf0509c8>] (rx_submit+0x0/0x1d4 [usbnet]) from [<bf0513d8>] (usbnet_bh+0x1b4/0x250 [usbnet])
> [ 238.881530] [<bf051224>] (usbnet_bh+0x0/0x250 [usbnet]) from [<c01f912c>] (tasklet_action+0xb0/0x1f8)
> [ 238.881530] r6:00000000 r5:ef9757f0 r4:ef9757ec r3:bf051224
> [ 238.881561] [<c01f907c>] (tasklet_action+0x0/0x1f8) from [<c01f97ac>] (__do_softirq+0x140/0x290)
> [ 238.881561] r8:00000006 r7:00000101 r6:00000000 r5:c0806098 r4:00000001
> [ 238.881591] r3:c01f907c
> [ 238.881622] [<c01f966c>] (__do_softirq+0x0/0x290) from [<c01f99cc>] (run_ksoftirqd+0xd0/0x1f4)
> [ 238.881622] [<c01f98fc>] (run_ksoftirqd+0x0/0x1f4) from [<c02113b0>] (kthread+0x90/0x98)
> [ 238.881652] r7:00000013 r6:c01f98fc r5:00000000 r4:ef831efc
> [ 238.881683] [<c0211320>] (kthread+0x0/0x98) from [<c01f62f4>] (do_exit+0x0/0x374)
> [ 238.881713] r6:c01f62f4 r5:c0211320 r4:ef831efc
> [ 238.881713] Mem-info:
> [ 238.881744] Normal per-cpu:
> [ 238.881744] CPU 0: hi: 186, btch: 31 usd: 38
> [ 238.881744] CPU 1: hi: 186, btch: 31 usd: 169
> [ 238.881774] HighMem per-cpu:
> [ 238.881774] CPU 0: hi: 90, btch: 15 usd: 66
> [ 238.881774] CPU 1: hi: 90, btch: 15 usd: 86
> [ 238.881805] active_anon:544 inactive_anon:71 isolated_anon:0
> [ 238.881805] active_file:926 inactive_file:2538 isolated_file:0
> [ 238.881805] unevictable:0 dirty:10 writeback:0 unstable:0
> [ 238.881805] free:57782 slab_reclaimable:864 slab_unreclaimable:186898
> [ 238.881805] mapped:632 shmem:144 pagetables:50 bounce:0
> [ 238.881835] Normal free:1328kB min:3532kB low:4412kB high:5296kB active_anon:0kB inactive_anon:0kB active_file:880kB inactive_file:848kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:780288kB mlocked:0kB dirty:36kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:3456kB slab_unreclaimable:747592kB kernel_stack:392kB pagetables:200kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
> [ 238.881866] lowmem_reserve[]: 0 1904 1904
> [ 238.881896] HighMem free:229800kB min:236kB low:508kB high:784kB active_anon:2176kB inactive_anon:284kB active_file:2824kB inactive_file:9304kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:243712kB mlocked:0kB dirty:4kB writeback:0kB mapped:2528kB shmem:576kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
> [ 238.881927] lowmem_reserve[]: 0 0 0
> [ 238.881958] Normal: 0*4kB 4*8kB 6*16kB 0*32kB 1*64kB 1*128kB 0*256kB 2*512kB 0*1024kB 0*2048kB 0*4096kB = 1344kB
> [ 238.882019] HighMem: 6*4kB 2*8kB 4*16kB 4*32kB 1*64kB 1*128kB 0*256kB 2*512kB 3*1024kB 0*2048kB 55*4096kB = 229800kB
> [ 238.882080] 3610 total pagecache pages
> [ 238.882080] 0 pages in swap cache
> [ 238.882080] Swap cache stats: add 0, delete 0, find 0/0
> [ 238.882110] Free swap = 0kB
> [ 238.882110] Total swap = 0kB
> [ 238.933776] 262144 pages of RAM
> [ 238.933776] 58240 free pages
> [ 238.933776] 10503 reserved pages
> [ 238.933776] 187773 slab pages
> [ 238.933807] 2475 pages shared
> [ 238.933807] 0 pages swap cached
>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> drivers/net/usb/usbnet.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 009bba3..9ab439d 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -645,6 +645,7 @@ int usbnet_stop (struct net_device *net)
> struct driver_info *info = dev->driver_info;
> int retval;
>
> + clear_bit(EVENT_DEV_OPEN, &dev->flags);
> netif_stop_queue (net);
>
> netif_info(dev, ifdown, dev->net,
> @@ -1524,9 +1525,12 @@ int usbnet_resume (struct usb_interface *intf)
> smp_mb();
> clear_bit(EVENT_DEV_ASLEEP, &dev->flags);
> spin_unlock_irq(&dev->txq.lock);
> - if (!(dev->txq.qlen >= TX_QLEN(dev)))
> - netif_start_queue(dev->net);
> - tasklet_schedule (&dev->bh);
> +
> + if (test_bit(EVENT_DEV_OPEN, &dev->flags)) {
> + if (!(dev->txq.qlen >= TX_QLEN(dev)))
> + netif_start_queue(dev->net);
> + tasklet_schedule (&dev->bh);
> + }
> }
> return 0;
> }
> --
> 1.7.4.1
>
^ permalink raw reply
* Re: [PATCH] smsc95xx: fix reset check
From: David Miller @ 2011-05-02 22:51 UTC (permalink / raw)
To: rabin; +Cc: steve.glendinning, netdev
In-Reply-To: <1304188167-18152-1-git-send-email-rabin@rab.in>
From: Rabin Vincent <rabin@rab.in>
Date: Sat, 30 Apr 2011 23:59:27 +0530
> The reset loop check should check the MII_BMCR register value for
> BMCR_RESET rather than for MII_BMCR (the register address, which also
> happens to be zero).
>
> Signed-off-by: Rabin Vincent <rabin@rab.in>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH] tg3: Fix failure to enable WoL by default when possible
From: David Miller @ 2011-05-02 22:47 UTC (permalink / raw)
To: rjw; +Cc: netdev, linux-kernel, mcarlson, mchan, sfr, linux-next
In-Reply-To: <201104282302.15502.rjw@sisk.pl>
From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Thu, 28 Apr 2011 23:02:15 +0200
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> tg3 is supposed to enable WoL by default on adapters which support
> that, but it fails to do so unless the adapter's
> /sys/devices/.../power/wakeup file contains 'enabled' during the
> initialization of the adapter. Fix that by making tg3 use
> device_set_wakeup_enable() to enable wakeup automatically whenever
> WoL should be enabled by default.
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Applied, thanks Rafael.
Stephen, this patch is going to show up in net-2.6 and it will
generate a merge conflict with Joe Perches's commit in net-next-2.6
which converts tg3 to use a bitmap for the tp->tg3_flags* values.
--------------------
commit 63c3a66fe6c827a731dcbdee181158b295626f83
Author: Joe Perches <joe@perches.com>
Date: Tue Apr 26 08:12:10 2011 +0000
tg3: Convert u32 flag,flg2,flg3 uses to bitmap
--------------------
It should be easy to resolve, and you don't need to report this
to us when you hit it while building your -next tree, thanks :-)
I'll resolve it myself over the next day or two.
> ---
> drivers/net/tg3.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/drivers/net/tg3.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/tg3.c
> +++ linux-2.6/drivers/net/tg3.c
> @@ -12327,8 +12327,10 @@ static void __devinit tg3_get_eeprom_hw_
> if (val & VCPU_CFGSHDW_ASPM_DBNC)
> tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
> if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
> - (val & VCPU_CFGSHDW_WOL_MAGPKT))
> + (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
> tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
> + device_set_wakeup_enable(&tp->pdev->dev, true);
> + }
> goto done;
> }
>
> @@ -12461,8 +12463,10 @@ static void __devinit tg3_get_eeprom_hw_
> tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
>
> if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
> - (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE))
> + (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
> tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
> + device_set_wakeup_enable(&tp->pdev->dev, true);
> + }
>
> if (cfg2 & (1 << 17))
> tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: [PATCH 1/5] networking: inappropriate ioctl operation should return ENOTTY
From: David Miller @ 2011-05-02 22:41 UTC (permalink / raw)
To: lifongsun; +Cc: alan, netdev, linux-kernel
In-Reply-To: <1303977891-29280-1-git-send-email-lifongsun@gmail.com>
From: Lifeng Sun <lifongsun@gmail.com>
Date: Thu, 28 Apr 2011 16:04:51 +0800
> ioctl() calls against a socket with an inappropriate ioctl operation
> are incorrectly returning EINVAL rather than ENOTTY:
>
> [ENOTTY]
> Inappropriate I/O control operation.
>
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=33992
>
> Signed-off-by: Lifeng Sun <lifongsun@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: David Miller @ 2011-05-02 22:35 UTC (permalink / raw)
To: cmetcalf; +Cc: shanwei, netdev
In-Reply-To: <4DBF3037.30203@tilera.com>
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 2 May 2011 18:29:11 -0400
> On 5/2/2011 6:21 PM, David Miller wrote:
>> From: Chris Metcalf <cmetcalf@tilera.com>
>> Date: Mon, 2 May 2011 18:20:01 -0400
>>
>>> I took the drivers/net/tile/ change into my tree, but I'll defer to David
>>> or some other net person to take the net/ipv6/udp.c change. Thanks!
>> I took them both into my tree. Didn't you see my reply?
>
> I did, but I didn't see the change yet in .39-rc5, so I figured it would be
> harmless to also take it into the tile tree.
This change will show up in net-next-2.6 and as a consequence linux-2.6-next
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: Chris Metcalf @ 2011-05-02 22:29 UTC (permalink / raw)
To: David Miller; +Cc: shanwei, netdev
In-Reply-To: <20110502.152136.115919893.davem@davemloft.net>
On 5/2/2011 6:21 PM, David Miller wrote:
> From: Chris Metcalf <cmetcalf@tilera.com>
> Date: Mon, 2 May 2011 18:20:01 -0400
>
>> I took the drivers/net/tile/ change into my tree, but I'll defer to David
>> or some other net person to take the net/ipv6/udp.c change. Thanks!
> I took them both into my tree. Didn't you see my reply?
I did, but I didn't see the change yet in .39-rc5, so I figured it would be
harmless to also take it into the tile tree. And, I thought you might have
just taken the platform-independent part of the change. I'll revert the
tile part of the change out of my tree. Thanks!
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply
* Re: [PATCH net-next-2.6] net: dont hold rtnl mutex during netlink dump callbacks
From: David Miller @ 2011-05-02 22:27 UTC (permalink / raw)
To: shemminger; +Cc: eric.dumazet, kaber, netdev, remi.denis-courmont
In-Reply-To: <20110428084337.6b54603e@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 28 Apr 2011 08:43:37 -0700
> On Thu, 28 Apr 2011 10:56:07 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
>> Four years ago, Patrick made a change to hold rtnl mutex during netlink
>> dump callbacks.
>>
>> I believe it was a wrong move. This slows down concurrent dumps, making
>> good old /proc/net/ files faster than rtnetlink in some situations.
>>
>> This occurred to me because one "ip link show dev ..." was _very_ slow
>> on a workload adding/removing network devices in background.
>>
>> All dump callbacks are able to use RCU locking now, so this patch does
>> roughly a revert of commits :
>>
>> 1c2d670f366 : [RTNETLINK]: Hold rtnl_mutex during netlink dump callbacks
>> 6313c1e0992 : [RTNETLINK]: Remove unnecessary locking in dump callbacks
>>
>> This let writers fight for rtnl mutex and readers going full speed.
>>
>> It also takes care of phonet : phonet_route_get() is now called from rcu
>> read section. I renamed it to phonet_route_get_rcu()
>>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Cc: Patrick McHardy <kaber@trash.net>
>> Cc: Remi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks everyone!
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: Chris Metcalf @ 2011-05-02 22:20 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, netdev
In-Reply-To: <4DB1617D.30600@cn.fujitsu.com>
On 4/22/2011 7:07 AM, Shan Wei wrote:
> Although these are equivalent, but the skb_checksum_start_offset() is more readable.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
> drivers/net/tile/tilepro.c | 2 +-
> net/ipv6/udp.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tile/tilepro.c b/drivers/net/tile/tilepro.c
> index 0825db6..1e980fd 100644
> --- a/drivers/net/tile/tilepro.c
> +++ b/drivers/net/tile/tilepro.c
> @@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
> unsigned int len = skb->len;
> unsigned char *data = skb->data;
>
> - unsigned int csum_start = skb->csum_start - skb_headroom(skb);
> + unsigned int csum_start = skb_checksum_start_offset(skb);
>
> lepp_frag_t frags[LEPP_MAX_FRAGS];
>
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 15c3774..95c62a1 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
> /* Do software UFO. Complete and fill in the UDP checksum as HW cannot
> * do checksum of UDP packets sent as multiple IP fragments.
> */
> - offset = skb->csum_start - skb_headroom(skb);
> + offset = skb_checksum_start_offset(skb);
> csum = skb_checksum(skb, offset, skb->len- offset, 0);
> offset += skb->csum_offset;
> *(__sum16 *)(skb->data + offset) = csum_fold(csum);
I took the drivers/net/tile/ change into my tree, but I'll defer to David
or some other net person to take the net/ipv6/udp.c change. Thanks!
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: David Miller @ 2011-05-02 22:21 UTC (permalink / raw)
To: cmetcalf; +Cc: shanwei, netdev
In-Reply-To: <4DBF2E11.3010904@tilera.com>
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 2 May 2011 18:20:01 -0400
> I took the drivers/net/tile/ change into my tree, but I'll defer to David
> or some other net person to take the net/ipv6/udp.c change. Thanks!
I took them both into my tree. Didn't you see my reply?
^ permalink raw reply
* net-2.6 state...
From: David Miller @ 2011-05-02 22:20 UTC (permalink / raw)
To: netdev
Right now I'm sorting through patchwork to make sure anything that
belongs in net-2.6, is there.
Then I'm going to push things out to Linus.
We will be in a more serious lock down mode after that. So I really
only want to see obvious critical fixes going into net-2.6. Even
comment typos will be put into net-next-2.6.
Please cooperate with this policy and everything will go smoothly.
There is nothing I like more than seeing people work on bug fixes at
this point in the -rc* series, so if you want to make me (as well as
the users reporting these things) really happy, fix some bugs. :-)
Thanks!
^ permalink raw reply
* RE: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e specific?)
From: Allan, Bruce W @ 2011-05-02 22:07 UTC (permalink / raw)
To: Allan, Bruce W, Kamil Iskra, netdev@vger.kernel.org,
e1000-devel@lists.sourceforge.net
Cc: linux-pm@lists.linux-foundation.org
In-Reply-To: <8DD2590731AB5D4C9DBF71A877482A9001B54CE017@orsmsx509.amr.corp.intel.com>
>-----Original Message-----
>From: Allan, Bruce W [mailto:bruce.w.allan@intel.com]
>Sent: Monday, May 02, 2011 3:02 PM
>To: Kamil Iskra; netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
>Cc: linux-pm@lists.linux-foundation.org
>Subject: Re: [E1000-devel] WoL stopped working after power off with 2.6.38
>(e1000e specific?)
>
>>-----Original Message-----
>>From: Kamil Iskra [mailto:kamil@iskra.name]
>>Sent: Friday, April 29, 2011 10:45 PM
>>To: netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
>>Subject: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e
>>specific?)
>>
>>[ Note: I'm not on these mailing lists, so be sure to Cc: me if you want
>>more info from me ]
>>
>>After upgrading from kernel 2.6.37 to 2.6.38, Wake on LAN after shutdown
>>stopped working for me on both of my Thinkpad laptops. Both systems use
>>the e1000e driver. One (a T61) has an 82566MM NIC, the other (an X201) an
>>82577LM. I'm running 64-bit Gentoo Linux with a custom compiled kernel.
>>The network driver is built into the kernel.
>>
>>Wake on LAN still works after suspend (S3), but not after a complete
>>shutdown (with power supply connected).
>>
>>I figured the updated e1000e driver in 2.6.38 was probably to blame,
>>however, after I copied the whole drivers/net/e1000e directory from the
>>2.6.37 over to the 2.6.38 tree and recompiled, the problem persisted, so I
>>don't know anymore.
>>
>>I modified the system shutdown sequence to invoke ifconfig and ethtool
>>right before the final halt. According to ifconfig, eth0 is down at that
>>point. According to ethtool, WoL is configured correctly ("Wake-on: g").
>>There is, however, a difference in the output of ethtool between the two
>>kernel versions. "Link detected:" shows "yes" with 2.6.37, but "no" with
>>2.6.38.
>>
>>A workaround that I found to work was to invoke "ifconfig eth0 up" right
>>before the halt.
>>
>>Any suggestions? Is this new behavior expected or is it a bug?
>
>WoL from S5 "works for me"(TM) using the e1000e driver on RHEL6 and 2.6.38.
>Could you provide your customer kernel configuration?
>
>Cc: linux-pm@lists.linux-foundation.org
>
>Thanks,
>Bruce.
:s/customer/custom/
^ permalink raw reply
* Re: pull request: batman-adv 2011-05-01
From: David Miller @ 2011-05-02 22:06 UTC (permalink / raw)
To: sven-KaDOiPu9UxWEi8DpZVb4nw
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1304284234-27338-1-git-send-email-sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
From: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
Date: Sun, 1 May 2011 23:10:30 +0200
> I would like to propose following patches for net-next-2.6/2.6.40. Marek
> Lindner continued to convert different datastructures to use RCU. Antonio
> Quartulli fixed an important bug introduced in the last patchset related to the
> update of the current gateway. He also did some minor cleanup work.
>
> I've removed the patch "net: batman-adv: remove rx_csum ethtool_ops" again
> because you already applied it in your branch.
I'll pull this, but I really want you to resolve atomic_dec_not_zero()
properly.
It does not belong in any batman-adv header file.
Instead it belongs in all of arch/${ARCH}/include/asm/atomic.h and
include/asm-generic/atomic.h
Please submit a patch which puts it in the proper place to linux-kernel
Don't worry about build problems resulting from this, I'll make sure
to deal with it properly when the change shows up in Linus's tree.
Thanks.
^ permalink raw reply
* RE: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e specific?)
From: Allan, Bruce W @ 2011-05-02 22:02 UTC (permalink / raw)
To: Kamil Iskra, netdev@vger.kernel.org,
e1000-devel@lists.sourceforge.net
Cc: linux-pm@lists.linux-foundation.org
In-Reply-To: <20110430054519.GA9826@scooby.iskra.name>
>-----Original Message-----
>From: Kamil Iskra [mailto:kamil@iskra.name]
>Sent: Friday, April 29, 2011 10:45 PM
>To: netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
>Subject: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e
>specific?)
>
>[ Note: I'm not on these mailing lists, so be sure to Cc: me if you want
>more info from me ]
>
>After upgrading from kernel 2.6.37 to 2.6.38, Wake on LAN after shutdown
>stopped working for me on both of my Thinkpad laptops. Both systems use
>the e1000e driver. One (a T61) has an 82566MM NIC, the other (an X201) an
>82577LM. I'm running 64-bit Gentoo Linux with a custom compiled kernel.
>The network driver is built into the kernel.
>
>Wake on LAN still works after suspend (S3), but not after a complete
>shutdown (with power supply connected).
>
>I figured the updated e1000e driver in 2.6.38 was probably to blame,
>however, after I copied the whole drivers/net/e1000e directory from the
>2.6.37 over to the 2.6.38 tree and recompiled, the problem persisted, so I
>don't know anymore.
>
>I modified the system shutdown sequence to invoke ifconfig and ethtool
>right before the final halt. According to ifconfig, eth0 is down at that
>point. According to ethtool, WoL is configured correctly ("Wake-on: g").
>There is, however, a difference in the output of ethtool between the two
>kernel versions. "Link detected:" shows "yes" with 2.6.37, but "no" with
>2.6.38.
>
>A workaround that I found to work was to invoke "ifconfig eth0 up" right
>before the halt.
>
>Any suggestions? Is this new behavior expected or is it a bug?
WoL from S5 "works for me"(TM) using the e1000e driver on RHEL6 and 2.6.38.
Could you provide your customer kernel configuration?
Cc: linux-pm@lists.linux-foundation.org
Thanks,
Bruce.
^ permalink raw reply
* Re: [PATCH] linux/stmmac.h: include <linux/platform_device.h> to remove compilation warning.
From: David Miller @ 2011-05-02 22:01 UTC (permalink / raw)
To: viresh.kumar
Cc: peppe.cavallaro, netdev, shiraz.hashim, armando.visconti,
deepak.sikri, viresh.linux
In-Reply-To: <2239eca1d15014be7b6d94f883f9492dc1fbc60a.1304317552.git.viresh.kumar@st.com>
From: Viresh Kumar <viresh.kumar@st.com>
Date: Mon, 2 May 2011 12:00:37 +0530
> stmmac.h uses struct platform_device and doesn't include
> <linux/platform_device.h>. And so we get following compilation warning while
> using this file:
> warning: ‘struct platform_device’ declared inside parameter list
>
> This patch includes <linux/platform_device.h> in stmmac.h to remove this warning
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
This patch applies to neither net-2.6, nor net-next-2.6
The context around your change in all current trees looks a lot
different than what's in your patch.
In fact, even if I go through the entire history in GIT of this
header file, those STMAC_TYPE_0 defines are never there.
The string "STMAC_TYPE_0" doesn't even show up in a query to google
code search.
What tree are you even patching against?
^ permalink raw reply
* Re: [PATCH] amd8111e: trivial typo spelling: Negotitate -> Negotiate
From: David Miller @ 2011-05-02 21:47 UTC (permalink / raw)
To: joe; +Cc: netdev
In-Reply-To: <1304366369.7792.45.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Mon, 02 May 2011 12:59:29 -0700
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks Joe.
^ permalink raw reply
* [PATCH net-next-2.6] ipv4: Make sure flowi4->{saddr,daddr} are always set.
From: David Miller @ 2011-05-02 21:38 UTC (permalink / raw)
To: netdev
Slow path output route resolution always makes sure that
->{saddr,daddr} are set, and also if we trigger into IPSEC resolution
we initialize them as well, because xfrm_lookup() expects them to be
fully resolved.
But if we hit the fast path and flowi4->flowi4_proto is zero, we won't
do this initialization.
Therefore, move the IPSEC path initialization to the route cache
lookup fast path to make sure these are always set.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/route.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 93f71be..64f360d 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2675,6 +2675,10 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *flp4)
dst_use(&rth->dst, jiffies);
RT_CACHE_STAT_INC(out_hit);
rcu_read_unlock_bh();
+ if (!flp4->saddr)
+ flp4->saddr = rth->rt_src;
+ if (!flp4->daddr)
+ flp4->daddr = rth->rt_dst;
return rth;
}
RT_CACHE_STAT_INC(out_hlist_search);
@@ -2772,15 +2776,10 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
if (IS_ERR(rt))
return rt;
- if (flp4->flowi4_proto) {
- if (!flp4->saddr)
- flp4->saddr = rt->rt_src;
- if (!flp4->daddr)
- flp4->daddr = rt->rt_dst;
+ if (flp4->flowi4_proto)
rt = (struct rtable *) xfrm_lookup(net, &rt->dst,
flowi4_to_flowi(flp4),
sk, 0);
- }
return rt;
}
--
1.7.4.5
^ permalink raw reply related
* Re: [PATCH] ipheth.c: Enable IP header alignment
From: L. Alberto Giménez @ 2011-05-02 21:12 UTC (permalink / raw)
To: David Miller
Cc: linux-kernel, dgiagio, dborca, pmcenery, david.hill, linux-usb,
netdev
In-Reply-To: <20110502.124622.226785624.davem@davemloft.net>
On Mon, May 02, 2011 at 12:46:22PM -0700, David Miller wrote:
>
> Why did this break things?
Hi, I don't know. As upstream is unresponsive and is applying patches to his
private repo without submitting them to the list (which I can understand), I
decided to submit the particular fix so mainline users can get tethering working
again.
I received a forwarded email with the patch (I think that's because I submitted
the driver to mainline) asking for the mainline driver status and if it was
being maintained.
>
> I'm not applying a fix when nobody can explain the reason why:
>
> 1) Things broke in the first place
> 2) Forcing reservation of 2 bytes fixes things
Honestly, I can't answer either of those ones. I just submitted a patch that
*seemed* to fix the problem (I don't own an iPhone device since long time ago),
after explictly requesting upstream to submit by himself, and getting a
negative.
> Where is the built in assumption about "2" and why does it exist? Why
> can't we fix this code not to have such assumptions in the first
> place?
Ditto.
At this point, I think that David, Diego or Daniel should step in if they want
to keep on with this discussion. I won't have problems if you want to take this
off-list.
Best regards,
--
L. Alberto Giménez
JabberID agimenez@jabber.sysvalve.es
GnuPG key ID 0x3BAABDE1
^ permalink raw reply
* Re: [PATCH] ipheth.c: Enable IP header alignment
From: Ben Hutchings @ 2011-05-02 21:04 UTC (permalink / raw)
To: L. Alberto Giménez
Cc: linux-kernel, dgiagio, dborca, davem, pmcenery, david.hill,
open list:USB SUBSYSTEM, open list:NETWORKING DRIVERS
In-Reply-To: <1304364912-15444-1-git-send-email-agimenez@sysvalve.es>
On Mon, 2011-05-02 at 21:35 +0200, L. Alberto Giménez wrote:
> Since commit ea812ca1b06113597adcd8e70c0f84a413d97544 (x86: Align skb w/ start
> of cacheline on newer core 2/Xeon Arch), NET_IP_ALIGN changed from 2 to 0, and
> the constant is used to reserve more room for the socket buffer.
>
> Some people have reported that tethering stopped working and David Hill
> submited a patch that redefined NET_IP_ALIGN. Pointed by Ben Hutchings, the
> patch has been reworked to use a private constant.
>
> I have no more an iPhone device to test it, so it is only compile-tested.
>
> Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
> ---
> drivers/net/usb/ipheth.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
> index 7d42f9a..8f1ffc7 100644
> --- a/drivers/net/usb/ipheth.c
> +++ b/drivers/net/usb/ipheth.c
> @@ -80,6 +80,8 @@
> #define IPHETH_CARRIER_CHECK_TIMEOUT round_jiffies_relative(1 * HZ)
> #define IPHETH_CARRIER_ON 0x04
>
> +#define IPHETH_IP_ALIGN 2
> +
> static struct usb_device_id ipheth_table[] = {
> { USB_DEVICE_AND_INTERFACE_INFO(
> USB_VENDOR_APPLE, USB_PRODUCT_IPHONE,
> @@ -205,15 +207,15 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
> len = urb->actual_length;
> buf = urb->transfer_buffer;
>
> - skb = dev_alloc_skb(NET_IP_ALIGN + len);
> + skb = dev_alloc_skb(IPHETH_IP_ALIGN + len);
> if (!skb) {
> err("%s: dev_alloc_skb: -ENOMEM", __func__);
> dev->net->stats.rx_dropped++;
> return;
> }
>
> - skb_reserve(skb, NET_IP_ALIGN);
> - memcpy(skb_put(skb, len), buf + NET_IP_ALIGN, len - NET_IP_ALIGN);
> + skb_reserve(skb, IPHETH_IP_ALIGN);
> + memcpy(skb_put(skb, len), buf + IPHETH_IP_ALIGN, len - IPHETH_IP_ALIGN);
[...]
So this was using NET_IP_ALIGN as an offset into the URB. Which was
totally bogus, as its value has long been architecture-dependent. The
code is also claiming to put len bytes but only copying len - delta.
The correct code would be something like:
if (urb->actual_length <= IPHETH_IP_ALIGN) {
dev->net->stats.rx_length_errors++;
return;
}
len = urb->actual_length - IPHETH_IP_ALIGN;
buf = urb->transfer_buffer + IPHETH_IP_ALIGN;
dev_alloc_skb(len);
...
memcpy(skb_put(skb, len), buf, len);
Ben.
> skb->dev = dev->net;
> skb->protocol = eth_type_trans(skb, dev->net);
>
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox