diff options
-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 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 325 | ||||
-rw-r--r-- | include/linux/usb/usbnet.h | 21 |
11 files changed, 507 insertions, 489 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); |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 14692bc51b51..65cbd060cc30 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -728,9 +728,9 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) | |||
728 | ret = rndis_command(dev, u.header, buflen); | 728 | ret = rndis_command(dev, u.header, buflen); |
729 | priv->current_command_oid = 0; | 729 | priv->current_command_oid = 0; |
730 | if (ret < 0) | 730 | if (ret < 0) |
731 | devdbg(dev, "rndis_query_oid(%s): rndis_command() failed, %d " | 731 | netdev_dbg(dev->net, "%s(%s): rndis_command() failed, %d (%08x)\n", |
732 | "(%08x)", oid_to_string(oid), ret, | 732 | __func__, oid_to_string(oid), ret, |
733 | le32_to_cpu(u.get_c->status)); | 733 | le32_to_cpu(u.get_c->status)); |
734 | 734 | ||
735 | if (ret == 0) { | 735 | if (ret == 0) { |
736 | memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len); | 736 | memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len); |
@@ -741,9 +741,9 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) | |||
741 | 741 | ||
742 | ret = rndis_error_status(u.get_c->status); | 742 | ret = rndis_error_status(u.get_c->status); |
743 | if (ret < 0) | 743 | if (ret < 0) |
744 | devdbg(dev, "rndis_query_oid(%s): device returned " | 744 | netdev_dbg(dev->net, "%s(%s): device returned error, 0x%08x (%d)\n", |
745 | "error, 0x%08x (%d)", oid_to_string(oid), | 745 | __func__, oid_to_string(oid), |
746 | le32_to_cpu(u.get_c->status), ret); | 746 | le32_to_cpu(u.get_c->status), ret); |
747 | } | 747 | } |
748 | 748 | ||
749 | mutex_unlock(&priv->command_lock); | 749 | mutex_unlock(&priv->command_lock); |
@@ -791,17 +791,17 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len) | |||
791 | ret = rndis_command(dev, u.header, buflen); | 791 | ret = rndis_command(dev, u.header, buflen); |
792 | priv->current_command_oid = 0; | 792 | priv->current_command_oid = 0; |
793 | if (ret < 0) | 793 | if (ret < 0) |
794 | devdbg(dev, "rndis_set_oid(%s): rndis_command() failed, %d " | 794 | netdev_dbg(dev->net, "%s(%s): rndis_command() failed, %d (%08x)\n", |
795 | "(%08x)", oid_to_string(oid), ret, | 795 | __func__, oid_to_string(oid), ret, |
796 | le32_to_cpu(u.set_c->status)); | 796 | le32_to_cpu(u.set_c->status)); |
797 | 797 | ||
798 | if (ret == 0) { | 798 | if (ret == 0) { |
799 | ret = rndis_error_status(u.set_c->status); | 799 | ret = rndis_error_status(u.set_c->status); |
800 | 800 | ||
801 | if (ret < 0) | 801 | if (ret < 0) |
802 | devdbg(dev, "rndis_set_oid(%s): device returned error, " | 802 | netdev_dbg(dev->net, "%s(%s): device returned error, 0x%08x (%d)\n", |
803 | "0x%08x (%d)", oid_to_string(oid), | 803 | __func__, oid_to_string(oid), |
804 | le32_to_cpu(u.set_c->status), ret); | 804 | le32_to_cpu(u.set_c->status), ret); |
805 | } | 805 | } |
806 | 806 | ||
807 | mutex_unlock(&priv->command_lock); | 807 | mutex_unlock(&priv->command_lock); |
@@ -870,11 +870,11 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, | |||
870 | #endif | 870 | #endif |
871 | 871 | ||
872 | if (value_type == 2) | 872 | if (value_type == 2) |
873 | devdbg(dev, "setting config parameter: %s, value: %s", | 873 | netdev_dbg(dev->net, "setting config parameter: %s, value: %s\n", |
874 | param, (u8 *)value); | 874 | param, (u8 *)value); |
875 | else | 875 | else |
876 | devdbg(dev, "setting config parameter: %s, value: %d", | 876 | netdev_dbg(dev->net, "setting config parameter: %s, value: %d\n", |
877 | param, *(u32 *)value); | 877 | param, *(u32 *)value); |
878 | 878 | ||
879 | infobuf->name_offs = cpu_to_le32(sizeof(*infobuf)); | 879 | infobuf->name_offs = cpu_to_le32(sizeof(*infobuf)); |
880 | infobuf->name_length = cpu_to_le32(param_len); | 880 | infobuf->name_length = cpu_to_le32(param_len); |
@@ -897,20 +897,21 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, | |||
897 | } | 897 | } |
898 | 898 | ||
899 | #ifdef DEBUG | 899 | #ifdef DEBUG |
900 | devdbg(dev, "info buffer (len: %d):", info_len); | 900 | netdev_dbg(dev->net, "info buffer (len: %d)\n", info_len); |
901 | for (i = 0; i < info_len; i += 12) { | 901 | for (i = 0; i < info_len; i += 12) { |
902 | u32 *tmp = (u32 *)((u8 *)infobuf + i); | 902 | u32 *tmp = (u32 *)((u8 *)infobuf + i); |
903 | devdbg(dev, "%08X:%08X:%08X", | 903 | netdev_dbg(dev->net, "%08X:%08X:%08X\n", |
904 | cpu_to_be32(tmp[0]), | 904 | cpu_to_be32(tmp[0]), |
905 | cpu_to_be32(tmp[1]), | 905 | cpu_to_be32(tmp[1]), |
906 | cpu_to_be32(tmp[2])); | 906 | cpu_to_be32(tmp[2])); |
907 | } | 907 | } |
908 | #endif | 908 | #endif |
909 | 909 | ||
910 | ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER, | 910 | ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER, |
911 | infobuf, info_len); | 911 | infobuf, info_len); |
912 | if (ret != 0) | 912 | if (ret != 0) |
913 | devdbg(dev, "setting rndis config parameter failed, %d.", ret); | 913 | netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n", |
914 | ret); | ||
914 | 915 | ||
915 | kfree(infobuf); | 916 | kfree(infobuf); |
916 | return ret; | 917 | return ret; |
@@ -945,13 +946,13 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) | |||
945 | 946 | ||
946 | ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid)); | 947 | ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid)); |
947 | if (ret < 0) { | 948 | if (ret < 0) { |
948 | devwarn(usbdev, "setting SSID failed (%08X)", ret); | 949 | netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret); |
949 | return ret; | 950 | return ret; |
950 | } | 951 | } |
951 | if (ret == 0) { | 952 | if (ret == 0) { |
952 | memcpy(&priv->essid, ssid, sizeof(priv->essid)); | 953 | memcpy(&priv->essid, ssid, sizeof(priv->essid)); |
953 | priv->radio_on = true; | 954 | priv->radio_on = true; |
954 | devdbg(usbdev, "set_essid: radio_on = true"); | 955 | netdev_dbg(usbdev->net, "%s(): radio_on = true\n", __func__); |
955 | } | 956 | } |
956 | 957 | ||
957 | return ret; | 958 | return ret; |
@@ -963,7 +964,8 @@ static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) | |||
963 | 964 | ||
964 | ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); | 965 | ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); |
965 | if (ret < 0) { | 966 | if (ret < 0) { |
966 | devwarn(usbdev, "setting BSSID[%pM] failed (%08X)", bssid, ret); | 967 | netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n", |
968 | bssid, ret); | ||
967 | return ret; | 969 | return ret; |
968 | } | 970 | } |
969 | 971 | ||
@@ -1021,7 +1023,8 @@ static int disassociate(struct usbnet *usbdev, bool reset_ssid) | |||
1021 | ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); | 1023 | ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); |
1022 | if (ret == 0) { | 1024 | if (ret == 0) { |
1023 | priv->radio_on = false; | 1025 | priv->radio_on = false; |
1024 | devdbg(usbdev, "disassociate: radio_on = false"); | 1026 | netdev_dbg(usbdev->net, "%s(): radio_on = false\n", |
1027 | __func__); | ||
1025 | 1028 | ||
1026 | if (reset_ssid) | 1029 | if (reset_ssid) |
1027 | msleep(100); | 1030 | msleep(100); |
@@ -1054,8 +1057,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, | |||
1054 | __le32 tmp; | 1057 | __le32 tmp; |
1055 | int auth_mode, ret; | 1058 | int auth_mode, ret; |
1056 | 1059 | ||
1057 | devdbg(usbdev, "set_auth_mode: wpa_version=0x%x authalg=0x%x " | 1060 | netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x authalg=0x%x keymgmt=0x%x\n", |
1058 | "keymgmt=0x%x", wpa_version, auth_type, keymgmt); | 1061 | __func__, wpa_version, auth_type, keymgmt); |
1059 | 1062 | ||
1060 | if (wpa_version & NL80211_WPA_VERSION_2) { | 1063 | if (wpa_version & NL80211_WPA_VERSION_2) { |
1061 | if (keymgmt & RNDIS_WLAN_KEY_MGMT_802_1X) | 1064 | if (keymgmt & RNDIS_WLAN_KEY_MGMT_802_1X) |
@@ -1082,7 +1085,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, | |||
1082 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, | 1085 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, |
1083 | sizeof(tmp)); | 1086 | sizeof(tmp)); |
1084 | if (ret != 0) { | 1087 | if (ret != 0) { |
1085 | devwarn(usbdev, "setting auth mode failed (%08X)", ret); | 1088 | netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n", |
1089 | ret); | ||
1086 | return ret; | 1090 | return ret; |
1087 | } | 1091 | } |
1088 | 1092 | ||
@@ -1098,7 +1102,8 @@ static int set_priv_filter(struct usbnet *usbdev) | |||
1098 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 1102 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
1099 | __le32 tmp; | 1103 | __le32 tmp; |
1100 | 1104 | ||
1101 | devdbg(usbdev, "set_priv_filter: wpa_version=0x%x", priv->wpa_version); | 1105 | netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x\n", |
1106 | __func__, priv->wpa_version); | ||
1102 | 1107 | ||
1103 | if (priv->wpa_version & NL80211_WPA_VERSION_2 || | 1108 | if (priv->wpa_version & NL80211_WPA_VERSION_2 || |
1104 | priv->wpa_version & NL80211_WPA_VERSION_1) | 1109 | priv->wpa_version & NL80211_WPA_VERSION_1) |
@@ -1116,8 +1121,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) | |||
1116 | __le32 tmp; | 1121 | __le32 tmp; |
1117 | int encr_mode, ret; | 1122 | int encr_mode, ret; |
1118 | 1123 | ||
1119 | devdbg(usbdev, "set_encr_mode: cipher_pair=0x%x cipher_group=0x%x", | 1124 | netdev_dbg(usbdev->net, "%s(): cipher_pair=0x%x cipher_group=0x%x\n", |
1120 | pairwise, groupwise); | 1125 | __func__, pairwise, groupwise); |
1121 | 1126 | ||
1122 | if (pairwise & RNDIS_WLAN_ALG_CCMP) | 1127 | if (pairwise & RNDIS_WLAN_ALG_CCMP) |
1123 | encr_mode = NDIS_80211_ENCR_CCMP_ENABLED; | 1128 | encr_mode = NDIS_80211_ENCR_CCMP_ENABLED; |
@@ -1136,7 +1141,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) | |||
1136 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, | 1141 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, |
1137 | sizeof(tmp)); | 1142 | sizeof(tmp)); |
1138 | if (ret != 0) { | 1143 | if (ret != 0) { |
1139 | devwarn(usbdev, "setting encr mode failed (%08X)", ret); | 1144 | netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n", |
1145 | ret); | ||
1140 | return ret; | 1146 | return ret; |
1141 | } | 1147 | } |
1142 | 1148 | ||
@@ -1151,13 +1157,15 @@ static int set_infra_mode(struct usbnet *usbdev, int mode) | |||
1151 | __le32 tmp; | 1157 | __le32 tmp; |
1152 | int ret; | 1158 | int ret; |
1153 | 1159 | ||
1154 | devdbg(usbdev, "set_infra_mode: infra_mode=0x%x", priv->infra_mode); | 1160 | netdev_dbg(usbdev->net, "%s(): infra_mode=0x%x\n", |
1161 | __func__, priv->infra_mode); | ||
1155 | 1162 | ||
1156 | tmp = cpu_to_le32(mode); | 1163 | tmp = cpu_to_le32(mode); |
1157 | ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp, | 1164 | ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp, |
1158 | sizeof(tmp)); | 1165 | sizeof(tmp)); |
1159 | if (ret != 0) { | 1166 | if (ret != 0) { |
1160 | devwarn(usbdev, "setting infra mode failed (%08X)", ret); | 1167 | netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n", |
1168 | ret); | ||
1161 | return ret; | 1169 | return ret; |
1162 | } | 1170 | } |
1163 | 1171 | ||
@@ -1174,7 +1182,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) | |||
1174 | { | 1182 | { |
1175 | __le32 tmp; | 1183 | __le32 tmp; |
1176 | 1184 | ||
1177 | devdbg(usbdev, "set_rts_threshold %i", rts_threshold); | 1185 | netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold); |
1178 | 1186 | ||
1179 | if (rts_threshold < 0 || rts_threshold > 2347) | 1187 | if (rts_threshold < 0 || rts_threshold > 2347) |
1180 | rts_threshold = 2347; | 1188 | rts_threshold = 2347; |
@@ -1188,7 +1196,7 @@ static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold) | |||
1188 | { | 1196 | { |
1189 | __le32 tmp; | 1197 | __le32 tmp; |
1190 | 1198 | ||
1191 | devdbg(usbdev, "set_frag_threshold %i", frag_threshold); | 1199 | netdev_dbg(usbdev->net, "%s(): %i\n", __func__, frag_threshold); |
1192 | 1200 | ||
1193 | if (frag_threshold < 256 || frag_threshold > 2346) | 1201 | if (frag_threshold < 256 || frag_threshold > 2346) |
1194 | frag_threshold = 2346; | 1202 | frag_threshold = 2346; |
@@ -1222,7 +1230,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1222 | unsigned int dsconfig; | 1230 | unsigned int dsconfig; |
1223 | int len, ret; | 1231 | int len, ret; |
1224 | 1232 | ||
1225 | devdbg(usbdev, "set_channel(%d)", channel); | 1233 | netdev_dbg(usbdev->net, "%s(%d)\n", __func__, channel); |
1226 | 1234 | ||
1227 | /* this OID is valid only when not associated */ | 1235 | /* this OID is valid only when not associated */ |
1228 | if (is_associated(usbdev)) | 1236 | if (is_associated(usbdev)) |
@@ -1233,7 +1241,8 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1233 | len = sizeof(config); | 1241 | len = sizeof(config); |
1234 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); | 1242 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); |
1235 | if (ret < 0) { | 1243 | if (ret < 0) { |
1236 | devdbg(usbdev, "set_channel: querying configuration failed"); | 1244 | netdev_dbg(usbdev->net, "%s(): querying configuration failed\n", |
1245 | __func__); | ||
1237 | return ret; | 1246 | return ret; |
1238 | } | 1247 | } |
1239 | 1248 | ||
@@ -1241,7 +1250,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1241 | ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, | 1250 | ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, |
1242 | sizeof(config)); | 1251 | sizeof(config)); |
1243 | 1252 | ||
1244 | devdbg(usbdev, "set_channel: %d -> %d", channel, ret); | 1253 | netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret); |
1245 | 1254 | ||
1246 | return ret; | 1255 | return ret; |
1247 | } | 1256 | } |
@@ -1255,7 +1264,8 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1255 | u32 cipher; | 1264 | u32 cipher; |
1256 | int ret; | 1265 | int ret; |
1257 | 1266 | ||
1258 | devdbg(usbdev, "add_wep_key(idx: %d, len: %d)", index, key_len); | 1267 | netdev_dbg(usbdev->net, "%s(idx: %d, len: %d)\n", |
1268 | __func__, index, key_len); | ||
1259 | 1269 | ||
1260 | if ((key_len != 5 && key_len != 13) || index < 0 || index > 3) | 1270 | if ((key_len != 5 && key_len != 13) || index < 0 || index > 3) |
1261 | return -EINVAL; | 1271 | return -EINVAL; |
@@ -1277,15 +1287,15 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1277 | ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, | 1287 | ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, |
1278 | RNDIS_WLAN_ALG_NONE); | 1288 | RNDIS_WLAN_ALG_NONE); |
1279 | if (ret) | 1289 | if (ret) |
1280 | devwarn(usbdev, "encryption couldn't be enabled (%08X)", | 1290 | netdev_warn(usbdev->net, "encryption couldn't be enabled (%08X)\n", |
1281 | ret); | 1291 | ret); |
1282 | } | 1292 | } |
1283 | 1293 | ||
1284 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key, | 1294 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key, |
1285 | sizeof(ndis_key)); | 1295 | sizeof(ndis_key)); |
1286 | if (ret != 0) { | 1296 | if (ret != 0) { |
1287 | devwarn(usbdev, "adding encryption key %d failed (%08X)", | 1297 | netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n", |
1288 | index+1, ret); | 1298 | index + 1, ret); |
1289 | return ret; | 1299 | return ret; |
1290 | } | 1300 | } |
1291 | 1301 | ||
@@ -1307,22 +1317,23 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1307 | int ret; | 1317 | int ret; |
1308 | 1318 | ||
1309 | if (index < 0 || index >= 4) { | 1319 | if (index < 0 || index >= 4) { |
1310 | devdbg(usbdev, "add_wpa_key: index out of range (%i)", index); | 1320 | netdev_dbg(usbdev->net, "%s(): index out of range (%i)\n", |
1321 | __func__, index); | ||
1311 | return -EINVAL; | 1322 | return -EINVAL; |
1312 | } | 1323 | } |
1313 | if (key_len > sizeof(ndis_key.material) || key_len < 0) { | 1324 | if (key_len > sizeof(ndis_key.material) || key_len < 0) { |
1314 | devdbg(usbdev, "add_wpa_key: key length out of range (%i)", | 1325 | netdev_dbg(usbdev->net, "%s(): key length out of range (%i)\n", |
1315 | key_len); | 1326 | __func__, key_len); |
1316 | return -EINVAL; | 1327 | return -EINVAL; |
1317 | } | 1328 | } |
1318 | if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) { | 1329 | if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) { |
1319 | if (!rx_seq || seq_len <= 0) { | 1330 | if (!rx_seq || seq_len <= 0) { |
1320 | devdbg(usbdev, "add_wpa_key: recv seq flag without" | 1331 | netdev_dbg(usbdev->net, "%s(): recv seq flag without buffer\n", |
1321 | "buffer"); | 1332 | __func__); |
1322 | return -EINVAL; | 1333 | return -EINVAL; |
1323 | } | 1334 | } |
1324 | if (rx_seq && seq_len > sizeof(ndis_key.rsc)) { | 1335 | if (rx_seq && seq_len > sizeof(ndis_key.rsc)) { |
1325 | devdbg(usbdev, "add_wpa_key: too big recv seq buffer"); | 1336 | netdev_dbg(usbdev->net, "%s(): too big recv seq buffer\n", __func__); |
1326 | return -EINVAL; | 1337 | return -EINVAL; |
1327 | } | 1338 | } |
1328 | } | 1339 | } |
@@ -1330,15 +1341,16 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1330 | is_addr_ok = addr && !is_zero_ether_addr(addr) && | 1341 | is_addr_ok = addr && !is_zero_ether_addr(addr) && |
1331 | !is_broadcast_ether_addr(addr); | 1342 | !is_broadcast_ether_addr(addr); |
1332 | if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) { | 1343 | if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) { |
1333 | devdbg(usbdev, "add_wpa_key: pairwise but bssid invalid (%pM)", | 1344 | netdev_dbg(usbdev->net, "%s(): pairwise but bssid invalid (%pM)\n", |
1334 | addr); | 1345 | __func__, addr); |
1335 | return -EINVAL; | 1346 | return -EINVAL; |
1336 | } | 1347 | } |
1337 | 1348 | ||
1338 | devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index, | 1349 | netdev_dbg(usbdev->net, "%s(%i): flags:%i%i%i\n", |
1339 | !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY), | 1350 | __func__, index, |
1340 | !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY), | 1351 | !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY), |
1341 | !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)); | 1352 | !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY), |
1353 | !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)); | ||
1342 | 1354 | ||
1343 | memset(&ndis_key, 0, sizeof(ndis_key)); | 1355 | memset(&ndis_key, 0, sizeof(ndis_key)); |
1344 | 1356 | ||
@@ -1372,7 +1384,8 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1372 | 1384 | ||
1373 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, | 1385 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, |
1374 | le32_to_cpu(ndis_key.size)); | 1386 | le32_to_cpu(ndis_key.size)); |
1375 | devdbg(usbdev, "add_wpa_key: OID_802_11_ADD_KEY -> %08X", ret); | 1387 | netdev_dbg(usbdev->net, "%s(): OID_802_11_ADD_KEY -> %08X\n", |
1388 | __func__, ret); | ||
1376 | if (ret != 0) | 1389 | if (ret != 0) |
1377 | return ret; | 1390 | return ret; |
1378 | 1391 | ||
@@ -1401,7 +1414,7 @@ static int restore_key(struct usbnet *usbdev, int key_idx) | |||
1401 | 1414 | ||
1402 | key = priv->encr_keys[key_idx]; | 1415 | key = priv->encr_keys[key_idx]; |
1403 | 1416 | ||
1404 | devdbg(usbdev, "restore_key: %i:%i", key_idx, key.len); | 1417 | netdev_dbg(usbdev->net, "%s(): %i:%i\n", __func__, key_idx, key.len); |
1405 | 1418 | ||
1406 | if (key.len == 0) | 1419 | if (key.len == 0) |
1407 | return 0; | 1420 | return 0; |
@@ -1436,8 +1449,9 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid) | |||
1436 | 1449 | ||
1437 | is_wpa = is_wpa_key(priv, index); | 1450 | is_wpa = is_wpa_key(priv, index); |
1438 | 1451 | ||
1439 | devdbg(usbdev, "remove_key: %i:%s:%i", index, is_wpa ? "wpa" : "wep", | 1452 | netdev_dbg(usbdev->net, "%s(): %i:%s:%i\n", |
1440 | priv->encr_keys[index].len); | 1453 | __func__, index, is_wpa ? "wpa" : "wep", |
1454 | priv->encr_keys[index].len); | ||
1441 | 1455 | ||
1442 | clear_key(priv, index); | 1456 | clear_key(priv, index); |
1443 | 1457 | ||
@@ -1464,9 +1478,9 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid) | |||
1464 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex, | 1478 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex, |
1465 | sizeof(keyindex)); | 1479 | sizeof(keyindex)); |
1466 | if (ret != 0) { | 1480 | if (ret != 0) { |
1467 | devwarn(usbdev, | 1481 | netdev_warn(usbdev->net, |
1468 | "removing encryption key %d failed (%08X)", | 1482 | "removing encryption key %d failed (%08X)\n", |
1469 | index, ret); | 1483 | index, ret); |
1470 | return ret; | 1484 | return ret; |
1471 | } | 1485 | } |
1472 | } | 1486 | } |
@@ -1498,9 +1512,9 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1498 | size = min(priv->multicast_size, netdev_mc_count(usbdev->net)); | 1512 | size = min(priv->multicast_size, netdev_mc_count(usbdev->net)); |
1499 | buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); | 1513 | buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); |
1500 | if (!buf) { | 1514 | if (!buf) { |
1501 | devwarn(usbdev, | 1515 | netdev_warn(usbdev->net, |
1502 | "couldn't alloc %d bytes of memory", | 1516 | "couldn't alloc %d bytes of memory\n", |
1503 | size * ETH_ALEN); | 1517 | size * ETH_ALEN); |
1504 | return; | 1518 | return; |
1505 | } | 1519 | } |
1506 | 1520 | ||
@@ -1520,8 +1534,8 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1520 | else | 1534 | else |
1521 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; | 1535 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; |
1522 | 1536 | ||
1523 | devdbg(usbdev, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d", | 1537 | netdev_dbg(usbdev->net, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n", |
1524 | i, priv->multicast_size, ret); | 1538 | i, priv->multicast_size, ret); |
1525 | 1539 | ||
1526 | kfree(buf); | 1540 | kfree(buf); |
1527 | } | 1541 | } |
@@ -1529,12 +1543,12 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1529 | ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, | 1543 | ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, |
1530 | sizeof(filter)); | 1544 | sizeof(filter)); |
1531 | if (ret < 0) { | 1545 | if (ret < 0) { |
1532 | devwarn(usbdev, "couldn't set packet filter: %08x", | 1546 | netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n", |
1533 | le32_to_cpu(filter)); | 1547 | le32_to_cpu(filter)); |
1534 | } | 1548 | } |
1535 | 1549 | ||
1536 | devdbg(usbdev, "OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d", | 1550 | netdev_dbg(usbdev->net, "OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d\n", |
1537 | le32_to_cpu(filter), ret); | 1551 | le32_to_cpu(filter), ret); |
1538 | } | 1552 | } |
1539 | 1553 | ||
1540 | /* | 1554 | /* |
@@ -1592,7 +1606,8 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, | |||
1592 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 1606 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
1593 | struct usbnet *usbdev = priv->usbdev; | 1607 | struct usbnet *usbdev = priv->usbdev; |
1594 | 1608 | ||
1595 | devdbg(usbdev, "rndis_set_tx_power type:0x%x dbm:%i", type, dbm); | 1609 | netdev_dbg(usbdev->net, "%s(): type:0x%x dbm:%i\n", |
1610 | __func__, type, dbm); | ||
1596 | 1611 | ||
1597 | /* Device doesn't support changing txpower after initialization, only | 1612 | /* Device doesn't support changing txpower after initialization, only |
1598 | * turn off/on radio. Support 'auto' mode and setting same dBm that is | 1613 | * turn off/on radio. Support 'auto' mode and setting same dBm that is |
@@ -1615,7 +1630,7 @@ static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm) | |||
1615 | 1630 | ||
1616 | *dbm = get_bcm4320_power_dbm(priv); | 1631 | *dbm = get_bcm4320_power_dbm(priv); |
1617 | 1632 | ||
1618 | devdbg(usbdev, "rndis_get_tx_power dbm:%i", *dbm); | 1633 | netdev_dbg(usbdev->net, "%s(): dbm:%i\n", __func__, *dbm); |
1619 | 1634 | ||
1620 | return 0; | 1635 | return 0; |
1621 | } | 1636 | } |
@@ -1629,7 +1644,7 @@ static int rndis_scan(struct wiphy *wiphy, struct net_device *dev, | |||
1629 | int ret; | 1644 | int ret; |
1630 | __le32 tmp; | 1645 | __le32 tmp; |
1631 | 1646 | ||
1632 | devdbg(usbdev, "cfg80211.scan"); | 1647 | netdev_dbg(usbdev->net, "cfg80211.scan\n"); |
1633 | 1648 | ||
1634 | /* Get current bssid list from device before new scan, as new scan | 1649 | /* Get current bssid list from device before new scan, as new scan |
1635 | * clears internal bssid list. | 1650 | * clears internal bssid list. |
@@ -1669,8 +1684,8 @@ static struct cfg80211_bss *rndis_bss_info_update(struct usbnet *usbdev, | |||
1669 | int ie_len, bssid_len; | 1684 | int ie_len, bssid_len; |
1670 | u8 *ie; | 1685 | u8 *ie; |
1671 | 1686 | ||
1672 | devdbg(usbdev, " found bssid: '%.32s' [%pM]", bssid->ssid.essid, | 1687 | netdev_dbg(usbdev->net, " found bssid: '%.32s' [%pM]\n", |
1673 | bssid->mac); | 1688 | bssid->ssid.essid, bssid->mac); |
1674 | 1689 | ||
1675 | /* parse bssid structure */ | 1690 | /* parse bssid structure */ |
1676 | bssid_len = le32_to_cpu(bssid->length); | 1691 | bssid_len = le32_to_cpu(bssid->length); |
@@ -1712,7 +1727,7 @@ static int rndis_check_bssid_list(struct usbnet *usbdev) | |||
1712 | int ret = -EINVAL, len, count, bssid_len; | 1727 | int ret = -EINVAL, len, count, bssid_len; |
1713 | bool resized = false; | 1728 | bool resized = false; |
1714 | 1729 | ||
1715 | devdbg(usbdev, "check_bssid_list"); | 1730 | netdev_dbg(usbdev->net, "check_bssid_list\n"); |
1716 | 1731 | ||
1717 | len = CONTROL_BUFFER_SIZE; | 1732 | len = CONTROL_BUFFER_SIZE; |
1718 | resize_buf: | 1733 | resize_buf: |
@@ -1736,8 +1751,8 @@ resize_buf: | |||
1736 | bssid = bssid_list->bssid; | 1751 | bssid = bssid_list->bssid; |
1737 | bssid_len = le32_to_cpu(bssid->length); | 1752 | bssid_len = le32_to_cpu(bssid->length); |
1738 | count = le32_to_cpu(bssid_list->num_items); | 1753 | count = le32_to_cpu(bssid_list->num_items); |
1739 | devdbg(usbdev, "check_bssid_list: %d BSSIDs found (buflen: %d)", count, | 1754 | netdev_dbg(usbdev->net, "check_bssid_list: %d BSSIDs found (buflen: %d)\n", |
1740 | len); | 1755 | count, len); |
1741 | 1756 | ||
1742 | while (count && ((void *)bssid + bssid_len) <= (buf + len)) { | 1757 | while (count && ((void *)bssid + bssid_len) <= (buf + len)) { |
1743 | rndis_bss_info_update(usbdev, bssid); | 1758 | rndis_bss_info_update(usbdev, bssid); |
@@ -1759,7 +1774,7 @@ static void rndis_get_scan_results(struct work_struct *work) | |||
1759 | struct usbnet *usbdev = priv->usbdev; | 1774 | struct usbnet *usbdev = priv->usbdev; |
1760 | int ret; | 1775 | int ret; |
1761 | 1776 | ||
1762 | devdbg(usbdev, "get_scan_results"); | 1777 | netdev_dbg(usbdev->net, "get_scan_results\n"); |
1763 | 1778 | ||
1764 | if (!priv->scan_request) | 1779 | if (!priv->scan_request) |
1765 | return; | 1780 | return; |
@@ -1793,7 +1808,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1793 | 1808 | ||
1794 | if (sme->crypto.n_ciphers_pairwise > 0 && | 1809 | if (sme->crypto.n_ciphers_pairwise > 0 && |
1795 | pairwise == RNDIS_WLAN_ALG_NONE) { | 1810 | pairwise == RNDIS_WLAN_ALG_NONE) { |
1796 | deverr(usbdev, "Unsupported pairwise cipher"); | 1811 | netdev_err(usbdev->net, "Unsupported pairwise cipher\n"); |
1797 | return -ENOTSUPP; | 1812 | return -ENOTSUPP; |
1798 | } | 1813 | } |
1799 | 1814 | ||
@@ -1803,28 +1818,30 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1803 | 1818 | ||
1804 | if (sme->crypto.n_akm_suites > 0 && | 1819 | if (sme->crypto.n_akm_suites > 0 && |
1805 | keymgmt == RNDIS_WLAN_KEY_MGMT_NONE) { | 1820 | keymgmt == RNDIS_WLAN_KEY_MGMT_NONE) { |
1806 | deverr(usbdev, "Invalid keymgmt"); | 1821 | netdev_err(usbdev->net, "Invalid keymgmt\n"); |
1807 | return -ENOTSUPP; | 1822 | return -ENOTSUPP; |
1808 | } | 1823 | } |
1809 | 1824 | ||
1810 | devdbg(usbdev, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:" | 1825 | netdev_dbg(usbdev->net, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:0x%x]:0x%x)\n", |
1811 | "0x%x]:0x%x)", sme->ssid, sme->bssid, chan, | 1826 | sme->ssid, sme->bssid, chan, |
1812 | sme->privacy, sme->crypto.wpa_versions, sme->auth_type, | 1827 | sme->privacy, sme->crypto.wpa_versions, sme->auth_type, |
1813 | groupwise, pairwise, keymgmt); | 1828 | groupwise, pairwise, keymgmt); |
1814 | 1829 | ||
1815 | if (is_associated(usbdev)) | 1830 | if (is_associated(usbdev)) |
1816 | disassociate(usbdev, false); | 1831 | disassociate(usbdev, false); |
1817 | 1832 | ||
1818 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); | 1833 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); |
1819 | if (ret < 0) { | 1834 | if (ret < 0) { |
1820 | devdbg(usbdev, "connect: set_infra_mode failed, %d", ret); | 1835 | netdev_dbg(usbdev->net, "connect: set_infra_mode failed, %d\n", |
1836 | ret); | ||
1821 | goto err_turn_radio_on; | 1837 | goto err_turn_radio_on; |
1822 | } | 1838 | } |
1823 | 1839 | ||
1824 | ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, | 1840 | ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, |
1825 | keymgmt); | 1841 | keymgmt); |
1826 | if (ret < 0) { | 1842 | if (ret < 0) { |
1827 | devdbg(usbdev, "connect: set_auth_mode failed, %d", ret); | 1843 | netdev_dbg(usbdev->net, "connect: set_auth_mode failed, %d\n", |
1844 | ret); | ||
1828 | goto err_turn_radio_on; | 1845 | goto err_turn_radio_on; |
1829 | } | 1846 | } |
1830 | 1847 | ||
@@ -1832,14 +1849,16 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1832 | 1849 | ||
1833 | ret = set_encr_mode(usbdev, pairwise, groupwise); | 1850 | ret = set_encr_mode(usbdev, pairwise, groupwise); |
1834 | if (ret < 0) { | 1851 | if (ret < 0) { |
1835 | devdbg(usbdev, "connect: set_encr_mode failed, %d", ret); | 1852 | netdev_dbg(usbdev->net, "connect: set_encr_mode failed, %d\n", |
1853 | ret); | ||
1836 | goto err_turn_radio_on; | 1854 | goto err_turn_radio_on; |
1837 | } | 1855 | } |
1838 | 1856 | ||
1839 | if (channel) { | 1857 | if (channel) { |
1840 | ret = set_channel(usbdev, chan); | 1858 | ret = set_channel(usbdev, chan); |
1841 | if (ret < 0) { | 1859 | if (ret < 0) { |
1842 | devdbg(usbdev, "connect: set_channel failed, %d", ret); | 1860 | netdev_dbg(usbdev->net, "connect: set_channel failed, %d\n", |
1861 | ret); | ||
1843 | goto err_turn_radio_on; | 1862 | goto err_turn_radio_on; |
1844 | } | 1863 | } |
1845 | } | 1864 | } |
@@ -1848,8 +1867,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1848 | priv->encr_tx_key_index = sme->key_idx; | 1867 | priv->encr_tx_key_index = sme->key_idx; |
1849 | ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); | 1868 | ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); |
1850 | if (ret < 0) { | 1869 | if (ret < 0) { |
1851 | devdbg(usbdev, "connect: add_wep_key failed, %d " | 1870 | netdev_dbg(usbdev->net, "connect: add_wep_key failed, %d (%d, %d)\n", |
1852 | "(%d, %d)", ret, sme->key_len, sme->key_idx); | 1871 | ret, sme->key_len, sme->key_idx); |
1853 | goto err_turn_radio_on; | 1872 | goto err_turn_radio_on; |
1854 | } | 1873 | } |
1855 | } | 1874 | } |
@@ -1858,7 +1877,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1858 | !is_broadcast_ether_addr(sme->bssid)) { | 1877 | !is_broadcast_ether_addr(sme->bssid)) { |
1859 | ret = set_bssid(usbdev, sme->bssid); | 1878 | ret = set_bssid(usbdev, sme->bssid); |
1860 | if (ret < 0) { | 1879 | if (ret < 0) { |
1861 | devdbg(usbdev, "connect: set_bssid failed, %d", ret); | 1880 | netdev_dbg(usbdev->net, "connect: set_bssid failed, %d\n", |
1881 | ret); | ||
1862 | goto err_turn_radio_on; | 1882 | goto err_turn_radio_on; |
1863 | } | 1883 | } |
1864 | } else | 1884 | } else |
@@ -1880,7 +1900,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1880 | 1900 | ||
1881 | ret = set_essid(usbdev, &ssid); | 1901 | ret = set_essid(usbdev, &ssid); |
1882 | if (ret < 0) | 1902 | if (ret < 0) |
1883 | devdbg(usbdev, "connect: set_essid failed, %d", ret); | 1903 | netdev_dbg(usbdev->net, "connect: set_essid failed, %d\n", ret); |
1884 | return ret; | 1904 | return ret; |
1885 | 1905 | ||
1886 | err_turn_radio_on: | 1906 | err_turn_radio_on: |
@@ -1895,7 +1915,7 @@ static int rndis_disconnect(struct wiphy *wiphy, struct net_device *dev, | |||
1895 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 1915 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
1896 | struct usbnet *usbdev = priv->usbdev; | 1916 | struct usbnet *usbdev = priv->usbdev; |
1897 | 1917 | ||
1898 | devdbg(usbdev, "cfg80211.disconnect(%d)", reason_code); | 1918 | netdev_dbg(usbdev->net, "cfg80211.disconnect(%d)\n", reason_code); |
1899 | 1919 | ||
1900 | priv->connected = false; | 1920 | priv->connected = false; |
1901 | memset(priv->bssid, 0, ETH_ALEN); | 1921 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -1929,21 +1949,23 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1929 | alg = RNDIS_WLAN_ALG_NONE; | 1949 | alg = RNDIS_WLAN_ALG_NONE; |
1930 | } | 1950 | } |
1931 | 1951 | ||
1932 | devdbg(usbdev, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)", params->ssid, | 1952 | netdev_dbg(usbdev->net, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)\n", |
1933 | params->bssid, chan, params->privacy); | 1953 | params->ssid, params->bssid, chan, params->privacy); |
1934 | 1954 | ||
1935 | if (is_associated(usbdev)) | 1955 | if (is_associated(usbdev)) |
1936 | disassociate(usbdev, false); | 1956 | disassociate(usbdev, false); |
1937 | 1957 | ||
1938 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); | 1958 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); |
1939 | if (ret < 0) { | 1959 | if (ret < 0) { |
1940 | devdbg(usbdev, "join_ibss: set_infra_mode failed, %d", ret); | 1960 | netdev_dbg(usbdev->net, "join_ibss: set_infra_mode failed, %d\n", |
1961 | ret); | ||
1941 | goto err_turn_radio_on; | 1962 | goto err_turn_radio_on; |
1942 | } | 1963 | } |
1943 | 1964 | ||
1944 | ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); | 1965 | ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); |
1945 | if (ret < 0) { | 1966 | if (ret < 0) { |
1946 | devdbg(usbdev, "join_ibss: set_auth_mode failed, %d", ret); | 1967 | netdev_dbg(usbdev->net, "join_ibss: set_auth_mode failed, %d\n", |
1968 | ret); | ||
1947 | goto err_turn_radio_on; | 1969 | goto err_turn_radio_on; |
1948 | } | 1970 | } |
1949 | 1971 | ||
@@ -1951,15 +1973,16 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1951 | 1973 | ||
1952 | ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); | 1974 | ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); |
1953 | if (ret < 0) { | 1975 | if (ret < 0) { |
1954 | devdbg(usbdev, "join_ibss: set_encr_mode failed, %d", ret); | 1976 | netdev_dbg(usbdev->net, "join_ibss: set_encr_mode failed, %d\n", |
1977 | ret); | ||
1955 | goto err_turn_radio_on; | 1978 | goto err_turn_radio_on; |
1956 | } | 1979 | } |
1957 | 1980 | ||
1958 | if (channel) { | 1981 | if (channel) { |
1959 | ret = set_channel(usbdev, chan); | 1982 | ret = set_channel(usbdev, chan); |
1960 | if (ret < 0) { | 1983 | if (ret < 0) { |
1961 | devdbg(usbdev, "join_ibss: set_channel failed, %d", | 1984 | netdev_dbg(usbdev->net, "join_ibss: set_channel failed, %d\n", |
1962 | ret); | 1985 | ret); |
1963 | goto err_turn_radio_on; | 1986 | goto err_turn_radio_on; |
1964 | } | 1987 | } |
1965 | } | 1988 | } |
@@ -1968,7 +1991,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1968 | !is_broadcast_ether_addr(params->bssid)) { | 1991 | !is_broadcast_ether_addr(params->bssid)) { |
1969 | ret = set_bssid(usbdev, params->bssid); | 1992 | ret = set_bssid(usbdev, params->bssid); |
1970 | if (ret < 0) { | 1993 | if (ret < 0) { |
1971 | devdbg(usbdev, "join_ibss: set_bssid failed, %d", ret); | 1994 | netdev_dbg(usbdev->net, "join_ibss: set_bssid failed, %d\n", |
1995 | ret); | ||
1972 | goto err_turn_radio_on; | 1996 | goto err_turn_radio_on; |
1973 | } | 1997 | } |
1974 | } else | 1998 | } else |
@@ -1988,7 +2012,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1988 | 2012 | ||
1989 | ret = set_essid(usbdev, &ssid); | 2013 | ret = set_essid(usbdev, &ssid); |
1990 | if (ret < 0) | 2014 | if (ret < 0) |
1991 | devdbg(usbdev, "join_ibss: set_essid failed, %d", ret); | 2015 | netdev_dbg(usbdev->net, "join_ibss: set_essid failed, %d\n", |
2016 | ret); | ||
1992 | return ret; | 2017 | return ret; |
1993 | 2018 | ||
1994 | err_turn_radio_on: | 2019 | err_turn_radio_on: |
@@ -2002,7 +2027,7 @@ static int rndis_leave_ibss(struct wiphy *wiphy, struct net_device *dev) | |||
2002 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 2027 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
2003 | struct usbnet *usbdev = priv->usbdev; | 2028 | struct usbnet *usbdev = priv->usbdev; |
2004 | 2029 | ||
2005 | devdbg(usbdev, "cfg80211.leave_ibss()"); | 2030 | netdev_dbg(usbdev->net, "cfg80211.leave_ibss()\n"); |
2006 | 2031 | ||
2007 | priv->connected = false; | 2032 | priv->connected = false; |
2008 | memset(priv->bssid, 0, ETH_ALEN); | 2033 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -2028,8 +2053,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2028 | struct usbnet *usbdev = priv->usbdev; | 2053 | struct usbnet *usbdev = priv->usbdev; |
2029 | __le32 flags; | 2054 | __le32 flags; |
2030 | 2055 | ||
2031 | devdbg(usbdev, "rndis_add_key(%i, %pM, %08x)", key_index, mac_addr, | 2056 | netdev_dbg(usbdev->net, "%s(%i, %pM, %08x)\n", |
2032 | params->cipher); | 2057 | __func__, key_index, mac_addr, params->cipher); |
2033 | 2058 | ||
2034 | switch (params->cipher) { | 2059 | switch (params->cipher) { |
2035 | case WLAN_CIPHER_SUITE_WEP40: | 2060 | case WLAN_CIPHER_SUITE_WEP40: |
@@ -2050,8 +2075,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2050 | key_index, mac_addr, params->seq, | 2075 | key_index, mac_addr, params->seq, |
2051 | params->seq_len, params->cipher, flags); | 2076 | params->seq_len, params->cipher, flags); |
2052 | default: | 2077 | default: |
2053 | devdbg(usbdev, "rndis_add_key: unsupported cipher %08x", | 2078 | netdev_dbg(usbdev->net, "%s(): unsupported cipher %08x\n", |
2054 | params->cipher); | 2079 | __func__, params->cipher); |
2055 | return -ENOTSUPP; | 2080 | return -ENOTSUPP; |
2056 | } | 2081 | } |
2057 | } | 2082 | } |
@@ -2062,7 +2087,7 @@ static int rndis_del_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2062 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 2087 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
2063 | struct usbnet *usbdev = priv->usbdev; | 2088 | struct usbnet *usbdev = priv->usbdev; |
2064 | 2089 | ||
2065 | devdbg(usbdev, "rndis_del_key(%i, %pM)", key_index, mac_addr); | 2090 | netdev_dbg(usbdev->net, "%s(%i, %pM)\n", __func__, key_index, mac_addr); |
2066 | 2091 | ||
2067 | return remove_key(usbdev, key_index, mac_addr); | 2092 | return remove_key(usbdev, key_index, mac_addr); |
2068 | } | 2093 | } |
@@ -2074,7 +2099,7 @@ static int rndis_set_default_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2074 | struct usbnet *usbdev = priv->usbdev; | 2099 | struct usbnet *usbdev = priv->usbdev; |
2075 | struct rndis_wlan_encr_key key; | 2100 | struct rndis_wlan_encr_key key; |
2076 | 2101 | ||
2077 | devdbg(usbdev, "rndis_set_default_key(%i)", key_index); | 2102 | netdev_dbg(usbdev->net, "%s(%i)\n", __func__, key_index); |
2078 | 2103 | ||
2079 | priv->encr_tx_key_index = key_index; | 2104 | priv->encr_tx_key_index = key_index; |
2080 | 2105 | ||
@@ -2188,7 +2213,8 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev) | |||
2188 | if (ret < 0) | 2213 | if (ret < 0) |
2189 | memset(bssid, 0, sizeof(bssid)); | 2214 | memset(bssid, 0, sizeof(bssid)); |
2190 | 2215 | ||
2191 | devdbg(usbdev, "link up work: [%pM] %s", bssid, roamed ? "roamed" : ""); | 2216 | netdev_dbg(usbdev->net, "link up work: [%pM]%s\n", |
2217 | bssid, roamed ? " roamed" : ""); | ||
2192 | 2218 | ||
2193 | /* Internal bss list in device always contains at least the currently | 2219 | /* Internal bss list in device always contains at least the currently |
2194 | * connected bss and we can get it to cfg80211 with | 2220 | * connected bss and we can get it to cfg80211 with |
@@ -2270,8 +2296,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev, | |||
2270 | /* must have at least one array entry */ | 2296 | /* must have at least one array entry */ |
2271 | if (len < offsetof(struct ndis_80211_status_indication, u) + | 2297 | if (len < offsetof(struct ndis_80211_status_indication, u) + |
2272 | sizeof(struct ndis_80211_auth_request)) { | 2298 | sizeof(struct ndis_80211_auth_request)) { |
2273 | devinfo(usbdev, "authentication indication: " | 2299 | netdev_info(usbdev->net, "authentication indication: too short message (%i)\n", |
2274 | "too short message (%i)", len); | 2300 | len); |
2275 | return; | 2301 | return; |
2276 | } | 2302 | } |
2277 | 2303 | ||
@@ -2298,8 +2324,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev, | |||
2298 | type = "group_error"; | 2324 | type = "group_error"; |
2299 | } | 2325 | } |
2300 | 2326 | ||
2301 | devinfo(usbdev, "authentication indication: %s (0x%08x)", type, | 2327 | netdev_info(usbdev->net, "authentication indication: %s (0x%08x)\n", |
2302 | le32_to_cpu(auth_req->flags)); | 2328 | type, le32_to_cpu(auth_req->flags)); |
2303 | 2329 | ||
2304 | if (pairwise_error) { | 2330 | if (pairwise_error) { |
2305 | key_type = NL80211_KEYTYPE_PAIRWISE; | 2331 | key_type = NL80211_KEYTYPE_PAIRWISE; |
@@ -2335,8 +2361,8 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, | |||
2335 | 2361 | ||
2336 | if (len < offsetof(struct ndis_80211_status_indication, u) + | 2362 | if (len < offsetof(struct ndis_80211_status_indication, u) + |
2337 | sizeof(struct ndis_80211_pmkid_cand_list)) { | 2363 | sizeof(struct ndis_80211_pmkid_cand_list)) { |
2338 | devinfo(usbdev, "pmkid candidate list indication: " | 2364 | netdev_info(usbdev->net, "pmkid candidate list indication: too short message (%i)\n", |
2339 | "too short message (%i)", len); | 2365 | len); |
2340 | return; | 2366 | return; |
2341 | } | 2367 | } |
2342 | 2368 | ||
@@ -2346,18 +2372,16 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, | |||
2346 | offsetof(struct ndis_80211_status_indication, u); | 2372 | offsetof(struct ndis_80211_status_indication, u); |
2347 | 2373 | ||
2348 | if (len < expected_len) { | 2374 | if (len < expected_len) { |
2349 | devinfo(usbdev, "pmkid candidate list indication: " | 2375 | netdev_info(usbdev->net, "pmkid candidate list indication: list larger than buffer (%i < %i)\n", |
2350 | "list larger than buffer (%i < %i)", | 2376 | len, expected_len); |
2351 | len, expected_len); | ||
2352 | return; | 2377 | return; |
2353 | } | 2378 | } |
2354 | 2379 | ||
2355 | cand_list = &indication->u.cand_list; | 2380 | cand_list = &indication->u.cand_list; |
2356 | 2381 | ||
2357 | devinfo(usbdev, "pmkid candidate list indication: " | 2382 | netdev_info(usbdev->net, "pmkid candidate list indication: version %i, candidates %i\n", |
2358 | "version %i, candidates %i", | 2383 | le32_to_cpu(cand_list->version), |
2359 | le32_to_cpu(cand_list->version), | 2384 | le32_to_cpu(cand_list->num_candidates)); |
2360 | le32_to_cpu(cand_list->num_candidates)); | ||
2361 | 2385 | ||
2362 | if (le32_to_cpu(cand_list->version) != 1) | 2386 | if (le32_to_cpu(cand_list->version) != 1) |
2363 | return; | 2387 | return; |
@@ -2366,8 +2390,8 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, | |||
2366 | struct ndis_80211_pmkid_candidate *cand = | 2390 | struct ndis_80211_pmkid_candidate *cand = |
2367 | &cand_list->candidate_list[i]; | 2391 | &cand_list->candidate_list[i]; |
2368 | 2392 | ||
2369 | devdbg(usbdev, "cand[%i]: flags: 0x%08x, bssid: %pM", | 2393 | netdev_dbg(usbdev->net, "cand[%i]: flags: 0x%08x, bssid: %pM\n", |
2370 | i, le32_to_cpu(cand->flags), cand->bssid); | 2394 | i, le32_to_cpu(cand->flags), cand->bssid); |
2371 | 2395 | ||
2372 | #if 0 | 2396 | #if 0 |
2373 | struct iw_pmkid_cand pcand; | 2397 | struct iw_pmkid_cand pcand; |
@@ -2398,15 +2422,14 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
2398 | len = le32_to_cpu(msg->length); | 2422 | len = le32_to_cpu(msg->length); |
2399 | 2423 | ||
2400 | if (len < 8) { | 2424 | if (len < 8) { |
2401 | devinfo(usbdev, "media specific indication, " | 2425 | netdev_info(usbdev->net, "media specific indication, ignore too short message (%i < 8)\n", |
2402 | "ignore too short message (%i < 8)", len); | 2426 | len); |
2403 | return; | 2427 | return; |
2404 | } | 2428 | } |
2405 | 2429 | ||
2406 | if (offset + len > buflen) { | 2430 | if (offset + len > buflen) { |
2407 | devinfo(usbdev, "media specific indication, " | 2431 | netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n", |
2408 | "too large to fit to buffer (%i > %i)", | 2432 | offset + len, buflen); |
2409 | offset + len, buflen); | ||
2410 | return; | 2433 | return; |
2411 | } | 2434 | } |
2412 | 2435 | ||
@@ -2414,13 +2437,13 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
2414 | 2437 | ||
2415 | switch (le32_to_cpu(indication->status_type)) { | 2438 | switch (le32_to_cpu(indication->status_type)) { |
2416 | case NDIS_80211_STATUSTYPE_RADIOSTATE: | 2439 | case NDIS_80211_STATUSTYPE_RADIOSTATE: |
2417 | devinfo(usbdev, "radio state indication: %i", | 2440 | netdev_info(usbdev->net, "radio state indication: %i\n", |
2418 | le32_to_cpu(indication->u.radio_status)); | 2441 | le32_to_cpu(indication->u.radio_status)); |
2419 | return; | 2442 | return; |
2420 | 2443 | ||
2421 | case NDIS_80211_STATUSTYPE_MEDIASTREAMMODE: | 2444 | case NDIS_80211_STATUSTYPE_MEDIASTREAMMODE: |
2422 | devinfo(usbdev, "media stream mode indication: %i", | 2445 | netdev_info(usbdev->net, "media stream mode indication: %i\n", |
2423 | le32_to_cpu(indication->u.media_stream_mode)); | 2446 | le32_to_cpu(indication->u.media_stream_mode)); |
2424 | return; | 2447 | return; |
2425 | 2448 | ||
2426 | case NDIS_80211_STATUSTYPE_AUTHENTICATION: | 2449 | case NDIS_80211_STATUSTYPE_AUTHENTICATION: |
@@ -2432,9 +2455,8 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
2432 | return; | 2455 | return; |
2433 | 2456 | ||
2434 | default: | 2457 | default: |
2435 | devinfo(usbdev, "media specific indication: " | 2458 | netdev_info(usbdev->net, "media specific indication: unknown status type 0x%08x\n", |
2436 | "unknown status type 0x%08x", | 2459 | le32_to_cpu(indication->status_type)); |
2437 | le32_to_cpu(indication->status_type)); | ||
2438 | } | 2460 | } |
2439 | } | 2461 | } |
2440 | 2462 | ||
@@ -2451,14 +2473,13 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
2451 | * and userspace to think that device is | 2473 | * and userspace to think that device is |
2452 | * roaming/reassociating when it isn't. | 2474 | * roaming/reassociating when it isn't. |
2453 | */ | 2475 | */ |
2454 | devdbg(usbdev, "ignored OID_802_11_ADD_KEY triggered " | 2476 | netdev_dbg(usbdev->net, "ignored OID_802_11_ADD_KEY triggered 'media connect'\n"); |
2455 | "'media connect'"); | ||
2456 | return; | 2477 | return; |
2457 | } | 2478 | } |
2458 | 2479 | ||
2459 | usbnet_pause_rx(usbdev); | 2480 | usbnet_pause_rx(usbdev); |
2460 | 2481 | ||
2461 | devinfo(usbdev, "media connect"); | 2482 | netdev_info(usbdev->net, "media connect\n"); |
2462 | 2483 | ||
2463 | /* queue work to avoid recursive calls into rndis_command */ | 2484 | /* queue work to avoid recursive calls into rndis_command */ |
2464 | set_bit(WORK_LINK_UP, &priv->work_pending); | 2485 | set_bit(WORK_LINK_UP, &priv->work_pending); |
@@ -2466,7 +2487,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
2466 | break; | 2487 | break; |
2467 | 2488 | ||
2468 | case RNDIS_STATUS_MEDIA_DISCONNECT: | 2489 | case RNDIS_STATUS_MEDIA_DISCONNECT: |
2469 | devinfo(usbdev, "media disconnect"); | 2490 | netdev_info(usbdev->net, "media disconnect\n"); |
2470 | 2491 | ||
2471 | /* queue work to avoid recursive calls into rndis_command */ | 2492 | /* queue work to avoid recursive calls into rndis_command */ |
2472 | set_bit(WORK_LINK_DOWN, &priv->work_pending); | 2493 | set_bit(WORK_LINK_DOWN, &priv->work_pending); |
@@ -2478,8 +2499,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
2478 | break; | 2499 | break; |
2479 | 2500 | ||
2480 | default: | 2501 | default: |
2481 | devinfo(usbdev, "indication: 0x%08x", | 2502 | netdev_info(usbdev->net, "indication: 0x%08x\n", |
2482 | le32_to_cpu(msg->status)); | 2503 | le32_to_cpu(msg->status)); |
2483 | break; | 2504 | break; |
2484 | } | 2505 | } |
2485 | } | 2506 | } |
@@ -2544,8 +2565,8 @@ static void rndis_device_poller(struct work_struct *work) | |||
2544 | if (ret == 0) | 2565 | if (ret == 0) |
2545 | priv->last_qual = level_to_qual(le32_to_cpu(rssi)); | 2566 | priv->last_qual = level_to_qual(le32_to_cpu(rssi)); |
2546 | 2567 | ||
2547 | devdbg(usbdev, "dev-poller: OID_802_11_RSSI -> %d, rssi:%d, qual: %d", | 2568 | netdev_dbg(usbdev->net, "dev-poller: OID_802_11_RSSI -> %d, rssi:%d, qual: %d\n", |
2548 | ret, le32_to_cpu(rssi), level_to_qual(le32_to_cpu(rssi))); | 2569 | ret, le32_to_cpu(rssi), level_to_qual(le32_to_cpu(rssi))); |
2549 | 2570 | ||
2550 | /* Workaround transfer stalls on poor quality links. | 2571 | /* Workaround transfer stalls on poor quality links. |
2551 | * TODO: find right way to fix these stalls (as stalls do not happen | 2572 | * TODO: find right way to fix these stalls (as stalls do not happen |
@@ -2838,11 +2859,11 @@ static int rndis_wlan_reset(struct usbnet *usbdev) | |||
2838 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 2859 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
2839 | int retval; | 2860 | int retval; |
2840 | 2861 | ||
2841 | devdbg(usbdev, "rndis_wlan_reset"); | 2862 | netdev_dbg(usbdev->net, "%s()\n", __func__); |
2842 | 2863 | ||
2843 | retval = rndis_reset(usbdev); | 2864 | retval = rndis_reset(usbdev); |
2844 | if (retval) | 2865 | if (retval) |
2845 | devwarn(usbdev, "rndis_reset() failed: %d", retval); | 2866 | netdev_warn(usbdev->net, "rndis_reset failed: %d\n", retval); |
2846 | 2867 | ||
2847 | /* rndis_reset cleared multicast list, so restore here. | 2868 | /* rndis_reset cleared multicast list, so restore here. |
2848 | (set_multicast_list() also turns on current packet filter) */ | 2869 | (set_multicast_list() also turns on current packet filter) */ |
@@ -2860,7 +2881,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev) | |||
2860 | int retval; | 2881 | int retval; |
2861 | __le32 filter; | 2882 | __le32 filter; |
2862 | 2883 | ||
2863 | devdbg(usbdev, "rndis_wlan_stop"); | 2884 | netdev_dbg(usbdev->net, "%s()\n", __func__); |
2864 | 2885 | ||
2865 | retval = disassociate(usbdev, false); | 2886 | retval = disassociate(usbdev, false); |
2866 | 2887 | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 8ce61359bf73..df1e83dd9a54 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32); | |||
214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); | 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); |
215 | extern int usbnet_nway_reset(struct net_device *net); | 215 | extern int usbnet_nway_reset(struct net_device *net); |
216 | 216 | ||
217 | /* messaging support includes the interface name, so it must not be | ||
218 | * used before it has one ... notably, in minidriver bind() calls. | ||
219 | */ | ||
220 | #ifdef DEBUG | ||
221 | #define devdbg(usbnet, fmt, arg...) \ | ||
222 | printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
223 | #else | ||
224 | #define devdbg(usbnet, fmt, arg...) \ | ||
225 | ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \ | ||
226 | ## arg); 0; }) | ||
227 | #endif | ||
228 | |||
229 | #define deverr(usbnet, fmt, arg...) \ | ||
230 | printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
231 | #define devwarn(usbnet, fmt, arg...) \ | ||
232 | printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
233 | |||
234 | #define devinfo(usbnet, fmt, arg...) \ | ||
235 | printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \ | ||
236 | |||
237 | |||
238 | #endif /* __LINUX_USB_USBNET_H */ | 217 | #endif /* __LINUX_USB_USBNET_H */ |