Commit 60b86755 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

usbnet: Convert dev(dbg|err|warn|info) macros to netdev_<level>

These macros are too similar to the dev_<level> equivalents
but take a usbnet * argument.  Convert them to the recently
introduced netdev_<level> macros and remove the old macros.

The old macros had "\n" appended to the format string.
Add the "\n" to the converted uses.

Some existing uses of the dev<foo> macros in cdc_eem.c
probably mistakenly had trailing "\n".  No "\n" added there.

Fix net1080 this/other log message inversion.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 82456b03
...@@ -184,7 +184,7 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, ...@@ -184,7 +184,7 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
void *buf; void *buf;
int err = -ENOMEM; int err = -ENOMEM;
devdbg(dev,"asix_read_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d", netdev_dbg(dev->net, "asix_read_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n",
cmd, value, index, size); cmd, value, index, size);
buf = kmalloc(size, GFP_KERNEL); buf = kmalloc(size, GFP_KERNEL);
...@@ -217,7 +217,7 @@ static int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, ...@@ -217,7 +217,7 @@ static int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
void *buf = NULL; void *buf = NULL;
int err = -ENOMEM; int err = -ENOMEM;
devdbg(dev,"asix_write_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d", netdev_dbg(dev->net, "asix_write_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n",
cmd, value, index, size); cmd, value, index, size);
if (data) { if (data) {
...@@ -264,15 +264,15 @@ asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index, ...@@ -264,15 +264,15 @@ asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
int status; int status;
struct urb *urb; struct urb *urb;
devdbg(dev,"asix_write_cmd_async() cmd=0x%02x value=0x%04x index=0x%04x size=%d", netdev_dbg(dev->net, "asix_write_cmd_async() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n",
cmd, value, index, size); cmd, value, index, size);
if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) { if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) {
deverr(dev, "Error allocating URB in write_cmd_async!"); netdev_err(dev->net, "Error allocating URB in write_cmd_async!\n");
return; return;
} }
if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) { if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) {
deverr(dev, "Failed to allocate memory for control request"); netdev_err(dev->net, "Failed to allocate memory for control request\n");
usb_free_urb(urb); usb_free_urb(urb);
return; return;
} }
...@@ -289,7 +289,7 @@ asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index, ...@@ -289,7 +289,7 @@ asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
asix_async_cmd_callback, req); asix_async_cmd_callback, req);
if((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { if((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
deverr(dev, "Error submitting the control message: status=%d", netdev_err(dev->net, "Error submitting the control message: status=%d\n",
status); status);
kfree(req); kfree(req);
usb_free_urb(urb); usb_free_urb(urb);
...@@ -314,7 +314,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -314,7 +314,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
while (skb->len > 0) { while (skb->len > 0) {
if ((short)(header & 0x0000ffff) != if ((short)(header & 0x0000ffff) !=
~((short)((header & 0xffff0000) >> 16))) { ~((short)((header & 0xffff0000) >> 16))) {
deverr(dev,"asix_rx_fixup() Bad Header Length"); netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n");
} }
/* get the packet length */ /* get the packet length */
size = (u16) (header & 0x0000ffff); size = (u16) (header & 0x0000ffff);
...@@ -322,7 +322,8 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -322,7 +322,8 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
if ((skb->len) - ((size + 1) & 0xfffe) == 0) if ((skb->len) - ((size + 1) & 0xfffe) == 0)
return 2; return 2;
if (size > ETH_FRAME_LEN) { if (size > ETH_FRAME_LEN) {
deverr(dev,"asix_rx_fixup() Bad RX Length %d", size); netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n",
size);
return 0; return 0;
} }
ax_skb = skb_clone(skb, GFP_ATOMIC); ax_skb = skb_clone(skb, GFP_ATOMIC);
...@@ -348,7 +349,8 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -348,7 +349,8 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
} }
if (skb->len < 0) { if (skb->len < 0) {
deverr(dev,"asix_rx_fixup() Bad SKB Length %d", skb->len); netdev_err(dev->net, "asix_rx_fixup() Bad SKB Length %d\n",
skb->len);
return 0; return 0;
} }
return 1; return 1;
...@@ -409,7 +411,7 @@ static void asix_status(struct usbnet *dev, struct urb *urb) ...@@ -409,7 +411,7 @@ static void asix_status(struct usbnet *dev, struct urb *urb)
usbnet_defer_kevent (dev, EVENT_LINK_RESET ); usbnet_defer_kevent (dev, EVENT_LINK_RESET );
} else } else
netif_carrier_off(dev->net); netif_carrier_off(dev->net);
devdbg(dev, "Link Status is: %d", link); netdev_dbg(dev->net, "Link Status is: %d\n", link);
} }
} }
...@@ -418,7 +420,7 @@ static inline int asix_set_sw_mii(struct usbnet *dev) ...@@ -418,7 +420,7 @@ static inline int asix_set_sw_mii(struct usbnet *dev)
int ret; int ret;
ret = asix_write_cmd(dev, AX_CMD_SET_SW_MII, 0x0000, 0, 0, NULL); ret = asix_write_cmd(dev, AX_CMD_SET_SW_MII, 0x0000, 0, 0, NULL);
if (ret < 0) if (ret < 0)
deverr(dev, "Failed to enable software MII access"); netdev_err(dev->net, "Failed to enable software MII access\n");
return ret; return ret;
} }
...@@ -427,7 +429,7 @@ static inline int asix_set_hw_mii(struct usbnet *dev) ...@@ -427,7 +429,7 @@ static inline int asix_set_hw_mii(struct usbnet *dev)
int ret; int ret;
ret = asix_write_cmd(dev, AX_CMD_SET_HW_MII, 0x0000, 0, 0, NULL); ret = asix_write_cmd(dev, AX_CMD_SET_HW_MII, 0x0000, 0, 0, NULL);
if (ret < 0) if (ret < 0)
deverr(dev, "Failed to enable hardware MII access"); netdev_err(dev->net, "Failed to enable hardware MII access\n");
return ret; return ret;
} }
...@@ -436,13 +438,14 @@ static inline int asix_get_phy_addr(struct usbnet *dev) ...@@ -436,13 +438,14 @@ static inline int asix_get_phy_addr(struct usbnet *dev)
u8 buf[2]; u8 buf[2];
int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf); int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf);
devdbg(dev, "asix_get_phy_addr()"); netdev_dbg(dev->net, "asix_get_phy_addr()\n");
if (ret < 0) { if (ret < 0) {
deverr(dev, "Error reading PHYID register: %02x", ret); netdev_err(dev->net, "Error reading PHYID register: %02x\n", ret);
goto out; goto out;
} }
devdbg(dev, "asix_get_phy_addr() returning 0x%04x", *((__le16 *)buf)); netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n",
*((__le16 *)buf));
ret = buf[1]; ret = buf[1];
out: out:
...@@ -455,7 +458,7 @@ static int asix_sw_reset(struct usbnet *dev, u8 flags) ...@@ -455,7 +458,7 @@ static int asix_sw_reset(struct usbnet *dev, u8 flags)
ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL); ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL);
if (ret < 0) if (ret < 0)
deverr(dev,"Failed to send software reset: %02x", ret); netdev_err(dev->net, "Failed to send software reset: %02x\n", ret);
return ret; return ret;
} }
...@@ -466,7 +469,7 @@ static u16 asix_read_rx_ctl(struct usbnet *dev) ...@@ -466,7 +469,7 @@ static u16 asix_read_rx_ctl(struct usbnet *dev)
int ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL, 0, 0, 2, &v); int ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL, 0, 0, 2, &v);
if (ret < 0) { if (ret < 0) {
deverr(dev, "Error reading RX_CTL register: %02x", ret); netdev_err(dev->net, "Error reading RX_CTL register: %02x\n", ret);
goto out; goto out;
} }
ret = le16_to_cpu(v); ret = le16_to_cpu(v);
...@@ -478,10 +481,10 @@ static int asix_write_rx_ctl(struct usbnet *dev, u16 mode) ...@@ -478,10 +481,10 @@ static int asix_write_rx_ctl(struct usbnet *dev, u16 mode)
{ {
int ret; int ret;
devdbg(dev,"asix_write_rx_ctl() - mode = 0x%04x", mode); netdev_dbg(dev->net, "asix_write_rx_ctl() - mode = 0x%04x\n", mode);
ret = asix_write_cmd(dev, AX_CMD_WRITE_RX_CTL, mode, 0, 0, NULL); ret = asix_write_cmd(dev, AX_CMD_WRITE_RX_CTL, mode, 0, 0, NULL);
if (ret < 0) if (ret < 0)
deverr(dev, "Failed to write RX_CTL mode to 0x%04x: %02x", netdev_err(dev->net, "Failed to write RX_CTL mode to 0x%04x: %02x\n",
mode, ret); mode, ret);
return ret; return ret;
...@@ -493,7 +496,8 @@ static u16 asix_read_medium_status(struct usbnet *dev) ...@@ -493,7 +496,8 @@ static u16 asix_read_medium_status(struct usbnet *dev)
int ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v); int ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v);
if (ret < 0) { if (ret < 0) {
deverr(dev, "Error reading Medium Status register: %02x", ret); netdev_err(dev->net, "Error reading Medium Status register: %02x\n",
ret);
goto out; goto out;
} }
ret = le16_to_cpu(v); ret = le16_to_cpu(v);
...@@ -505,10 +509,10 @@ static int asix_write_medium_mode(struct usbnet *dev, u16 mode) ...@@ -505,10 +509,10 @@ static int asix_write_medium_mode(struct usbnet *dev, u16 mode)
{ {
int ret; int ret;
devdbg(dev,"asix_write_medium_mode() - mode = 0x%04x", mode); netdev_dbg(dev->net, "asix_write_medium_mode() - mode = 0x%04x\n", mode);
ret = asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); ret = asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
if (ret < 0) if (ret < 0)
deverr(dev, "Failed to write Medium Mode mode to 0x%04x: %02x", netdev_err(dev->net, "Failed to write Medium Mode mode to 0x%04x: %02x\n",
mode, ret); mode, ret);
return ret; return ret;
...@@ -518,10 +522,10 @@ static int asix_write_gpio(struct usbnet *dev, u16 value, int sleep) ...@@ -518,10 +522,10 @@ static int asix_write_gpio(struct usbnet *dev, u16 value, int sleep)
{ {
int ret; int ret;
devdbg(dev,"asix_write_gpio() - value = 0x%04x", value); netdev_dbg(dev->net, "asix_write_gpio() - value = 0x%04x\n", value);
ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS, value, 0, 0, NULL); ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS, value, 0, 0, NULL);
if (ret < 0) if (ret < 0)
deverr(dev, "Failed to write GPIO value 0x%04x: %02x", netdev_err(dev->net, "Failed to write GPIO value 0x%04x: %02x\n",
value, ret); value, ret);
if (sleep) if (sleep)
...@@ -588,7 +592,8 @@ static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc) ...@@ -588,7 +592,8 @@ static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
asix_set_hw_mii(dev); asix_set_hw_mii(dev);
mutex_unlock(&dev->phy_mutex); mutex_unlock(&dev->phy_mutex);
devdbg(dev, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", phy_id, loc, le16_to_cpu(res)); netdev_dbg(dev->net, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
phy_id, loc, le16_to_cpu(res));
return le16_to_cpu(res); return le16_to_cpu(res);
} }
...@@ -599,7 +604,8 @@ asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val) ...@@ -599,7 +604,8 @@ asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
struct usbnet *dev = netdev_priv(netdev); struct usbnet *dev = netdev_priv(netdev);
__le16 res = cpu_to_le16(val); __le16 res = cpu_to_le16(val);
devdbg(dev, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", phy_id, loc, val); netdev_dbg(dev->net, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
phy_id, loc, val);
mutex_lock(&dev->phy_mutex); mutex_lock(&dev->phy_mutex);
asix_set_sw_mii(dev); asix_set_sw_mii(dev);
asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, &res); asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, &res);
...@@ -800,7 +806,8 @@ static int ax88172_link_reset(struct usbnet *dev) ...@@ -800,7 +806,8 @@ static int ax88172_link_reset(struct usbnet *dev)
if (ecmd.duplex != DUPLEX_FULL) if (ecmd.duplex != DUPLEX_FULL)
mode |= ~AX88172_MEDIUM_FD; mode |= ~AX88172_MEDIUM_FD;
devdbg(dev, "ax88172_link_reset() speed: %d duplex: %d setting mode to 0x%04x", ecmd.speed, ecmd.duplex, mode); netdev_dbg(dev->net, "ax88172_link_reset() speed: %d duplex: %d setting mode to 0x%04x\n",
ecmd.speed, ecmd.duplex, mode);
asix_write_medium_mode(dev, mode); asix_write_medium_mode(dev, mode);
...@@ -902,7 +909,8 @@ static int ax88772_link_reset(struct usbnet *dev) ...@@ -902,7 +909,8 @@ static int ax88772_link_reset(struct usbnet *dev)
if (ecmd.duplex != DUPLEX_FULL) if (ecmd.duplex != DUPLEX_FULL)
mode &= ~AX_MEDIUM_FD; mode &= ~AX_MEDIUM_FD;
devdbg(dev, "ax88772_link_reset() speed: %d duplex: %d setting mode to 0x%04x", ecmd.speed, ecmd.duplex, mode); netdev_dbg(dev->net, "ax88772_link_reset() speed: %d duplex: %d setting mode to 0x%04x\n",
ecmd.speed, ecmd.duplex, mode);
asix_write_medium_mode(dev, mode); asix_write_medium_mode(dev, mode);
...@@ -1059,10 +1067,10 @@ static int marvell_phy_init(struct usbnet *dev) ...@@ -1059,10 +1067,10 @@ static int marvell_phy_init(struct usbnet *dev)
struct asix_data *data = (struct asix_data *)&dev->data; struct asix_data *data = (struct asix_data *)&dev->data;
u16 reg; u16 reg;
devdbg(dev,"marvell_phy_init()"); netdev_dbg(dev->net, "marvell_phy_init()\n");
reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_MARVELL_STATUS); reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_MARVELL_STATUS);
devdbg(dev,"MII_MARVELL_STATUS = 0x%04x", reg); netdev_dbg(dev->net, "MII_MARVELL_STATUS = 0x%04x\n", reg);
asix_mdio_write(dev->net, dev->mii.phy_id, MII_MARVELL_CTRL, asix_mdio_write(dev->net, dev->mii.phy_id, MII_MARVELL_CTRL,
MARVELL_CTRL_RXDELAY | MARVELL_CTRL_TXDELAY); MARVELL_CTRL_RXDELAY | MARVELL_CTRL_TXDELAY);
...@@ -1070,7 +1078,7 @@ static int marvell_phy_init(struct usbnet *dev) ...@@ -1070,7 +1078,7 @@ static int marvell_phy_init(struct usbnet *dev)
if (data->ledmode) { if (data->ledmode) {
reg = asix_mdio_read(dev->net, dev->mii.phy_id, reg = asix_mdio_read(dev->net, dev->mii.phy_id,
MII_MARVELL_LED_CTRL); MII_MARVELL_LED_CTRL);
devdbg(dev,"MII_MARVELL_LED_CTRL (1) = 0x%04x", reg); netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (1) = 0x%04x\n", reg);
reg &= 0xf8ff; reg &= 0xf8ff;
reg |= (1 + 0x0100); reg |= (1 + 0x0100);
...@@ -1079,7 +1087,7 @@ static int marvell_phy_init(struct usbnet *dev) ...@@ -1079,7 +1087,7 @@ static int marvell_phy_init(struct usbnet *dev)
reg = asix_mdio_read(dev->net, dev->mii.phy_id, reg = asix_mdio_read(dev->net, dev->mii.phy_id,
MII_MARVELL_LED_CTRL); MII_MARVELL_LED_CTRL);
devdbg(dev,"MII_MARVELL_LED_CTRL (2) = 0x%04x", reg); netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (2) = 0x%04x\n", reg);
reg &= 0xfc0f; reg &= 0xfc0f;
} }
...@@ -1090,7 +1098,7 @@ static int marvell_led_status(struct usbnet *dev, u16 speed) ...@@ -1090,7 +1098,7 @@ static int marvell_led_status(struct usbnet *dev, u16 speed)
{ {
u16 reg = asix_mdio_read(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL); u16 reg = asix_mdio_read(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL);
devdbg(dev, "marvell_led_status() read 0x%04x", reg); netdev_dbg(dev->net, "marvell_led_status() read 0x%04x\n", reg);
/* Clear out the center LED bits - 0x03F0 */ /* Clear out the center LED bits - 0x03F0 */
reg &= 0xfc0f; reg &= 0xfc0f;
...@@ -1106,7 +1114,7 @@ static int marvell_led_status(struct usbnet *dev, u16 speed) ...@@ -1106,7 +1114,7 @@ static int marvell_led_status(struct usbnet *dev, u16 speed)
reg |= 0x02f0; reg |= 0x02f0;
} }
devdbg(dev, "marvell_led_status() writing 0x%04x", reg); netdev_dbg(dev->net, "marvell_led_status() writing 0x%04x\n", reg);
asix_mdio_write(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL, reg); asix_mdio_write(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL, reg);
return 0; return 0;
...@@ -1118,7 +1126,7 @@ static int ax88178_link_reset(struct usbnet *dev) ...@@ -1118,7 +1126,7 @@ static int ax88178_link_reset(struct usbnet *dev)
struct ethtool_cmd ecmd; struct ethtool_cmd ecmd;
struct asix_data *data = (struct asix_data *)&dev->data; struct asix_data *data = (struct asix_data *)&dev->data;
devdbg(dev,"ax88178_link_reset()"); netdev_dbg(dev->net, "ax88178_link_reset()\n");
mii_check_media(&dev->mii, 1, 1); mii_check_media(&dev->mii, 1, 1);
mii_ethtool_gset(&dev->mii, &ecmd); mii_ethtool_gset(&dev->mii, &ecmd);
...@@ -1138,7 +1146,8 @@ static int ax88178_link_reset(struct usbnet *dev) ...@@ -1138,7 +1146,8 @@ static int ax88178_link_reset(struct usbnet *dev)
else else
mode &= ~AX_MEDIUM_FD; mode &= ~AX_MEDIUM_FD;
devdbg(dev, "ax88178_link_reset() speed: %d duplex: %d setting mode to 0x%04x", ecmd.speed, ecmd.duplex, mode); netdev_dbg(dev->net, "ax88178_link_reset() speed: %d duplex: %d setting mode to 0x%04x\n",
ecmd.speed, ecmd.duplex, mode);
asix_write_medium_mode(dev, mode); asix_write_medium_mode(dev, mode);
...@@ -1188,7 +1197,7 @@ static int ax88178_change_mtu(struct net_device *net, int new_mtu) ...@@ -1188,7 +1197,7 @@ static int ax88178_change_mtu(struct net_device *net, int new_mtu)
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
int ll_mtu = new_mtu + net->hard_header_len + 4; int ll_mtu = new_mtu + net->hard_header_len + 4;
devdbg(dev, "ax88178_change_mtu() new_mtu=%d", new_mtu); netdev_dbg(dev->net, "ax88178_change_mtu() new_mtu=%d\n", new_mtu);
if (new_mtu <= 0 || ll_mtu > 16384) if (new_mtu <= 0 || ll_mtu > 16384)
return -EINVAL; return -EINVAL;
......
...@@ -73,7 +73,7 @@ static void eem_linkcmd(struct usbnet *dev, struct sk_buff *skb) ...@@ -73,7 +73,7 @@ static void eem_linkcmd(struct usbnet *dev, struct sk_buff *skb)
usb_free_urb(urb); usb_free_urb(urb);
fail: fail:
dev_kfree_skb(skb); dev_kfree_skb(skb);
devwarn(dev, "link cmd failure\n"); netdev_warn(dev->net, "link cmd failure\n");
return; return;
} }
} }
...@@ -212,7 +212,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -212,7 +212,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
* b15: 1 (EEM command) * b15: 1 (EEM command)
*/ */
if (header & BIT(14)) { if (header & BIT(14)) {
devdbg(dev, "reserved command %04x\n", header); netdev_dbg(dev->net, "reserved command %04x\n",
header);
continue; continue;
} }
...@@ -255,7 +256,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -255,7 +256,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
case 1: /* Echo response */ case 1: /* Echo response */
case 5: /* Tickle */ case 5: /* Tickle */
default: /* reserved */ default: /* reserved */
devwarn(dev, "unexpected link command %d\n", netdev_warn(dev->net,
"unexpected link command %d\n",
bmEEMCmd); bmEEMCmd);
continue; continue;
} }
......
...@@ -340,7 +340,7 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind); ...@@ -340,7 +340,7 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
static void dumpspeed(struct usbnet *dev, __le32 *speeds) static void dumpspeed(struct usbnet *dev, __le32 *speeds)
{ {
if (netif_msg_timer(dev)) if (netif_msg_timer(dev))
devinfo(dev, "link speeds: %u kbps up, %u kbps down", netdev_info(dev->net, "link speeds: %u kbps up, %u kbps down\n",
__le32_to_cpu(speeds[0]) / 1000, __le32_to_cpu(speeds[0]) / 1000,
__le32_to_cpu(speeds[1]) / 1000); __le32_to_cpu(speeds[1]) / 1000);
} }
...@@ -362,7 +362,7 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) ...@@ -362,7 +362,7 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
switch (event->bNotificationType) { switch (event->bNotificationType) {
case USB_CDC_NOTIFY_NETWORK_CONNECTION: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
if (netif_msg_timer(dev)) if (netif_msg_timer(dev))
devdbg(dev, "CDC: carrier %s", netdev_dbg(dev->net, "CDC: carrier %s\n",
event->wValue ? "on" : "off"); event->wValue ? "on" : "off");
if (event->wValue) if (event->wValue)
netif_carrier_on(dev->net); netif_carrier_on(dev->net);
...@@ -371,7 +371,7 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) ...@@ -371,7 +371,7 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
break; break;
case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */
if (netif_msg_timer(dev)) if (netif_msg_timer(dev))
devdbg(dev, "CDC: speed change (len %d)", netdev_dbg(dev->net, "CDC: speed change (len %d)\n",
urb->actual_length); urb->actual_length);
if (urb->actual_length != (sizeof *event + 8)) if (urb->actual_length != (sizeof *event + 8))
set_bit(EVENT_STS_SPLIT, &dev->flags); set_bit(EVENT_STS_SPLIT, &dev->flags);
...@@ -382,7 +382,7 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) ...@@ -382,7 +382,7 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
* but there are no standard formats for the response data. * but there are no standard formats for the response data.
*/ */
default: default:
deverr(dev, "CDC: unexpected notification %02x!", netdev_err(dev->net, "CDC: unexpected notification %02x!\n",
event->bNotificationType); event->bNotificationType);
break; break;
} }
......
...@@ -58,7 +58,7 @@ static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data) ...@@ -58,7 +58,7 @@ static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
void *buf; void *buf;
int err = -ENOMEM; int err = -ENOMEM;
devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length); netdev_dbg(dev->net, "dm_read() reg=0x%02x length=%d\n", reg, length);
buf = kmalloc(length, GFP_KERNEL); buf = kmalloc(length, GFP_KERNEL);
if (!buf) if (!buf)
...@@ -89,7 +89,7 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) ...@@ -89,7 +89,7 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
void *buf = NULL; void *buf = NULL;
int err = -ENOMEM; int err = -ENOMEM;
devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length); netdev_dbg(dev->net, "dm_write() reg=0x%02x, length=%d\n", reg, length);
if (data) { if (data) {
buf = kmalloc(length, GFP_KERNEL); buf = kmalloc(length, GFP_KERNEL);
...@@ -112,7 +112,8 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) ...@@ -112,7 +112,8 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
{ {
devdbg(dev, "dm_write_reg() reg=0x%02x, value=0x%02x", reg, value); netdev_dbg(dev->net, "dm_write_reg() reg=0x%02x, value=0x%02x\n",
reg, value);
return usb_control_msg(dev->udev, return usb_control_msg(dev->udev,
usb_sndctrlpipe(dev->udev, 0), usb_sndctrlpipe(dev->udev, 0),
DM_WRITE_REG, DM_WRITE_REG,
...@@ -142,13 +143,13 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, ...@@ -142,13 +143,13 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
urb = usb_alloc_urb(0, GFP_ATOMIC); urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) { if (!urb) {
deverr(dev, "Error allocating URB in dm_write_async_helper!"); netdev_err(dev->net, "Error allocating URB in dm_write_async_helper!\n");
return; return;
} }
req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
if (!req) { if (!req) {
deverr(dev, "Failed to allocate memory for control request"); netdev_err(dev->net, "Failed to allocate memory for control request\n");
usb_free_urb(urb); usb_free_urb(urb);
return; return;
} }
...@@ -166,7 +167,7 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, ...@@ -166,7 +167,7 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0) { if (status < 0) {
deverr(dev, "Error submitting the control message: status=%d", netdev_err(dev->net, "Error submitting the control message: status=%d\n",
status); status);
kfree(req); kfree(req);
usb_free_urb(urb); usb_free_urb(urb);
...@@ -175,14 +176,14 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, ...@@ -175,14 +176,14 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
{ {
devdbg(dev, "dm_write_async() reg=0x%02x length=%d", reg, length); netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length);
dm_write_async_helper(dev, reg, 0, length, data); dm_write_async_helper(dev, reg, 0, length, data);
} }
static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value) static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
{ {
devdbg(dev, "dm_write_reg_async() reg=0x%02x value=0x%02x", netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n",
reg, value); reg, value);
dm_write_async_helper(dev, reg, value, 0, NULL); dm_write_async_helper(dev, reg, value, 0, NULL);
...@@ -211,7 +212,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu ...@@ -211,7 +212,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu
} }
if (i == DM_TIMEOUT) { if (i == DM_TIMEOUT) {
deverr(dev, "%s read timed out!", phy ? "phy" : "eeprom"); netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom");
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -219,7 +220,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu ...@@ -219,7 +220,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu
dm_write_reg(dev, DM_SHARED_CTRL, 0x0); dm_write_reg(dev, DM_SHARED_CTRL, 0x0);
ret = dm_read(dev, DM_SHARED_DATA, 2, value); ret = dm_read(dev, DM_SHARED_DATA, 2, value);
devdbg(dev, "read shared %d 0x%02x returned 0x%04x, %d", netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n",
phy, reg, *value, ret); phy, reg, *value, ret);
out: out:
...@@ -254,7 +255,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu ...@@ -254,7 +255,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu
} }
if (i == DM_TIMEOUT) { if (i == DM_TIMEOUT) {
deverr(dev, "%s write timed out!", phy ? "phy" : "eeprom"); netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom");
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -304,14 +305,14 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc) ...@@ -304,14 +305,14 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
__le16 res; __le16 res;
if (phy_id) { if (phy_id) {
devdbg(dev, "Only internal phy supported"); netdev_dbg(dev->net, "Only internal phy supported\n");
return 0; return 0;
} }
dm_read_shared_word(dev, 1, loc, &res); dm_read_shared_word(dev, 1, loc, &res);
devdbg(dev, netdev_dbg(dev->net,
"dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
phy_id, loc, le16_to_cpu(res)); phy_id, loc, le16_to_cpu(res));
return le16_to_cpu(res); return le16_to_cpu(res);
...@@ -324,11 +325,11 @@ static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc, ...@@ -324,11 +325,11 @@ static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc,
__le16 res = cpu_to_le16(val); __le16 res = cpu_to_le16(val);
if (phy_id) { if (phy_id) {
devdbg(dev, "Only internal phy supported"); netdev_dbg(dev->net, "Only internal phy supported\n");
return; return;
} }
devdbg(dev,"dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
phy_id, loc, val); phy_id, loc, val);
dm_write_shared_word(dev, 1, loc, res); dm_write_shared_word(dev, 1, loc, res);
...@@ -592,7 +593,7 @@ static void dm9601_status(struct usbnet *dev, struct urb *urb) ...@@ -592,7 +593,7 @@ static void dm9601_status(struct usbnet *dev, struct urb *urb)
} }
else else
netif_carrier_off(dev->net); netif_carrier_off(dev->net);
devdbg(dev, "Link Status is: %d", link); netdev_dbg(dev->net, "Link Status is: %d\n", link);
} }
} }
...@@ -603,7 +604,7 @@ static int dm9601_link_reset(struct usbnet *dev) ...@@ -603,7 +604,7 @@ static int dm9601_link_reset(struct usbnet *dev)
mii_check_media(&dev->mii, 1, 1); mii_check_media(&dev->mii, 1, 1);
mii_ethtool_gset(&dev->mii, &ecmd); mii_ethtool_gset(&dev->mii, &ecmd);
devdbg(dev, "link_reset() speed: %d duplex: %d", netdev_dbg(dev->net, "link_reset() speed: %d duplex: %d\n",
ecmd.speed, ecmd.duplex); ecmd.speed, ecmd.duplex);
return 0; return 0;
......
...@@ -51,7 +51,7 @@ static int int51x1_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -51,7 +51,7 @@ static int int51x1_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
int len; int len;
if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) { if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) {
deverr(dev, "unexpected tiny rx frame"); netdev_err(dev->net, "unexpected tiny rx frame\n");
return 0; return 0;
} }
...@@ -138,25 +138,25 @@ static void int51x1_set_multicast(struct net_device *netdev) ...@@ -138,25 +138,25 @@ static void int51x1_set_multicast(struct net_device *netdev)
if (netdev->flags & IFF_PROMISC) { if (netdev->flags & IFF_PROMISC) {
/* do not expect to see traffic of other PLCs */ /* do not expect to see traffic of other PLCs */
filter |= PACKET_TYPE_PROMISCUOUS; filter |= PACKET_TYPE_PROMISCUOUS;
devinfo(dev, "promiscuous mode enabled"); netdev_info(dev->net, "promiscuous mode enabled\n");
} else if (!netdev_mc_empty(netdev) || } else if (!netdev_mc_empty(netdev) ||
(netdev->flags & IFF_ALLMULTI)) { (netdev->flags & IFF_ALLMULTI)) {
filter |= PACKET_TYPE_ALL_MULTICAST; filter |= PACKET_TYPE_ALL_MULTICAST;
devdbg(dev, "receive all multicast enabled"); netdev_dbg(dev->net, "receive all multicast enabled\n");
} else { } else {
/* ~PROMISCUOUS, ~MULTICAST */ /* ~PROMISCUOUS, ~MULTICAST */
devdbg(dev, "receive own packets only"); netdev_dbg(dev->net, "receive own packets only\n");
} }
urb = usb_alloc_urb(0, GFP_ATOMIC); urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) { if (!urb) {
devwarn(dev, "Error allocating URB"); netdev_warn(dev->net, "Error allocating URB\n");
return; return;
} }
req = kmalloc(sizeof(*req), GFP_ATOMIC); req = kmalloc(sizeof(*req), GFP_ATOMIC);
if (!req) { if (!req) {
devwarn(dev, "Error allocating control msg"); netdev_warn(dev->net, "Error allocating control msg\n");
goto out; goto out;
} }
...@@ -173,7 +173,8 @@ static void int51x1_set_multicast(struct net_device *netdev) ...@@ -173,7 +173,8 @@ static void int51x1_set_multicast(struct net_device *netdev)
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0) { if (status < 0) {
devwarn(dev, "Error submitting control msg, sts=%d", status); netdev_warn(dev->net, "Error submitting control msg, sts=%d\n",
status);
goto out1; goto out1;
} }
return; return;
......
...@@ -205,9 +205,9 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) ...@@ -205,9 +205,9 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
{ {
if (!netif_msg_link(dev)) if (!netif_msg_link(dev))
return; return;
devdbg(dev, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" netdev_dbg(dev->net, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;"
" this%s%s;" " this%s%s;"
" other%s%s; r/o 0x%x", " other%s%s; r/o 0x%x\n",
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name, dev->udev->devpath,
usbctl, usbctl,
(usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "",
...@@ -216,12 +216,13 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) ...@@ -216,12 +216,13 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
(usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "",
(usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "",
(usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "",
(usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
(usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "",
(usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "",
usbctl & ~USBCTL_WRITABLE_MASK
); (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "",
(usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
usbctl & ~USBCTL_WRITABLE_MASK);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -250,9 +251,7 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) ...@@ -250,9 +251,7 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status)
{ {
if (!netif_msg_link(dev)) if (!netif_msg_link(dev))
return; return;
devdbg(dev, "net1080 %s-%s status 0x%x:" netdev_dbg(dev->net, "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n",
" this (%c) PKT=%d%s%s%s;"
" other PKT=%d%s%s%s; unspec 0x%x",
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name, dev->udev->devpath,
status, status,
...@@ -270,8 +269,7 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) ...@@ -270,8 +269,7 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status)
(status & STATUS_SUSPEND_OTHER) ? " SUS" : "", (status & STATUS_SUSPEND_OTHER) ? " SUS" : "",
(status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "",
status & STATUS_UNSPEC_MASK status & STATUS_UNSPEC_MASK);
);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -287,7 +285,7 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) ...@@ -287,7 +285,7 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status)
static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl)
{ {
if (netif_msg_link(dev)) if (netif_msg_link(dev))
devdbg(dev, "net1080 %s-%s ttl 0x%x this = %d, other = %d", netdev_dbg(dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n",
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name, dev->udev->devpath,
ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); ttl, TTL_THIS(ttl), TTL_OTHER(ttl));
} }
...@@ -335,10 +333,9 @@ static int net1080_reset(struct usbnet *dev) ...@@ -335,10 +333,9 @@ static int net1080_reset(struct usbnet *dev)
dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS);
if (netif_msg_link(dev)) if (netif_msg_link(dev))
devinfo(dev, "port %c, peer %sconnected", netdev_info(dev->net, "port %c, peer %sconnected\n",
(status & STATUS_PORT_A) ? 'A' : 'B', (status & STATUS_PORT_A) ? 'A' : 'B',
(status & STATUS_CONN_OTHER) ? "" : "dis" (status & STATUS_CONN_OTHER) ? "" : "dis");
);
retval = 0; retval = 0;
done: done:
...@@ -416,7 +413,7 @@ static void nc_ensure_sync(struct usbnet *dev) ...@@ -416,7 +413,7 @@ static void nc_ensure_sync(struct usbnet *dev)
} }
if (netif_msg_rx_err(dev)) if (netif_msg_rx_err(dev))
devdbg(dev, "flush net1080; too many framing errors"); netdev_dbg(dev->net, "flush net1080; too many framing errors\n");
dev->frame_errors = 0; dev->frame_errors = 0;
} }
} }
...@@ -486,7 +483,7 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -486,7 +483,7 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
return 0; return 0;
} }
#if 0 #if 0
devdbg(dev, "frame <rx h %d p %d id %d", header->hdr_len, netdev_dbg(dev->net, "frame <rx h %d p %d id %d\n", header->hdr_len,
header->packet_len, header->packet_id); header->packet_len, header->packet_id);
#endif #endif
dev->frame_errors = 0; dev->frame_errors = 0;
...@@ -547,7 +544,7 @@ net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) ...@@ -547,7 +544,7 @@ net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer);
put_unaligned(header->packet_id, &trailer->packet_id); put_unaligned(header->packet_id, &trailer->packet_id);
#if 0 #if 0
devdbg(dev, "frame >tx h %d p %d id %d", netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n",
header->hdr_len, header->packet_len, header->hdr_len, header->packet_len,
header->packet_id); header->packet_id);
#endif #endif
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
*/ */
void rndis_status(struct usbnet *dev, struct urb *urb) void rndis_status(struct usbnet *dev, struct urb *urb)
{ {
devdbg(dev, "rndis status urb, len %d stat %d", netdev_dbg(dev->net, "rndis status urb, len %d stat %d\n",
urb->actual_length, urb->status); urb->actual_length, urb->status);
// FIXME for keepalives, respond immediately (asynchronously) // FIXME for keepalives, respond immediately (asynchronously)
// if not an RNDIS status, do like cdc_status(dev,urb) does // if not an RNDIS status, do like cdc_status(dev,urb) does
...@@ -497,7 +497,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -497,7 +497,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
skb->len < msg_len || skb->len < msg_len ||
(data_offset + data_len + 8) > msg_len)) { (data_offset + data_len + 8) > msg_len)) {
dev->net->stats.rx_frame_errors++; dev->net->stats.rx_frame_errors++;
devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", netdev_dbg(dev->net, "bad rndis message %d/%d/%d/%d, len %d\n",
le32_to_cpu(hdr->msg_type), le32_to_cpu(hdr->msg_type),
msg_len, data_offset, data_len, skb->len); msg_len, data_offset, data_len, skb->len);
return 0; return 0;
......
...@@ -78,7 +78,7 @@ static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) ...@@ -78,7 +78,7 @@ static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data)
00, index, buf, 4, USB_CTRL_GET_TIMEOUT); 00, index, buf, 4, USB_CTRL_GET_TIMEOUT);
if (unlikely(ret < 0)) if (unlikely(ret < 0))
devwarn(dev, "Failed to read register index 0x%08x", index); netdev_warn(dev->net, "Failed to read register index 0x%08x\n", index);
le32_to_cpus(buf); le32_to_cpus(buf);
*data = *buf; *data = *buf;
...@@ -106,7 +106,7 @@ static int smsc95xx_write_reg(struct usbnet *dev, u32 index, u32 data) ...@@ -106,7 +106,7 @@ static int smsc95xx_write_reg(struct usbnet *dev, u32 index, u32 data)
00, index, buf, 4, USB_CTRL_SET_TIMEOUT); 00, index, buf, 4, USB_CTRL_SET_TIMEOUT);
if (unlikely(ret < 0)) if (unlikely(ret < 0))
devwarn(dev, "Failed to write register index 0x%08x", index); netdev_warn(dev->net, "Failed to write register index 0x%08x\n", index);
kfree(buf); kfree(buf);
...@@ -138,7 +138,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) ...@@ -138,7 +138,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
/* confirm MII not busy */ /* confirm MII not busy */
if (smsc95xx_phy_wait_not_busy(dev)) { if (smsc95xx_phy_wait_not_busy(dev)) {
devwarn(dev, "MII is busy in smsc95xx_mdio_read"); netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_read\n");
mutex_unlock(&dev->phy_mutex); mutex_unlock(&dev->phy_mutex);
return -EIO; return -EIO;
} }
...@@ -150,7 +150,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) ...@@ -150,7 +150,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
smsc95xx_write_reg(dev, MII_ADDR, addr); smsc95xx_write_reg(dev, MII_ADDR, addr);
if (smsc95xx_phy_wait_not_busy(dev)) { if (smsc95xx_phy_wait_not_busy(dev)) {
devwarn(dev, "Timed out reading MII reg %02X", idx); netdev_warn(dev->net, "Timed out reading MII reg %02X\n", idx);
mutex_unlock(&dev->phy_mutex); mutex_unlock(&dev->phy_mutex);
return -EIO; return -EIO;
} }
...@@ -172,7 +172,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx, ...@@ -172,7 +172,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
/* confirm MII not busy */ /* confirm MII not busy */
if (smsc95xx_phy_wait_not_busy(dev)) { if (smsc95xx_phy_wait_not_busy(dev)) {
devwarn(dev, "MII is busy in smsc95xx_mdio_write"); netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_write\n");
mutex_unlock(&dev->phy_mutex); mutex_unlock(&dev->phy_mutex);
return; return;
} }
...@@ -187,7 +187,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx, ...@@ -187,7 +187,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
smsc95xx_write_reg(dev, MII_ADDR, addr); smsc95xx_write_reg(dev, MII_ADDR, addr);
if (smsc95xx_phy_wait_not_busy(dev)) if (smsc95xx_phy_wait_not_busy(dev))
devwarn(dev, "Timed out writing MII reg %02X", idx); netdev_warn(dev->net, "Timed out writing MII reg %02X\n", idx);
mutex_unlock(&dev->phy_mutex); mutex_unlock(&dev->phy_mutex);
} }
...@@ -205,7 +205,7 @@ static int smsc95xx_wait_eeprom(struct usbnet *dev) ...@@ -205,7 +205,7 @@ static int smsc95xx_wait_eeprom(struct usbnet *dev)
} while (!time_after(jiffies, start_time + HZ)); } while (!time_after(jiffies, start_time + HZ));
if (val & (E2P_CMD_TIMEOUT_ | E2P_CMD_BUSY_)) { if (val & (E2P_CMD_TIMEOUT_ | E2P_CMD_BUSY_)) {
devwarn(dev, "EEPROM read operation timeout"); netdev_warn(dev->net, "EEPROM read operation timeout\n");
return -EIO; return -EIO;
} }
...@@ -226,7 +226,7 @@ static int smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev) ...@@ -226,7 +226,7 @@ static int smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev)
udelay(40); udelay(40);
} while (!time_after(jiffies, start_time + HZ)); } while (!time_after(jiffies, start_time + HZ));
devwarn(dev, "EEPROM is busy"); netdev_warn(dev->net, "EEPROM is busy\n");
return -EIO; return -EIO;
} }
...@@ -308,7 +308,7 @@ static void smsc95xx_async_cmd_callback(struct urb *urb) ...@@ -308,7 +308,7 @@ static void smsc95xx_async_cmd_callback(struct urb *urb)
int status = urb->status; int status = urb->status;
if (status < 0) if (status < 0)
devwarn(dev, "async callback failed with %d", status); netdev_warn(dev->net, "async callback failed with %d\n", status);
kfree(usb_context); kfree(usb_context);
usb_free_urb(urb); usb_free_urb(urb);
...@@ -323,13 +323,13 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data) ...@@ -323,13 +323,13 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data)
urb = usb_alloc_urb(0, GFP_ATOMIC); urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) { if (!urb) {
devwarn(dev, "Error allocating URB"); netdev_warn(dev->net, "Error allocating URB\n");
return -ENOMEM; return -ENOMEM;
} }
usb_context = kmalloc(sizeof(struct usb_context), GFP_ATOMIC); usb_context = kmalloc(sizeof(struct usb_context), GFP_ATOMIC);
if (usb_context == NULL) { if (usb_context == NULL) {
devwarn(dev, "Error allocating control msg"); netdev_warn(dev->net, "Error allocating control msg\n");
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -348,7 +348,8 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data) ...@@ -348,7 +348,8 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data)
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0) { if (status < 0) {
devwarn(dev, "Error submitting control msg, sts=%d", status); netdev_warn(dev->net, "Error submitting control msg, sts=%d\n",
status);
kfree(usb_context); kfree(usb_context);
usb_free_urb(urb); usb_free_urb(urb);
} }
...@@ -376,12 +377,12 @@ static void smsc95xx_set_multicast(struct net_device *netdev) ...@@ -376,12 +377,12 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
if (dev->net->flags & IFF_PROMISC) { if (dev->net->flags & IFF_PROMISC) {
if (netif_msg_drv(dev)) if (netif_msg_drv(dev))
devdbg(dev, "promiscuous mode enabled"); netdev_dbg(dev->net, "promiscuous mode enabled\n");
pdata->mac_cr |= MAC_CR_PRMS_; pdata->mac_cr |= MAC_CR_PRMS_;
pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_); pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_);
} else if (dev->net->flags & IFF_ALLMULTI) { } else if (dev->net->flags & IFF_ALLMULTI) {
if (netif_msg_drv(dev)) if (netif_msg_drv(dev))
devdbg(dev, "receive all multicast enabled"); netdev_dbg(dev->net, "receive all multicast enabled\n");
pdata->mac_cr |= MAC_CR_MCPAS_; pdata->mac_cr |= MAC_CR_MCPAS_;
pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
} else if (!netdev_mc_empty(dev->net)) { } else if (!netdev_mc_empty(dev->net)) {
...@@ -401,20 +402,20 @@ static void smsc95xx_set_multicast(struct net_device *netdev) ...@@ -401,20 +402,20 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
else else
hash_lo |= mask; hash_lo |= mask;
} else { } else {
devwarn(dev, "dmi_addrlen != 6"); netdev_warn(dev->net, "dmi_addrlen != 6\n");
} }
mc_list = mc_list->next; mc_list = mc_list->next;
} }
if (count != ((u32) netdev_mc_count(dev->net))) if (count != ((u32) netdev_mc_count(dev->net)))
devwarn(dev, "mc_count != dev->mc_count"); netdev_warn(dev->net, "mc_count != dev->mc_count\n");
if (netif_msg_drv(dev)) if (netif_msg_drv(dev))
devdbg(dev, "HASHH=0x%08X, HASHL=0x%08X", hash_hi, netdev_dbg(dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
hash_lo); hash_hi, hash_lo);
} else { } else {
if (netif_msg_drv(dev)) if (netif_msg_drv(dev))
devdbg(dev, "receive own packets only"); netdev_dbg(dev->net, "receive own packets only\n");
pdata->mac_cr &= pdata->mac_cr &=
~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_);
} }
...@@ -434,7 +435,7 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, ...@@ -434,7 +435,7 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "error reading AFC_CFG"); netdev_warn(dev->net, "error reading AFC_CFG\n");
return; return;
} }
...@@ -452,12 +453,12 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, ...@@ -452,12 +453,12 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
afc_cfg &= ~0xF; afc_cfg &= ~0xF;
if (netif_msg_link(dev)) if (netif_msg_link(dev))
devdbg(dev, "rx pause %s, tx pause %s", netdev_dbg(dev->net, "rx pause %s, tx pause %s\n",
(cap & FLOW_CTRL_RX ? "enabled" : "disabled"), cap & FLOW_CTRL_RX ? "enabled" : "disabled",
(cap & FLOW_CTRL_TX ? "enabled" : "disabled")); cap & FLOW_CTRL_TX ? "enabled" : "disabled");
} else { } else {
if (netif_msg_link(dev)) if (netif_msg_link(dev))
devdbg(dev, "half duplex"); netdev_dbg(dev->net, "half duplex\n");
flow = 0; flow = 0;
afc_cfg |= 0xF; afc_cfg |= 0xF;
} }
...@@ -486,7 +487,7 @@ static int smsc95xx_link_reset(struct usbnet *dev) ...@@ -486,7 +487,7 @@ static int smsc95xx_link_reset(struct usbnet *dev)
rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA); rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA);
if (netif_msg_link(dev)) if (netif_msg_link(dev))
devdbg(dev, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x", netdev_dbg(dev->net, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x\n",
ecmd.speed, ecmd.duplex, lcladv, rmtadv); ecmd.speed, ecmd.duplex, lcladv, rmtadv);
spin_lock_irqsave(&pdata->mac_cr_lock, flags); spin_lock_irqsave(&pdata->mac_cr_lock, flags);
...@@ -511,7 +512,8 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) ...@@ -511,7 +512,8 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb)
u32 intdata; u32 intdata;
if (urb->actual_length != 4) { if (urb->actual_length != 4) {
devwarn(dev, "unexpected urb length %d", urb->actual_length); netdev_warn(dev->net, "unexpected urb length %d\n",
urb->actual_length);
return; return;
} }
...@@ -519,12 +521,13 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) ...@@ -519,12 +521,13 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb)
le32_to_cpus(&intdata); le32_to_cpus(&intdata);
if (netif_msg_link(dev)) if (netif_msg_link(dev))
devdbg(dev, "intdata: 0x%08X", intdata); netdev_dbg(dev->net, "intdata: 0x%08X\n", intdata);
if (intdata & INT_ENP_PHY_INT_) if (intdata & INT_ENP_PHY_INT_)
usbnet_defer_kevent(dev, EVENT_LINK_RESET); usbnet_defer_kevent(dev, EVENT_LINK_RESET);
else else
devwarn(dev, "unexpected interrupt, intdata=0x%08X", intdata); netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n",
intdata);
} }
/* Enable or disable Tx & Rx checksum offload engines */ /* Enable or disable Tx & Rx checksum offload engines */
...@@ -534,7 +537,7 @@ static int smsc95xx_set_csums(struct usbnet *dev) ...@@ -534,7 +537,7 @@ static int smsc95xx_set_csums(struct usbnet *dev)
u32 read_buf; u32 read_buf;
int ret = smsc95xx_read_reg(dev, COE_CR, &read_buf); int ret = smsc95xx_read_reg(dev, COE_CR, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read COE_CR: %d", ret); netdev_warn(dev->net, "Failed to read COE_CR: %d\n", ret);
return ret; return ret;
} }
...@@ -550,12 +553,12 @@ static int smsc95xx_set_csums(struct usbnet *dev) ...@@ -550,12 +553,12 @@ static int smsc95xx_set_csums(struct usbnet *dev)
ret = smsc95xx_write_reg(dev, COE_CR, read_buf); ret = smsc95xx_write_reg(dev, COE_CR, read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write COE_CR: %d", ret); netdev_warn(dev->net, "Failed to write COE_CR: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_hw(dev)) if (netif_msg_hw(dev))
devdbg(dev, "COE_CR = 0x%08x", read_buf); netdev_dbg(dev->net, "COE_CR = 0x%08x\n", read_buf);
return 0; return 0;
} }
...@@ -580,7 +583,7 @@ static int smsc95xx_ethtool_set_eeprom(struct net_device *netdev, ...@@ -580,7 +583,7 @@ static int smsc95xx_ethtool_set_eeprom(struct net_device *netdev,
struct usbnet *dev = netdev_priv(netdev); struct usbnet *dev = netdev_priv(netdev);
if (ee->magic != LAN95XX_EEPROM_MAGIC) { if (ee->magic != LAN95XX_EEPROM_MAGIC) {
devwarn(dev, "EEPROM: magic value mismatch, magic = 0x%x", netdev_warn(dev->net, "EEPROM: magic value mismatch, magic = 0x%x\n",
ee->magic); ee->magic);
return -EINVAL; return -EINVAL;
} }
...@@ -660,7 +663,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) ...@@ -660,7 +663,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
if (is_valid_ether_addr(dev->net->dev_addr)) { if (is_valid_ether_addr(dev->net->dev_addr)) {
/* eeprom values are valid so use them */ /* eeprom values are valid so use them */
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "MAC address read from EEPROM"); netdev_dbg(dev->net, "MAC address read from EEPROM\n");
return; return;
} }
} }
...@@ -668,7 +671,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) ...@@ -668,7 +671,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
/* no eeprom, or eeprom values are invalid. generate random MAC */ /* no eeprom, or eeprom values are invalid. generate random MAC */
random_ether_addr(dev->net->dev_addr); random_ether_addr(dev->net->dev_addr);
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "MAC address set to random_ether_addr"); netdev_dbg(dev->net, "MAC address set to random_ether_addr\n");
} }
static int smsc95xx_set_mac_address(struct usbnet *dev) static int smsc95xx_set_mac_address(struct usbnet *dev)
...@@ -680,13 +683,13 @@ static int smsc95xx_set_mac_address(struct usbnet *dev) ...@@ -680,13 +683,13 @@ static int smsc95xx_set_mac_address(struct usbnet *dev)
ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); ret = smsc95xx_write_reg(dev, ADDRL, addr_lo);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write ADDRL: %d", ret); netdev_warn(dev->net, "Failed to write ADDRL: %d\n", ret);
return ret; return ret;
} }
ret = smsc95xx_write_reg(dev, ADDRH, addr_hi); ret = smsc95xx_write_reg(dev, ADDRH, addr_hi);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write ADDRH: %d", ret); netdev_warn(dev->net, "Failed to write ADDRH: %d\n", ret);
return ret; return ret;
} }
...@@ -748,7 +751,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) ...@@ -748,7 +751,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
mii_nway_restart(&dev->mii); mii_nway_restart(&dev->mii);
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "phy initialised successfully"); netdev_dbg(dev->net, "phy initialised successfully\n");
return 0; return 0;
} }
...@@ -760,13 +763,13 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -760,13 +763,13 @@ static int smsc95xx_reset(struct usbnet *dev)
int ret = 0, timeout; int ret = 0, timeout;
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "entering smsc95xx_reset"); netdev_dbg(dev->net, "entering smsc95xx_reset\n");
write_buf = HW_CFG_LRST_; write_buf = HW_CFG_LRST_;
ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); ret = smsc95xx_write_reg(dev, HW_CFG, write_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write HW_CFG_LRST_ bit in HW_CFG " netdev_warn(dev->net, "Failed to write HW_CFG_LRST_ bit in HW_CFG register, ret = %d\n",
"register, ret = %d", ret); ret);
return ret; return ret;
} }
...@@ -774,7 +777,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -774,7 +777,7 @@ static int smsc95xx_reset(struct usbnet *dev)
do { do {
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read HW_CFG: %d", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
msleep(10); msleep(10);
...@@ -782,14 +785,14 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -782,14 +785,14 @@ static int smsc95xx_reset(struct usbnet *dev)
} while ((read_buf & HW_CFG_LRST_) && (timeout < 100)); } while ((read_buf & HW_CFG_LRST_) && (timeout < 100));
if (timeout >= 100) { if (timeout >= 100) {
devwarn(dev, "timeout waiting for completion of Lite Reset"); netdev_warn(dev->net, "timeout waiting for completion of Lite Reset\n");
return ret; return ret;
} }
write_buf = PM_CTL_PHY_RST_; write_buf = PM_CTL_PHY_RST_;
ret = smsc95xx_write_reg(dev, PM_CTRL, write_buf); ret = smsc95xx_write_reg(dev, PM_CTRL, write_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write PM_CTRL: %d", ret); netdev_warn(dev->net, "Failed to write PM_CTRL: %d\n", ret);
return ret; return ret;
} }
...@@ -797,7 +800,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -797,7 +800,7 @@ static int smsc95xx_reset(struct usbnet *dev)
do { do {
ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf); ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read PM_CTRL: %d", ret); netdev_warn(dev->net, "Failed to read PM_CTRL: %d\n", ret);
return ret; return ret;
} }
msleep(10); msleep(10);
...@@ -805,7 +808,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -805,7 +808,7 @@ static int smsc95xx_reset(struct usbnet *dev)
} while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100)); } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100));
if (timeout >= 100) { if (timeout >= 100) {
devwarn(dev, "timeout waiting for PHY Reset"); netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
return ret; return ret;
} }
...@@ -816,34 +819,34 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -816,34 +819,34 @@ static int smsc95xx_reset(struct usbnet *dev)
return ret; return ret;
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "MAC Address: %pM", dev->net->dev_addr); netdev_dbg(dev->net, "MAC Address: %pM\n", dev->net->dev_addr);
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read HW_CFG: %d", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "Read Value from HW_CFG : 0x%08x", read_buf); netdev_dbg(dev->net, "Read Value from HW_CFG : 0x%08x\n", read_buf);
read_buf |= HW_CFG_BIR_; read_buf |= HW_CFG_BIR_;
ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); ret = smsc95xx_write_reg(dev, HW_CFG, read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write HW_CFG_BIR_ bit in HW_CFG " netdev_warn(dev->net, "Failed to write HW_CFG_BIR_ bit in HW_CFG register, ret = %d\n",
"register, ret = %d", ret); ret);
return ret; return ret;
} }
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read HW_CFG: %d", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "Read Value from HW_CFG after writing " netdev_dbg(dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n",
"HW_CFG_BIR_: 0x%08x", read_buf); read_buf);
if (!turbo_mode) { if (!turbo_mode) {
burst_cap = 0; burst_cap = 0;
...@@ -857,46 +860,46 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -857,46 +860,46 @@ static int smsc95xx_reset(struct usbnet *dev)
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "rx_urb_size=%ld", (ulong)dev->rx_urb_size); netdev_dbg(dev->net, "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size);
ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write BURST_CAP: %d", ret); netdev_warn(dev->net, "Failed to write BURST_CAP: %d\n", ret);
return ret; return ret;
} }
ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf); ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read BURST_CAP: %d", ret); netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "Read Value from BURST_CAP after writing: 0x%08x", netdev_dbg(dev->net, "Read Value from BURST_CAP after writing: 0x%08x\n",
read_buf); read_buf);
read_buf = DEFAULT_BULK_IN_DELAY; read_buf = DEFAULT_BULK_IN_DELAY;
ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "ret = %d", ret); netdev_warn(dev->net, "ret = %d\n", ret);
return ret; return ret;
} }
ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf); ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read BULK_IN_DLY: %d", ret); netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "Read Value from BULK_IN_DLY after writing: " netdev_dbg(dev->net, "Read Value from BULK_IN_DLY after writing: 0x%08x\n",
"0x%08x", read_buf); read_buf);
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read HW_CFG: %d", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "Read Value from HW_CFG: 0x%08x", read_buf); netdev_dbg(dev->net, "Read Value from HW_CFG: 0x%08x\n", read_buf);
if (turbo_mode) if (turbo_mode)
read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_);
...@@ -908,40 +911,42 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -908,40 +911,42 @@ static int smsc95xx_reset(struct usbnet *dev)
ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); ret = smsc95xx_write_reg(dev, HW_CFG, read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write HW_CFG register, ret=%d", ret); netdev_warn(dev->net, "Failed to write HW_CFG register, ret=%d\n",
ret);
return ret; return ret;
} }
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read HW_CFG: %d", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "Read Value from HW_CFG after writing: 0x%08x", netdev_dbg(dev->net, "Read Value from HW_CFG after writing: 0x%08x\n",
read_buf); read_buf);
write_buf = 0xFFFFFFFF; write_buf = 0xFFFFFFFF;
ret = smsc95xx_write_reg(dev, INT_STS, write_buf); ret = smsc95xx_write_reg(dev, INT_STS, write_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write INT_STS register, ret=%d", ret); netdev_warn(dev->net, "Failed to write INT_STS register, ret=%d\n",
ret);
return ret; return ret;
} }
ret = smsc95xx_read_reg(dev, ID_REV, &read_buf); ret = smsc95xx_read_reg(dev, ID_REV, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read ID_REV: %d", ret); netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "ID_REV = 0x%08x", read_buf); netdev_dbg(dev->net, "ID_REV = 0x%08x\n", read_buf);
/* Configure GPIO pins as LED outputs */ /* Configure GPIO pins as LED outputs */
write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
LED_GPIO_CFG_FDX_LED; LED_GPIO_CFG_FDX_LED;
ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write LED_GPIO_CFG register, ret=%d", netdev_warn(dev->net, "Failed to write LED_GPIO_CFG register, ret=%d\n",
ret); ret);
return ret; return ret;
} }
...@@ -950,21 +955,21 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -950,21 +955,21 @@ static int smsc95xx_reset(struct usbnet *dev)
write_buf = 0; write_buf = 0;
ret = smsc95xx_write_reg(dev, FLOW, write_buf); ret = smsc95xx_write_reg(dev, FLOW, write_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write FLOW: %d", ret); netdev_warn(dev->net, "Failed to write FLOW: %d\n", ret);
return ret; return ret;
} }
read_buf = AFC_CFG_DEFAULT; read_buf = AFC_CFG_DEFAULT;
ret = smsc95xx_write_reg(dev, AFC_CFG, read_buf); ret = smsc95xx_write_reg(dev, AFC_CFG, read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write AFC_CFG: %d", ret); netdev_warn(dev->net, "Failed to write AFC_CFG: %d\n", ret);
return ret; return ret;
} }
/* Don't need mac_cr_lock during initialisation */ /* Don't need mac_cr_lock during initialisation */
ret = smsc95xx_read_reg(dev, MAC_CR, &pdata->mac_cr); ret = smsc95xx_read_reg(dev, MAC_CR, &pdata->mac_cr);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read MAC_CR: %d", ret); netdev_warn(dev->net, "Failed to read MAC_CR: %d\n", ret);
return ret; return ret;
} }
...@@ -973,7 +978,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -973,7 +978,7 @@ static int smsc95xx_reset(struct usbnet *dev)
write_buf = (u32)ETH_P_8021Q; write_buf = (u32)ETH_P_8021Q;
ret = smsc95xx_write_reg(dev, VLAN1, write_buf); ret = smsc95xx_write_reg(dev, VLAN1, write_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write VAN1: %d", ret); netdev_warn(dev->net, "Failed to write VAN1: %d\n", ret);
return ret; return ret;
} }
...@@ -981,7 +986,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -981,7 +986,7 @@ static int smsc95xx_reset(struct usbnet *dev)
ethtool_op_set_tx_hw_csum(netdev, pdata->use_tx_csum); ethtool_op_set_tx_hw_csum(netdev, pdata->use_tx_csum);
ret = smsc95xx_set_csums(dev); ret = smsc95xx_set_csums(dev);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to set csum offload: %d", ret); netdev_warn(dev->net, "Failed to set csum offload: %d\n", ret);
return ret; return ret;
} }
...@@ -992,7 +997,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -992,7 +997,7 @@ static int smsc95xx_reset(struct usbnet *dev)
ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to read INT_EP_CTL: %d", ret); netdev_warn(dev->net, "Failed to read INT_EP_CTL: %d\n", ret);
return ret; return ret;
} }
...@@ -1001,7 +1006,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -1001,7 +1006,7 @@ static int smsc95xx_reset(struct usbnet *dev)
ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf); ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "Failed to write INT_EP_CTL: %d", ret); netdev_warn(dev->net, "Failed to write INT_EP_CTL: %d\n", ret);
return ret; return ret;
} }
...@@ -1009,7 +1014,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -1009,7 +1014,7 @@ static int smsc95xx_reset(struct usbnet *dev)
smsc95xx_start_rx_path(dev); smsc95xx_start_rx_path(dev);
if (netif_msg_ifup(dev)) if (netif_msg_ifup(dev))
devdbg(dev, "smsc95xx_reset, return 0"); netdev_dbg(dev->net, "smsc95xx_reset, return 0\n");
return 0; return 0;
} }
...@@ -1034,7 +1039,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -1034,7 +1039,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
ret = usbnet_get_endpoints(dev, intf); ret = usbnet_get_endpoints(dev, intf);
if (ret < 0) { if (ret < 0) {
devwarn(dev, "usbnet_get_endpoints failed: %d", ret); netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret);
return ret; return ret;
} }
...@@ -1043,7 +1048,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -1043,7 +1048,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
pdata = (struct smsc95xx_priv *)(dev->data[0]); pdata = (struct smsc95xx_priv *)(dev->data[0]);
if (!pdata) { if (!pdata) {
devwarn(dev, "Unable to allocate struct smsc95xx_priv"); netdev_warn(dev->net, "Unable to allocate struct smsc95xx_priv\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1067,7 +1072,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) ...@@ -1067,7 +1072,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
if (pdata) { if (pdata) {
if (netif_msg_ifdown(dev)) if (netif_msg_ifdown(dev))
devdbg(dev, "free pdata"); netdev_dbg(dev->net, "free pdata\n");
kfree(pdata); kfree(pdata);
pdata = NULL; pdata = NULL;
dev->data[0] = 0; dev->data[0] = 0;
...@@ -1102,7 +1107,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1102,7 +1107,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
if (unlikely(header & RX_STS_ES_)) { if (unlikely(header & RX_STS_ES_)) {
if (netif_msg_rx_err(dev)) if (netif_msg_rx_err(dev))
devdbg(dev, "Error header=0x%08x", header); netdev_dbg(dev->net, "Error header=0x%08x\n",
header);
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
dev->net->stats.rx_dropped++; dev->net->stats.rx_dropped++;
...@@ -1120,7 +1126,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1120,7 +1126,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
/* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */
if (unlikely(size > (ETH_FRAME_LEN + 12))) { if (unlikely(size > (ETH_FRAME_LEN + 12))) {
if (netif_msg_rx_err(dev)) if (netif_msg_rx_err(dev))
devdbg(dev, "size err header=0x%08x", netdev_dbg(dev->net, "size err header=0x%08x\n",
header); header);
return 0; return 0;
} }
...@@ -1137,7 +1143,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1137,7 +1143,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
ax_skb = skb_clone(skb, GFP_ATOMIC); ax_skb = skb_clone(skb, GFP_ATOMIC);
if (unlikely(!ax_skb)) { if (unlikely(!ax_skb)) {
devwarn(dev, "Error allocating skb"); netdev_warn(dev->net, "Error allocating skb\n");
return 0; return 0;
} }
...@@ -1161,7 +1167,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1161,7 +1167,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
} }
if (unlikely(skb->len < 0)) { if (unlikely(skb->len < 0)) {
devwarn(dev, "invalid rx length<0 %d", skb->len); netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len);
return 0; return 0;
} }
......
...@@ -243,12 +243,12 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb) ...@@ -243,12 +243,12 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
dev->net->stats.rx_bytes += skb->len; dev->net->stats.rx_bytes += skb->len;
if (netif_msg_rx_status (dev)) if (netif_msg_rx_status (dev))
devdbg (dev, "< rx, len %zu, type 0x%x", netdev_dbg(dev->net, "< rx, len %zu, type 0x%x\n",
skb->len + sizeof (struct ethhdr), skb->protocol); skb->len + sizeof (struct ethhdr), skb->protocol);
memset (skb->cb, 0, sizeof (struct skb_data)); memset (skb->cb, 0, sizeof (struct skb_data));
status = netif_rx (skb); status = netif_rx (skb);
if (status != NET_RX_SUCCESS && netif_msg_rx_err (dev)) if (status != NET_RX_SUCCESS && netif_msg_rx_err (dev))
devdbg (dev, "netif_rx status %d", status); netdev_dbg(dev->net, "netif_rx status %d\n", status);
} }
EXPORT_SYMBOL_GPL(usbnet_skb_return); EXPORT_SYMBOL_GPL(usbnet_skb_return);
...@@ -313,9 +313,9 @@ void usbnet_defer_kevent (struct usbnet *dev, int work) ...@@ -313,9 +313,9 @@ void usbnet_defer_kevent (struct usbnet *dev, int work)
{ {
set_bit (work, &dev->flags); set_bit (work, &dev->flags);
if (!schedule_work (&dev->kevent)) if (!schedule_work (&dev->kevent))
deverr (dev, "kevent %d may have been dropped", work); netdev_err(dev->net, "kevent %d may have been dropped\n", work);
else else
devdbg (dev, "kevent %d scheduled", work); netdev_dbg(dev->net, "kevent %d scheduled\n", work);
} }
EXPORT_SYMBOL_GPL(usbnet_defer_kevent); EXPORT_SYMBOL_GPL(usbnet_defer_kevent);
...@@ -333,7 +333,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) ...@@ -333,7 +333,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
if ((skb = alloc_skb (size + NET_IP_ALIGN, flags)) == NULL) { if ((skb = alloc_skb (size + NET_IP_ALIGN, flags)) == NULL) {
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
devdbg (dev, "no rx skb"); netdev_dbg(dev->net, "no rx skb\n");
usbnet_defer_kevent (dev, EVENT_RX_MEMORY); usbnet_defer_kevent (dev, EVENT_RX_MEMORY);
usb_free_urb (urb); usb_free_urb (urb);
return; return;
...@@ -364,12 +364,12 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) ...@@ -364,12 +364,12 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
break; break;
case -ENODEV: case -ENODEV:
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "device gone"); netdev_dbg(dev->net, "device gone\n");
netif_device_detach (dev->net); netif_device_detach (dev->net);
break; break;
default: default:
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
devdbg (dev, "rx submit, %d", retval); netdev_dbg(dev->net, "rx submit, %d\n", retval);
tasklet_schedule (&dev->bh); tasklet_schedule (&dev->bh);
break; break;
case 0: case 0:
...@@ -377,7 +377,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) ...@@ -377,7 +377,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
} }
} else { } else {
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "rx: stopped"); netdev_dbg(dev->net, "rx: stopped\n");
retval = -ENOLINK; retval = -ENOLINK;
} }
spin_unlock_irqrestore (&dev->rxq.lock, lockflags); spin_unlock_irqrestore (&dev->rxq.lock, lockflags);
...@@ -401,7 +401,7 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) ...@@ -401,7 +401,7 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
usbnet_skb_return (dev, skb); usbnet_skb_return (dev, skb);
else { else {
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
devdbg (dev, "drop"); netdev_dbg(dev->net, "drop\n");
error: error:
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
skb_queue_tail (&dev->done, skb); skb_queue_tail (&dev->done, skb);
...@@ -429,7 +429,7 @@ static void rx_complete (struct urb *urb) ...@@ -429,7 +429,7 @@ static void rx_complete (struct urb *urb)
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
dev->net->stats.rx_length_errors++; dev->net->stats.rx_length_errors++;
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
devdbg (dev, "rx length %d", skb->len); netdev_dbg(dev->net, "rx length %d\n", skb->len);
} }
break; break;
...@@ -447,7 +447,7 @@ static void rx_complete (struct urb *urb) ...@@ -447,7 +447,7 @@ static void rx_complete (struct urb *urb)
case -ECONNRESET: /* async unlink */ case -ECONNRESET: /* async unlink */
case -ESHUTDOWN: /* hardware gone */ case -ESHUTDOWN: /* hardware gone */
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "rx shutdown, code %d", urb_status); netdev_dbg(dev->net, "rx shutdown, code %d\n", urb_status);
goto block; goto block;
/* we get controller i/o faults during khubd disconnect() delays. /* we get controller i/o faults during khubd disconnect() delays.
...@@ -461,7 +461,7 @@ static void rx_complete (struct urb *urb) ...@@ -461,7 +461,7 @@ static void rx_complete (struct urb *urb)
if (!timer_pending (&dev->delay)) { if (!timer_pending (&dev->delay)) {
mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES);
if (netif_msg_link (dev)) if (netif_msg_link (dev))
devdbg (dev, "rx throttle %d", urb_status); netdev_dbg(dev->net, "rx throttle %d\n", urb_status);
} }
block: block:
entry->state = rx_cleanup; entry->state = rx_cleanup;
...@@ -478,7 +478,7 @@ static void rx_complete (struct urb *urb) ...@@ -478,7 +478,7 @@ static void rx_complete (struct urb *urb)
entry->state = rx_cleanup; entry->state = rx_cleanup;
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
devdbg (dev, "rx status %d", urb_status); netdev_dbg(dev->net, "rx status %d\n", urb_status);
break; break;
} }
...@@ -493,7 +493,7 @@ static void rx_complete (struct urb *urb) ...@@ -493,7 +493,7 @@ static void rx_complete (struct urb *urb)
usb_free_urb (urb); usb_free_urb (urb);
} }
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
devdbg (dev, "no read resubmitted"); netdev_dbg(dev->net, "no read resubmitted\n");
} }
static void intr_complete (struct urb *urb) static void intr_complete (struct urb *urb)
...@@ -511,14 +511,14 @@ static void intr_complete (struct urb *urb) ...@@ -511,14 +511,14 @@ static void intr_complete (struct urb *urb)
case -ENOENT: /* urb killed */ case -ENOENT: /* urb killed */
case -ESHUTDOWN: /* hardware gone */ case -ESHUTDOWN: /* hardware gone */
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "intr shutdown, code %d", status); netdev_dbg(dev->net, "intr shutdown, code %d\n", status);
return; return;
/* NOTE: not throttling like RX/TX, since this endpoint /* NOTE: not throttling like RX/TX, since this endpoint
* already polls infrequently * already polls infrequently
*/ */
default: default:
devdbg (dev, "intr status %d", status); netdev_dbg(dev->net, "intr status %d\n", status);
break; break;
} }
...@@ -528,7 +528,7 @@ static void intr_complete (struct urb *urb) ...@@ -528,7 +528,7 @@ static void intr_complete (struct urb *urb)
memset(urb->transfer_buffer, 0, urb->transfer_buffer_length); memset(urb->transfer_buffer, 0, urb->transfer_buffer_length);
status = usb_submit_urb (urb, GFP_ATOMIC); status = usb_submit_urb (urb, GFP_ATOMIC);
if (status != 0 && netif_msg_timer (dev)) if (status != 0 && netif_msg_timer (dev))
deverr(dev, "intr resubmit --> %d", status); netdev_err(dev->net, "intr resubmit --> %d\n", status);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -537,7 +537,7 @@ void usbnet_pause_rx(struct usbnet *dev) ...@@ -537,7 +537,7 @@ void usbnet_pause_rx(struct usbnet *dev)
set_bit(EVENT_RX_PAUSED, &dev->flags); set_bit(EVENT_RX_PAUSED, &dev->flags);
if (netif_msg_rx_status(dev)) if (netif_msg_rx_status(dev))
devdbg(dev, "paused rx queue enabled"); netdev_dbg(dev->net, "paused rx queue enabled\n");
} }
EXPORT_SYMBOL_GPL(usbnet_pause_rx); EXPORT_SYMBOL_GPL(usbnet_pause_rx);
...@@ -556,7 +556,8 @@ void usbnet_resume_rx(struct usbnet *dev) ...@@ -556,7 +556,8 @@ void usbnet_resume_rx(struct usbnet *dev)
tasklet_schedule(&dev->bh); tasklet_schedule(&dev->bh);
if (netif_msg_rx_status(dev)) if (netif_msg_rx_status(dev))
devdbg(dev, "paused rx queue disabled, %d skbs requeued", num); netdev_dbg(dev->net, "paused rx queue disabled, %d skbs requeued\n",
num);
} }
EXPORT_SYMBOL_GPL(usbnet_resume_rx); EXPORT_SYMBOL_GPL(usbnet_resume_rx);
...@@ -589,7 +590,7 @@ static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) ...@@ -589,7 +590,7 @@ static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q)
// these (async) unlinks complete immediately // these (async) unlinks complete immediately
retval = usb_unlink_urb (urb); retval = usb_unlink_urb (urb);
if (retval != -EINPROGRESS && retval != 0) if (retval != -EINPROGRESS && retval != 0)
devdbg (dev, "unlink urb err, %d", retval); netdev_dbg(dev->net, "unlink urb err, %d\n", retval);
else else
count++; count++;
} }
...@@ -632,7 +633,7 @@ static void usbnet_terminate_urbs(struct usbnet *dev) ...@@ -632,7 +633,7 @@ static void usbnet_terminate_urbs(struct usbnet *dev)
schedule_timeout(UNLINK_TIMEOUT_MS); schedule_timeout(UNLINK_TIMEOUT_MS);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
if (netif_msg_ifdown(dev)) if (netif_msg_ifdown(dev))
devdbg(dev, "waited for %d urb completions", netdev_dbg(dev->net, "waited for %d urb completions\n",
temp); temp);
} }
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
...@@ -649,18 +650,17 @@ int usbnet_stop (struct net_device *net) ...@@ -649,18 +650,17 @@ int usbnet_stop (struct net_device *net)
netif_stop_queue (net); netif_stop_queue (net);
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld", netdev_info(dev->net, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n",
net->stats.rx_packets, net->stats.tx_packets, net->stats.rx_packets, net->stats.tx_packets,
net->stats.rx_errors, net->stats.tx_errors net->stats.rx_errors, net->stats.tx_errors);
);
/* allow minidriver to stop correctly (wireless devices to turn off /* allow minidriver to stop correctly (wireless devices to turn off
* radio etc) */ * radio etc) */
if (info->stop) { if (info->stop) {
retval = info->stop(dev); retval = info->stop(dev);
if (retval < 0 && netif_msg_ifdown(dev)) if (retval < 0 && netif_msg_ifdown(dev))
devinfo(dev, netdev_info(dev->net,
"stop fail (%d) usbnet usb-%s-%s, %s", "stop fail (%d) usbnet usb-%s-%s, %s\n",
retval, retval,
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name, dev->udev->devpath,
info->description); info->description);
...@@ -703,10 +703,11 @@ int usbnet_open (struct net_device *net) ...@@ -703,10 +703,11 @@ int usbnet_open (struct net_device *net)
if ((retval = usb_autopm_get_interface(dev->intf)) < 0) { if ((retval = usb_autopm_get_interface(dev->intf)) < 0) {
if (netif_msg_ifup (dev)) if (netif_msg_ifup (dev))
devinfo (dev, netdev_info(dev->net,
"resumption fail (%d) usbnet usb-%s-%s, %s", "resumption fail (%d) usbnet usb-%s-%s, %s\n",
retval, retval,
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name,
dev->udev->devpath,
info->description); info->description);
goto done_nopm; goto done_nopm;
} }
...@@ -714,10 +715,11 @@ int usbnet_open (struct net_device *net) ...@@ -714,10 +715,11 @@ int usbnet_open (struct net_device *net)
// put into "known safe" state // put into "known safe" state
if (info->reset && (retval = info->reset (dev)) < 0) { if (info->reset && (retval = info->reset (dev)) < 0) {
if (netif_msg_ifup (dev)) if (netif_msg_ifup (dev))
devinfo (dev, netdev_info(dev->net,
"open reset fail (%d) usbnet usb-%s-%s, %s", "open reset fail (%d) usbnet usb-%s-%s, %s\n",
retval, retval,
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name,
dev->udev->devpath,
info->description); info->description);
goto done; goto done;
} }
...@@ -725,7 +727,7 @@ int usbnet_open (struct net_device *net) ...@@ -725,7 +727,7 @@ int usbnet_open (struct net_device *net)
// insist peer be connected // insist peer be connected
if (info->check_connect && (retval = info->check_connect (dev)) < 0) { if (info->check_connect && (retval = info->check_connect (dev)) < 0) {
if (netif_msg_ifup (dev)) if (netif_msg_ifup (dev))
devdbg (dev, "can't open; %d", retval); netdev_dbg(dev->net, "can't open; %d\n", retval);
goto done; goto done;
} }
...@@ -734,7 +736,7 @@ int usbnet_open (struct net_device *net) ...@@ -734,7 +736,7 @@ int usbnet_open (struct net_device *net)
retval = usb_submit_urb (dev->interrupt, GFP_KERNEL); retval = usb_submit_urb (dev->interrupt, GFP_KERNEL);
if (retval < 0) { if (retval < 0) {
if (netif_msg_ifup (dev)) if (netif_msg_ifup (dev))
deverr (dev, "intr submit %d", retval); netdev_err(dev->net, "intr submit %d\n", retval);
goto done; goto done;
} }
} }
...@@ -756,10 +758,9 @@ int usbnet_open (struct net_device *net) ...@@ -756,10 +758,9 @@ int usbnet_open (struct net_device *net)
else else
framing = "simple"; framing = "simple";
devinfo (dev, "open: enable queueing " netdev_info(dev->net, "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n",
"(rx %d, tx %d) mtu %d %s framing", (int)RX_QLEN(dev), (int)TX_QLEN(dev),
(int)RX_QLEN (dev), (int)TX_QLEN (dev), dev->net->mtu, dev->net->mtu, framing);
framing);
} }
// delay posting reads until we're fully open // delay posting reads until we're fully open
...@@ -908,7 +909,7 @@ kevent (struct work_struct *work) ...@@ -908,7 +909,7 @@ kevent (struct work_struct *work)
status != -ESHUTDOWN) { status != -ESHUTDOWN) {
if (netif_msg_tx_err (dev)) if (netif_msg_tx_err (dev))
fail_pipe: fail_pipe:
deverr (dev, "can't clear tx halt, status %d", netdev_err(dev->net, "can't clear tx halt, status %d\n",
status); status);
} else { } else {
clear_bit (EVENT_TX_HALT, &dev->flags); clear_bit (EVENT_TX_HALT, &dev->flags);
...@@ -928,7 +929,7 @@ kevent (struct work_struct *work) ...@@ -928,7 +929,7 @@ kevent (struct work_struct *work)
status != -ESHUTDOWN) { status != -ESHUTDOWN) {
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
fail_halt: fail_halt:
deverr (dev, "can't clear rx halt, status %d", netdev_err(dev->net, "can't clear rx halt, status %d\n",
status); status);
} else { } else {
clear_bit (EVENT_RX_HALT, &dev->flags); clear_bit (EVENT_RX_HALT, &dev->flags);
...@@ -967,9 +968,10 @@ kevent (struct work_struct *work) ...@@ -967,9 +968,10 @@ kevent (struct work_struct *work)
if(info->link_reset && (retval = info->link_reset(dev)) < 0) { if(info->link_reset && (retval = info->link_reset(dev)) < 0) {
usb_autopm_put_interface(dev->intf); usb_autopm_put_interface(dev->intf);
skip_reset: skip_reset:
devinfo(dev, "link reset failed (%d) usbnet usb-%s-%s, %s", netdev_info(dev->net, "link reset failed (%d) usbnet usb-%s-%s, %s\n",
retval, retval,
dev->udev->bus->bus_name, dev->udev->devpath, dev->udev->bus->bus_name,
dev->udev->devpath,
info->description); info->description);
} else { } else {
usb_autopm_put_interface(dev->intf); usb_autopm_put_interface(dev->intf);
...@@ -977,8 +979,7 @@ kevent (struct work_struct *work) ...@@ -977,8 +979,7 @@ kevent (struct work_struct *work)
} }
if (dev->flags) if (dev->flags)
devdbg (dev, "kevent done, flags = 0x%lx", netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags);
dev->flags);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -1015,14 +1016,15 @@ static void tx_complete (struct urb *urb) ...@@ -1015,14 +1016,15 @@ static void tx_complete (struct urb *urb)
mod_timer (&dev->delay, mod_timer (&dev->delay,
jiffies + THROTTLE_JIFFIES); jiffies + THROTTLE_JIFFIES);
if (netif_msg_link (dev)) if (netif_msg_link (dev))
devdbg (dev, "tx throttle %d", netdev_dbg(dev->net, "tx throttle %d\n",
urb->status); urb->status);
} }
netif_stop_queue (dev->net); netif_stop_queue (dev->net);
break; break;
default: default:
if (netif_msg_tx_err (dev)) if (netif_msg_tx_err (dev))
devdbg (dev, "tx err %d", entry->urb->status); netdev_dbg(dev->net, "tx err %d\n",
entry->urb->status);
break; break;
} }
} }
...@@ -1065,7 +1067,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, ...@@ -1065,7 +1067,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
skb = info->tx_fixup (dev, skb, GFP_ATOMIC); skb = info->tx_fixup (dev, skb, GFP_ATOMIC);
if (!skb) { if (!skb) {
if (netif_msg_tx_err (dev)) if (netif_msg_tx_err (dev))
devdbg (dev, "can't tx_fixup skb"); netdev_dbg(dev->net, "can't tx_fixup skb\n");
goto drop; goto drop;
} }
} }
...@@ -1073,7 +1075,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, ...@@ -1073,7 +1075,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) { if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) {
if (netif_msg_tx_err (dev)) if (netif_msg_tx_err (dev))
devdbg (dev, "no urb"); netdev_dbg(dev->net, "no urb\n");
goto drop; goto drop;
} }
...@@ -1113,7 +1115,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, ...@@ -1113,7 +1115,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
/* no use to process more packets */ /* no use to process more packets */
netif_stop_queue(net); netif_stop_queue(net);
spin_unlock_irqrestore(&dev->txq.lock, flags); spin_unlock_irqrestore(&dev->txq.lock, flags);
devdbg(dev, "Delaying transmission for resumption"); netdev_dbg(dev->net, "Delaying transmission for resumption\n");
goto deferred; goto deferred;
} }
#endif #endif
...@@ -1127,7 +1129,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, ...@@ -1127,7 +1129,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
default: default:
usb_autopm_put_interface_async(dev->intf); usb_autopm_put_interface_async(dev->intf);
if (netif_msg_tx_err (dev)) if (netif_msg_tx_err (dev))
devdbg (dev, "tx: submit urb err %d", retval); netdev_dbg(dev->net, "tx: submit urb err %d\n", retval);
break; break;
case 0: case 0:
net->trans_start = jiffies; net->trans_start = jiffies;
...@@ -1139,14 +1141,14 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, ...@@ -1139,14 +1141,14 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
if (retval) { if (retval) {
if (netif_msg_tx_err (dev)) if (netif_msg_tx_err (dev))
devdbg (dev, "drop, code %d", retval); netdev_dbg(dev->net, "drop, code %d\n", retval);
drop: drop:
dev->net->stats.tx_dropped++; dev->net->stats.tx_dropped++;
if (skb) if (skb)
dev_kfree_skb_any (skb); dev_kfree_skb_any (skb);
usb_free_urb (urb); usb_free_urb (urb);
} else if (netif_msg_tx_queued (dev)) { } else if (netif_msg_tx_queued (dev)) {
devdbg (dev, "> tx, len %d, type 0x%x", netdev_dbg(dev->net, "> tx, len %d, type 0x%x\n",
length, skb->protocol); length, skb->protocol);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -1179,7 +1181,7 @@ static void usbnet_bh (unsigned long param) ...@@ -1179,7 +1181,7 @@ static void usbnet_bh (unsigned long param)
dev_kfree_skb (skb); dev_kfree_skb (skb);
continue; continue;
default: default:
devdbg (dev, "bogus skb state %d", entry->state); netdev_dbg(dev->net, "bogus skb state %d\n", entry->state);
} }
} }
...@@ -1208,7 +1210,7 @@ static void usbnet_bh (unsigned long param) ...@@ -1208,7 +1210,7 @@ static void usbnet_bh (unsigned long param)
rx_submit (dev, urb, GFP_ATOMIC); rx_submit (dev, urb, GFP_ATOMIC);
} }
if (temp != dev->rxq.qlen && netif_msg_link (dev)) if (temp != dev->rxq.qlen && netif_msg_link (dev))
devdbg (dev, "rxqlen %d --> %d", netdev_dbg(dev->net, "rxqlen %d --> %d\n",
temp, dev->rxq.qlen); temp, dev->rxq.qlen);
if (dev->rxq.qlen < qlen) if (dev->rxq.qlen < qlen)
tasklet_schedule (&dev->bh); tasklet_schedule (&dev->bh);
...@@ -1241,7 +1243,7 @@ void usbnet_disconnect (struct usb_interface *intf) ...@@ -1241,7 +1243,7 @@ void usbnet_disconnect (struct usb_interface *intf)
xdev = interface_to_usbdev (intf); xdev = interface_to_usbdev (intf);
if (netif_msg_probe (dev)) if (netif_msg_probe (dev))
devinfo (dev, "unregister '%s' usb-%s-%s, %s", netdev_info(dev->net, "unregister '%s' usb-%s-%s, %s\n",
intf->dev.driver->name, intf->dev.driver->name,
xdev->bus->bus_name, xdev->devpath, xdev->bus->bus_name, xdev->devpath,
dev->driver_info->description); dev->driver_info->description);
...@@ -1408,7 +1410,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) ...@@ -1408,7 +1410,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
if (status) if (status)
goto out3; goto out3;
if (netif_msg_probe (dev)) if (netif_msg_probe (dev))
devinfo (dev, "register '%s' at usb-%s-%s, %s, %pM", netdev_info(dev->net, "register '%s' at usb-%s-%s, %s, %pM\n",
udev->dev.driver->name, udev->dev.driver->name,
xdev->bus->bus_name, xdev->devpath, xdev->bus->bus_name, xdev->devpath,
dev->driver_info->description, dev->driver_info->description,
......
...@@ -728,8 +728,8 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) ...@@ -728,8 +728,8 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
ret = rndis_command(dev, u.header, buflen); ret = rndis_command(dev, u.header, buflen);
priv->current_command_oid = 0; priv->current_command_oid = 0;
if (ret < 0) if (ret < 0)
devdbg(dev, "rndis_query_oid(%s): rndis_command() failed, %d " netdev_dbg(dev->net, "%s(%s): rndis_command() failed, %d (%08x)\n",
"(%08x)", oid_to_string(oid), ret, __func__, oid_to_string(oid), ret,
le32_to_cpu(u.get_c->status)); le32_to_cpu(u.get_c->status));
if (ret == 0) { if (ret == 0) {
...@@ -741,8 +741,8 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) ...@@ -741,8 +741,8 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
ret = rndis_error_status(u.get_c->status); ret = rndis_error_status(u.get_c->status);
if (ret < 0) if (ret < 0)
devdbg(dev, "rndis_query_oid(%s): device returned " netdev_dbg(dev->net, "%s(%s): device returned error, 0x%08x (%d)\n",
"error, 0x%08x (%d)", oid_to_string(oid), __func__, oid_to_string(oid),
le32_to_cpu(u.get_c->status), ret); le32_to_cpu(u.get_c->status), ret);
} }
...@@ -791,16 +791,16 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len) ...@@ -791,16 +791,16 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len)
ret = rndis_command(dev, u.header, buflen); ret = rndis_command(dev, u.header, buflen);
priv->current_command_oid = 0; priv->current_command_oid = 0;
if (ret < 0) if (ret < 0)
devdbg(dev, "rndis_set_oid(%s): rndis_command() failed, %d " netdev_dbg(dev->net, "%s(%s): rndis_command() failed, %d (%08x)\n",
"(%08x)", oid_to_string(oid), ret, __func__, oid_to_string(oid), ret,
le32_to_cpu(u.set_c->status)); le32_to_cpu(u.set_c->status));
if (ret == 0) { if (ret == 0) {
ret = rndis_error_status(u.set_c->status); ret = rndis_error_status(u.set_c->status);
if (ret < 0) if (ret < 0)
devdbg(dev, "rndis_set_oid(%s): device returned error, " netdev_dbg(dev->net, "%s(%s): device returned error, 0x%08x (%d)\n",
"0x%08x (%d)", oid_to_string(oid), __func__, oid_to_string(oid),
le32_to_cpu(u.set_c->status), ret); le32_to_cpu(u.set_c->status), ret);
} }
...@@ -870,10 +870,10 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, ...@@ -870,10 +870,10 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param,
#endif #endif
if (value_type == 2) if (value_type == 2)
devdbg(dev, "setting config parameter: %s, value: %s", netdev_dbg(dev->net, "setting config parameter: %s, value: %s\n",
param, (u8 *)value); param, (u8 *)value);
else else
devdbg(dev, "setting config parameter: %s, value: %d", netdev_dbg(dev->net, "setting config parameter: %s, value: %d\n",
param, *(u32 *)value); param, *(u32 *)value);
infobuf->name_offs = cpu_to_le32(sizeof(*infobuf)); infobuf->name_offs = cpu_to_le32(sizeof(*infobuf));
...@@ -897,10 +897,10 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, ...@@ -897,10 +897,10 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param,
} }
#ifdef DEBUG #ifdef DEBUG
devdbg(dev, "info buffer (len: %d):", info_len); netdev_dbg(dev->net, "info buffer (len: %d)\n", info_len);
for (i = 0; i < info_len; i += 12) { for (i = 0; i < info_len; i += 12) {
u32 *tmp = (u32 *)((u8 *)infobuf + i); u32 *tmp = (u32 *)((u8 *)infobuf + i);
devdbg(dev, "%08X:%08X:%08X", netdev_dbg(dev->net, "%08X:%08X:%08X\n",
cpu_to_be32(tmp[0]), cpu_to_be32(tmp[0]),
cpu_to_be32(tmp[1]), cpu_to_be32(tmp[1]),
cpu_to_be32(tmp[2])); cpu_to_be32(tmp[2]));
...@@ -910,7 +910,8 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, ...@@ -910,7 +910,8 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param,
ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER, ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER,
infobuf, info_len); infobuf, info_len);
if (ret != 0) if (ret != 0)
devdbg(dev, "setting rndis config parameter failed, %d.", ret); netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n",
ret);
kfree(infobuf); kfree(infobuf);
return ret; return ret;
...@@ -945,13 +946,13 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) ...@@ -945,13 +946,13 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid)); ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid));
if (ret < 0) { if (ret < 0) {
devwarn(usbdev, "setting SSID failed (%08X)", ret); netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret);
return ret; return ret;
} }
if (ret == 0) { if (ret == 0) {
memcpy(&priv->essid, ssid, sizeof(priv->essid)); memcpy(&priv->essid, ssid, sizeof(priv->essid));
priv->radio_on = true; priv->radio_on = true;
devdbg(usbdev, "set_essid: radio_on = true"); netdev_dbg(usbdev->net, "%s(): radio_on = true\n", __func__);
} }
return ret; return ret;
...@@ -963,7 +964,8 @@ static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) ...@@ -963,7 +964,8 @@ static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN);
if (ret < 0) { if (ret < 0) {
devwarn(usbdev, "setting BSSID[%pM] failed (%08X)", bssid, ret); netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n",
bssid, ret);
return ret; return ret;
} }
...@@ -1021,7 +1023,8 @@ static int disassociate(struct usbnet *usbdev, bool reset_ssid) ...@@ -1021,7 +1023,8 @@ static int disassociate(struct usbnet *usbdev, bool reset_ssid)
ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0);
if (ret == 0) { if (ret == 0) {
priv->radio_on = false; priv->radio_on = false;
devdbg(usbdev, "disassociate: radio_on = false"); netdev_dbg(usbdev->net, "%s(): radio_on = false\n",
__func__);
if (reset_ssid) if (reset_ssid)
msleep(100); msleep(100);
...@@ -1054,8 +1057,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, ...@@ -1054,8 +1057,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version,
__le32 tmp; __le32 tmp;
int auth_mode, ret; int auth_mode, ret;
devdbg(usbdev, "set_auth_mode: wpa_version=0x%x authalg=0x%x " netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x authalg=0x%x keymgmt=0x%x\n",
"keymgmt=0x%x", wpa_version, auth_type, keymgmt); __func__, wpa_version, auth_type, keymgmt);
if (wpa_version & NL80211_WPA_VERSION_2) { if (wpa_version & NL80211_WPA_VERSION_2) {
if (keymgmt & RNDIS_WLAN_KEY_MGMT_802_1X) if (keymgmt & RNDIS_WLAN_KEY_MGMT_802_1X)
...@@ -1082,7 +1085,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, ...@@ -1082,7 +1085,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version,
ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp,
sizeof(tmp)); sizeof(tmp));
if (ret != 0) { if (ret != 0) {
devwarn(usbdev, "setting auth mode failed (%08X)", ret); netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n",
ret);
return ret; return ret;
} }
...@@ -1098,7 +1102,8 @@ static int set_priv_filter(struct usbnet *usbdev) ...@@ -1098,7 +1102,8 @@ static int set_priv_filter(struct usbnet *usbdev)
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
__le32 tmp; __le32 tmp;
devdbg(usbdev, "set_priv_filter: wpa_version=0x%x", priv->wpa_version); netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x\n",
__func__, priv->wpa_version);
if (priv->wpa_version & NL80211_WPA_VERSION_2 || if (priv->wpa_version & NL80211_WPA_VERSION_2 ||
priv->wpa_version & NL80211_WPA_VERSION_1) priv->wpa_version & NL80211_WPA_VERSION_1)
...@@ -1116,8 +1121,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) ...@@ -1116,8 +1121,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise)
__le32 tmp; __le32 tmp;
int encr_mode, ret; int encr_mode, ret;
devdbg(usbdev, "set_encr_mode: cipher_pair=0x%x cipher_group=0x%x", netdev_dbg(usbdev->net, "%s(): cipher_pair=0x%x cipher_group=0x%x\n",
pairwise, groupwise); __func__, pairwise, groupwise);
if (pairwise & RNDIS_WLAN_ALG_CCMP) if (pairwise & RNDIS_WLAN_ALG_CCMP)
encr_mode = NDIS_80211_ENCR_CCMP_ENABLED; encr_mode = NDIS_80211_ENCR_CCMP_ENABLED;
...@@ -1136,7 +1141,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) ...@@ -1136,7 +1141,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise)
ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp,
sizeof(tmp)); sizeof(tmp));
if (ret != 0) { if (ret != 0) {
devwarn(usbdev, "setting encr mode failed (%08X)", ret); netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n",
ret);
return ret; return ret;
} }
...@@ -1151,13 +1157,15 @@ static int set_infra_mode(struct usbnet *usbdev, int mode) ...@@ -1151,13 +1157,15 @@ static int set_infra_mode(struct usbnet *usbdev, int mode)
__le32 tmp; __le32 tmp;
int ret; int ret;
devdbg(usbdev, "set_infra_mode: infra_mode=0x%x", priv->infra_mode); netdev_dbg(usbdev->net, "%s(): infra_mode=0x%x\n",
__func__, priv->infra_mode);
tmp = cpu_to_le32(mode); tmp = cpu_to_le32(mode);
ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp, ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp,
sizeof(tmp)); sizeof(tmp));
if (ret != 0) { if (ret != 0) {
devwarn(usbdev, "setting infra mode failed (%08X)", ret); netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n",
ret);
return ret; return ret;
} }
...@@ -1174,7 +1182,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) ...@@ -1174,7 +1182,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold)
{ {
__le32 tmp; __le32 tmp;
devdbg(usbdev, "set_rts_threshold %i", rts_threshold); netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold);
if (rts_threshold < 0 || rts_threshold > 2347) if (rts_threshold < 0 || rts_threshold > 2347)
rts_threshold = 2347; rts_threshold = 2347;
...@@ -1188,7 +1196,7 @@ static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold) ...@@ -1188,7 +1196,7 @@ static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold)
{ {
__le32 tmp; __le32 tmp;
devdbg(usbdev, "set_frag_threshold %i", frag_threshold); netdev_dbg(usbdev->net, "%s(): %i\n", __func__, frag_threshold);
if (frag_threshold < 256 || frag_threshold > 2346) if (frag_threshold < 256 || frag_threshold > 2346)
frag_threshold = 2346; frag_threshold = 2346;
...@@ -1222,7 +1230,7 @@ static int set_channel(struct usbnet *usbdev, int channel) ...@@ -1222,7 +1230,7 @@ static int set_channel(struct usbnet *usbdev, int channel)
unsigned int dsconfig; unsigned int dsconfig;
int len, ret; int len, ret;
devdbg(usbdev, "set_channel(%d)", channel); netdev_dbg(usbdev->net, "%s(%d)\n", __func__, channel);
/* this OID is valid only when not associated */ /* this OID is valid only when not associated */
if (is_associated(usbdev)) if (is_associated(usbdev))
...@@ -1233,7 +1241,8 @@ static int set_channel(struct usbnet *usbdev, int channel) ...@@ -1233,7 +1241,8 @@ static int set_channel(struct usbnet *usbdev, int channel)
len = sizeof(config); len = sizeof(config);
ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "set_channel: querying configuration failed"); netdev_dbg(usbdev->net, "%s(): querying configuration failed\n",
__func__);
return ret; return ret;
} }
...@@ -1241,7 +1250,7 @@ static int set_channel(struct usbnet *usbdev, int channel) ...@@ -1241,7 +1250,7 @@ static int set_channel(struct usbnet *usbdev, int channel)
ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config,
sizeof(config)); sizeof(config));
devdbg(usbdev, "set_channel: %d -> %d", channel, ret); netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret);
return ret; return ret;
} }
...@@ -1255,7 +1264,8 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1255,7 +1264,8 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len,
u32 cipher; u32 cipher;
int ret; int ret;
devdbg(usbdev, "add_wep_key(idx: %d, len: %d)", index, key_len); netdev_dbg(usbdev->net, "%s(idx: %d, len: %d)\n",
__func__, index, key_len);
if ((key_len != 5 && key_len != 13) || index < 0 || index > 3) if ((key_len != 5 && key_len != 13) || index < 0 || index > 3)
return -EINVAL; return -EINVAL;
...@@ -1277,15 +1287,15 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1277,15 +1287,15 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len,
ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP,
RNDIS_WLAN_ALG_NONE); RNDIS_WLAN_ALG_NONE);
if (ret) if (ret)
devwarn(usbdev, "encryption couldn't be enabled (%08X)", netdev_warn(usbdev->net, "encryption couldn't be enabled (%08X)\n",
ret); ret);
} }
ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key, ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key,
sizeof(ndis_key)); sizeof(ndis_key));
if (ret != 0) { if (ret != 0) {
devwarn(usbdev, "adding encryption key %d failed (%08X)", netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n",
index+1, ret); index + 1, ret);
return ret; return ret;
} }
...@@ -1307,22 +1317,23 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1307,22 +1317,23 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
int ret; int ret;
if (index < 0 || index >= 4) { if (index < 0 || index >= 4) {
devdbg(usbdev, "add_wpa_key: index out of range (%i)", index); netdev_dbg(usbdev->net, "%s(): index out of range (%i)\n",
__func__, index);
return -EINVAL; return -EINVAL;
} }
if (key_len > sizeof(ndis_key.material) || key_len < 0) { if (key_len > sizeof(ndis_key.material) || key_len < 0) {
devdbg(usbdev, "add_wpa_key: key length out of range (%i)", netdev_dbg(usbdev->net, "%s(): key length out of range (%i)\n",
key_len); __func__, key_len);
return -EINVAL; return -EINVAL;
} }
if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) { if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) {
if (!rx_seq || seq_len <= 0) { if (!rx_seq || seq_len <= 0) {
devdbg(usbdev, "add_wpa_key: recv seq flag without" netdev_dbg(usbdev->net, "%s(): recv seq flag without buffer\n",
"buffer"); __func__);
return -EINVAL; return -EINVAL;
} }
if (rx_seq && seq_len > sizeof(ndis_key.rsc)) { if (rx_seq && seq_len > sizeof(ndis_key.rsc)) {
devdbg(usbdev, "add_wpa_key: too big recv seq buffer"); netdev_dbg(usbdev->net, "%s(): too big recv seq buffer\n", __func__);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -1330,12 +1341,13 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1330,12 +1341,13 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
is_addr_ok = addr && !is_zero_ether_addr(addr) && is_addr_ok = addr && !is_zero_ether_addr(addr) &&
!is_broadcast_ether_addr(addr); !is_broadcast_ether_addr(addr);
if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) { if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) {
devdbg(usbdev, "add_wpa_key: pairwise but bssid invalid (%pM)", netdev_dbg(usbdev->net, "%s(): pairwise but bssid invalid (%pM)\n",
addr); __func__, addr);
return -EINVAL; return -EINVAL;
} }
devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index, netdev_dbg(usbdev->net, "%s(%i): flags:%i%i%i\n",
__func__, index,
!!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY), !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY),
!!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY), !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY),
!!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)); !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ));
...@@ -1372,7 +1384,8 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1372,7 +1384,8 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key,
le32_to_cpu(ndis_key.size)); le32_to_cpu(ndis_key.size));
devdbg(usbdev, "add_wpa_key: OID_802_11_ADD_KEY -> %08X", ret); netdev_dbg(usbdev->net, "%s(): OID_802_11_ADD_KEY -> %08X\n",
__func__, ret);
if (ret != 0) if (ret != 0)
return ret; return ret;
...@@ -1401,7 +1414,7 @@ static int restore_key(struct usbnet *usbdev, int key_idx) ...@@ -1401,7 +1414,7 @@ static int restore_key(struct usbnet *usbdev, int key_idx)
key = priv->encr_keys[key_idx]; key = priv->encr_keys[key_idx];
devdbg(usbdev, "restore_key: %i:%i", key_idx, key.len); netdev_dbg(usbdev->net, "%s(): %i:%i\n", __func__, key_idx, key.len);
if (key.len == 0) if (key.len == 0)
return 0; return 0;
...@@ -1436,7 +1449,8 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid) ...@@ -1436,7 +1449,8 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid)
is_wpa = is_wpa_key(priv, index); is_wpa = is_wpa_key(priv, index);
devdbg(usbdev, "remove_key: %i:%s:%i", index, is_wpa ? "wpa" : "wep", netdev_dbg(usbdev->net, "%s(): %i:%s:%i\n",
__func__, index, is_wpa ? "wpa" : "wep",
priv->encr_keys[index].len); priv->encr_keys[index].len);
clear_key(priv, index); clear_key(priv, index);
...@@ -1464,8 +1478,8 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid) ...@@ -1464,8 +1478,8 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid)
ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex, ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex,
sizeof(keyindex)); sizeof(keyindex));
if (ret != 0) { if (ret != 0) {
devwarn(usbdev, netdev_warn(usbdev->net,
"removing encryption key %d failed (%08X)", "removing encryption key %d failed (%08X)\n",
index, ret); index, ret);
return ret; return ret;
} }
...@@ -1498,8 +1512,8 @@ static void set_multicast_list(struct usbnet *usbdev) ...@@ -1498,8 +1512,8 @@ static void set_multicast_list(struct usbnet *usbdev)
size = min(priv->multicast_size, netdev_mc_count(usbdev->net)); size = min(priv->multicast_size, netdev_mc_count(usbdev->net));
buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); buf = kmalloc(size * ETH_ALEN, GFP_KERNEL);
if (!buf) { if (!buf) {
devwarn(usbdev, netdev_warn(usbdev->net,
"couldn't alloc %d bytes of memory", "couldn't alloc %d bytes of memory\n",
size * ETH_ALEN); size * ETH_ALEN);
return; return;
} }
...@@ -1520,7 +1534,7 @@ static void set_multicast_list(struct usbnet *usbdev) ...@@ -1520,7 +1534,7 @@ static void set_multicast_list(struct usbnet *usbdev)
else else
filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST;
devdbg(usbdev, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d", netdev_dbg(usbdev->net, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n",
i, priv->multicast_size, ret); i, priv->multicast_size, ret);
kfree(buf); kfree(buf);
...@@ -1529,11 +1543,11 @@ static void set_multicast_list(struct usbnet *usbdev) ...@@ -1529,11 +1543,11 @@ static void set_multicast_list(struct usbnet *usbdev)
ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter,
sizeof(filter)); sizeof(filter));
if (ret < 0) { if (ret < 0) {
devwarn(usbdev, "couldn't set packet filter: %08x", netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n",
le32_to_cpu(filter)); le32_to_cpu(filter));
} }
devdbg(usbdev, "OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d", netdev_dbg(usbdev->net, "OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d\n",
le32_to_cpu(filter), ret); le32_to_cpu(filter), ret);
} }
...@@ -1592,7 +1606,8 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, ...@@ -1592,7 +1606,8 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type,
struct rndis_wlan_private *priv = wiphy_priv(wiphy); struct rndis_wlan_private *priv = wiphy_priv(wiphy);
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
devdbg(usbdev, "rndis_set_tx_power type:0x%x dbm:%i", type, dbm); netdev_dbg(usbdev->net, "%s(): type:0x%x dbm:%i\n",
__func__, type, dbm);
/* Device doesn't support changing txpower after initialization, only /* Device doesn't support changing txpower after initialization, only
* turn off/on radio. Support 'auto' mode and setting same dBm that is * turn off/on radio. Support 'auto' mode and setting same dBm that is
...@@ -1615,7 +1630,7 @@ static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm) ...@@ -1615,7 +1630,7 @@ static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm)
*dbm = get_bcm4320_power_dbm(priv); *dbm = get_bcm4320_power_dbm(priv);
devdbg(usbdev, "rndis_get_tx_power dbm:%i", *dbm); netdev_dbg(usbdev->net, "%s(): dbm:%i\n", __func__, *dbm);
return 0; return 0;
} }
...@@ -1629,7 +1644,7 @@ static int rndis_scan(struct wiphy *wiphy, struct net_device *dev, ...@@ -1629,7 +1644,7 @@ static int rndis_scan(struct wiphy *wiphy, struct net_device *dev,
int ret; int ret;
__le32 tmp; __le32 tmp;
devdbg(usbdev, "cfg80211.scan"); netdev_dbg(usbdev->net, "cfg80211.scan\n");
/* Get current bssid list from device before new scan, as new scan /* Get current bssid list from device before new scan, as new scan
* clears internal bssid list. * clears internal bssid list.
...@@ -1669,8 +1684,8 @@ static struct cfg80211_bss *rndis_bss_info_update(struct usbnet *usbdev, ...@@ -1669,8 +1684,8 @@ static struct cfg80211_bss *rndis_bss_info_update(struct usbnet *usbdev,
int ie_len, bssid_len; int ie_len, bssid_len;
u8 *ie; u8 *ie;
devdbg(usbdev, " found bssid: '%.32s' [%pM]", bssid->ssid.essid, netdev_dbg(usbdev->net, " found bssid: '%.32s' [%pM]\n",
bssid->mac); bssid->ssid.essid, bssid->mac);
/* parse bssid structure */ /* parse bssid structure */
bssid_len = le32_to_cpu(bssid->length); bssid_len = le32_to_cpu(bssid->length);
...@@ -1712,7 +1727,7 @@ static int rndis_check_bssid_list(struct usbnet *usbdev) ...@@ -1712,7 +1727,7 @@ static int rndis_check_bssid_list(struct usbnet *usbdev)
int ret = -EINVAL, len, count, bssid_len; int ret = -EINVAL, len, count, bssid_len;
bool resized = false; bool resized = false;
devdbg(usbdev, "check_bssid_list"); netdev_dbg(usbdev->net, "check_bssid_list\n");
len = CONTROL_BUFFER_SIZE; len = CONTROL_BUFFER_SIZE;
resize_buf: resize_buf:
...@@ -1736,8 +1751,8 @@ static int rndis_check_bssid_list(struct usbnet *usbdev) ...@@ -1736,8 +1751,8 @@ static int rndis_check_bssid_list(struct usbnet *usbdev)
bssid = bssid_list->bssid; bssid = bssid_list->bssid;
bssid_len = le32_to_cpu(bssid->length); bssid_len = le32_to_cpu(bssid->length);
count = le32_to_cpu(bssid_list->num_items); count = le32_to_cpu(bssid_list->num_items);
devdbg(usbdev, "check_bssid_list: %d BSSIDs found (buflen: %d)", count, netdev_dbg(usbdev->net, "check_bssid_list: %d BSSIDs found (buflen: %d)\n",
len); count, len);
while (count && ((void *)bssid + bssid_len) <= (buf + len)) { while (count && ((void *)bssid + bssid_len) <= (buf + len)) {
rndis_bss_info_update(usbdev, bssid); rndis_bss_info_update(usbdev, bssid);
...@@ -1759,7 +1774,7 @@ static void rndis_get_scan_results(struct work_struct *work) ...@@ -1759,7 +1774,7 @@ static void rndis_get_scan_results(struct work_struct *work)
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
int ret; int ret;
devdbg(usbdev, "get_scan_results"); netdev_dbg(usbdev->net, "get_scan_results\n");
if (!priv->scan_request) if (!priv->scan_request)
return; return;
...@@ -1793,7 +1808,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1793,7 +1808,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
if (sme->crypto.n_ciphers_pairwise > 0 && if (sme->crypto.n_ciphers_pairwise > 0 &&
pairwise == RNDIS_WLAN_ALG_NONE) { pairwise == RNDIS_WLAN_ALG_NONE) {
deverr(usbdev, "Unsupported pairwise cipher"); netdev_err(usbdev->net, "Unsupported pairwise cipher\n");
return -ENOTSUPP; return -ENOTSUPP;
} }
...@@ -1803,12 +1818,12 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1803,12 +1818,12 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
if (sme->crypto.n_akm_suites > 0 && if (sme->crypto.n_akm_suites > 0 &&
keymgmt == RNDIS_WLAN_KEY_MGMT_NONE) { keymgmt == RNDIS_WLAN_KEY_MGMT_NONE) {
deverr(usbdev, "Invalid keymgmt"); netdev_err(usbdev->net, "Invalid keymgmt\n");
return -ENOTSUPP; return -ENOTSUPP;
} }
devdbg(usbdev, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:" netdev_dbg(usbdev->net, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:0x%x]:0x%x)\n",
"0x%x]:0x%x)", sme->ssid, sme->bssid, chan, sme->ssid, sme->bssid, chan,
sme->privacy, sme->crypto.wpa_versions, sme->auth_type, sme->privacy, sme->crypto.wpa_versions, sme->auth_type,
groupwise, pairwise, keymgmt); groupwise, pairwise, keymgmt);
...@@ -1817,14 +1832,16 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1817,14 +1832,16 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "connect: set_infra_mode failed, %d", ret); netdev_dbg(usbdev->net, "connect: set_infra_mode failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type,
keymgmt); keymgmt);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "connect: set_auth_mode failed, %d", ret); netdev_dbg(usbdev->net, "connect: set_auth_mode failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
...@@ -1832,14 +1849,16 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1832,14 +1849,16 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
ret = set_encr_mode(usbdev, pairwise, groupwise); ret = set_encr_mode(usbdev, pairwise, groupwise);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "connect: set_encr_mode failed, %d", ret); netdev_dbg(usbdev->net, "connect: set_encr_mode failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
if (channel) { if (channel) {
ret = set_channel(usbdev, chan); ret = set_channel(usbdev, chan);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "connect: set_channel failed, %d", ret); netdev_dbg(usbdev->net, "connect: set_channel failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
} }
...@@ -1848,8 +1867,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1848,8 +1867,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
priv->encr_tx_key_index = sme->key_idx; priv->encr_tx_key_index = sme->key_idx;
ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "connect: add_wep_key failed, %d " netdev_dbg(usbdev->net, "connect: add_wep_key failed, %d (%d, %d)\n",
"(%d, %d)", ret, sme->key_len, sme->key_idx); ret, sme->key_len, sme->key_idx);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
} }
...@@ -1858,7 +1877,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1858,7 +1877,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
!is_broadcast_ether_addr(sme->bssid)) { !is_broadcast_ether_addr(sme->bssid)) {
ret = set_bssid(usbdev, sme->bssid); ret = set_bssid(usbdev, sme->bssid);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "connect: set_bssid failed, %d", ret); netdev_dbg(usbdev->net, "connect: set_bssid failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
} else } else
...@@ -1880,7 +1900,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1880,7 +1900,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
ret = set_essid(usbdev, &ssid); ret = set_essid(usbdev, &ssid);
if (ret < 0) if (ret < 0)
devdbg(usbdev, "connect: set_essid failed, %d", ret); netdev_dbg(usbdev->net, "connect: set_essid failed, %d\n", ret);
return ret; return ret;
err_turn_radio_on: err_turn_radio_on:
...@@ -1895,7 +1915,7 @@ static int rndis_disconnect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1895,7 +1915,7 @@ static int rndis_disconnect(struct wiphy *wiphy, struct net_device *dev,
struct rndis_wlan_private *priv = wiphy_priv(wiphy); struct rndis_wlan_private *priv = wiphy_priv(wiphy);
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
devdbg(usbdev, "cfg80211.disconnect(%d)", reason_code); netdev_dbg(usbdev->net, "cfg80211.disconnect(%d)\n", reason_code);
priv->connected = false; priv->connected = false;
memset(priv->bssid, 0, ETH_ALEN); memset(priv->bssid, 0, ETH_ALEN);
...@@ -1929,21 +1949,23 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1929,21 +1949,23 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
alg = RNDIS_WLAN_ALG_NONE; alg = RNDIS_WLAN_ALG_NONE;
} }
devdbg(usbdev, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)", params->ssid, netdev_dbg(usbdev->net, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)\n",
params->bssid, chan, params->privacy); params->ssid, params->bssid, chan, params->privacy);
if (is_associated(usbdev)) if (is_associated(usbdev))
disassociate(usbdev, false); disassociate(usbdev, false);
ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "join_ibss: set_infra_mode failed, %d", ret); netdev_dbg(usbdev->net, "join_ibss: set_infra_mode failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "join_ibss: set_auth_mode failed, %d", ret); netdev_dbg(usbdev->net, "join_ibss: set_auth_mode failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
...@@ -1951,14 +1973,15 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1951,14 +1973,15 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "join_ibss: set_encr_mode failed, %d", ret); netdev_dbg(usbdev->net, "join_ibss: set_encr_mode failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
if (channel) { if (channel) {
ret = set_channel(usbdev, chan); ret = set_channel(usbdev, chan);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "join_ibss: set_channel failed, %d", netdev_dbg(usbdev->net, "join_ibss: set_channel failed, %d\n",
ret); ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
...@@ -1968,7 +1991,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1968,7 +1991,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
!is_broadcast_ether_addr(params->bssid)) { !is_broadcast_ether_addr(params->bssid)) {
ret = set_bssid(usbdev, params->bssid); ret = set_bssid(usbdev, params->bssid);
if (ret < 0) { if (ret < 0) {
devdbg(usbdev, "join_ibss: set_bssid failed, %d", ret); netdev_dbg(usbdev->net, "join_ibss: set_bssid failed, %d\n",
ret);
goto err_turn_radio_on; goto err_turn_radio_on;
} }
} else } else
...@@ -1988,7 +2012,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1988,7 +2012,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
ret = set_essid(usbdev, &ssid); ret = set_essid(usbdev, &ssid);
if (ret < 0) if (ret < 0)
devdbg(usbdev, "join_ibss: set_essid failed, %d", ret); netdev_dbg(usbdev->net, "join_ibss: set_essid failed, %d\n",
ret);
return ret; return ret;
err_turn_radio_on: err_turn_radio_on:
...@@ -2002,7 +2027,7 @@ static int rndis_leave_ibss(struct wiphy *wiphy, struct net_device *dev) ...@@ -2002,7 +2027,7 @@ static int rndis_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
struct rndis_wlan_private *priv = wiphy_priv(wiphy); struct rndis_wlan_private *priv = wiphy_priv(wiphy);
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
devdbg(usbdev, "cfg80211.leave_ibss()"); netdev_dbg(usbdev->net, "cfg80211.leave_ibss()\n");
priv->connected = false; priv->connected = false;
memset(priv->bssid, 0, ETH_ALEN); memset(priv->bssid, 0, ETH_ALEN);
...@@ -2028,8 +2053,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -2028,8 +2053,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev,
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
__le32 flags; __le32 flags;
devdbg(usbdev, "rndis_add_key(%i, %pM, %08x)", key_index, mac_addr, netdev_dbg(usbdev->net, "%s(%i, %pM, %08x)\n",
params->cipher); __func__, key_index, mac_addr, params->cipher);
switch (params->cipher) { switch (params->cipher) {
case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP40:
...@@ -2050,8 +2075,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -2050,8 +2075,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev,
key_index, mac_addr, params->seq, key_index, mac_addr, params->seq,
params->seq_len, params->cipher, flags); params->seq_len, params->cipher, flags);
default: default:
devdbg(usbdev, "rndis_add_key: unsupported cipher %08x", netdev_dbg(usbdev->net, "%s(): unsupported cipher %08x\n",
params->cipher); __func__, params->cipher);
return -ENOTSUPP; return -ENOTSUPP;
} }
} }
...@@ -2062,7 +2087,7 @@ static int rndis_del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -2062,7 +2087,7 @@ static int rndis_del_key(struct wiphy *wiphy, struct net_device *netdev,
struct rndis_wlan_private *priv = wiphy_priv(wiphy); struct rndis_wlan_private *priv = wiphy_priv(wiphy);
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
devdbg(usbdev, "rndis_del_key(%i, %pM)", key_index, mac_addr); netdev_dbg(usbdev->net, "%s(%i, %pM)\n", __func__, key_index, mac_addr);
return remove_key(usbdev, key_index, mac_addr); return remove_key(usbdev, key_index, mac_addr);
} }
...@@ -2074,7 +2099,7 @@ static int rndis_set_default_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -2074,7 +2099,7 @@ static int rndis_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
struct usbnet *usbdev = priv->usbdev; struct usbnet *usbdev = priv->usbdev;
struct rndis_wlan_encr_key key; struct rndis_wlan_encr_key key;
devdbg(usbdev, "rndis_set_default_key(%i)", key_index); netdev_dbg(usbdev->net, "%s(%i)\n", __func__, key_index);
priv->encr_tx_key_index = key_index; priv->encr_tx_key_index = key_index;
...@@ -2188,7 +2213,8 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev) ...@@ -2188,7 +2213,8 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
if (ret < 0) if (ret < 0)
memset(bssid, 0, sizeof(bssid)); memset(bssid, 0, sizeof(bssid));
devdbg(usbdev, "link up work: [%pM] %s", bssid, roamed ? "roamed" : ""); netdev_dbg(usbdev->net, "link up work: [%pM]%s\n",
bssid, roamed ? " roamed" : "");
/* Internal bss list in device always contains at least the currently /* Internal bss list in device always contains at least the currently
* connected bss and we can get it to cfg80211 with * connected bss and we can get it to cfg80211 with
...@@ -2270,8 +2296,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev, ...@@ -2270,8 +2296,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev,
/* must have at least one array entry */ /* must have at least one array entry */
if (len < offsetof(struct ndis_80211_status_indication, u) + if (len < offsetof(struct ndis_80211_status_indication, u) +
sizeof(struct ndis_80211_auth_request)) { sizeof(struct ndis_80211_auth_request)) {
devinfo(usbdev, "authentication indication: " netdev_info(usbdev->net, "authentication indication: too short message (%i)\n",
"too short message (%i)", len); len);
return; return;
} }
...@@ -2298,8 +2324,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev, ...@@ -2298,8 +2324,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev,
type = "group_error"; type = "group_error";
} }
devinfo(usbdev, "authentication indication: %s (0x%08x)", type, netdev_info(usbdev->net, "authentication indication: %s (0x%08x)\n",
le32_to_cpu(auth_req->flags)); type, le32_to_cpu(auth_req->flags));
if (pairwise_error) { if (pairwise_error) {
key_type = NL80211_KEYTYPE_PAIRWISE; key_type = NL80211_KEYTYPE_PAIRWISE;
...@@ -2335,8 +2361,8 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, ...@@ -2335,8 +2361,8 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev,
if (len < offsetof(struct ndis_80211_status_indication, u) + if (len < offsetof(struct ndis_80211_status_indication, u) +
sizeof(struct ndis_80211_pmkid_cand_list)) { sizeof(struct ndis_80211_pmkid_cand_list)) {
devinfo(usbdev, "pmkid candidate list indication: " netdev_info(usbdev->net, "pmkid candidate list indication: too short message (%i)\n",
"too short message (%i)", len); len);
return; return;
} }
...@@ -2346,16 +2372,14 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, ...@@ -2346,16 +2372,14 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev,
offsetof(struct ndis_80211_status_indication, u); offsetof(struct ndis_80211_status_indication, u);
if (len < expected_len) { if (len < expected_len) {
devinfo(usbdev, "pmkid candidate list indication: " netdev_info(usbdev->net, "pmkid candidate list indication: list larger than buffer (%i < %i)\n",
"list larger than buffer (%i < %i)",
len, expected_len); len, expected_len);
return; return;
} }
cand_list = &indication->u.cand_list; cand_list = &indication->u.cand_list;
devinfo(usbdev, "pmkid candidate list indication: " netdev_info(usbdev->net, "pmkid candidate list indication: version %i, candidates %i\n",
"version %i, candidates %i",
le32_to_cpu(cand_list->version), le32_to_cpu(cand_list->version),
le32_to_cpu(cand_list->num_candidates)); le32_to_cpu(cand_list->num_candidates));
...@@ -2366,7 +2390,7 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, ...@@ -2366,7 +2390,7 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev,
struct ndis_80211_pmkid_candidate *cand = struct ndis_80211_pmkid_candidate *cand =
&cand_list->candidate_list[i]; &cand_list->candidate_list[i];
devdbg(usbdev, "cand[%i]: flags: 0x%08x, bssid: %pM", netdev_dbg(usbdev->net, "cand[%i]: flags: 0x%08x, bssid: %pM\n",
i, le32_to_cpu(cand->flags), cand->bssid); i, le32_to_cpu(cand->flags), cand->bssid);
#if 0 #if 0
...@@ -2398,14 +2422,13 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, ...@@ -2398,14 +2422,13 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev,
len = le32_to_cpu(msg->length); len = le32_to_cpu(msg->length);
if (len < 8) { if (len < 8) {
devinfo(usbdev, "media specific indication, " netdev_info(usbdev->net, "media specific indication, ignore too short message (%i < 8)\n",
"ignore too short message (%i < 8)", len); len);
return; return;
} }
if (offset + len > buflen) { if (offset + len > buflen) {
devinfo(usbdev, "media specific indication, " netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n",
"too large to fit to buffer (%i > %i)",
offset + len, buflen); offset + len, buflen);
return; return;
} }
...@@ -2414,12 +2437,12 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, ...@@ -2414,12 +2437,12 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev,
switch (le32_to_cpu(indication->status_type)) { switch (le32_to_cpu(indication->status_type)) {
case NDIS_80211_STATUSTYPE_RADIOSTATE: case NDIS_80211_STATUSTYPE_RADIOSTATE:
devinfo(usbdev, "radio state indication: %i", netdev_info(usbdev->net, "radio state indication: %i\n",
le32_to_cpu(indication->u.radio_status)); le32_to_cpu(indication->u.radio_status));
return; return;
case NDIS_80211_STATUSTYPE_MEDIASTREAMMODE: case NDIS_80211_STATUSTYPE_MEDIASTREAMMODE:
devinfo(usbdev, "media stream mode indication: %i", netdev_info(usbdev->net, "media stream mode indication: %i\n",
le32_to_cpu(indication->u.media_stream_mode)); le32_to_cpu(indication->u.media_stream_mode));
return; return;
...@@ -2432,8 +2455,7 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, ...@@ -2432,8 +2455,7 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev,
return; return;
default: default:
devinfo(usbdev, "media specific indication: " netdev_info(usbdev->net, "media specific indication: unknown status type 0x%08x\n",
"unknown status type 0x%08x",
le32_to_cpu(indication->status_type)); le32_to_cpu(indication->status_type));
} }
} }
...@@ -2451,14 +2473,13 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) ...@@ -2451,14 +2473,13 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
* and userspace to think that device is * and userspace to think that device is
* roaming/reassociating when it isn't. * roaming/reassociating when it isn't.
*/ */
devdbg(usbdev, "ignored OID_802_11_ADD_KEY triggered " netdev_dbg(usbdev->net, "ignored OID_802_11_ADD_KEY triggered 'media connect'\n");
"'media connect'");
return; return;
} }
usbnet_pause_rx(usbdev); usbnet_pause_rx(usbdev);
devinfo(usbdev, "media connect"); netdev_info(usbdev->net, "media connect\n");
/* queue work to avoid recursive calls into rndis_command */ /* queue work to avoid recursive calls into rndis_command */
set_bit(WORK_LINK_UP, &priv->work_pending); set_bit(WORK_LINK_UP, &priv->work_pending);
...@@ -2466,7 +2487,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) ...@@ -2466,7 +2487,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
break; break;
case RNDIS_STATUS_MEDIA_DISCONNECT: case RNDIS_STATUS_MEDIA_DISCONNECT:
devinfo(usbdev, "media disconnect"); netdev_info(usbdev->net, "media disconnect\n");
/* queue work to avoid recursive calls into rndis_command */ /* queue work to avoid recursive calls into rndis_command */
set_bit(WORK_LINK_DOWN, &priv->work_pending); set_bit(WORK_LINK_DOWN, &priv->work_pending);
...@@ -2478,7 +2499,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) ...@@ -2478,7 +2499,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
break; break;
default: default:
devinfo(usbdev, "indication: 0x%08x", netdev_info(usbdev->net, "indication: 0x%08x\n",
le32_to_cpu(msg->status)); le32_to_cpu(msg->status));
break; break;
} }
...@@ -2544,7 +2565,7 @@ static void rndis_device_poller(struct work_struct *work) ...@@ -2544,7 +2565,7 @@ static void rndis_device_poller(struct work_struct *work)
if (ret == 0) if (ret == 0)
priv->last_qual = level_to_qual(le32_to_cpu(rssi)); priv->last_qual = level_to_qual(le32_to_cpu(rssi));
devdbg(usbdev, "dev-poller: OID_802_11_RSSI -> %d, rssi:%d, qual: %d", netdev_dbg(usbdev->net, "dev-poller: OID_802_11_RSSI -> %d, rssi:%d, qual: %d\n",
ret, le32_to_cpu(rssi), level_to_qual(le32_to_cpu(rssi))); ret, le32_to_cpu(rssi), level_to_qual(le32_to_cpu(rssi)));
/* Workaround transfer stalls on poor quality links. /* Workaround transfer stalls on poor quality links.
...@@ -2838,11 +2859,11 @@ static int rndis_wlan_reset(struct usbnet *usbdev) ...@@ -2838,11 +2859,11 @@ static int rndis_wlan_reset(struct usbnet *usbdev)
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
int retval; int retval;
devdbg(usbdev, "rndis_wlan_reset"); netdev_dbg(usbdev->net, "%s()\n", __func__);
retval = rndis_reset(usbdev); retval = rndis_reset(usbdev);
if (retval) if (retval)
devwarn(usbdev, "rndis_reset() failed: %d", retval); netdev_warn(usbdev->net, "rndis_reset failed: %d\n", retval);
/* rndis_reset cleared multicast list, so restore here. /* rndis_reset cleared multicast list, so restore here.
(set_multicast_list() also turns on current packet filter) */ (set_multicast_list() also turns on current packet filter) */
...@@ -2860,7 +2881,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev) ...@@ -2860,7 +2881,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
int retval; int retval;
__le32 filter; __le32 filter;
devdbg(usbdev, "rndis_wlan_stop"); netdev_dbg(usbdev->net, "%s()\n", __func__);
retval = disassociate(usbdev, false); retval = disassociate(usbdev, false);
......
...@@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32); ...@@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32);
extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
extern int usbnet_nway_reset(struct net_device *net); extern int usbnet_nway_reset(struct net_device *net);
/* messaging support includes the interface name, so it must not be
* used before it has one ... notably, in minidriver bind() calls.
*/
#ifdef DEBUG
#define devdbg(usbnet, fmt, arg...) \
printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
#else
#define devdbg(usbnet, fmt, arg...) \
({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \
## arg); 0; })
#endif
#define deverr(usbnet, fmt, arg...) \
printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
#define devwarn(usbnet, fmt, arg...) \
printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
#define devinfo(usbnet, fmt, arg...) \
printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \
#endif /* __LINUX_USB_USBNET_H */ #endif /* __LINUX_USB_USBNET_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment