diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 05:30:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:35:40 -0500 |
commit | 60b86755929e1a7e9038c8d860a8491cfdf8d93a (patch) | |
tree | 97062c7136ead4adcdbf2bd3280143da1fabbe20 /drivers/net/usb | |
parent | 82456b031e3c3b5bf95a7e49bd9b68b146446e76 (diff) |
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: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/asix.c | 97 | ||||
-rw-r--r-- | drivers/net/usb/cdc_eem.c | 10 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 18 | ||||
-rw-r--r-- | drivers/net/usb/dm9601.c | 49 | ||||
-rw-r--r-- | drivers/net/usb/int51x1.c | 15 | ||||
-rw-r--r-- | drivers/net/usb/net1080.c | 101 | ||||
-rw-r--r-- | drivers/net/usb/rndis_host.c | 10 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 188 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 162 |
9 files changed, 334 insertions, 316 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index f02551713b13..f605204de3e5 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -184,8 +184,8 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, | |||
184 | void *buf; | 184 | void *buf; |
185 | int err = -ENOMEM; | 185 | int err = -ENOMEM; |
186 | 186 | ||
187 | devdbg(dev,"asix_read_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d", | 187 | netdev_dbg(dev->net, "asix_read_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n", |
188 | cmd, value, index, size); | 188 | cmd, value, index, size); |
189 | 189 | ||
190 | buf = kmalloc(size, GFP_KERNEL); | 190 | buf = kmalloc(size, GFP_KERNEL); |
191 | if (!buf) | 191 | if (!buf) |
@@ -217,8 +217,8 @@ static int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, | |||
217 | void *buf = NULL; | 217 | void *buf = NULL; |
218 | int err = -ENOMEM; | 218 | int err = -ENOMEM; |
219 | 219 | ||
220 | devdbg(dev,"asix_write_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d", | 220 | netdev_dbg(dev->net, "asix_write_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n", |
221 | cmd, value, index, size); | 221 | cmd, value, index, size); |
222 | 222 | ||
223 | if (data) { | 223 | if (data) { |
224 | buf = kmalloc(size, GFP_KERNEL); | 224 | buf = kmalloc(size, GFP_KERNEL); |
@@ -264,15 +264,15 @@ asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index, | |||
264 | int status; | 264 | int status; |
265 | struct urb *urb; | 265 | struct urb *urb; |
266 | 266 | ||
267 | devdbg(dev,"asix_write_cmd_async() cmd=0x%02x value=0x%04x index=0x%04x size=%d", | 267 | netdev_dbg(dev->net, "asix_write_cmd_async() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n", |
268 | cmd, value, index, size); | 268 | cmd, value, index, size); |
269 | if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) { | 269 | if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) { |
270 | deverr(dev, "Error allocating URB in write_cmd_async!"); | 270 | netdev_err(dev->net, "Error allocating URB in write_cmd_async!\n"); |
271 | return; | 271 | return; |
272 | } | 272 | } |
273 | 273 | ||
274 | if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) { | 274 | if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) { |
275 | deverr(dev, "Failed to allocate memory for control request"); | 275 | netdev_err(dev->net, "Failed to allocate memory for control request\n"); |
276 | usb_free_urb(urb); | 276 | usb_free_urb(urb); |
277 | return; | 277 | return; |
278 | } | 278 | } |
@@ -289,8 +289,8 @@ asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index, | |||
289 | asix_async_cmd_callback, req); | 289 | asix_async_cmd_callback, req); |
290 | 290 | ||
291 | if((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { | 291 | if((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { |
292 | deverr(dev, "Error submitting the control message: status=%d", | 292 | netdev_err(dev->net, "Error submitting the control message: status=%d\n", |
293 | status); | 293 | status); |
294 | kfree(req); | 294 | kfree(req); |
295 | usb_free_urb(urb); | 295 | usb_free_urb(urb); |
296 | } | 296 | } |
@@ -314,7 +314,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
314 | while (skb->len > 0) { | 314 | while (skb->len > 0) { |
315 | if ((short)(header & 0x0000ffff) != | 315 | if ((short)(header & 0x0000ffff) != |
316 | ~((short)((header & 0xffff0000) >> 16))) { | 316 | ~((short)((header & 0xffff0000) >> 16))) { |
317 | deverr(dev,"asix_rx_fixup() Bad Header Length"); | 317 | netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n"); |
318 | } | 318 | } |
319 | /* get the packet length */ | 319 | /* get the packet length */ |
320 | size = (u16) (header & 0x0000ffff); | 320 | size = (u16) (header & 0x0000ffff); |
@@ -322,7 +322,8 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
322 | if ((skb->len) - ((size + 1) & 0xfffe) == 0) | 322 | if ((skb->len) - ((size + 1) & 0xfffe) == 0) |
323 | return 2; | 323 | return 2; |
324 | if (size > ETH_FRAME_LEN) { | 324 | if (size > ETH_FRAME_LEN) { |
325 | deverr(dev,"asix_rx_fixup() Bad RX Length %d", size); | 325 | netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n", |
326 | size); | ||
326 | return 0; | 327 | return 0; |
327 | } | 328 | } |
328 | ax_skb = skb_clone(skb, GFP_ATOMIC); | 329 | ax_skb = skb_clone(skb, GFP_ATOMIC); |
@@ -348,7 +349,8 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
348 | } | 349 | } |
349 | 350 | ||
350 | if (skb->len < 0) { | 351 | if (skb->len < 0) { |
351 | deverr(dev,"asix_rx_fixup() Bad SKB Length %d", skb->len); | 352 | netdev_err(dev->net, "asix_rx_fixup() Bad SKB Length %d\n", |
353 | skb->len); | ||
352 | return 0; | 354 | return 0; |
353 | } | 355 | } |
354 | return 1; | 356 | return 1; |
@@ -409,7 +411,7 @@ static void asix_status(struct usbnet *dev, struct urb *urb) | |||
409 | usbnet_defer_kevent (dev, EVENT_LINK_RESET ); | 411 | usbnet_defer_kevent (dev, EVENT_LINK_RESET ); |
410 | } else | 412 | } else |
411 | netif_carrier_off(dev->net); | 413 | netif_carrier_off(dev->net); |
412 | devdbg(dev, "Link Status is: %d", link); | 414 | netdev_dbg(dev->net, "Link Status is: %d\n", link); |
413 | } | 415 | } |
414 | } | 416 | } |
415 | 417 | ||
@@ -418,7 +420,7 @@ static inline int asix_set_sw_mii(struct usbnet *dev) | |||
418 | int ret; | 420 | int ret; |
419 | ret = asix_write_cmd(dev, AX_CMD_SET_SW_MII, 0x0000, 0, 0, NULL); | 421 | ret = asix_write_cmd(dev, AX_CMD_SET_SW_MII, 0x0000, 0, 0, NULL); |
420 | if (ret < 0) | 422 | if (ret < 0) |
421 | deverr(dev, "Failed to enable software MII access"); | 423 | netdev_err(dev->net, "Failed to enable software MII access\n"); |
422 | return ret; | 424 | return ret; |
423 | } | 425 | } |
424 | 426 | ||
@@ -427,7 +429,7 @@ static inline int asix_set_hw_mii(struct usbnet *dev) | |||
427 | int ret; | 429 | int ret; |
428 | ret = asix_write_cmd(dev, AX_CMD_SET_HW_MII, 0x0000, 0, 0, NULL); | 430 | ret = asix_write_cmd(dev, AX_CMD_SET_HW_MII, 0x0000, 0, 0, NULL); |
429 | if (ret < 0) | 431 | if (ret < 0) |
430 | deverr(dev, "Failed to enable hardware MII access"); | 432 | netdev_err(dev->net, "Failed to enable hardware MII access\n"); |
431 | return ret; | 433 | return ret; |
432 | } | 434 | } |
433 | 435 | ||
@@ -436,13 +438,14 @@ static inline int asix_get_phy_addr(struct usbnet *dev) | |||
436 | u8 buf[2]; | 438 | u8 buf[2]; |
437 | int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf); | 439 | int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf); |
438 | 440 | ||
439 | devdbg(dev, "asix_get_phy_addr()"); | 441 | netdev_dbg(dev->net, "asix_get_phy_addr()\n"); |
440 | 442 | ||
441 | if (ret < 0) { | 443 | if (ret < 0) { |
442 | deverr(dev, "Error reading PHYID register: %02x", ret); | 444 | netdev_err(dev->net, "Error reading PHYID register: %02x\n", ret); |
443 | goto out; | 445 | goto out; |
444 | } | 446 | } |
445 | devdbg(dev, "asix_get_phy_addr() returning 0x%04x", *((__le16 *)buf)); | 447 | netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n", |
448 | *((__le16 *)buf)); | ||
446 | ret = buf[1]; | 449 | ret = buf[1]; |
447 | 450 | ||
448 | out: | 451 | out: |
@@ -455,7 +458,7 @@ static int asix_sw_reset(struct usbnet *dev, u8 flags) | |||
455 | 458 | ||
456 | ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL); | 459 | ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL); |
457 | if (ret < 0) | 460 | if (ret < 0) |
458 | deverr(dev,"Failed to send software reset: %02x", ret); | 461 | netdev_err(dev->net, "Failed to send software reset: %02x\n", ret); |
459 | 462 | ||
460 | return ret; | 463 | return ret; |
461 | } | 464 | } |
@@ -466,7 +469,7 @@ static u16 asix_read_rx_ctl(struct usbnet *dev) | |||
466 | int ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL, 0, 0, 2, &v); | 469 | int ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL, 0, 0, 2, &v); |
467 | 470 | ||
468 | if (ret < 0) { | 471 | if (ret < 0) { |
469 | deverr(dev, "Error reading RX_CTL register: %02x", ret); | 472 | netdev_err(dev->net, "Error reading RX_CTL register: %02x\n", ret); |
470 | goto out; | 473 | goto out; |
471 | } | 474 | } |
472 | ret = le16_to_cpu(v); | 475 | ret = le16_to_cpu(v); |
@@ -478,11 +481,11 @@ static int asix_write_rx_ctl(struct usbnet *dev, u16 mode) | |||
478 | { | 481 | { |
479 | int ret; | 482 | int ret; |
480 | 483 | ||
481 | devdbg(dev,"asix_write_rx_ctl() - mode = 0x%04x", mode); | 484 | netdev_dbg(dev->net, "asix_write_rx_ctl() - mode = 0x%04x\n", mode); |
482 | ret = asix_write_cmd(dev, AX_CMD_WRITE_RX_CTL, mode, 0, 0, NULL); | 485 | ret = asix_write_cmd(dev, AX_CMD_WRITE_RX_CTL, mode, 0, 0, NULL); |
483 | if (ret < 0) | 486 | if (ret < 0) |
484 | deverr(dev, "Failed to write RX_CTL mode to 0x%04x: %02x", | 487 | netdev_err(dev->net, "Failed to write RX_CTL mode to 0x%04x: %02x\n", |
485 | mode, ret); | 488 | mode, ret); |
486 | 489 | ||
487 | return ret; | 490 | return ret; |
488 | } | 491 | } |
@@ -493,7 +496,8 @@ static u16 asix_read_medium_status(struct usbnet *dev) | |||
493 | int ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v); | 496 | int ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v); |
494 | 497 | ||
495 | if (ret < 0) { | 498 | if (ret < 0) { |
496 | deverr(dev, "Error reading Medium Status register: %02x", ret); | 499 | netdev_err(dev->net, "Error reading Medium Status register: %02x\n", |
500 | ret); | ||
497 | goto out; | 501 | goto out; |
498 | } | 502 | } |
499 | ret = le16_to_cpu(v); | 503 | ret = le16_to_cpu(v); |
@@ -505,11 +509,11 @@ static int asix_write_medium_mode(struct usbnet *dev, u16 mode) | |||
505 | { | 509 | { |
506 | int ret; | 510 | int ret; |
507 | 511 | ||
508 | devdbg(dev,"asix_write_medium_mode() - mode = 0x%04x", mode); | 512 | netdev_dbg(dev->net, "asix_write_medium_mode() - mode = 0x%04x\n", mode); |
509 | ret = asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); | 513 | ret = asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); |
510 | if (ret < 0) | 514 | if (ret < 0) |
511 | deverr(dev, "Failed to write Medium Mode mode to 0x%04x: %02x", | 515 | netdev_err(dev->net, "Failed to write Medium Mode mode to 0x%04x: %02x\n", |
512 | mode, ret); | 516 | mode, ret); |
513 | 517 | ||
514 | return ret; | 518 | return ret; |
515 | } | 519 | } |
@@ -518,11 +522,11 @@ static int asix_write_gpio(struct usbnet *dev, u16 value, int sleep) | |||
518 | { | 522 | { |
519 | int ret; | 523 | int ret; |
520 | 524 | ||
521 | devdbg(dev,"asix_write_gpio() - value = 0x%04x", value); | 525 | netdev_dbg(dev->net, "asix_write_gpio() - value = 0x%04x\n", value); |
522 | ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS, value, 0, 0, NULL); | 526 | ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS, value, 0, 0, NULL); |
523 | if (ret < 0) | 527 | if (ret < 0) |
524 | deverr(dev, "Failed to write GPIO value 0x%04x: %02x", | 528 | netdev_err(dev->net, "Failed to write GPIO value 0x%04x: %02x\n", |
525 | value, ret); | 529 | value, ret); |
526 | 530 | ||
527 | if (sleep) | 531 | if (sleep) |
528 | msleep(sleep); | 532 | msleep(sleep); |
@@ -588,7 +592,8 @@ static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc) | |||
588 | asix_set_hw_mii(dev); | 592 | asix_set_hw_mii(dev); |
589 | mutex_unlock(&dev->phy_mutex); | 593 | mutex_unlock(&dev->phy_mutex); |
590 | 594 | ||
591 | devdbg(dev, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", phy_id, loc, le16_to_cpu(res)); | 595 | netdev_dbg(dev->net, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n", |
596 | phy_id, loc, le16_to_cpu(res)); | ||
592 | 597 | ||
593 | return le16_to_cpu(res); | 598 | return le16_to_cpu(res); |
594 | } | 599 | } |
@@ -599,7 +604,8 @@ asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val) | |||
599 | struct usbnet *dev = netdev_priv(netdev); | 604 | struct usbnet *dev = netdev_priv(netdev); |
600 | __le16 res = cpu_to_le16(val); | 605 | __le16 res = cpu_to_le16(val); |
601 | 606 | ||
602 | devdbg(dev, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", phy_id, loc, val); | 607 | netdev_dbg(dev->net, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", |
608 | phy_id, loc, val); | ||
603 | mutex_lock(&dev->phy_mutex); | 609 | mutex_lock(&dev->phy_mutex); |
604 | asix_set_sw_mii(dev); | 610 | asix_set_sw_mii(dev); |
605 | asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, &res); | 611 | 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 | if (ecmd.duplex != DUPLEX_FULL) | 806 | if (ecmd.duplex != DUPLEX_FULL) |
801 | mode |= ~AX88172_MEDIUM_FD; | 807 | mode |= ~AX88172_MEDIUM_FD; |
802 | 808 | ||
803 | devdbg(dev, "ax88172_link_reset() speed: %d duplex: %d setting mode to 0x%04x", ecmd.speed, ecmd.duplex, mode); | 809 | netdev_dbg(dev->net, "ax88172_link_reset() speed: %d duplex: %d setting mode to 0x%04x\n", |
810 | ecmd.speed, ecmd.duplex, mode); | ||
804 | 811 | ||
805 | asix_write_medium_mode(dev, mode); | 812 | asix_write_medium_mode(dev, mode); |
806 | 813 | ||
@@ -902,7 +909,8 @@ static int ax88772_link_reset(struct usbnet *dev) | |||
902 | if (ecmd.duplex != DUPLEX_FULL) | 909 | if (ecmd.duplex != DUPLEX_FULL) |
903 | mode &= ~AX_MEDIUM_FD; | 910 | mode &= ~AX_MEDIUM_FD; |
904 | 911 | ||
905 | devdbg(dev, "ax88772_link_reset() speed: %d duplex: %d setting mode to 0x%04x", ecmd.speed, ecmd.duplex, mode); | 912 | netdev_dbg(dev->net, "ax88772_link_reset() speed: %d duplex: %d setting mode to 0x%04x\n", |
913 | ecmd.speed, ecmd.duplex, mode); | ||
906 | 914 | ||
907 | asix_write_medium_mode(dev, mode); | 915 | asix_write_medium_mode(dev, mode); |
908 | 916 | ||
@@ -1059,10 +1067,10 @@ static int marvell_phy_init(struct usbnet *dev) | |||
1059 | struct asix_data *data = (struct asix_data *)&dev->data; | 1067 | struct asix_data *data = (struct asix_data *)&dev->data; |
1060 | u16 reg; | 1068 | u16 reg; |
1061 | 1069 | ||
1062 | devdbg(dev,"marvell_phy_init()"); | 1070 | netdev_dbg(dev->net, "marvell_phy_init()\n"); |
1063 | 1071 | ||
1064 | reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_MARVELL_STATUS); | 1072 | reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_MARVELL_STATUS); |
1065 | devdbg(dev,"MII_MARVELL_STATUS = 0x%04x", reg); | 1073 | netdev_dbg(dev->net, "MII_MARVELL_STATUS = 0x%04x\n", reg); |
1066 | 1074 | ||
1067 | asix_mdio_write(dev->net, dev->mii.phy_id, MII_MARVELL_CTRL, | 1075 | asix_mdio_write(dev->net, dev->mii.phy_id, MII_MARVELL_CTRL, |
1068 | MARVELL_CTRL_RXDELAY | MARVELL_CTRL_TXDELAY); | 1076 | MARVELL_CTRL_RXDELAY | MARVELL_CTRL_TXDELAY); |
@@ -1070,7 +1078,7 @@ static int marvell_phy_init(struct usbnet *dev) | |||
1070 | if (data->ledmode) { | 1078 | if (data->ledmode) { |
1071 | reg = asix_mdio_read(dev->net, dev->mii.phy_id, | 1079 | reg = asix_mdio_read(dev->net, dev->mii.phy_id, |
1072 | MII_MARVELL_LED_CTRL); | 1080 | MII_MARVELL_LED_CTRL); |
1073 | devdbg(dev,"MII_MARVELL_LED_CTRL (1) = 0x%04x", reg); | 1081 | netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (1) = 0x%04x\n", reg); |
1074 | 1082 | ||
1075 | reg &= 0xf8ff; | 1083 | reg &= 0xf8ff; |
1076 | reg |= (1 + 0x0100); | 1084 | reg |= (1 + 0x0100); |
@@ -1079,7 +1087,7 @@ static int marvell_phy_init(struct usbnet *dev) | |||
1079 | 1087 | ||
1080 | reg = asix_mdio_read(dev->net, dev->mii.phy_id, | 1088 | reg = asix_mdio_read(dev->net, dev->mii.phy_id, |
1081 | MII_MARVELL_LED_CTRL); | 1089 | MII_MARVELL_LED_CTRL); |
1082 | devdbg(dev,"MII_MARVELL_LED_CTRL (2) = 0x%04x", reg); | 1090 | netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (2) = 0x%04x\n", reg); |
1083 | reg &= 0xfc0f; | 1091 | reg &= 0xfc0f; |
1084 | } | 1092 | } |
1085 | 1093 | ||
@@ -1090,7 +1098,7 @@ static int marvell_led_status(struct usbnet *dev, u16 speed) | |||
1090 | { | 1098 | { |
1091 | u16 reg = asix_mdio_read(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL); | 1099 | u16 reg = asix_mdio_read(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL); |
1092 | 1100 | ||
1093 | devdbg(dev, "marvell_led_status() read 0x%04x", reg); | 1101 | netdev_dbg(dev->net, "marvell_led_status() read 0x%04x\n", reg); |
1094 | 1102 | ||
1095 | /* Clear out the center LED bits - 0x03F0 */ | 1103 | /* Clear out the center LED bits - 0x03F0 */ |
1096 | reg &= 0xfc0f; | 1104 | reg &= 0xfc0f; |
@@ -1106,7 +1114,7 @@ static int marvell_led_status(struct usbnet *dev, u16 speed) | |||
1106 | reg |= 0x02f0; | 1114 | reg |= 0x02f0; |
1107 | } | 1115 | } |
1108 | 1116 | ||
1109 | devdbg(dev, "marvell_led_status() writing 0x%04x", reg); | 1117 | netdev_dbg(dev->net, "marvell_led_status() writing 0x%04x\n", reg); |
1110 | asix_mdio_write(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL, reg); | 1118 | asix_mdio_write(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL, reg); |
1111 | 1119 | ||
1112 | return 0; | 1120 | return 0; |
@@ -1118,7 +1126,7 @@ static int ax88178_link_reset(struct usbnet *dev) | |||
1118 | struct ethtool_cmd ecmd; | 1126 | struct ethtool_cmd ecmd; |
1119 | struct asix_data *data = (struct asix_data *)&dev->data; | 1127 | struct asix_data *data = (struct asix_data *)&dev->data; |
1120 | 1128 | ||
1121 | devdbg(dev,"ax88178_link_reset()"); | 1129 | netdev_dbg(dev->net, "ax88178_link_reset()\n"); |
1122 | 1130 | ||
1123 | mii_check_media(&dev->mii, 1, 1); | 1131 | mii_check_media(&dev->mii, 1, 1); |
1124 | mii_ethtool_gset(&dev->mii, &ecmd); | 1132 | mii_ethtool_gset(&dev->mii, &ecmd); |
@@ -1138,7 +1146,8 @@ static int ax88178_link_reset(struct usbnet *dev) | |||
1138 | else | 1146 | else |
1139 | mode &= ~AX_MEDIUM_FD; | 1147 | mode &= ~AX_MEDIUM_FD; |
1140 | 1148 | ||
1141 | devdbg(dev, "ax88178_link_reset() speed: %d duplex: %d setting mode to 0x%04x", ecmd.speed, ecmd.duplex, mode); | 1149 | netdev_dbg(dev->net, "ax88178_link_reset() speed: %d duplex: %d setting mode to 0x%04x\n", |
1150 | ecmd.speed, ecmd.duplex, mode); | ||
1142 | 1151 | ||
1143 | asix_write_medium_mode(dev, mode); | 1152 | asix_write_medium_mode(dev, mode); |
1144 | 1153 | ||
@@ -1188,7 +1197,7 @@ static int ax88178_change_mtu(struct net_device *net, int new_mtu) | |||
1188 | struct usbnet *dev = netdev_priv(net); | 1197 | struct usbnet *dev = netdev_priv(net); |
1189 | int ll_mtu = new_mtu + net->hard_header_len + 4; | 1198 | int ll_mtu = new_mtu + net->hard_header_len + 4; |
1190 | 1199 | ||
1191 | devdbg(dev, "ax88178_change_mtu() new_mtu=%d", new_mtu); | 1200 | netdev_dbg(dev->net, "ax88178_change_mtu() new_mtu=%d\n", new_mtu); |
1192 | 1201 | ||
1193 | if (new_mtu <= 0 || ll_mtu > 16384) | 1202 | if (new_mtu <= 0 || ll_mtu > 16384) |
1194 | return -EINVAL; | 1203 | return -EINVAL; |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index c337ffc3304a..a4a85a6ed86d 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -73,7 +73,7 @@ static void eem_linkcmd(struct usbnet *dev, struct sk_buff *skb) | |||
73 | usb_free_urb(urb); | 73 | usb_free_urb(urb); |
74 | fail: | 74 | fail: |
75 | dev_kfree_skb(skb); | 75 | dev_kfree_skb(skb); |
76 | devwarn(dev, "link cmd failure\n"); | 76 | netdev_warn(dev->net, "link cmd failure\n"); |
77 | return; | 77 | return; |
78 | } | 78 | } |
79 | } | 79 | } |
@@ -212,7 +212,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
212 | * b15: 1 (EEM command) | 212 | * b15: 1 (EEM command) |
213 | */ | 213 | */ |
214 | if (header & BIT(14)) { | 214 | if (header & BIT(14)) { |
215 | devdbg(dev, "reserved command %04x\n", header); | 215 | netdev_dbg(dev->net, "reserved command %04x\n", |
216 | header); | ||
216 | continue; | 217 | continue; |
217 | } | 218 | } |
218 | 219 | ||
@@ -255,8 +256,9 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
255 | case 1: /* Echo response */ | 256 | case 1: /* Echo response */ |
256 | case 5: /* Tickle */ | 257 | case 5: /* Tickle */ |
257 | default: /* reserved */ | 258 | default: /* reserved */ |
258 | devwarn(dev, "unexpected link command %d\n", | 259 | netdev_warn(dev->net, |
259 | bmEEMCmd); | 260 | "unexpected link command %d\n", |
261 | bmEEMCmd); | ||
260 | continue; | 262 | continue; |
261 | } | 263 | } |
262 | 264 | ||
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 4f27f022fbf7..7e5a75269cc5 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -340,9 +340,9 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind); | |||
340 | static void dumpspeed(struct usbnet *dev, __le32 *speeds) | 340 | static void dumpspeed(struct usbnet *dev, __le32 *speeds) |
341 | { | 341 | { |
342 | if (netif_msg_timer(dev)) | 342 | if (netif_msg_timer(dev)) |
343 | devinfo(dev, "link speeds: %u kbps up, %u kbps down", | 343 | netdev_info(dev->net, "link speeds: %u kbps up, %u kbps down\n", |
344 | __le32_to_cpu(speeds[0]) / 1000, | 344 | __le32_to_cpu(speeds[0]) / 1000, |
345 | __le32_to_cpu(speeds[1]) / 1000); | 345 | __le32_to_cpu(speeds[1]) / 1000); |
346 | } | 346 | } |
347 | 347 | ||
348 | static void cdc_status(struct usbnet *dev, struct urb *urb) | 348 | static void cdc_status(struct usbnet *dev, struct urb *urb) |
@@ -362,8 +362,8 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) | |||
362 | switch (event->bNotificationType) { | 362 | switch (event->bNotificationType) { |
363 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: | 363 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: |
364 | if (netif_msg_timer(dev)) | 364 | if (netif_msg_timer(dev)) |
365 | devdbg(dev, "CDC: carrier %s", | 365 | netdev_dbg(dev->net, "CDC: carrier %s\n", |
366 | event->wValue ? "on" : "off"); | 366 | event->wValue ? "on" : "off"); |
367 | if (event->wValue) | 367 | if (event->wValue) |
368 | netif_carrier_on(dev->net); | 368 | netif_carrier_on(dev->net); |
369 | else | 369 | else |
@@ -371,8 +371,8 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) | |||
371 | break; | 371 | break; |
372 | case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ | 372 | case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ |
373 | if (netif_msg_timer(dev)) | 373 | if (netif_msg_timer(dev)) |
374 | devdbg(dev, "CDC: speed change (len %d)", | 374 | netdev_dbg(dev->net, "CDC: speed change (len %d)\n", |
375 | urb->actual_length); | 375 | urb->actual_length); |
376 | if (urb->actual_length != (sizeof *event + 8)) | 376 | if (urb->actual_length != (sizeof *event + 8)) |
377 | set_bit(EVENT_STS_SPLIT, &dev->flags); | 377 | set_bit(EVENT_STS_SPLIT, &dev->flags); |
378 | else | 378 | else |
@@ -382,8 +382,8 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) | |||
382 | * but there are no standard formats for the response data. | 382 | * but there are no standard formats for the response data. |
383 | */ | 383 | */ |
384 | default: | 384 | default: |
385 | deverr(dev, "CDC: unexpected notification %02x!", | 385 | netdev_err(dev->net, "CDC: unexpected notification %02x!\n", |
386 | event->bNotificationType); | 386 | event->bNotificationType); |
387 | break; | 387 | break; |
388 | } | 388 | } |
389 | } | 389 | } |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index c820fec62041..269339769f47 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -58,7 +58,7 @@ static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data) | |||
58 | void *buf; | 58 | void *buf; |
59 | int err = -ENOMEM; | 59 | int err = -ENOMEM; |
60 | 60 | ||
61 | devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length); | 61 | netdev_dbg(dev->net, "dm_read() reg=0x%02x length=%d\n", reg, length); |
62 | 62 | ||
63 | buf = kmalloc(length, GFP_KERNEL); | 63 | buf = kmalloc(length, GFP_KERNEL); |
64 | if (!buf) | 64 | if (!buf) |
@@ -89,7 +89,7 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) | |||
89 | void *buf = NULL; | 89 | void *buf = NULL; |
90 | int err = -ENOMEM; | 90 | int err = -ENOMEM; |
91 | 91 | ||
92 | devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length); | 92 | netdev_dbg(dev->net, "dm_write() reg=0x%02x, length=%d\n", reg, length); |
93 | 93 | ||
94 | if (data) { | 94 | if (data) { |
95 | buf = kmalloc(length, GFP_KERNEL); | 95 | buf = kmalloc(length, GFP_KERNEL); |
@@ -112,7 +112,8 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) | |||
112 | 112 | ||
113 | static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) | 113 | static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) |
114 | { | 114 | { |
115 | devdbg(dev, "dm_write_reg() reg=0x%02x, value=0x%02x", reg, value); | 115 | netdev_dbg(dev->net, "dm_write_reg() reg=0x%02x, value=0x%02x\n", |
116 | reg, value); | ||
116 | return usb_control_msg(dev->udev, | 117 | return usb_control_msg(dev->udev, |
117 | usb_sndctrlpipe(dev->udev, 0), | 118 | usb_sndctrlpipe(dev->udev, 0), |
118 | DM_WRITE_REG, | 119 | DM_WRITE_REG, |
@@ -142,13 +143,13 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, | |||
142 | 143 | ||
143 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 144 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
144 | if (!urb) { | 145 | if (!urb) { |
145 | deverr(dev, "Error allocating URB in dm_write_async_helper!"); | 146 | netdev_err(dev->net, "Error allocating URB in dm_write_async_helper!\n"); |
146 | return; | 147 | return; |
147 | } | 148 | } |
148 | 149 | ||
149 | req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); | 150 | req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); |
150 | if (!req) { | 151 | if (!req) { |
151 | deverr(dev, "Failed to allocate memory for control request"); | 152 | netdev_err(dev->net, "Failed to allocate memory for control request\n"); |
152 | usb_free_urb(urb); | 153 | usb_free_urb(urb); |
153 | return; | 154 | return; |
154 | } | 155 | } |
@@ -166,8 +167,8 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, | |||
166 | 167 | ||
167 | status = usb_submit_urb(urb, GFP_ATOMIC); | 168 | status = usb_submit_urb(urb, GFP_ATOMIC); |
168 | if (status < 0) { | 169 | if (status < 0) { |
169 | deverr(dev, "Error submitting the control message: status=%d", | 170 | netdev_err(dev->net, "Error submitting the control message: status=%d\n", |
170 | status); | 171 | status); |
171 | kfree(req); | 172 | kfree(req); |
172 | usb_free_urb(urb); | 173 | usb_free_urb(urb); |
173 | } | 174 | } |
@@ -175,15 +176,15 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, | |||
175 | 176 | ||
176 | static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) | 177 | static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) |
177 | { | 178 | { |
178 | devdbg(dev, "dm_write_async() reg=0x%02x length=%d", reg, length); | 179 | netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length); |
179 | 180 | ||
180 | dm_write_async_helper(dev, reg, 0, length, data); | 181 | dm_write_async_helper(dev, reg, 0, length, data); |
181 | } | 182 | } |
182 | 183 | ||
183 | static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value) | 184 | static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value) |
184 | { | 185 | { |
185 | devdbg(dev, "dm_write_reg_async() reg=0x%02x value=0x%02x", | 186 | netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n", |
186 | reg, value); | 187 | reg, value); |
187 | 188 | ||
188 | dm_write_async_helper(dev, reg, value, 0, NULL); | 189 | dm_write_async_helper(dev, reg, value, 0, NULL); |
189 | } | 190 | } |
@@ -211,7 +212,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu | |||
211 | } | 212 | } |
212 | 213 | ||
213 | if (i == DM_TIMEOUT) { | 214 | if (i == DM_TIMEOUT) { |
214 | deverr(dev, "%s read timed out!", phy ? "phy" : "eeprom"); | 215 | netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom"); |
215 | ret = -EIO; | 216 | ret = -EIO; |
216 | goto out; | 217 | goto out; |
217 | } | 218 | } |
@@ -219,8 +220,8 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu | |||
219 | dm_write_reg(dev, DM_SHARED_CTRL, 0x0); | 220 | dm_write_reg(dev, DM_SHARED_CTRL, 0x0); |
220 | ret = dm_read(dev, DM_SHARED_DATA, 2, value); | 221 | ret = dm_read(dev, DM_SHARED_DATA, 2, value); |
221 | 222 | ||
222 | devdbg(dev, "read shared %d 0x%02x returned 0x%04x, %d", | 223 | netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n", |
223 | phy, reg, *value, ret); | 224 | phy, reg, *value, ret); |
224 | 225 | ||
225 | out: | 226 | out: |
226 | mutex_unlock(&dev->phy_mutex); | 227 | mutex_unlock(&dev->phy_mutex); |
@@ -254,7 +255,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu | |||
254 | } | 255 | } |
255 | 256 | ||
256 | if (i == DM_TIMEOUT) { | 257 | if (i == DM_TIMEOUT) { |
257 | deverr(dev, "%s write timed out!", phy ? "phy" : "eeprom"); | 258 | netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom"); |
258 | ret = -EIO; | 259 | ret = -EIO; |
259 | goto out; | 260 | goto out; |
260 | } | 261 | } |
@@ -304,15 +305,15 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc) | |||
304 | __le16 res; | 305 | __le16 res; |
305 | 306 | ||
306 | if (phy_id) { | 307 | if (phy_id) { |
307 | devdbg(dev, "Only internal phy supported"); | 308 | netdev_dbg(dev->net, "Only internal phy supported\n"); |
308 | return 0; | 309 | return 0; |
309 | } | 310 | } |
310 | 311 | ||
311 | dm_read_shared_word(dev, 1, loc, &res); | 312 | dm_read_shared_word(dev, 1, loc, &res); |
312 | 313 | ||
313 | devdbg(dev, | 314 | netdev_dbg(dev->net, |
314 | "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", | 315 | "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n", |
315 | phy_id, loc, le16_to_cpu(res)); | 316 | phy_id, loc, le16_to_cpu(res)); |
316 | 317 | ||
317 | return le16_to_cpu(res); | 318 | return le16_to_cpu(res); |
318 | } | 319 | } |
@@ -324,12 +325,12 @@ static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc, | |||
324 | __le16 res = cpu_to_le16(val); | 325 | __le16 res = cpu_to_le16(val); |
325 | 326 | ||
326 | if (phy_id) { | 327 | if (phy_id) { |
327 | devdbg(dev, "Only internal phy supported"); | 328 | netdev_dbg(dev->net, "Only internal phy supported\n"); |
328 | return; | 329 | return; |
329 | } | 330 | } |
330 | 331 | ||
331 | devdbg(dev,"dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", | 332 | netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", |
332 | phy_id, loc, val); | 333 | phy_id, loc, val); |
333 | 334 | ||
334 | dm_write_shared_word(dev, 1, loc, res); | 335 | dm_write_shared_word(dev, 1, loc, res); |
335 | } | 336 | } |
@@ -592,7 +593,7 @@ static void dm9601_status(struct usbnet *dev, struct urb *urb) | |||
592 | } | 593 | } |
593 | else | 594 | else |
594 | netif_carrier_off(dev->net); | 595 | netif_carrier_off(dev->net); |
595 | devdbg(dev, "Link Status is: %d", link); | 596 | netdev_dbg(dev->net, "Link Status is: %d\n", link); |
596 | } | 597 | } |
597 | } | 598 | } |
598 | 599 | ||
@@ -603,8 +604,8 @@ static int dm9601_link_reset(struct usbnet *dev) | |||
603 | mii_check_media(&dev->mii, 1, 1); | 604 | mii_check_media(&dev->mii, 1, 1); |
604 | mii_ethtool_gset(&dev->mii, &ecmd); | 605 | mii_ethtool_gset(&dev->mii, &ecmd); |
605 | 606 | ||
606 | devdbg(dev, "link_reset() speed: %d duplex: %d", | 607 | netdev_dbg(dev->net, "link_reset() speed: %d duplex: %d\n", |
607 | ecmd.speed, ecmd.duplex); | 608 | ecmd.speed, ecmd.duplex); |
608 | 609 | ||
609 | return 0; | 610 | return 0; |
610 | } | 611 | } |
diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c index 9ab5c1983a7d..3c228df57062 100644 --- a/drivers/net/usb/int51x1.c +++ b/drivers/net/usb/int51x1.c | |||
@@ -51,7 +51,7 @@ static int int51x1_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
51 | int len; | 51 | int len; |
52 | 52 | ||
53 | if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) { | 53 | if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) { |
54 | deverr(dev, "unexpected tiny rx frame"); | 54 | netdev_err(dev->net, "unexpected tiny rx frame\n"); |
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
@@ -138,25 +138,25 @@ static void int51x1_set_multicast(struct net_device *netdev) | |||
138 | if (netdev->flags & IFF_PROMISC) { | 138 | if (netdev->flags & IFF_PROMISC) { |
139 | /* do not expect to see traffic of other PLCs */ | 139 | /* do not expect to see traffic of other PLCs */ |
140 | filter |= PACKET_TYPE_PROMISCUOUS; | 140 | filter |= PACKET_TYPE_PROMISCUOUS; |
141 | devinfo(dev, "promiscuous mode enabled"); | 141 | netdev_info(dev->net, "promiscuous mode enabled\n"); |
142 | } else if (!netdev_mc_empty(netdev) || | 142 | } else if (!netdev_mc_empty(netdev) || |
143 | (netdev->flags & IFF_ALLMULTI)) { | 143 | (netdev->flags & IFF_ALLMULTI)) { |
144 | filter |= PACKET_TYPE_ALL_MULTICAST; | 144 | filter |= PACKET_TYPE_ALL_MULTICAST; |
145 | devdbg(dev, "receive all multicast enabled"); | 145 | netdev_dbg(dev->net, "receive all multicast enabled\n"); |
146 | } else { | 146 | } else { |
147 | /* ~PROMISCUOUS, ~MULTICAST */ | 147 | /* ~PROMISCUOUS, ~MULTICAST */ |
148 | devdbg(dev, "receive own packets only"); | 148 | netdev_dbg(dev->net, "receive own packets only\n"); |
149 | } | 149 | } |
150 | 150 | ||
151 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 151 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
152 | if (!urb) { | 152 | if (!urb) { |
153 | devwarn(dev, "Error allocating URB"); | 153 | netdev_warn(dev->net, "Error allocating URB\n"); |
154 | return; | 154 | return; |
155 | } | 155 | } |
156 | 156 | ||
157 | req = kmalloc(sizeof(*req), GFP_ATOMIC); | 157 | req = kmalloc(sizeof(*req), GFP_ATOMIC); |
158 | if (!req) { | 158 | if (!req) { |
159 | devwarn(dev, "Error allocating control msg"); | 159 | netdev_warn(dev->net, "Error allocating control msg\n"); |
160 | goto out; | 160 | goto out; |
161 | } | 161 | } |
162 | 162 | ||
@@ -173,7 +173,8 @@ static void int51x1_set_multicast(struct net_device *netdev) | |||
173 | 173 | ||
174 | status = usb_submit_urb(urb, GFP_ATOMIC); | 174 | status = usb_submit_urb(urb, GFP_ATOMIC); |
175 | if (status < 0) { | 175 | if (status < 0) { |
176 | devwarn(dev, "Error submitting control msg, sts=%d", status); | 176 | netdev_warn(dev->net, "Error submitting control msg, sts=%d\n", |
177 | status); | ||
177 | goto out1; | 178 | goto out1; |
178 | } | 179 | } |
179 | return; | 180 | return; |
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c index aeb1ab03a9ee..f6994053c101 100644 --- a/drivers/net/usb/net1080.c +++ b/drivers/net/usb/net1080.c | |||
@@ -205,23 +205,24 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) | |||
205 | { | 205 | { |
206 | if (!netif_msg_link(dev)) | 206 | if (!netif_msg_link(dev)) |
207 | return; | 207 | return; |
208 | devdbg(dev, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" | 208 | netdev_dbg(dev->net, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" |
209 | " this%s%s;" | 209 | " this%s%s;" |
210 | " other%s%s; r/o 0x%x", | 210 | " other%s%s; r/o 0x%x\n", |
211 | dev->udev->bus->bus_name, dev->udev->devpath, | 211 | dev->udev->bus->bus_name, dev->udev->devpath, |
212 | usbctl, | 212 | usbctl, |
213 | (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", | 213 | (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", |
214 | (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", | 214 | (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", |
215 | (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", | 215 | (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", |
216 | (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", | 216 | (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", |
217 | (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", | 217 | (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", |
218 | 218 | ||
219 | (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", | 219 | (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", |
220 | (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "", | 220 | (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", |
221 | (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", | 221 | |
222 | (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", | 222 | (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", |
223 | usbctl & ~USBCTL_WRITABLE_MASK | 223 | (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "", |
224 | ); | 224 | |
225 | usbctl & ~USBCTL_WRITABLE_MASK); | ||
225 | } | 226 | } |
226 | 227 | ||
227 | /*-------------------------------------------------------------------------*/ | 228 | /*-------------------------------------------------------------------------*/ |
@@ -250,28 +251,25 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) | |||
250 | { | 251 | { |
251 | if (!netif_msg_link(dev)) | 252 | if (!netif_msg_link(dev)) |
252 | return; | 253 | return; |
253 | devdbg(dev, "net1080 %s-%s status 0x%x:" | 254 | 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", |
254 | " this (%c) PKT=%d%s%s%s;" | 255 | dev->udev->bus->bus_name, dev->udev->devpath, |
255 | " other PKT=%d%s%s%s; unspec 0x%x", | 256 | status, |
256 | dev->udev->bus->bus_name, dev->udev->devpath, | 257 | |
257 | status, | 258 | // XXX the packet counts don't seem right |
258 | 259 | // (1 at reset, not 0); maybe UNSPEC too | |
259 | // XXX the packet counts don't seem right | 260 | |
260 | // (1 at reset, not 0); maybe UNSPEC too | 261 | (status & STATUS_PORT_A) ? 'A' : 'B', |
261 | 262 | STATUS_PACKETS_THIS(status), | |
262 | (status & STATUS_PORT_A) ? 'A' : 'B', | 263 | (status & STATUS_CONN_THIS) ? " CON" : "", |
263 | STATUS_PACKETS_THIS(status), | 264 | (status & STATUS_SUSPEND_THIS) ? " SUS" : "", |
264 | (status & STATUS_CONN_THIS) ? " CON" : "", | 265 | (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", |
265 | (status & STATUS_SUSPEND_THIS) ? " SUS" : "", | 266 | |
266 | (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", | 267 | STATUS_PACKETS_OTHER(status), |
267 | 268 | (status & STATUS_CONN_OTHER) ? " CON" : "", | |
268 | STATUS_PACKETS_OTHER(status), | 269 | (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", |
269 | (status & STATUS_CONN_OTHER) ? " CON" : "", | 270 | (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", |
270 | (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", | 271 | |
271 | (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", | 272 | status & STATUS_UNSPEC_MASK); |
272 | |||
273 | status & STATUS_UNSPEC_MASK | ||
274 | ); | ||
275 | } | 273 | } |
276 | 274 | ||
277 | /*-------------------------------------------------------------------------*/ | 275 | /*-------------------------------------------------------------------------*/ |
@@ -287,9 +285,9 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) | |||
287 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) | 285 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) |
288 | { | 286 | { |
289 | if (netif_msg_link(dev)) | 287 | if (netif_msg_link(dev)) |
290 | devdbg(dev, "net1080 %s-%s ttl 0x%x this = %d, other = %d", | 288 | netdev_dbg(dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n", |
291 | dev->udev->bus->bus_name, dev->udev->devpath, | 289 | dev->udev->bus->bus_name, dev->udev->devpath, |
292 | ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); | 290 | ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); |
293 | } | 291 | } |
294 | 292 | ||
295 | /*-------------------------------------------------------------------------*/ | 293 | /*-------------------------------------------------------------------------*/ |
@@ -335,10 +333,9 @@ static int net1080_reset(struct usbnet *dev) | |||
335 | dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); | 333 | dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); |
336 | 334 | ||
337 | if (netif_msg_link(dev)) | 335 | if (netif_msg_link(dev)) |
338 | devinfo(dev, "port %c, peer %sconnected", | 336 | netdev_info(dev->net, "port %c, peer %sconnected\n", |
339 | (status & STATUS_PORT_A) ? 'A' : 'B', | 337 | (status & STATUS_PORT_A) ? 'A' : 'B', |
340 | (status & STATUS_CONN_OTHER) ? "" : "dis" | 338 | (status & STATUS_CONN_OTHER) ? "" : "dis"); |
341 | ); | ||
342 | retval = 0; | 339 | retval = 0; |
343 | 340 | ||
344 | done: | 341 | done: |
@@ -416,7 +413,7 @@ static void nc_ensure_sync(struct usbnet *dev) | |||
416 | } | 413 | } |
417 | 414 | ||
418 | if (netif_msg_rx_err(dev)) | 415 | if (netif_msg_rx_err(dev)) |
419 | devdbg(dev, "flush net1080; too many framing errors"); | 416 | netdev_dbg(dev->net, "flush net1080; too many framing errors\n"); |
420 | dev->frame_errors = 0; | 417 | dev->frame_errors = 0; |
421 | } | 418 | } |
422 | } | 419 | } |
@@ -486,8 +483,8 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
486 | return 0; | 483 | return 0; |
487 | } | 484 | } |
488 | #if 0 | 485 | #if 0 |
489 | devdbg(dev, "frame <rx h %d p %d id %d", header->hdr_len, | 486 | netdev_dbg(dev->net, "frame <rx h %d p %d id %d\n", header->hdr_len, |
490 | header->packet_len, header->packet_id); | 487 | header->packet_len, header->packet_id); |
491 | #endif | 488 | #endif |
492 | dev->frame_errors = 0; | 489 | dev->frame_errors = 0; |
493 | return 1; | 490 | return 1; |
@@ -547,9 +544,9 @@ encapsulate: | |||
547 | trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); | 544 | trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); |
548 | put_unaligned(header->packet_id, &trailer->packet_id); | 545 | put_unaligned(header->packet_id, &trailer->packet_id); |
549 | #if 0 | 546 | #if 0 |
550 | devdbg(dev, "frame >tx h %d p %d id %d", | 547 | netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n", |
551 | header->hdr_len, header->packet_len, | 548 | header->hdr_len, header->packet_len, |
552 | header->packet_id); | 549 | header->packet_id); |
553 | #endif | 550 | #endif |
554 | return skb; | 551 | return skb; |
555 | } | 552 | } |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 490fa8f55424..f01f02401856 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -57,8 +57,8 @@ | |||
57 | */ | 57 | */ |
58 | void rndis_status(struct usbnet *dev, struct urb *urb) | 58 | void rndis_status(struct usbnet *dev, struct urb *urb) |
59 | { | 59 | { |
60 | devdbg(dev, "rndis status urb, len %d stat %d", | 60 | netdev_dbg(dev->net, "rndis status urb, len %d stat %d\n", |
61 | urb->actual_length, urb->status); | 61 | urb->actual_length, urb->status); |
62 | // FIXME for keepalives, respond immediately (asynchronously) | 62 | // FIXME for keepalives, respond immediately (asynchronously) |
63 | // if not an RNDIS status, do like cdc_status(dev,urb) does | 63 | // if not an RNDIS status, do like cdc_status(dev,urb) does |
64 | } | 64 | } |
@@ -497,9 +497,9 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
497 | skb->len < msg_len || | 497 | skb->len < msg_len || |
498 | (data_offset + data_len + 8) > msg_len)) { | 498 | (data_offset + data_len + 8) > msg_len)) { |
499 | dev->net->stats.rx_frame_errors++; | 499 | dev->net->stats.rx_frame_errors++; |
500 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", | 500 | netdev_dbg(dev->net, "bad rndis message %d/%d/%d/%d, len %d\n", |
501 | le32_to_cpu(hdr->msg_type), | 501 | le32_to_cpu(hdr->msg_type), |
502 | msg_len, data_offset, data_len, skb->len); | 502 | msg_len, data_offset, data_len, skb->len); |
503 | return 0; | 503 | return 0; |
504 | } | 504 | } |
505 | skb_pull(skb, 8 + data_offset); | 505 | skb_pull(skb, 8 + data_offset); |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 48555d0e374d..d4cbcefbff38 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -78,7 +78,7 @@ static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) | |||
78 | 00, index, buf, 4, USB_CTRL_GET_TIMEOUT); | 78 | 00, index, buf, 4, USB_CTRL_GET_TIMEOUT); |
79 | 79 | ||
80 | if (unlikely(ret < 0)) | 80 | if (unlikely(ret < 0)) |
81 | devwarn(dev, "Failed to read register index 0x%08x", index); | 81 | netdev_warn(dev->net, "Failed to read register index 0x%08x\n", index); |
82 | 82 | ||
83 | le32_to_cpus(buf); | 83 | le32_to_cpus(buf); |
84 | *data = *buf; | 84 | *data = *buf; |
@@ -106,7 +106,7 @@ static int smsc95xx_write_reg(struct usbnet *dev, u32 index, u32 data) | |||
106 | 00, index, buf, 4, USB_CTRL_SET_TIMEOUT); | 106 | 00, index, buf, 4, USB_CTRL_SET_TIMEOUT); |
107 | 107 | ||
108 | if (unlikely(ret < 0)) | 108 | if (unlikely(ret < 0)) |
109 | devwarn(dev, "Failed to write register index 0x%08x", index); | 109 | netdev_warn(dev->net, "Failed to write register index 0x%08x\n", index); |
110 | 110 | ||
111 | kfree(buf); | 111 | kfree(buf); |
112 | 112 | ||
@@ -138,7 +138,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) | |||
138 | 138 | ||
139 | /* confirm MII not busy */ | 139 | /* confirm MII not busy */ |
140 | if (smsc95xx_phy_wait_not_busy(dev)) { | 140 | if (smsc95xx_phy_wait_not_busy(dev)) { |
141 | devwarn(dev, "MII is busy in smsc95xx_mdio_read"); | 141 | netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_read\n"); |
142 | mutex_unlock(&dev->phy_mutex); | 142 | mutex_unlock(&dev->phy_mutex); |
143 | return -EIO; | 143 | return -EIO; |
144 | } | 144 | } |
@@ -150,7 +150,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) | |||
150 | smsc95xx_write_reg(dev, MII_ADDR, addr); | 150 | smsc95xx_write_reg(dev, MII_ADDR, addr); |
151 | 151 | ||
152 | if (smsc95xx_phy_wait_not_busy(dev)) { | 152 | if (smsc95xx_phy_wait_not_busy(dev)) { |
153 | devwarn(dev, "Timed out reading MII reg %02X", idx); | 153 | netdev_warn(dev->net, "Timed out reading MII reg %02X\n", idx); |
154 | mutex_unlock(&dev->phy_mutex); | 154 | mutex_unlock(&dev->phy_mutex); |
155 | return -EIO; | 155 | return -EIO; |
156 | } | 156 | } |
@@ -172,7 +172,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx, | |||
172 | 172 | ||
173 | /* confirm MII not busy */ | 173 | /* confirm MII not busy */ |
174 | if (smsc95xx_phy_wait_not_busy(dev)) { | 174 | if (smsc95xx_phy_wait_not_busy(dev)) { |
175 | devwarn(dev, "MII is busy in smsc95xx_mdio_write"); | 175 | netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_write\n"); |
176 | mutex_unlock(&dev->phy_mutex); | 176 | mutex_unlock(&dev->phy_mutex); |
177 | return; | 177 | return; |
178 | } | 178 | } |
@@ -187,7 +187,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx, | |||
187 | smsc95xx_write_reg(dev, MII_ADDR, addr); | 187 | smsc95xx_write_reg(dev, MII_ADDR, addr); |
188 | 188 | ||
189 | if (smsc95xx_phy_wait_not_busy(dev)) | 189 | if (smsc95xx_phy_wait_not_busy(dev)) |
190 | devwarn(dev, "Timed out writing MII reg %02X", idx); | 190 | netdev_warn(dev->net, "Timed out writing MII reg %02X\n", idx); |
191 | 191 | ||
192 | mutex_unlock(&dev->phy_mutex); | 192 | mutex_unlock(&dev->phy_mutex); |
193 | } | 193 | } |
@@ -205,7 +205,7 @@ static int smsc95xx_wait_eeprom(struct usbnet *dev) | |||
205 | } while (!time_after(jiffies, start_time + HZ)); | 205 | } while (!time_after(jiffies, start_time + HZ)); |
206 | 206 | ||
207 | if (val & (E2P_CMD_TIMEOUT_ | E2P_CMD_BUSY_)) { | 207 | if (val & (E2P_CMD_TIMEOUT_ | E2P_CMD_BUSY_)) { |
208 | devwarn(dev, "EEPROM read operation timeout"); | 208 | netdev_warn(dev->net, "EEPROM read operation timeout\n"); |
209 | return -EIO; | 209 | return -EIO; |
210 | } | 210 | } |
211 | 211 | ||
@@ -226,7 +226,7 @@ static int smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev) | |||
226 | udelay(40); | 226 | udelay(40); |
227 | } while (!time_after(jiffies, start_time + HZ)); | 227 | } while (!time_after(jiffies, start_time + HZ)); |
228 | 228 | ||
229 | devwarn(dev, "EEPROM is busy"); | 229 | netdev_warn(dev->net, "EEPROM is busy\n"); |
230 | return -EIO; | 230 | return -EIO; |
231 | } | 231 | } |
232 | 232 | ||
@@ -308,7 +308,7 @@ static void smsc95xx_async_cmd_callback(struct urb *urb) | |||
308 | int status = urb->status; | 308 | int status = urb->status; |
309 | 309 | ||
310 | if (status < 0) | 310 | if (status < 0) |
311 | devwarn(dev, "async callback failed with %d", status); | 311 | netdev_warn(dev->net, "async callback failed with %d\n", status); |
312 | 312 | ||
313 | kfree(usb_context); | 313 | kfree(usb_context); |
314 | usb_free_urb(urb); | 314 | usb_free_urb(urb); |
@@ -323,13 +323,13 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data) | |||
323 | 323 | ||
324 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 324 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
325 | if (!urb) { | 325 | if (!urb) { |
326 | devwarn(dev, "Error allocating URB"); | 326 | netdev_warn(dev->net, "Error allocating URB\n"); |
327 | return -ENOMEM; | 327 | return -ENOMEM; |
328 | } | 328 | } |
329 | 329 | ||
330 | usb_context = kmalloc(sizeof(struct usb_context), GFP_ATOMIC); | 330 | usb_context = kmalloc(sizeof(struct usb_context), GFP_ATOMIC); |
331 | if (usb_context == NULL) { | 331 | if (usb_context == NULL) { |
332 | devwarn(dev, "Error allocating control msg"); | 332 | netdev_warn(dev->net, "Error allocating control msg\n"); |
333 | usb_free_urb(urb); | 333 | usb_free_urb(urb); |
334 | return -ENOMEM; | 334 | return -ENOMEM; |
335 | } | 335 | } |
@@ -348,7 +348,8 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data) | |||
348 | 348 | ||
349 | status = usb_submit_urb(urb, GFP_ATOMIC); | 349 | status = usb_submit_urb(urb, GFP_ATOMIC); |
350 | if (status < 0) { | 350 | if (status < 0) { |
351 | devwarn(dev, "Error submitting control msg, sts=%d", status); | 351 | netdev_warn(dev->net, "Error submitting control msg, sts=%d\n", |
352 | status); | ||
352 | kfree(usb_context); | 353 | kfree(usb_context); |
353 | usb_free_urb(urb); | 354 | usb_free_urb(urb); |
354 | } | 355 | } |
@@ -376,12 +377,12 @@ static void smsc95xx_set_multicast(struct net_device *netdev) | |||
376 | 377 | ||
377 | if (dev->net->flags & IFF_PROMISC) { | 378 | if (dev->net->flags & IFF_PROMISC) { |
378 | if (netif_msg_drv(dev)) | 379 | if (netif_msg_drv(dev)) |
379 | devdbg(dev, "promiscuous mode enabled"); | 380 | netdev_dbg(dev->net, "promiscuous mode enabled\n"); |
380 | pdata->mac_cr |= MAC_CR_PRMS_; | 381 | pdata->mac_cr |= MAC_CR_PRMS_; |
381 | pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_); | 382 | pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_); |
382 | } else if (dev->net->flags & IFF_ALLMULTI) { | 383 | } else if (dev->net->flags & IFF_ALLMULTI) { |
383 | if (netif_msg_drv(dev)) | 384 | if (netif_msg_drv(dev)) |
384 | devdbg(dev, "receive all multicast enabled"); | 385 | netdev_dbg(dev->net, "receive all multicast enabled\n"); |
385 | pdata->mac_cr |= MAC_CR_MCPAS_; | 386 | pdata->mac_cr |= MAC_CR_MCPAS_; |
386 | pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); | 387 | pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); |
387 | } else if (!netdev_mc_empty(dev->net)) { | 388 | } else if (!netdev_mc_empty(dev->net)) { |
@@ -401,20 +402,20 @@ static void smsc95xx_set_multicast(struct net_device *netdev) | |||
401 | else | 402 | else |
402 | hash_lo |= mask; | 403 | hash_lo |= mask; |
403 | } else { | 404 | } else { |
404 | devwarn(dev, "dmi_addrlen != 6"); | 405 | netdev_warn(dev->net, "dmi_addrlen != 6\n"); |
405 | } | 406 | } |
406 | mc_list = mc_list->next; | 407 | mc_list = mc_list->next; |
407 | } | 408 | } |
408 | 409 | ||
409 | if (count != ((u32) netdev_mc_count(dev->net))) | 410 | if (count != ((u32) netdev_mc_count(dev->net))) |
410 | devwarn(dev, "mc_count != dev->mc_count"); | 411 | netdev_warn(dev->net, "mc_count != dev->mc_count\n"); |
411 | 412 | ||
412 | if (netif_msg_drv(dev)) | 413 | if (netif_msg_drv(dev)) |
413 | devdbg(dev, "HASHH=0x%08X, HASHL=0x%08X", hash_hi, | 414 | netdev_dbg(dev->net, "HASHH=0x%08X, HASHL=0x%08X\n", |
414 | hash_lo); | 415 | hash_hi, hash_lo); |
415 | } else { | 416 | } else { |
416 | if (netif_msg_drv(dev)) | 417 | if (netif_msg_drv(dev)) |
417 | devdbg(dev, "receive own packets only"); | 418 | netdev_dbg(dev->net, "receive own packets only\n"); |
418 | pdata->mac_cr &= | 419 | pdata->mac_cr &= |
419 | ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); | 420 | ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); |
420 | } | 421 | } |
@@ -434,7 +435,7 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, | |||
434 | 435 | ||
435 | int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); | 436 | int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); |
436 | if (ret < 0) { | 437 | if (ret < 0) { |
437 | devwarn(dev, "error reading AFC_CFG"); | 438 | netdev_warn(dev->net, "error reading AFC_CFG\n"); |
438 | return; | 439 | return; |
439 | } | 440 | } |
440 | 441 | ||
@@ -452,12 +453,12 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, | |||
452 | afc_cfg &= ~0xF; | 453 | afc_cfg &= ~0xF; |
453 | 454 | ||
454 | if (netif_msg_link(dev)) | 455 | if (netif_msg_link(dev)) |
455 | devdbg(dev, "rx pause %s, tx pause %s", | 456 | netdev_dbg(dev->net, "rx pause %s, tx pause %s\n", |
456 | (cap & FLOW_CTRL_RX ? "enabled" : "disabled"), | 457 | cap & FLOW_CTRL_RX ? "enabled" : "disabled", |
457 | (cap & FLOW_CTRL_TX ? "enabled" : "disabled")); | 458 | cap & FLOW_CTRL_TX ? "enabled" : "disabled"); |
458 | } else { | 459 | } else { |
459 | if (netif_msg_link(dev)) | 460 | if (netif_msg_link(dev)) |
460 | devdbg(dev, "half duplex"); | 461 | netdev_dbg(dev->net, "half duplex\n"); |
461 | flow = 0; | 462 | flow = 0; |
462 | afc_cfg |= 0xF; | 463 | afc_cfg |= 0xF; |
463 | } | 464 | } |
@@ -486,8 +487,8 @@ static int smsc95xx_link_reset(struct usbnet *dev) | |||
486 | rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA); | 487 | rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA); |
487 | 488 | ||
488 | if (netif_msg_link(dev)) | 489 | if (netif_msg_link(dev)) |
489 | devdbg(dev, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x", | 490 | netdev_dbg(dev->net, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x\n", |
490 | ecmd.speed, ecmd.duplex, lcladv, rmtadv); | 491 | ecmd.speed, ecmd.duplex, lcladv, rmtadv); |
491 | 492 | ||
492 | spin_lock_irqsave(&pdata->mac_cr_lock, flags); | 493 | spin_lock_irqsave(&pdata->mac_cr_lock, flags); |
493 | if (ecmd.duplex != DUPLEX_FULL) { | 494 | if (ecmd.duplex != DUPLEX_FULL) { |
@@ -511,7 +512,8 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) | |||
511 | u32 intdata; | 512 | u32 intdata; |
512 | 513 | ||
513 | if (urb->actual_length != 4) { | 514 | if (urb->actual_length != 4) { |
514 | devwarn(dev, "unexpected urb length %d", urb->actual_length); | 515 | netdev_warn(dev->net, "unexpected urb length %d\n", |
516 | urb->actual_length); | ||
515 | return; | 517 | return; |
516 | } | 518 | } |
517 | 519 | ||
@@ -519,12 +521,13 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) | |||
519 | le32_to_cpus(&intdata); | 521 | le32_to_cpus(&intdata); |
520 | 522 | ||
521 | if (netif_msg_link(dev)) | 523 | if (netif_msg_link(dev)) |
522 | devdbg(dev, "intdata: 0x%08X", intdata); | 524 | netdev_dbg(dev->net, "intdata: 0x%08X\n", intdata); |
523 | 525 | ||
524 | if (intdata & INT_ENP_PHY_INT_) | 526 | if (intdata & INT_ENP_PHY_INT_) |
525 | usbnet_defer_kevent(dev, EVENT_LINK_RESET); | 527 | usbnet_defer_kevent(dev, EVENT_LINK_RESET); |
526 | else | 528 | else |
527 | devwarn(dev, "unexpected interrupt, intdata=0x%08X", intdata); | 529 | netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n", |
530 | intdata); | ||
528 | } | 531 | } |
529 | 532 | ||
530 | /* Enable or disable Tx & Rx checksum offload engines */ | 533 | /* Enable or disable Tx & Rx checksum offload engines */ |
@@ -534,7 +537,7 @@ static int smsc95xx_set_csums(struct usbnet *dev) | |||
534 | u32 read_buf; | 537 | u32 read_buf; |
535 | int ret = smsc95xx_read_reg(dev, COE_CR, &read_buf); | 538 | int ret = smsc95xx_read_reg(dev, COE_CR, &read_buf); |
536 | if (ret < 0) { | 539 | if (ret < 0) { |
537 | devwarn(dev, "Failed to read COE_CR: %d", ret); | 540 | netdev_warn(dev->net, "Failed to read COE_CR: %d\n", ret); |
538 | return ret; | 541 | return ret; |
539 | } | 542 | } |
540 | 543 | ||
@@ -550,12 +553,12 @@ static int smsc95xx_set_csums(struct usbnet *dev) | |||
550 | 553 | ||
551 | ret = smsc95xx_write_reg(dev, COE_CR, read_buf); | 554 | ret = smsc95xx_write_reg(dev, COE_CR, read_buf); |
552 | if (ret < 0) { | 555 | if (ret < 0) { |
553 | devwarn(dev, "Failed to write COE_CR: %d", ret); | 556 | netdev_warn(dev->net, "Failed to write COE_CR: %d\n", ret); |
554 | return ret; | 557 | return ret; |
555 | } | 558 | } |
556 | 559 | ||
557 | if (netif_msg_hw(dev)) | 560 | if (netif_msg_hw(dev)) |
558 | devdbg(dev, "COE_CR = 0x%08x", read_buf); | 561 | netdev_dbg(dev->net, "COE_CR = 0x%08x\n", read_buf); |
559 | return 0; | 562 | return 0; |
560 | } | 563 | } |
561 | 564 | ||
@@ -580,8 +583,8 @@ static int smsc95xx_ethtool_set_eeprom(struct net_device *netdev, | |||
580 | struct usbnet *dev = netdev_priv(netdev); | 583 | struct usbnet *dev = netdev_priv(netdev); |
581 | 584 | ||
582 | if (ee->magic != LAN95XX_EEPROM_MAGIC) { | 585 | if (ee->magic != LAN95XX_EEPROM_MAGIC) { |
583 | devwarn(dev, "EEPROM: magic value mismatch, magic = 0x%x", | 586 | netdev_warn(dev->net, "EEPROM: magic value mismatch, magic = 0x%x\n", |
584 | ee->magic); | 587 | ee->magic); |
585 | return -EINVAL; | 588 | return -EINVAL; |
586 | } | 589 | } |
587 | 590 | ||
@@ -660,7 +663,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) | |||
660 | if (is_valid_ether_addr(dev->net->dev_addr)) { | 663 | if (is_valid_ether_addr(dev->net->dev_addr)) { |
661 | /* eeprom values are valid so use them */ | 664 | /* eeprom values are valid so use them */ |
662 | if (netif_msg_ifup(dev)) | 665 | if (netif_msg_ifup(dev)) |
663 | devdbg(dev, "MAC address read from EEPROM"); | 666 | netdev_dbg(dev->net, "MAC address read from EEPROM\n"); |
664 | return; | 667 | return; |
665 | } | 668 | } |
666 | } | 669 | } |
@@ -668,7 +671,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) | |||
668 | /* no eeprom, or eeprom values are invalid. generate random MAC */ | 671 | /* no eeprom, or eeprom values are invalid. generate random MAC */ |
669 | random_ether_addr(dev->net->dev_addr); | 672 | random_ether_addr(dev->net->dev_addr); |
670 | if (netif_msg_ifup(dev)) | 673 | if (netif_msg_ifup(dev)) |
671 | devdbg(dev, "MAC address set to random_ether_addr"); | 674 | netdev_dbg(dev->net, "MAC address set to random_ether_addr\n"); |
672 | } | 675 | } |
673 | 676 | ||
674 | static int smsc95xx_set_mac_address(struct usbnet *dev) | 677 | static int smsc95xx_set_mac_address(struct usbnet *dev) |
@@ -680,13 +683,13 @@ static int smsc95xx_set_mac_address(struct usbnet *dev) | |||
680 | 683 | ||
681 | ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); | 684 | ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); |
682 | if (ret < 0) { | 685 | if (ret < 0) { |
683 | devwarn(dev, "Failed to write ADDRL: %d", ret); | 686 | netdev_warn(dev->net, "Failed to write ADDRL: %d\n", ret); |
684 | return ret; | 687 | return ret; |
685 | } | 688 | } |
686 | 689 | ||
687 | ret = smsc95xx_write_reg(dev, ADDRH, addr_hi); | 690 | ret = smsc95xx_write_reg(dev, ADDRH, addr_hi); |
688 | if (ret < 0) { | 691 | if (ret < 0) { |
689 | devwarn(dev, "Failed to write ADDRH: %d", ret); | 692 | netdev_warn(dev->net, "Failed to write ADDRH: %d\n", ret); |
690 | return ret; | 693 | return ret; |
691 | } | 694 | } |
692 | 695 | ||
@@ -748,7 +751,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) | |||
748 | mii_nway_restart(&dev->mii); | 751 | mii_nway_restart(&dev->mii); |
749 | 752 | ||
750 | if (netif_msg_ifup(dev)) | 753 | if (netif_msg_ifup(dev)) |
751 | devdbg(dev, "phy initialised successfully"); | 754 | netdev_dbg(dev->net, "phy initialised successfully\n"); |
752 | return 0; | 755 | return 0; |
753 | } | 756 | } |
754 | 757 | ||
@@ -760,13 +763,13 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
760 | int ret = 0, timeout; | 763 | int ret = 0, timeout; |
761 | 764 | ||
762 | if (netif_msg_ifup(dev)) | 765 | if (netif_msg_ifup(dev)) |
763 | devdbg(dev, "entering smsc95xx_reset"); | 766 | netdev_dbg(dev->net, "entering smsc95xx_reset\n"); |
764 | 767 | ||
765 | write_buf = HW_CFG_LRST_; | 768 | write_buf = HW_CFG_LRST_; |
766 | ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); | 769 | ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); |
767 | if (ret < 0) { | 770 | if (ret < 0) { |
768 | devwarn(dev, "Failed to write HW_CFG_LRST_ bit in HW_CFG " | 771 | netdev_warn(dev->net, "Failed to write HW_CFG_LRST_ bit in HW_CFG register, ret = %d\n", |
769 | "register, ret = %d", ret); | 772 | ret); |
770 | return ret; | 773 | return ret; |
771 | } | 774 | } |
772 | 775 | ||
@@ -774,7 +777,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
774 | do { | 777 | do { |
775 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 778 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
776 | if (ret < 0) { | 779 | if (ret < 0) { |
777 | devwarn(dev, "Failed to read HW_CFG: %d", ret); | 780 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
778 | return ret; | 781 | return ret; |
779 | } | 782 | } |
780 | msleep(10); | 783 | msleep(10); |
@@ -782,14 +785,14 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
782 | } while ((read_buf & HW_CFG_LRST_) && (timeout < 100)); | 785 | } while ((read_buf & HW_CFG_LRST_) && (timeout < 100)); |
783 | 786 | ||
784 | if (timeout >= 100) { | 787 | if (timeout >= 100) { |
785 | devwarn(dev, "timeout waiting for completion of Lite Reset"); | 788 | netdev_warn(dev->net, "timeout waiting for completion of Lite Reset\n"); |
786 | return ret; | 789 | return ret; |
787 | } | 790 | } |
788 | 791 | ||
789 | write_buf = PM_CTL_PHY_RST_; | 792 | write_buf = PM_CTL_PHY_RST_; |
790 | ret = smsc95xx_write_reg(dev, PM_CTRL, write_buf); | 793 | ret = smsc95xx_write_reg(dev, PM_CTRL, write_buf); |
791 | if (ret < 0) { | 794 | if (ret < 0) { |
792 | devwarn(dev, "Failed to write PM_CTRL: %d", ret); | 795 | netdev_warn(dev->net, "Failed to write PM_CTRL: %d\n", ret); |
793 | return ret; | 796 | return ret; |
794 | } | 797 | } |
795 | 798 | ||
@@ -797,7 +800,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
797 | do { | 800 | do { |
798 | ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf); | 801 | ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf); |
799 | if (ret < 0) { | 802 | if (ret < 0) { |
800 | devwarn(dev, "Failed to read PM_CTRL: %d", ret); | 803 | netdev_warn(dev->net, "Failed to read PM_CTRL: %d\n", ret); |
801 | return ret; | 804 | return ret; |
802 | } | 805 | } |
803 | msleep(10); | 806 | msleep(10); |
@@ -805,7 +808,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
805 | } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100)); | 808 | } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100)); |
806 | 809 | ||
807 | if (timeout >= 100) { | 810 | if (timeout >= 100) { |
808 | devwarn(dev, "timeout waiting for PHY Reset"); | 811 | netdev_warn(dev->net, "timeout waiting for PHY Reset\n"); |
809 | return ret; | 812 | return ret; |
810 | } | 813 | } |
811 | 814 | ||
@@ -816,34 +819,34 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
816 | return ret; | 819 | return ret; |
817 | 820 | ||
818 | if (netif_msg_ifup(dev)) | 821 | if (netif_msg_ifup(dev)) |
819 | devdbg(dev, "MAC Address: %pM", dev->net->dev_addr); | 822 | netdev_dbg(dev->net, "MAC Address: %pM\n", dev->net->dev_addr); |
820 | 823 | ||
821 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 824 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
822 | if (ret < 0) { | 825 | if (ret < 0) { |
823 | devwarn(dev, "Failed to read HW_CFG: %d", ret); | 826 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
824 | return ret; | 827 | return ret; |
825 | } | 828 | } |
826 | 829 | ||
827 | if (netif_msg_ifup(dev)) | 830 | if (netif_msg_ifup(dev)) |
828 | devdbg(dev, "Read Value from HW_CFG : 0x%08x", read_buf); | 831 | netdev_dbg(dev->net, "Read Value from HW_CFG : 0x%08x\n", read_buf); |
829 | 832 | ||
830 | read_buf |= HW_CFG_BIR_; | 833 | read_buf |= HW_CFG_BIR_; |
831 | 834 | ||
832 | ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); | 835 | ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); |
833 | if (ret < 0) { | 836 | if (ret < 0) { |
834 | devwarn(dev, "Failed to write HW_CFG_BIR_ bit in HW_CFG " | 837 | netdev_warn(dev->net, "Failed to write HW_CFG_BIR_ bit in HW_CFG register, ret = %d\n", |
835 | "register, ret = %d", ret); | 838 | ret); |
836 | return ret; | 839 | return ret; |
837 | } | 840 | } |
838 | 841 | ||
839 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 842 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
840 | if (ret < 0) { | 843 | if (ret < 0) { |
841 | devwarn(dev, "Failed to read HW_CFG: %d", ret); | 844 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
842 | return ret; | 845 | return ret; |
843 | } | 846 | } |
844 | if (netif_msg_ifup(dev)) | 847 | if (netif_msg_ifup(dev)) |
845 | devdbg(dev, "Read Value from HW_CFG after writing " | 848 | netdev_dbg(dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n", |
846 | "HW_CFG_BIR_: 0x%08x", read_buf); | 849 | read_buf); |
847 | 850 | ||
848 | if (!turbo_mode) { | 851 | if (!turbo_mode) { |
849 | burst_cap = 0; | 852 | burst_cap = 0; |
@@ -857,46 +860,46 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
857 | } | 860 | } |
858 | 861 | ||
859 | if (netif_msg_ifup(dev)) | 862 | if (netif_msg_ifup(dev)) |
860 | devdbg(dev, "rx_urb_size=%ld", (ulong)dev->rx_urb_size); | 863 | netdev_dbg(dev->net, "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); |
861 | 864 | ||
862 | ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); | 865 | ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); |
863 | if (ret < 0) { | 866 | if (ret < 0) { |
864 | devwarn(dev, "Failed to write BURST_CAP: %d", ret); | 867 | netdev_warn(dev->net, "Failed to write BURST_CAP: %d\n", ret); |
865 | return ret; | 868 | return ret; |
866 | } | 869 | } |
867 | 870 | ||
868 | ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf); | 871 | ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf); |
869 | if (ret < 0) { | 872 | if (ret < 0) { |
870 | devwarn(dev, "Failed to read BURST_CAP: %d", ret); | 873 | netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret); |
871 | return ret; | 874 | return ret; |
872 | } | 875 | } |
873 | if (netif_msg_ifup(dev)) | 876 | if (netif_msg_ifup(dev)) |
874 | devdbg(dev, "Read Value from BURST_CAP after writing: 0x%08x", | 877 | netdev_dbg(dev->net, "Read Value from BURST_CAP after writing: 0x%08x\n", |
875 | read_buf); | 878 | read_buf); |
876 | 879 | ||
877 | read_buf = DEFAULT_BULK_IN_DELAY; | 880 | read_buf = DEFAULT_BULK_IN_DELAY; |
878 | ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); | 881 | ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); |
879 | if (ret < 0) { | 882 | if (ret < 0) { |
880 | devwarn(dev, "ret = %d", ret); | 883 | netdev_warn(dev->net, "ret = %d\n", ret); |
881 | return ret; | 884 | return ret; |
882 | } | 885 | } |
883 | 886 | ||
884 | ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf); | 887 | ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf); |
885 | if (ret < 0) { | 888 | if (ret < 0) { |
886 | devwarn(dev, "Failed to read BULK_IN_DLY: %d", ret); | 889 | netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret); |
887 | return ret; | 890 | return ret; |
888 | } | 891 | } |
889 | if (netif_msg_ifup(dev)) | 892 | if (netif_msg_ifup(dev)) |
890 | devdbg(dev, "Read Value from BULK_IN_DLY after writing: " | 893 | netdev_dbg(dev->net, "Read Value from BULK_IN_DLY after writing: 0x%08x\n", |
891 | "0x%08x", read_buf); | 894 | read_buf); |
892 | 895 | ||
893 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 896 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
894 | if (ret < 0) { | 897 | if (ret < 0) { |
895 | devwarn(dev, "Failed to read HW_CFG: %d", ret); | 898 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
896 | return ret; | 899 | return ret; |
897 | } | 900 | } |
898 | if (netif_msg_ifup(dev)) | 901 | if (netif_msg_ifup(dev)) |
899 | devdbg(dev, "Read Value from HW_CFG: 0x%08x", read_buf); | 902 | netdev_dbg(dev->net, "Read Value from HW_CFG: 0x%08x\n", read_buf); |
900 | 903 | ||
901 | if (turbo_mode) | 904 | if (turbo_mode) |
902 | read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); | 905 | read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); |
@@ -908,41 +911,43 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
908 | 911 | ||
909 | ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); | 912 | ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); |
910 | if (ret < 0) { | 913 | if (ret < 0) { |
911 | devwarn(dev, "Failed to write HW_CFG register, ret=%d", ret); | 914 | netdev_warn(dev->net, "Failed to write HW_CFG register, ret=%d\n", |
915 | ret); | ||
912 | return ret; | 916 | return ret; |
913 | } | 917 | } |
914 | 918 | ||
915 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 919 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
916 | if (ret < 0) { | 920 | if (ret < 0) { |
917 | devwarn(dev, "Failed to read HW_CFG: %d", ret); | 921 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
918 | return ret; | 922 | return ret; |
919 | } | 923 | } |
920 | if (netif_msg_ifup(dev)) | 924 | if (netif_msg_ifup(dev)) |
921 | devdbg(dev, "Read Value from HW_CFG after writing: 0x%08x", | 925 | netdev_dbg(dev->net, "Read Value from HW_CFG after writing: 0x%08x\n", |
922 | read_buf); | 926 | read_buf); |
923 | 927 | ||
924 | write_buf = 0xFFFFFFFF; | 928 | write_buf = 0xFFFFFFFF; |
925 | ret = smsc95xx_write_reg(dev, INT_STS, write_buf); | 929 | ret = smsc95xx_write_reg(dev, INT_STS, write_buf); |
926 | if (ret < 0) { | 930 | if (ret < 0) { |
927 | devwarn(dev, "Failed to write INT_STS register, ret=%d", ret); | 931 | netdev_warn(dev->net, "Failed to write INT_STS register, ret=%d\n", |
932 | ret); | ||
928 | return ret; | 933 | return ret; |
929 | } | 934 | } |
930 | 935 | ||
931 | ret = smsc95xx_read_reg(dev, ID_REV, &read_buf); | 936 | ret = smsc95xx_read_reg(dev, ID_REV, &read_buf); |
932 | if (ret < 0) { | 937 | if (ret < 0) { |
933 | devwarn(dev, "Failed to read ID_REV: %d", ret); | 938 | netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret); |
934 | return ret; | 939 | return ret; |
935 | } | 940 | } |
936 | if (netif_msg_ifup(dev)) | 941 | if (netif_msg_ifup(dev)) |
937 | devdbg(dev, "ID_REV = 0x%08x", read_buf); | 942 | netdev_dbg(dev->net, "ID_REV = 0x%08x\n", read_buf); |
938 | 943 | ||
939 | /* Configure GPIO pins as LED outputs */ | 944 | /* Configure GPIO pins as LED outputs */ |
940 | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | | 945 | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | |
941 | LED_GPIO_CFG_FDX_LED; | 946 | LED_GPIO_CFG_FDX_LED; |
942 | ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); | 947 | ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); |
943 | if (ret < 0) { | 948 | if (ret < 0) { |
944 | devwarn(dev, "Failed to write LED_GPIO_CFG register, ret=%d", | 949 | netdev_warn(dev->net, "Failed to write LED_GPIO_CFG register, ret=%d\n", |
945 | ret); | 950 | ret); |
946 | return ret; | 951 | return ret; |
947 | } | 952 | } |
948 | 953 | ||
@@ -950,21 +955,21 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
950 | write_buf = 0; | 955 | write_buf = 0; |
951 | ret = smsc95xx_write_reg(dev, FLOW, write_buf); | 956 | ret = smsc95xx_write_reg(dev, FLOW, write_buf); |
952 | if (ret < 0) { | 957 | if (ret < 0) { |
953 | devwarn(dev, "Failed to write FLOW: %d", ret); | 958 | netdev_warn(dev->net, "Failed to write FLOW: %d\n", ret); |
954 | return ret; | 959 | return ret; |
955 | } | 960 | } |
956 | 961 | ||
957 | read_buf = AFC_CFG_DEFAULT; | 962 | read_buf = AFC_CFG_DEFAULT; |
958 | ret = smsc95xx_write_reg(dev, AFC_CFG, read_buf); | 963 | ret = smsc95xx_write_reg(dev, AFC_CFG, read_buf); |
959 | if (ret < 0) { | 964 | if (ret < 0) { |
960 | devwarn(dev, "Failed to write AFC_CFG: %d", ret); | 965 | netdev_warn(dev->net, "Failed to write AFC_CFG: %d\n", ret); |
961 | return ret; | 966 | return ret; |
962 | } | 967 | } |
963 | 968 | ||
964 | /* Don't need mac_cr_lock during initialisation */ | 969 | /* Don't need mac_cr_lock during initialisation */ |
965 | ret = smsc95xx_read_reg(dev, MAC_CR, &pdata->mac_cr); | 970 | ret = smsc95xx_read_reg(dev, MAC_CR, &pdata->mac_cr); |
966 | if (ret < 0) { | 971 | if (ret < 0) { |
967 | devwarn(dev, "Failed to read MAC_CR: %d", ret); | 972 | netdev_warn(dev->net, "Failed to read MAC_CR: %d\n", ret); |
968 | return ret; | 973 | return ret; |
969 | } | 974 | } |
970 | 975 | ||
@@ -973,7 +978,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
973 | write_buf = (u32)ETH_P_8021Q; | 978 | write_buf = (u32)ETH_P_8021Q; |
974 | ret = smsc95xx_write_reg(dev, VLAN1, write_buf); | 979 | ret = smsc95xx_write_reg(dev, VLAN1, write_buf); |
975 | if (ret < 0) { | 980 | if (ret < 0) { |
976 | devwarn(dev, "Failed to write VAN1: %d", ret); | 981 | netdev_warn(dev->net, "Failed to write VAN1: %d\n", ret); |
977 | return ret; | 982 | return ret; |
978 | } | 983 | } |
979 | 984 | ||
@@ -981,7 +986,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
981 | ethtool_op_set_tx_hw_csum(netdev, pdata->use_tx_csum); | 986 | ethtool_op_set_tx_hw_csum(netdev, pdata->use_tx_csum); |
982 | ret = smsc95xx_set_csums(dev); | 987 | ret = smsc95xx_set_csums(dev); |
983 | if (ret < 0) { | 988 | if (ret < 0) { |
984 | devwarn(dev, "Failed to set csum offload: %d", ret); | 989 | netdev_warn(dev->net, "Failed to set csum offload: %d\n", ret); |
985 | return ret; | 990 | return ret; |
986 | } | 991 | } |
987 | 992 | ||
@@ -992,7 +997,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
992 | 997 | ||
993 | ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); | 998 | ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); |
994 | if (ret < 0) { | 999 | if (ret < 0) { |
995 | devwarn(dev, "Failed to read INT_EP_CTL: %d", ret); | 1000 | netdev_warn(dev->net, "Failed to read INT_EP_CTL: %d\n", ret); |
996 | return ret; | 1001 | return ret; |
997 | } | 1002 | } |
998 | 1003 | ||
@@ -1001,7 +1006,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
1001 | 1006 | ||
1002 | ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf); | 1007 | ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf); |
1003 | if (ret < 0) { | 1008 | if (ret < 0) { |
1004 | devwarn(dev, "Failed to write INT_EP_CTL: %d", ret); | 1009 | netdev_warn(dev->net, "Failed to write INT_EP_CTL: %d\n", ret); |
1005 | return ret; | 1010 | return ret; |
1006 | } | 1011 | } |
1007 | 1012 | ||
@@ -1009,7 +1014,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
1009 | smsc95xx_start_rx_path(dev); | 1014 | smsc95xx_start_rx_path(dev); |
1010 | 1015 | ||
1011 | if (netif_msg_ifup(dev)) | 1016 | if (netif_msg_ifup(dev)) |
1012 | devdbg(dev, "smsc95xx_reset, return 0"); | 1017 | netdev_dbg(dev->net, "smsc95xx_reset, return 0\n"); |
1013 | return 0; | 1018 | return 0; |
1014 | } | 1019 | } |
1015 | 1020 | ||
@@ -1034,7 +1039,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1034 | 1039 | ||
1035 | ret = usbnet_get_endpoints(dev, intf); | 1040 | ret = usbnet_get_endpoints(dev, intf); |
1036 | if (ret < 0) { | 1041 | if (ret < 0) { |
1037 | devwarn(dev, "usbnet_get_endpoints failed: %d", ret); | 1042 | netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret); |
1038 | return ret; | 1043 | return ret; |
1039 | } | 1044 | } |
1040 | 1045 | ||
@@ -1043,7 +1048,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1043 | 1048 | ||
1044 | pdata = (struct smsc95xx_priv *)(dev->data[0]); | 1049 | pdata = (struct smsc95xx_priv *)(dev->data[0]); |
1045 | if (!pdata) { | 1050 | if (!pdata) { |
1046 | devwarn(dev, "Unable to allocate struct smsc95xx_priv"); | 1051 | netdev_warn(dev->net, "Unable to allocate struct smsc95xx_priv\n"); |
1047 | return -ENOMEM; | 1052 | return -ENOMEM; |
1048 | } | 1053 | } |
1049 | 1054 | ||
@@ -1067,7 +1072,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
1067 | struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); | 1072 | struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); |
1068 | if (pdata) { | 1073 | if (pdata) { |
1069 | if (netif_msg_ifdown(dev)) | 1074 | if (netif_msg_ifdown(dev)) |
1070 | devdbg(dev, "free pdata"); | 1075 | netdev_dbg(dev->net, "free pdata\n"); |
1071 | kfree(pdata); | 1076 | kfree(pdata); |
1072 | pdata = NULL; | 1077 | pdata = NULL; |
1073 | dev->data[0] = 0; | 1078 | dev->data[0] = 0; |
@@ -1102,7 +1107,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1102 | 1107 | ||
1103 | if (unlikely(header & RX_STS_ES_)) { | 1108 | if (unlikely(header & RX_STS_ES_)) { |
1104 | if (netif_msg_rx_err(dev)) | 1109 | if (netif_msg_rx_err(dev)) |
1105 | devdbg(dev, "Error header=0x%08x", header); | 1110 | netdev_dbg(dev->net, "Error header=0x%08x\n", |
1111 | header); | ||
1106 | dev->net->stats.rx_errors++; | 1112 | dev->net->stats.rx_errors++; |
1107 | dev->net->stats.rx_dropped++; | 1113 | dev->net->stats.rx_dropped++; |
1108 | 1114 | ||
@@ -1120,8 +1126,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1120 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ | 1126 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ |
1121 | if (unlikely(size > (ETH_FRAME_LEN + 12))) { | 1127 | if (unlikely(size > (ETH_FRAME_LEN + 12))) { |
1122 | if (netif_msg_rx_err(dev)) | 1128 | if (netif_msg_rx_err(dev)) |
1123 | devdbg(dev, "size err header=0x%08x", | 1129 | netdev_dbg(dev->net, "size err header=0x%08x\n", |
1124 | header); | 1130 | header); |
1125 | return 0; | 1131 | return 0; |
1126 | } | 1132 | } |
1127 | 1133 | ||
@@ -1137,7 +1143,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1137 | 1143 | ||
1138 | ax_skb = skb_clone(skb, GFP_ATOMIC); | 1144 | ax_skb = skb_clone(skb, GFP_ATOMIC); |
1139 | if (unlikely(!ax_skb)) { | 1145 | if (unlikely(!ax_skb)) { |
1140 | devwarn(dev, "Error allocating skb"); | 1146 | netdev_warn(dev->net, "Error allocating skb\n"); |
1141 | return 0; | 1147 | return 0; |
1142 | } | 1148 | } |
1143 | 1149 | ||
@@ -1161,7 +1167,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1161 | } | 1167 | } |
1162 | 1168 | ||
1163 | if (unlikely(skb->len < 0)) { | 1169 | if (unlikely(skb->len < 0)) { |
1164 | devwarn(dev, "invalid rx length<0 %d", skb->len); | 1170 | netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len); |
1165 | return 0; | 1171 | return 0; |
1166 | } | 1172 | } |
1167 | 1173 | ||
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 035fab04c0a0..8e732930d249 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -243,12 +243,12 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb) | |||
243 | dev->net->stats.rx_bytes += skb->len; | 243 | dev->net->stats.rx_bytes += skb->len; |
244 | 244 | ||
245 | if (netif_msg_rx_status (dev)) | 245 | if (netif_msg_rx_status (dev)) |
246 | devdbg (dev, "< rx, len %zu, type 0x%x", | 246 | netdev_dbg(dev->net, "< rx, len %zu, type 0x%x\n", |
247 | skb->len + sizeof (struct ethhdr), skb->protocol); | 247 | skb->len + sizeof (struct ethhdr), skb->protocol); |
248 | memset (skb->cb, 0, sizeof (struct skb_data)); | 248 | memset (skb->cb, 0, sizeof (struct skb_data)); |
249 | status = netif_rx (skb); | 249 | status = netif_rx (skb); |
250 | if (status != NET_RX_SUCCESS && netif_msg_rx_err (dev)) | 250 | if (status != NET_RX_SUCCESS && netif_msg_rx_err (dev)) |
251 | devdbg (dev, "netif_rx status %d", status); | 251 | netdev_dbg(dev->net, "netif_rx status %d\n", status); |
252 | } | 252 | } |
253 | EXPORT_SYMBOL_GPL(usbnet_skb_return); | 253 | EXPORT_SYMBOL_GPL(usbnet_skb_return); |
254 | 254 | ||
@@ -313,9 +313,9 @@ void usbnet_defer_kevent (struct usbnet *dev, int work) | |||
313 | { | 313 | { |
314 | set_bit (work, &dev->flags); | 314 | set_bit (work, &dev->flags); |
315 | if (!schedule_work (&dev->kevent)) | 315 | if (!schedule_work (&dev->kevent)) |
316 | deverr (dev, "kevent %d may have been dropped", work); | 316 | netdev_err(dev->net, "kevent %d may have been dropped\n", work); |
317 | else | 317 | else |
318 | devdbg (dev, "kevent %d scheduled", work); | 318 | netdev_dbg(dev->net, "kevent %d scheduled\n", work); |
319 | } | 319 | } |
320 | EXPORT_SYMBOL_GPL(usbnet_defer_kevent); | 320 | EXPORT_SYMBOL_GPL(usbnet_defer_kevent); |
321 | 321 | ||
@@ -333,7 +333,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
333 | 333 | ||
334 | if ((skb = alloc_skb (size + NET_IP_ALIGN, flags)) == NULL) { | 334 | if ((skb = alloc_skb (size + NET_IP_ALIGN, flags)) == NULL) { |
335 | if (netif_msg_rx_err (dev)) | 335 | if (netif_msg_rx_err (dev)) |
336 | devdbg (dev, "no rx skb"); | 336 | netdev_dbg(dev->net, "no rx skb\n"); |
337 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); | 337 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); |
338 | usb_free_urb (urb); | 338 | usb_free_urb (urb); |
339 | return; | 339 | return; |
@@ -364,12 +364,12 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
364 | break; | 364 | break; |
365 | case -ENODEV: | 365 | case -ENODEV: |
366 | if (netif_msg_ifdown (dev)) | 366 | if (netif_msg_ifdown (dev)) |
367 | devdbg (dev, "device gone"); | 367 | netdev_dbg(dev->net, "device gone\n"); |
368 | netif_device_detach (dev->net); | 368 | netif_device_detach (dev->net); |
369 | break; | 369 | break; |
370 | default: | 370 | default: |
371 | if (netif_msg_rx_err (dev)) | 371 | if (netif_msg_rx_err (dev)) |
372 | devdbg (dev, "rx submit, %d", retval); | 372 | netdev_dbg(dev->net, "rx submit, %d\n", retval); |
373 | tasklet_schedule (&dev->bh); | 373 | tasklet_schedule (&dev->bh); |
374 | break; | 374 | break; |
375 | case 0: | 375 | case 0: |
@@ -377,7 +377,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
377 | } | 377 | } |
378 | } else { | 378 | } else { |
379 | if (netif_msg_ifdown (dev)) | 379 | if (netif_msg_ifdown (dev)) |
380 | devdbg (dev, "rx: stopped"); | 380 | netdev_dbg(dev->net, "rx: stopped\n"); |
381 | retval = -ENOLINK; | 381 | retval = -ENOLINK; |
382 | } | 382 | } |
383 | spin_unlock_irqrestore (&dev->rxq.lock, lockflags); | 383 | spin_unlock_irqrestore (&dev->rxq.lock, lockflags); |
@@ -401,7 +401,7 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | |||
401 | usbnet_skb_return (dev, skb); | 401 | usbnet_skb_return (dev, skb); |
402 | else { | 402 | else { |
403 | if (netif_msg_rx_err (dev)) | 403 | if (netif_msg_rx_err (dev)) |
404 | devdbg (dev, "drop"); | 404 | netdev_dbg(dev->net, "drop\n"); |
405 | error: | 405 | error: |
406 | dev->net->stats.rx_errors++; | 406 | dev->net->stats.rx_errors++; |
407 | skb_queue_tail (&dev->done, skb); | 407 | skb_queue_tail (&dev->done, skb); |
@@ -429,7 +429,7 @@ static void rx_complete (struct urb *urb) | |||
429 | dev->net->stats.rx_errors++; | 429 | dev->net->stats.rx_errors++; |
430 | dev->net->stats.rx_length_errors++; | 430 | dev->net->stats.rx_length_errors++; |
431 | if (netif_msg_rx_err (dev)) | 431 | if (netif_msg_rx_err (dev)) |
432 | devdbg (dev, "rx length %d", skb->len); | 432 | netdev_dbg(dev->net, "rx length %d\n", skb->len); |
433 | } | 433 | } |
434 | break; | 434 | break; |
435 | 435 | ||
@@ -447,7 +447,7 @@ static void rx_complete (struct urb *urb) | |||
447 | case -ECONNRESET: /* async unlink */ | 447 | case -ECONNRESET: /* async unlink */ |
448 | case -ESHUTDOWN: /* hardware gone */ | 448 | case -ESHUTDOWN: /* hardware gone */ |
449 | if (netif_msg_ifdown (dev)) | 449 | if (netif_msg_ifdown (dev)) |
450 | devdbg (dev, "rx shutdown, code %d", urb_status); | 450 | netdev_dbg(dev->net, "rx shutdown, code %d\n", urb_status); |
451 | goto block; | 451 | goto block; |
452 | 452 | ||
453 | /* we get controller i/o faults during khubd disconnect() delays. | 453 | /* we get controller i/o faults during khubd disconnect() delays. |
@@ -461,7 +461,7 @@ static void rx_complete (struct urb *urb) | |||
461 | if (!timer_pending (&dev->delay)) { | 461 | if (!timer_pending (&dev->delay)) { |
462 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); | 462 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); |
463 | if (netif_msg_link (dev)) | 463 | if (netif_msg_link (dev)) |
464 | devdbg (dev, "rx throttle %d", urb_status); | 464 | netdev_dbg(dev->net, "rx throttle %d\n", urb_status); |
465 | } | 465 | } |
466 | block: | 466 | block: |
467 | entry->state = rx_cleanup; | 467 | entry->state = rx_cleanup; |
@@ -478,7 +478,7 @@ block: | |||
478 | entry->state = rx_cleanup; | 478 | entry->state = rx_cleanup; |
479 | dev->net->stats.rx_errors++; | 479 | dev->net->stats.rx_errors++; |
480 | if (netif_msg_rx_err (dev)) | 480 | if (netif_msg_rx_err (dev)) |
481 | devdbg (dev, "rx status %d", urb_status); | 481 | netdev_dbg(dev->net, "rx status %d\n", urb_status); |
482 | break; | 482 | break; |
483 | } | 483 | } |
484 | 484 | ||
@@ -493,7 +493,7 @@ block: | |||
493 | usb_free_urb (urb); | 493 | usb_free_urb (urb); |
494 | } | 494 | } |
495 | if (netif_msg_rx_err (dev)) | 495 | if (netif_msg_rx_err (dev)) |
496 | devdbg (dev, "no read resubmitted"); | 496 | netdev_dbg(dev->net, "no read resubmitted\n"); |
497 | } | 497 | } |
498 | 498 | ||
499 | static void intr_complete (struct urb *urb) | 499 | static void intr_complete (struct urb *urb) |
@@ -511,14 +511,14 @@ static void intr_complete (struct urb *urb) | |||
511 | case -ENOENT: /* urb killed */ | 511 | case -ENOENT: /* urb killed */ |
512 | case -ESHUTDOWN: /* hardware gone */ | 512 | case -ESHUTDOWN: /* hardware gone */ |
513 | if (netif_msg_ifdown (dev)) | 513 | if (netif_msg_ifdown (dev)) |
514 | devdbg (dev, "intr shutdown, code %d", status); | 514 | netdev_dbg(dev->net, "intr shutdown, code %d\n", status); |
515 | return; | 515 | return; |
516 | 516 | ||
517 | /* NOTE: not throttling like RX/TX, since this endpoint | 517 | /* NOTE: not throttling like RX/TX, since this endpoint |
518 | * already polls infrequently | 518 | * already polls infrequently |
519 | */ | 519 | */ |
520 | default: | 520 | default: |
521 | devdbg (dev, "intr status %d", status); | 521 | netdev_dbg(dev->net, "intr status %d\n", status); |
522 | break; | 522 | break; |
523 | } | 523 | } |
524 | 524 | ||
@@ -528,7 +528,7 @@ static void intr_complete (struct urb *urb) | |||
528 | memset(urb->transfer_buffer, 0, urb->transfer_buffer_length); | 528 | memset(urb->transfer_buffer, 0, urb->transfer_buffer_length); |
529 | status = usb_submit_urb (urb, GFP_ATOMIC); | 529 | status = usb_submit_urb (urb, GFP_ATOMIC); |
530 | if (status != 0 && netif_msg_timer (dev)) | 530 | if (status != 0 && netif_msg_timer (dev)) |
531 | deverr(dev, "intr resubmit --> %d", status); | 531 | netdev_err(dev->net, "intr resubmit --> %d\n", status); |
532 | } | 532 | } |
533 | 533 | ||
534 | /*-------------------------------------------------------------------------*/ | 534 | /*-------------------------------------------------------------------------*/ |
@@ -537,7 +537,7 @@ void usbnet_pause_rx(struct usbnet *dev) | |||
537 | set_bit(EVENT_RX_PAUSED, &dev->flags); | 537 | set_bit(EVENT_RX_PAUSED, &dev->flags); |
538 | 538 | ||
539 | if (netif_msg_rx_status(dev)) | 539 | if (netif_msg_rx_status(dev)) |
540 | devdbg(dev, "paused rx queue enabled"); | 540 | netdev_dbg(dev->net, "paused rx queue enabled\n"); |
541 | } | 541 | } |
542 | EXPORT_SYMBOL_GPL(usbnet_pause_rx); | 542 | EXPORT_SYMBOL_GPL(usbnet_pause_rx); |
543 | 543 | ||
@@ -556,7 +556,8 @@ void usbnet_resume_rx(struct usbnet *dev) | |||
556 | tasklet_schedule(&dev->bh); | 556 | tasklet_schedule(&dev->bh); |
557 | 557 | ||
558 | if (netif_msg_rx_status(dev)) | 558 | if (netif_msg_rx_status(dev)) |
559 | devdbg(dev, "paused rx queue disabled, %d skbs requeued", num); | 559 | netdev_dbg(dev->net, "paused rx queue disabled, %d skbs requeued\n", |
560 | num); | ||
560 | } | 561 | } |
561 | EXPORT_SYMBOL_GPL(usbnet_resume_rx); | 562 | EXPORT_SYMBOL_GPL(usbnet_resume_rx); |
562 | 563 | ||
@@ -589,7 +590,7 @@ static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) | |||
589 | // these (async) unlinks complete immediately | 590 | // these (async) unlinks complete immediately |
590 | retval = usb_unlink_urb (urb); | 591 | retval = usb_unlink_urb (urb); |
591 | if (retval != -EINPROGRESS && retval != 0) | 592 | if (retval != -EINPROGRESS && retval != 0) |
592 | devdbg (dev, "unlink urb err, %d", retval); | 593 | netdev_dbg(dev->net, "unlink urb err, %d\n", retval); |
593 | else | 594 | else |
594 | count++; | 595 | count++; |
595 | } | 596 | } |
@@ -632,8 +633,8 @@ static void usbnet_terminate_urbs(struct usbnet *dev) | |||
632 | schedule_timeout(UNLINK_TIMEOUT_MS); | 633 | schedule_timeout(UNLINK_TIMEOUT_MS); |
633 | set_current_state(TASK_UNINTERRUPTIBLE); | 634 | set_current_state(TASK_UNINTERRUPTIBLE); |
634 | if (netif_msg_ifdown(dev)) | 635 | if (netif_msg_ifdown(dev)) |
635 | devdbg(dev, "waited for %d urb completions", | 636 | netdev_dbg(dev->net, "waited for %d urb completions\n", |
636 | temp); | 637 | temp); |
637 | } | 638 | } |
638 | set_current_state(TASK_RUNNING); | 639 | set_current_state(TASK_RUNNING); |
639 | dev->wait = NULL; | 640 | dev->wait = NULL; |
@@ -649,21 +650,20 @@ int usbnet_stop (struct net_device *net) | |||
649 | netif_stop_queue (net); | 650 | netif_stop_queue (net); |
650 | 651 | ||
651 | if (netif_msg_ifdown (dev)) | 652 | if (netif_msg_ifdown (dev)) |
652 | devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld", | 653 | netdev_info(dev->net, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", |
653 | net->stats.rx_packets, net->stats.tx_packets, | 654 | net->stats.rx_packets, net->stats.tx_packets, |
654 | net->stats.rx_errors, net->stats.tx_errors | 655 | net->stats.rx_errors, net->stats.tx_errors); |
655 | ); | ||
656 | 656 | ||
657 | /* allow minidriver to stop correctly (wireless devices to turn off | 657 | /* allow minidriver to stop correctly (wireless devices to turn off |
658 | * radio etc) */ | 658 | * radio etc) */ |
659 | if (info->stop) { | 659 | if (info->stop) { |
660 | retval = info->stop(dev); | 660 | retval = info->stop(dev); |
661 | if (retval < 0 && netif_msg_ifdown(dev)) | 661 | if (retval < 0 && netif_msg_ifdown(dev)) |
662 | devinfo(dev, | 662 | netdev_info(dev->net, |
663 | "stop fail (%d) usbnet usb-%s-%s, %s", | 663 | "stop fail (%d) usbnet usb-%s-%s, %s\n", |
664 | retval, | 664 | retval, |
665 | dev->udev->bus->bus_name, dev->udev->devpath, | 665 | dev->udev->bus->bus_name, dev->udev->devpath, |
666 | info->description); | 666 | info->description); |
667 | } | 667 | } |
668 | 668 | ||
669 | if (!(info->flags & FLAG_AVOID_UNLINK_URBS)) | 669 | if (!(info->flags & FLAG_AVOID_UNLINK_URBS)) |
@@ -703,29 +703,31 @@ int usbnet_open (struct net_device *net) | |||
703 | 703 | ||
704 | if ((retval = usb_autopm_get_interface(dev->intf)) < 0) { | 704 | if ((retval = usb_autopm_get_interface(dev->intf)) < 0) { |
705 | if (netif_msg_ifup (dev)) | 705 | if (netif_msg_ifup (dev)) |
706 | devinfo (dev, | 706 | netdev_info(dev->net, |
707 | "resumption fail (%d) usbnet usb-%s-%s, %s", | 707 | "resumption fail (%d) usbnet usb-%s-%s, %s\n", |
708 | retval, | 708 | retval, |
709 | dev->udev->bus->bus_name, dev->udev->devpath, | 709 | dev->udev->bus->bus_name, |
710 | info->description); | 710 | dev->udev->devpath, |
711 | info->description); | ||
711 | goto done_nopm; | 712 | goto done_nopm; |
712 | } | 713 | } |
713 | 714 | ||
714 | // put into "known safe" state | 715 | // put into "known safe" state |
715 | if (info->reset && (retval = info->reset (dev)) < 0) { | 716 | if (info->reset && (retval = info->reset (dev)) < 0) { |
716 | if (netif_msg_ifup (dev)) | 717 | if (netif_msg_ifup (dev)) |
717 | devinfo (dev, | 718 | netdev_info(dev->net, |
718 | "open reset fail (%d) usbnet usb-%s-%s, %s", | 719 | "open reset fail (%d) usbnet usb-%s-%s, %s\n", |
719 | retval, | 720 | retval, |
720 | dev->udev->bus->bus_name, dev->udev->devpath, | 721 | dev->udev->bus->bus_name, |
721 | info->description); | 722 | dev->udev->devpath, |
723 | info->description); | ||
722 | goto done; | 724 | goto done; |
723 | } | 725 | } |
724 | 726 | ||
725 | // insist peer be connected | 727 | // insist peer be connected |
726 | if (info->check_connect && (retval = info->check_connect (dev)) < 0) { | 728 | if (info->check_connect && (retval = info->check_connect (dev)) < 0) { |
727 | if (netif_msg_ifup (dev)) | 729 | if (netif_msg_ifup (dev)) |
728 | devdbg (dev, "can't open; %d", retval); | 730 | netdev_dbg(dev->net, "can't open; %d\n", retval); |
729 | goto done; | 731 | goto done; |
730 | } | 732 | } |
731 | 733 | ||
@@ -734,7 +736,7 @@ int usbnet_open (struct net_device *net) | |||
734 | retval = usb_submit_urb (dev->interrupt, GFP_KERNEL); | 736 | retval = usb_submit_urb (dev->interrupt, GFP_KERNEL); |
735 | if (retval < 0) { | 737 | if (retval < 0) { |
736 | if (netif_msg_ifup (dev)) | 738 | if (netif_msg_ifup (dev)) |
737 | deverr (dev, "intr submit %d", retval); | 739 | netdev_err(dev->net, "intr submit %d\n", retval); |
738 | goto done; | 740 | goto done; |
739 | } | 741 | } |
740 | } | 742 | } |
@@ -756,10 +758,9 @@ int usbnet_open (struct net_device *net) | |||
756 | else | 758 | else |
757 | framing = "simple"; | 759 | framing = "simple"; |
758 | 760 | ||
759 | devinfo (dev, "open: enable queueing " | 761 | netdev_info(dev->net, "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", |
760 | "(rx %d, tx %d) mtu %d %s framing", | 762 | (int)RX_QLEN(dev), (int)TX_QLEN(dev), |
761 | (int)RX_QLEN (dev), (int)TX_QLEN (dev), dev->net->mtu, | 763 | dev->net->mtu, framing); |
762 | framing); | ||
763 | } | 764 | } |
764 | 765 | ||
765 | // delay posting reads until we're fully open | 766 | // delay posting reads until we're fully open |
@@ -908,8 +909,8 @@ kevent (struct work_struct *work) | |||
908 | status != -ESHUTDOWN) { | 909 | status != -ESHUTDOWN) { |
909 | if (netif_msg_tx_err (dev)) | 910 | if (netif_msg_tx_err (dev)) |
910 | fail_pipe: | 911 | fail_pipe: |
911 | deverr (dev, "can't clear tx halt, status %d", | 912 | netdev_err(dev->net, "can't clear tx halt, status %d\n", |
912 | status); | 913 | status); |
913 | } else { | 914 | } else { |
914 | clear_bit (EVENT_TX_HALT, &dev->flags); | 915 | clear_bit (EVENT_TX_HALT, &dev->flags); |
915 | if (status != -ESHUTDOWN) | 916 | if (status != -ESHUTDOWN) |
@@ -928,8 +929,8 @@ fail_pipe: | |||
928 | status != -ESHUTDOWN) { | 929 | status != -ESHUTDOWN) { |
929 | if (netif_msg_rx_err (dev)) | 930 | if (netif_msg_rx_err (dev)) |
930 | fail_halt: | 931 | fail_halt: |
931 | deverr (dev, "can't clear rx halt, status %d", | 932 | netdev_err(dev->net, "can't clear rx halt, status %d\n", |
932 | status); | 933 | status); |
933 | } else { | 934 | } else { |
934 | clear_bit (EVENT_RX_HALT, &dev->flags); | 935 | clear_bit (EVENT_RX_HALT, &dev->flags); |
935 | tasklet_schedule (&dev->bh); | 936 | tasklet_schedule (&dev->bh); |
@@ -967,18 +968,18 @@ fail_lowmem: | |||
967 | if(info->link_reset && (retval = info->link_reset(dev)) < 0) { | 968 | if(info->link_reset && (retval = info->link_reset(dev)) < 0) { |
968 | usb_autopm_put_interface(dev->intf); | 969 | usb_autopm_put_interface(dev->intf); |
969 | skip_reset: | 970 | skip_reset: |
970 | devinfo(dev, "link reset failed (%d) usbnet usb-%s-%s, %s", | 971 | netdev_info(dev->net, "link reset failed (%d) usbnet usb-%s-%s, %s\n", |
971 | retval, | 972 | retval, |
972 | dev->udev->bus->bus_name, dev->udev->devpath, | 973 | dev->udev->bus->bus_name, |
973 | info->description); | 974 | dev->udev->devpath, |
975 | info->description); | ||
974 | } else { | 976 | } else { |
975 | usb_autopm_put_interface(dev->intf); | 977 | usb_autopm_put_interface(dev->intf); |
976 | } | 978 | } |
977 | } | 979 | } |
978 | 980 | ||
979 | if (dev->flags) | 981 | if (dev->flags) |
980 | devdbg (dev, "kevent done, flags = 0x%lx", | 982 | netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags); |
981 | dev->flags); | ||
982 | } | 983 | } |
983 | 984 | ||
984 | /*-------------------------------------------------------------------------*/ | 985 | /*-------------------------------------------------------------------------*/ |
@@ -1015,14 +1016,15 @@ static void tx_complete (struct urb *urb) | |||
1015 | mod_timer (&dev->delay, | 1016 | mod_timer (&dev->delay, |
1016 | jiffies + THROTTLE_JIFFIES); | 1017 | jiffies + THROTTLE_JIFFIES); |
1017 | if (netif_msg_link (dev)) | 1018 | if (netif_msg_link (dev)) |
1018 | devdbg (dev, "tx throttle %d", | 1019 | netdev_dbg(dev->net, "tx throttle %d\n", |
1019 | urb->status); | 1020 | urb->status); |
1020 | } | 1021 | } |
1021 | netif_stop_queue (dev->net); | 1022 | netif_stop_queue (dev->net); |
1022 | break; | 1023 | break; |
1023 | default: | 1024 | default: |
1024 | if (netif_msg_tx_err (dev)) | 1025 | if (netif_msg_tx_err (dev)) |
1025 | devdbg (dev, "tx err %d", entry->urb->status); | 1026 | netdev_dbg(dev->net, "tx err %d\n", |
1027 | entry->urb->status); | ||
1026 | break; | 1028 | break; |
1027 | } | 1029 | } |
1028 | } | 1030 | } |
@@ -1065,7 +1067,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1065 | skb = info->tx_fixup (dev, skb, GFP_ATOMIC); | 1067 | skb = info->tx_fixup (dev, skb, GFP_ATOMIC); |
1066 | if (!skb) { | 1068 | if (!skb) { |
1067 | if (netif_msg_tx_err (dev)) | 1069 | if (netif_msg_tx_err (dev)) |
1068 | devdbg (dev, "can't tx_fixup skb"); | 1070 | netdev_dbg(dev->net, "can't tx_fixup skb\n"); |
1069 | goto drop; | 1071 | goto drop; |
1070 | } | 1072 | } |
1071 | } | 1073 | } |
@@ -1073,7 +1075,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1073 | 1075 | ||
1074 | if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) { | 1076 | if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) { |
1075 | if (netif_msg_tx_err (dev)) | 1077 | if (netif_msg_tx_err (dev)) |
1076 | devdbg (dev, "no urb"); | 1078 | netdev_dbg(dev->net, "no urb\n"); |
1077 | goto drop; | 1079 | goto drop; |
1078 | } | 1080 | } |
1079 | 1081 | ||
@@ -1113,7 +1115,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1113 | /* no use to process more packets */ | 1115 | /* no use to process more packets */ |
1114 | netif_stop_queue(net); | 1116 | netif_stop_queue(net); |
1115 | spin_unlock_irqrestore(&dev->txq.lock, flags); | 1117 | spin_unlock_irqrestore(&dev->txq.lock, flags); |
1116 | devdbg(dev, "Delaying transmission for resumption"); | 1118 | netdev_dbg(dev->net, "Delaying transmission for resumption\n"); |
1117 | goto deferred; | 1119 | goto deferred; |
1118 | } | 1120 | } |
1119 | #endif | 1121 | #endif |
@@ -1127,7 +1129,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1127 | default: | 1129 | default: |
1128 | usb_autopm_put_interface_async(dev->intf); | 1130 | usb_autopm_put_interface_async(dev->intf); |
1129 | if (netif_msg_tx_err (dev)) | 1131 | if (netif_msg_tx_err (dev)) |
1130 | devdbg (dev, "tx: submit urb err %d", retval); | 1132 | netdev_dbg(dev->net, "tx: submit urb err %d\n", retval); |
1131 | break; | 1133 | break; |
1132 | case 0: | 1134 | case 0: |
1133 | net->trans_start = jiffies; | 1135 | net->trans_start = jiffies; |
@@ -1139,15 +1141,15 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1139 | 1141 | ||
1140 | if (retval) { | 1142 | if (retval) { |
1141 | if (netif_msg_tx_err (dev)) | 1143 | if (netif_msg_tx_err (dev)) |
1142 | devdbg (dev, "drop, code %d", retval); | 1144 | netdev_dbg(dev->net, "drop, code %d\n", retval); |
1143 | drop: | 1145 | drop: |
1144 | dev->net->stats.tx_dropped++; | 1146 | dev->net->stats.tx_dropped++; |
1145 | if (skb) | 1147 | if (skb) |
1146 | dev_kfree_skb_any (skb); | 1148 | dev_kfree_skb_any (skb); |
1147 | usb_free_urb (urb); | 1149 | usb_free_urb (urb); |
1148 | } else if (netif_msg_tx_queued (dev)) { | 1150 | } else if (netif_msg_tx_queued (dev)) { |
1149 | devdbg (dev, "> tx, len %d, type 0x%x", | 1151 | netdev_dbg(dev->net, "> tx, len %d, type 0x%x\n", |
1150 | length, skb->protocol); | 1152 | length, skb->protocol); |
1151 | } | 1153 | } |
1152 | #ifdef CONFIG_PM | 1154 | #ifdef CONFIG_PM |
1153 | deferred: | 1155 | deferred: |
@@ -1179,7 +1181,7 @@ static void usbnet_bh (unsigned long param) | |||
1179 | dev_kfree_skb (skb); | 1181 | dev_kfree_skb (skb); |
1180 | continue; | 1182 | continue; |
1181 | default: | 1183 | default: |
1182 | devdbg (dev, "bogus skb state %d", entry->state); | 1184 | netdev_dbg(dev->net, "bogus skb state %d\n", entry->state); |
1183 | } | 1185 | } |
1184 | } | 1186 | } |
1185 | 1187 | ||
@@ -1208,8 +1210,8 @@ static void usbnet_bh (unsigned long param) | |||
1208 | rx_submit (dev, urb, GFP_ATOMIC); | 1210 | rx_submit (dev, urb, GFP_ATOMIC); |
1209 | } | 1211 | } |
1210 | if (temp != dev->rxq.qlen && netif_msg_link (dev)) | 1212 | if (temp != dev->rxq.qlen && netif_msg_link (dev)) |
1211 | devdbg (dev, "rxqlen %d --> %d", | 1213 | netdev_dbg(dev->net, "rxqlen %d --> %d\n", |
1212 | temp, dev->rxq.qlen); | 1214 | temp, dev->rxq.qlen); |
1213 | if (dev->rxq.qlen < qlen) | 1215 | if (dev->rxq.qlen < qlen) |
1214 | tasklet_schedule (&dev->bh); | 1216 | tasklet_schedule (&dev->bh); |
1215 | } | 1217 | } |
@@ -1241,10 +1243,10 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
1241 | xdev = interface_to_usbdev (intf); | 1243 | xdev = interface_to_usbdev (intf); |
1242 | 1244 | ||
1243 | if (netif_msg_probe (dev)) | 1245 | if (netif_msg_probe (dev)) |
1244 | devinfo (dev, "unregister '%s' usb-%s-%s, %s", | 1246 | netdev_info(dev->net, "unregister '%s' usb-%s-%s, %s\n", |
1245 | intf->dev.driver->name, | 1247 | intf->dev.driver->name, |
1246 | xdev->bus->bus_name, xdev->devpath, | 1248 | xdev->bus->bus_name, xdev->devpath, |
1247 | dev->driver_info->description); | 1249 | dev->driver_info->description); |
1248 | 1250 | ||
1249 | net = dev->net; | 1251 | net = dev->net; |
1250 | unregister_netdev (net); | 1252 | unregister_netdev (net); |
@@ -1408,11 +1410,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1408 | if (status) | 1410 | if (status) |
1409 | goto out3; | 1411 | goto out3; |
1410 | if (netif_msg_probe (dev)) | 1412 | if (netif_msg_probe (dev)) |
1411 | devinfo (dev, "register '%s' at usb-%s-%s, %s, %pM", | 1413 | netdev_info(dev->net, "register '%s' at usb-%s-%s, %s, %pM\n", |
1412 | udev->dev.driver->name, | 1414 | udev->dev.driver->name, |
1413 | xdev->bus->bus_name, xdev->devpath, | 1415 | xdev->bus->bus_name, xdev->devpath, |
1414 | dev->driver_info->description, | 1416 | dev->driver_info->description, |
1415 | net->dev_addr); | 1417 | net->dev_addr); |
1416 | 1418 | ||
1417 | // ok, it's ready to go. | 1419 | // ok, it's ready to go. |
1418 | usb_set_intfdata (udev, dev); | 1420 | usb_set_intfdata (udev, dev); |