aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-19 05:46:14 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-20 17:53:14 -0400
commit49ae25b03c8622e381e4e54d066cd4ee2dbcc3e2 (patch)
tree858136fb869d6077abcaca9abb05ef50146dc098 /drivers/net/usb
parent4308fc58dceda40fac8a8d9c05b7cfba0a6bbed3 (diff)
USB: remove dbg() usage in USB networking drivers
The dbg() USB macro is so old, it predates me. The USB networking drivers are the last hold-out using this macro, and we want to get rid of it, so replace the usage of it with the proper netdev_dbg() or dev_dbg() (depending on the context) calls. Some places we end up using a local variable for the debug call, so also convert the other existing dev_* calls to use it as well, to save tiny amounts of code space. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/asix_devices.c36
-rw-r--r--drivers/net/usb/catc.c55
-rw-r--r--drivers/net/usb/gl620a.c10
-rw-r--r--drivers/net/usb/kaweth.c134
-rw-r--r--drivers/net/usb/net1080.c48
-rw-r--r--drivers/net/usb/rtl8150.c6
6 files changed, 152 insertions, 137 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 4fd48df6b989..8d5fdf103bcd 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -221,7 +221,8 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
221 /* Get the MAC address */ 221 /* Get the MAC address */
222 ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf); 222 ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
223 if (ret < 0) { 223 if (ret < 0) {
224 dbg("read AX_CMD_READ_NODE_ID failed: %d", ret); 224 netdev_dbg(dev->net, "read AX_CMD_READ_NODE_ID failed: %d\n",
225 ret);
225 goto out; 226 goto out;
226 } 227 }
227 memcpy(dev->net->dev_addr, buf, ETH_ALEN); 228 memcpy(dev->net->dev_addr, buf, ETH_ALEN);
@@ -303,7 +304,7 @@ static int ax88772_reset(struct usbnet *dev)
303 304
304 ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL); 305 ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
305 if (ret < 0) { 306 if (ret < 0) {
306 dbg("Select PHY #1 failed: %d", ret); 307 netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
307 goto out; 308 goto out;
308 } 309 }
309 310
@@ -331,13 +332,13 @@ static int ax88772_reset(struct usbnet *dev)
331 332
332 msleep(150); 333 msleep(150);
333 rx_ctl = asix_read_rx_ctl(dev); 334 rx_ctl = asix_read_rx_ctl(dev);
334 dbg("RX_CTL is 0x%04x after software reset", rx_ctl); 335 netdev_dbg(dev->net, "RX_CTL is 0x%04x after software reset\n", rx_ctl);
335 ret = asix_write_rx_ctl(dev, 0x0000); 336 ret = asix_write_rx_ctl(dev, 0x0000);
336 if (ret < 0) 337 if (ret < 0)
337 goto out; 338 goto out;
338 339
339 rx_ctl = asix_read_rx_ctl(dev); 340 rx_ctl = asix_read_rx_ctl(dev);
340 dbg("RX_CTL is 0x%04x setting to 0x0000", rx_ctl); 341 netdev_dbg(dev->net, "RX_CTL is 0x%04x setting to 0x0000\n", rx_ctl);
341 342
342 ret = asix_sw_reset(dev, AX_SWRESET_PRL); 343 ret = asix_sw_reset(dev, AX_SWRESET_PRL);
343 if (ret < 0) 344 if (ret < 0)
@@ -364,7 +365,7 @@ static int ax88772_reset(struct usbnet *dev)
364 AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT, 365 AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
365 AX88772_IPG2_DEFAULT, 0, NULL); 366 AX88772_IPG2_DEFAULT, 0, NULL);
366 if (ret < 0) { 367 if (ret < 0) {
367 dbg("Write IPG,IPG1,IPG2 failed: %d", ret); 368 netdev_dbg(dev->net, "Write IPG,IPG1,IPG2 failed: %d\n", ret);
368 goto out; 369 goto out;
369 } 370 }
370 371
@@ -381,10 +382,13 @@ static int ax88772_reset(struct usbnet *dev)
381 goto out; 382 goto out;
382 383
383 rx_ctl = asix_read_rx_ctl(dev); 384 rx_ctl = asix_read_rx_ctl(dev);
384 dbg("RX_CTL is 0x%04x after all initializations", rx_ctl); 385 netdev_dbg(dev->net, "RX_CTL is 0x%04x after all initializations\n",
386 rx_ctl);
385 387
386 rx_ctl = asix_read_medium_status(dev); 388 rx_ctl = asix_read_medium_status(dev);
387 dbg("Medium Status is 0x%04x after all initializations", rx_ctl); 389 netdev_dbg(dev->net,
390 "Medium Status is 0x%04x after all initializations\n",
391 rx_ctl);
388 392
389 return 0; 393 return 0;
390 394
@@ -416,7 +420,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
416 /* Get the MAC address */ 420 /* Get the MAC address */
417 ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf); 421 ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
418 if (ret < 0) { 422 if (ret < 0) {
419 dbg("Failed to read MAC address: %d", ret); 423 netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
420 return ret; 424 return ret;
421 } 425 }
422 memcpy(dev->net->dev_addr, buf, ETH_ALEN); 426 memcpy(dev->net->dev_addr, buf, ETH_ALEN);
@@ -439,7 +443,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
439 /* Reset the PHY to normal operation mode */ 443 /* Reset the PHY to normal operation mode */
440 ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL); 444 ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
441 if (ret < 0) { 445 if (ret < 0) {
442 dbg("Select PHY #1 failed: %d", ret); 446 netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
443 return ret; 447 return ret;
444 } 448 }
445 449
@@ -459,7 +463,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
459 463
460 /* Read PHYID register *AFTER* the PHY was reset properly */ 464 /* Read PHYID register *AFTER* the PHY was reset properly */
461 phyid = asix_get_phyid(dev); 465 phyid = asix_get_phyid(dev);
462 dbg("PHYID=0x%08x", phyid); 466 netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
463 467
464 /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */ 468 /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
465 if (dev->driver_info->flags & FLAG_FRAMING_AX) { 469 if (dev->driver_info->flags & FLAG_FRAMING_AX) {
@@ -575,13 +579,13 @@ static int ax88178_reset(struct usbnet *dev)
575 u32 phyid; 579 u32 phyid;
576 580
577 asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status); 581 asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status);
578 dbg("GPIO Status: 0x%04x", status); 582 netdev_dbg(dev->net, "GPIO Status: 0x%04x\n", status);
579 583
580 asix_write_cmd(dev, AX_CMD_WRITE_ENABLE, 0, 0, 0, NULL); 584 asix_write_cmd(dev, AX_CMD_WRITE_ENABLE, 0, 0, 0, NULL);
581 asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x0017, 0, 2, &eeprom); 585 asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x0017, 0, 2, &eeprom);
582 asix_write_cmd(dev, AX_CMD_WRITE_DISABLE, 0, 0, 0, NULL); 586 asix_write_cmd(dev, AX_CMD_WRITE_DISABLE, 0, 0, 0, NULL);
583 587
584 dbg("EEPROM index 0x17 is 0x%04x", eeprom); 588 netdev_dbg(dev->net, "EEPROM index 0x17 is 0x%04x\n", eeprom);
585 589
586 if (eeprom == cpu_to_le16(0xffff)) { 590 if (eeprom == cpu_to_le16(0xffff)) {
587 data->phymode = PHY_MODE_MARVELL; 591 data->phymode = PHY_MODE_MARVELL;
@@ -592,7 +596,7 @@ static int ax88178_reset(struct usbnet *dev)
592 data->ledmode = le16_to_cpu(eeprom) >> 8; 596 data->ledmode = le16_to_cpu(eeprom) >> 8;
593 gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1; 597 gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1;
594 } 598 }
595 dbg("GPIO0: %d, PhyMode: %d", gpio0, data->phymode); 599 netdev_dbg(dev->net, "GPIO0: %d, PhyMode: %d\n", gpio0, data->phymode);
596 600
597 /* Power up external GigaPHY through AX88178 GPIO pin */ 601 /* Power up external GigaPHY through AX88178 GPIO pin */
598 asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40); 602 asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40);
@@ -601,14 +605,14 @@ static int ax88178_reset(struct usbnet *dev)
601 asix_write_gpio(dev, 0x001c, 300); 605 asix_write_gpio(dev, 0x001c, 300);
602 asix_write_gpio(dev, 0x003c, 30); 606 asix_write_gpio(dev, 0x003c, 30);
603 } else { 607 } else {
604 dbg("gpio phymode == 1 path"); 608 netdev_dbg(dev->net, "gpio phymode == 1 path\n");
605 asix_write_gpio(dev, AX_GPIO_GPO1EN, 30); 609 asix_write_gpio(dev, AX_GPIO_GPO1EN, 30);
606 asix_write_gpio(dev, AX_GPIO_GPO1EN | AX_GPIO_GPO_1, 30); 610 asix_write_gpio(dev, AX_GPIO_GPO1EN | AX_GPIO_GPO_1, 30);
607 } 611 }
608 612
609 /* Read PHYID register *AFTER* powering up PHY */ 613 /* Read PHYID register *AFTER* powering up PHY */
610 phyid = asix_get_phyid(dev); 614 phyid = asix_get_phyid(dev);
611 dbg("PHYID=0x%08x", phyid); 615 netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
612 616
613 /* Set AX88178 to enable MII/GMII/RGMII interface for external PHY */ 617 /* Set AX88178 to enable MII/GMII/RGMII interface for external PHY */
614 asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL); 618 asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL);
@@ -770,7 +774,7 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
770 /* Get the MAC address */ 774 /* Get the MAC address */
771 ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf); 775 ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
772 if (ret < 0) { 776 if (ret < 0) {
773 dbg("Failed to read MAC address: %d", ret); 777 netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
774 return ret; 778 return ret;
775 } 779 }
776 memcpy(dev->net->dev_addr, buf, ETH_ALEN); 780 memcpy(dev->net->dev_addr, buf, ETH_ALEN);
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 26c5bebd9eca..18d9579123ea 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -236,7 +236,8 @@ static void catc_rx_done(struct urb *urb)
236 } 236 }
237 237
238 if (status) { 238 if (status) {
239 dbg("rx_done, status %d, length %d", status, urb->actual_length); 239 dev_dbg(&urb->dev->dev, "rx_done, status %d, length %d\n",
240 status, urb->actual_length);
240 return; 241 return;
241 } 242 }
242 243
@@ -275,10 +276,11 @@ static void catc_rx_done(struct urb *urb)
275 if (atomic_read(&catc->recq_sz)) { 276 if (atomic_read(&catc->recq_sz)) {
276 int state; 277 int state;
277 atomic_dec(&catc->recq_sz); 278 atomic_dec(&catc->recq_sz);
278 dbg("getting extra packet"); 279 netdev_dbg(catc->netdev, "getting extra packet\n");
279 urb->dev = catc->usbdev; 280 urb->dev = catc->usbdev;
280 if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { 281 if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
281 dbg("submit(rx_urb) status %d", state); 282 netdev_dbg(catc->netdev,
283 "submit(rx_urb) status %d\n", state);
282 } 284 }
283 } else { 285 } else {
284 clear_bit(RX_RUNNING, &catc->flags); 286 clear_bit(RX_RUNNING, &catc->flags);
@@ -317,18 +319,20 @@ static void catc_irq_done(struct urb *urb)
317 return; 319 return;
318 /* -EPIPE: should clear the halt */ 320 /* -EPIPE: should clear the halt */
319 default: /* error */ 321 default: /* error */
320 dbg("irq_done, status %d, data %02x %02x.", status, data[0], data[1]); 322 dev_dbg(&urb->dev->dev,
323 "irq_done, status %d, data %02x %02x.\n",
324 status, data[0], data[1]);
321 goto resubmit; 325 goto resubmit;
322 } 326 }
323 327
324 if (linksts == LinkGood) { 328 if (linksts == LinkGood) {
325 netif_carrier_on(catc->netdev); 329 netif_carrier_on(catc->netdev);
326 dbg("link ok"); 330 netdev_dbg(catc->netdev, "link ok\n");
327 } 331 }
328 332
329 if (linksts == LinkBad) { 333 if (linksts == LinkBad) {
330 netif_carrier_off(catc->netdev); 334 netif_carrier_off(catc->netdev);
331 dbg("link bad"); 335 netdev_dbg(catc->netdev, "link bad\n");
332 } 336 }
333 337
334 if (hasdata) { 338 if (hasdata) {
@@ -385,7 +389,7 @@ static void catc_tx_done(struct urb *urb)
385 int r, status = urb->status; 389 int r, status = urb->status;
386 390
387 if (status == -ECONNRESET) { 391 if (status == -ECONNRESET) {
388 dbg("Tx Reset."); 392 dev_dbg(&urb->dev->dev, "Tx Reset.\n");
389 urb->status = 0; 393 urb->status = 0;
390 catc->netdev->trans_start = jiffies; 394 catc->netdev->trans_start = jiffies;
391 catc->netdev->stats.tx_errors++; 395 catc->netdev->stats.tx_errors++;
@@ -395,7 +399,8 @@ static void catc_tx_done(struct urb *urb)
395 } 399 }
396 400
397 if (status) { 401 if (status) {
398 dbg("tx_done, status %d, length %d", status, urb->actual_length); 402 dev_dbg(&urb->dev->dev, "tx_done, status %d, length %d\n",
403 status, urb->actual_length);
399 return; 404 return;
400 } 405 }
401 406
@@ -511,7 +516,8 @@ static void catc_ctrl_done(struct urb *urb)
511 int status = urb->status; 516 int status = urb->status;
512 517
513 if (status) 518 if (status)
514 dbg("ctrl_done, status %d, len %d.", status, urb->actual_length); 519 dev_dbg(&urb->dev->dev, "ctrl_done, status %d, len %d.\n",
520 status, urb->actual_length);
515 521
516 spin_lock_irqsave(&catc->ctrl_lock, flags); 522 spin_lock_irqsave(&catc->ctrl_lock, flags);
517 523
@@ -667,7 +673,9 @@ static void catc_set_multicast_list(struct net_device *netdev)
667 f5u011_mchash_async(catc, catc->multicast); 673 f5u011_mchash_async(catc, catc->multicast);
668 if (catc->rxmode[0] != rx) { 674 if (catc->rxmode[0] != rx) {
669 catc->rxmode[0] = rx; 675 catc->rxmode[0] = rx;
670 dbg("Setting RX mode to %2.2X %2.2X", catc->rxmode[0], catc->rxmode[1]); 676 netdev_dbg(catc->netdev,
677 "Setting RX mode to %2.2X %2.2X\n",
678 catc->rxmode[0], catc->rxmode[1]);
671 f5u011_rxmode_async(catc, catc->rxmode); 679 f5u011_rxmode_async(catc, catc->rxmode);
672 } 680 }
673 } 681 }
@@ -766,6 +774,7 @@ static const struct net_device_ops catc_netdev_ops = {
766 774
767static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id) 775static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id)
768{ 776{
777 struct device *dev = &intf->dev;
769 struct usb_device *usbdev = interface_to_usbdev(intf); 778 struct usb_device *usbdev = interface_to_usbdev(intf);
770 struct net_device *netdev; 779 struct net_device *netdev;
771 struct catc *catc; 780 struct catc *catc;
@@ -774,7 +783,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
774 783
775 if (usb_set_interface(usbdev, 784 if (usb_set_interface(usbdev,
776 intf->altsetting->desc.bInterfaceNumber, 1)) { 785 intf->altsetting->desc.bInterfaceNumber, 1)) {
777 dev_err(&intf->dev, "Can't set altsetting 1.\n"); 786 dev_err(dev, "Can't set altsetting 1.\n");
778 return -EIO; 787 return -EIO;
779 } 788 }
780 789
@@ -817,7 +826,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
817 if (le16_to_cpu(usbdev->descriptor.idVendor) == 0x0423 && 826 if (le16_to_cpu(usbdev->descriptor.idVendor) == 0x0423 &&
818 le16_to_cpu(usbdev->descriptor.idProduct) == 0xa && 827 le16_to_cpu(usbdev->descriptor.idProduct) == 0xa &&
819 le16_to_cpu(catc->usbdev->descriptor.bcdDevice) == 0x0130) { 828 le16_to_cpu(catc->usbdev->descriptor.bcdDevice) == 0x0130) {
820 dbg("Testing for f5u011"); 829 dev_dbg(dev, "Testing for f5u011\n");
821 catc->is_f5u011 = 1; 830 catc->is_f5u011 = 1;
822 atomic_set(&catc->recq_sz, 0); 831 atomic_set(&catc->recq_sz, 0);
823 pktsz = RX_PKT_SZ; 832 pktsz = RX_PKT_SZ;
@@ -838,7 +847,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
838 catc->irq_buf, 2, catc_irq_done, catc, 1); 847 catc->irq_buf, 2, catc_irq_done, catc, 1);
839 848
840 if (!catc->is_f5u011) { 849 if (!catc->is_f5u011) {
841 dbg("Checking memory size\n"); 850 dev_dbg(dev, "Checking memory size\n");
842 851
843 i = 0x12345678; 852 i = 0x12345678;
844 catc_write_mem(catc, 0x7a80, &i, 4); 853 catc_write_mem(catc, 0x7a80, &i, 4);
@@ -850,7 +859,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
850 case 0x12345678: 859 case 0x12345678:
851 catc_set_reg(catc, TxBufCount, 8); 860 catc_set_reg(catc, TxBufCount, 8);
852 catc_set_reg(catc, RxBufCount, 32); 861 catc_set_reg(catc, RxBufCount, 32);
853 dbg("64k Memory\n"); 862 dev_dbg(dev, "64k Memory\n");
854 break; 863 break;
855 default: 864 default:
856 dev_warn(&intf->dev, 865 dev_warn(&intf->dev,
@@ -858,49 +867,49 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
858 case 0x87654321: 867 case 0x87654321:
859 catc_set_reg(catc, TxBufCount, 4); 868 catc_set_reg(catc, TxBufCount, 4);
860 catc_set_reg(catc, RxBufCount, 16); 869 catc_set_reg(catc, RxBufCount, 16);
861 dbg("32k Memory\n"); 870 dev_dbg(dev, "32k Memory\n");
862 break; 871 break;
863 } 872 }
864 873
865 dbg("Getting MAC from SEEROM."); 874 dev_dbg(dev, "Getting MAC from SEEROM.\n");
866 875
867 catc_get_mac(catc, netdev->dev_addr); 876 catc_get_mac(catc, netdev->dev_addr);
868 877
869 dbg("Setting MAC into registers."); 878 dev_dbg(dev, "Setting MAC into registers.\n");
870 879
871 for (i = 0; i < 6; i++) 880 for (i = 0; i < 6; i++)
872 catc_set_reg(catc, StationAddr0 - i, netdev->dev_addr[i]); 881 catc_set_reg(catc, StationAddr0 - i, netdev->dev_addr[i]);
873 882
874 dbg("Filling the multicast list."); 883 dev_dbg(dev, "Filling the multicast list.\n");
875 884
876 memset(broadcast, 0xff, 6); 885 memset(broadcast, 0xff, 6);
877 catc_multicast(broadcast, catc->multicast); 886 catc_multicast(broadcast, catc->multicast);
878 catc_multicast(netdev->dev_addr, catc->multicast); 887 catc_multicast(netdev->dev_addr, catc->multicast);
879 catc_write_mem(catc, 0xfa80, catc->multicast, 64); 888 catc_write_mem(catc, 0xfa80, catc->multicast, 64);
880 889
881 dbg("Clearing error counters."); 890 dev_dbg(dev, "Clearing error counters.\n");
882 891
883 for (i = 0; i < 8; i++) 892 for (i = 0; i < 8; i++)
884 catc_set_reg(catc, EthStats + i, 0); 893 catc_set_reg(catc, EthStats + i, 0);
885 catc->last_stats = jiffies; 894 catc->last_stats = jiffies;
886 895
887 dbg("Enabling."); 896 dev_dbg(dev, "Enabling.\n");
888 897
889 catc_set_reg(catc, MaxBurst, RX_MAX_BURST); 898 catc_set_reg(catc, MaxBurst, RX_MAX_BURST);
890 catc_set_reg(catc, OpModes, OpTxMerge | OpRxMerge | OpLenInclude | Op3MemWaits); 899 catc_set_reg(catc, OpModes, OpTxMerge | OpRxMerge | OpLenInclude | Op3MemWaits);
891 catc_set_reg(catc, LEDCtrl, LEDLink); 900 catc_set_reg(catc, LEDCtrl, LEDLink);
892 catc_set_reg(catc, RxUnit, RxEnable | RxPolarity | RxMultiCast); 901 catc_set_reg(catc, RxUnit, RxEnable | RxPolarity | RxMultiCast);
893 } else { 902 } else {
894 dbg("Performing reset\n"); 903 dev_dbg(dev, "Performing reset\n");
895 catc_reset(catc); 904 catc_reset(catc);
896 catc_get_mac(catc, netdev->dev_addr); 905 catc_get_mac(catc, netdev->dev_addr);
897 906
898 dbg("Setting RX Mode"); 907 dev_dbg(dev, "Setting RX Mode\n");
899 catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast; 908 catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast;
900 catc->rxmode[1] = 0; 909 catc->rxmode[1] = 0;
901 f5u011_rxmode(catc, catc->rxmode); 910 f5u011_rxmode(catc, catc->rxmode);
902 } 911 }
903 dbg("Init done."); 912 dev_dbg(dev, "Init done.\n");
904 printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %pM.\n", 913 printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %pM.\n",
905 netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate", 914 netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate",
906 usbdev->bus->bus_name, usbdev->devpath, netdev->dev_addr); 915 usbdev->bus->bus_name, usbdev->devpath, netdev->dev_addr);
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c
index db3c8021f2a3..a7e3f4e55bf3 100644
--- a/drivers/net/usb/gl620a.c
+++ b/drivers/net/usb/gl620a.c
@@ -91,7 +91,9 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
91 // get the packet count of the received skb 91 // get the packet count of the received skb
92 count = le32_to_cpu(header->packet_count); 92 count = le32_to_cpu(header->packet_count);
93 if (count > GL_MAX_TRANSMIT_PACKETS) { 93 if (count > GL_MAX_TRANSMIT_PACKETS) {
94 dbg("genelink: invalid received packet count %u", count); 94 netdev_dbg(dev->net,
95 "genelink: invalid received packet count %u\n",
96 count);
95 return 0; 97 return 0;
96 } 98 }
97 99
@@ -107,7 +109,8 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
107 109
108 // this may be a broken packet 110 // this may be a broken packet
109 if (size > GL_MAX_PACKET_LEN) { 111 if (size > GL_MAX_PACKET_LEN) {
110 dbg("genelink: invalid rx length %d", size); 112 netdev_dbg(dev->net, "genelink: invalid rx length %d\n",
113 size);
111 return 0; 114 return 0;
112 } 115 }
113 116
@@ -133,7 +136,8 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
133 skb_pull(skb, 4); 136 skb_pull(skb, 4);
134 137
135 if (skb->len > GL_MAX_PACKET_LEN) { 138 if (skb->len > GL_MAX_PACKET_LEN) {
136 dbg("genelink: invalid rx length %d", skb->len); 139 netdev_dbg(dev->net, "genelink: invalid rx length %d\n",
140 skb->len);
137 return 0; 141 return 0;
138 } 142 }
139 return 1; 143 return 1;
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index c3d03490c97d..c75e11e1b385 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -267,19 +267,16 @@ static int kaweth_control(struct kaweth_device *kaweth,
267 struct usb_ctrlrequest *dr; 267 struct usb_ctrlrequest *dr;
268 int retval; 268 int retval;
269 269
270 dbg("kaweth_control()"); 270 netdev_dbg(kaweth->net, "kaweth_control()\n");
271 271
272 if(in_interrupt()) { 272 if(in_interrupt()) {
273 dbg("in_interrupt()"); 273 netdev_dbg(kaweth->net, "in_interrupt()\n");
274 return -EBUSY; 274 return -EBUSY;
275 } 275 }
276 276
277 dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); 277 dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
278 278 if (!dr)
279 if (!dr) {
280 dbg("kmalloc() failed");
281 return -ENOMEM; 279 return -ENOMEM;
282 }
283 280
284 dr->bRequestType = requesttype; 281 dr->bRequestType = requesttype;
285 dr->bRequest = request; 282 dr->bRequest = request;
@@ -305,7 +302,7 @@ static int kaweth_read_configuration(struct kaweth_device *kaweth)
305{ 302{
306 int retval; 303 int retval;
307 304
308 dbg("Reading kaweth configuration"); 305 netdev_dbg(kaweth->net, "Reading kaweth configuration\n");
309 306
310 retval = kaweth_control(kaweth, 307 retval = kaweth_control(kaweth,
311 usb_rcvctrlpipe(kaweth->dev, 0), 308 usb_rcvctrlpipe(kaweth->dev, 0),
@@ -327,7 +324,7 @@ static int kaweth_set_urb_size(struct kaweth_device *kaweth, __u16 urb_size)
327{ 324{
328 int retval; 325 int retval;
329 326
330 dbg("Setting URB size to %d", (unsigned)urb_size); 327 netdev_dbg(kaweth->net, "Setting URB size to %d\n", (unsigned)urb_size);
331 328
332 retval = kaweth_control(kaweth, 329 retval = kaweth_control(kaweth,
333 usb_sndctrlpipe(kaweth->dev, 0), 330 usb_sndctrlpipe(kaweth->dev, 0),
@@ -349,7 +346,7 @@ static int kaweth_set_sofs_wait(struct kaweth_device *kaweth, __u16 sofs_wait)
349{ 346{
350 int retval; 347 int retval;
351 348
352 dbg("Set SOFS wait to %d", (unsigned)sofs_wait); 349 netdev_dbg(kaweth->net, "Set SOFS wait to %d\n", (unsigned)sofs_wait);
353 350
354 retval = kaweth_control(kaweth, 351 retval = kaweth_control(kaweth,
355 usb_sndctrlpipe(kaweth->dev, 0), 352 usb_sndctrlpipe(kaweth->dev, 0),
@@ -372,7 +369,8 @@ static int kaweth_set_receive_filter(struct kaweth_device *kaweth,
372{ 369{
373 int retval; 370 int retval;
374 371
375 dbg("Set receive filter to %d", (unsigned)receive_filter); 372 netdev_dbg(kaweth->net, "Set receive filter to %d\n",
373 (unsigned)receive_filter);
376 374
377 retval = kaweth_control(kaweth, 375 retval = kaweth_control(kaweth,
378 usb_sndctrlpipe(kaweth->dev, 0), 376 usb_sndctrlpipe(kaweth->dev, 0),
@@ -421,12 +419,13 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
421 kaweth->firmware_buf[4] = type; 419 kaweth->firmware_buf[4] = type;
422 kaweth->firmware_buf[5] = interrupt; 420 kaweth->firmware_buf[5] = interrupt;
423 421
424 dbg("High: %i, Low:%i", kaweth->firmware_buf[3], 422 netdev_dbg(kaweth->net, "High: %i, Low:%i\n", kaweth->firmware_buf[3],
425 kaweth->firmware_buf[2]); 423 kaweth->firmware_buf[2]);
426 424
427 dbg("Downloading firmware at %p to kaweth device at %p", 425 netdev_dbg(kaweth->net,
428 fw->data, kaweth); 426 "Downloading firmware at %p to kaweth device at %p\n",
429 dbg("Firmware length: %d", data_len); 427 fw->data, kaweth);
428 netdev_dbg(kaweth->net, "Firmware length: %d\n", data_len);
430 429
431 return kaweth_control(kaweth, 430 return kaweth_control(kaweth,
432 usb_sndctrlpipe(kaweth->dev, 0), 431 usb_sndctrlpipe(kaweth->dev, 0),
@@ -454,7 +453,7 @@ static int kaweth_trigger_firmware(struct kaweth_device *kaweth,
454 kaweth->firmware_buf[6] = 0x00; 453 kaweth->firmware_buf[6] = 0x00;
455 kaweth->firmware_buf[7] = 0x00; 454 kaweth->firmware_buf[7] = 0x00;
456 455
457 dbg("Triggering firmware"); 456 netdev_dbg(kaweth->net, "Triggering firmware\n");
458 457
459 return kaweth_control(kaweth, 458 return kaweth_control(kaweth,
460 usb_sndctrlpipe(kaweth->dev, 0), 459 usb_sndctrlpipe(kaweth->dev, 0),
@@ -474,11 +473,11 @@ static int kaweth_reset(struct kaweth_device *kaweth)
474{ 473{
475 int result; 474 int result;
476 475
477 dbg("kaweth_reset(%p)", kaweth); 476 netdev_dbg(kaweth->net, "kaweth_reset(%p)\n", kaweth);
478 result = usb_reset_configuration(kaweth->dev); 477 result = usb_reset_configuration(kaweth->dev);
479 mdelay(10); 478 mdelay(10);
480 479
481 dbg("kaweth_reset() returns %d.",result); 480 netdev_dbg(kaweth->net, "kaweth_reset() returns %d.\n", result);
482 481
483 return result; 482 return result;
484} 483}
@@ -595,6 +594,7 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth);
595 ****************************************************************/ 594 ****************************************************************/
596static void kaweth_usb_receive(struct urb *urb) 595static void kaweth_usb_receive(struct urb *urb)
597{ 596{
597 struct device *dev = &urb->dev->dev;
598 struct kaweth_device *kaweth = urb->context; 598 struct kaweth_device *kaweth = urb->context;
599 struct net_device *net = kaweth->net; 599 struct net_device *net = kaweth->net;
600 int status = urb->status; 600 int status = urb->status;
@@ -610,25 +610,25 @@ static void kaweth_usb_receive(struct urb *urb)
610 kaweth->stats.rx_errors++; 610 kaweth->stats.rx_errors++;
611 kaweth->end = 1; 611 kaweth->end = 1;
612 wake_up(&kaweth->term_wait); 612 wake_up(&kaweth->term_wait);
613 dbg("Status was -EPIPE."); 613 dev_dbg(dev, "Status was -EPIPE.\n");
614 return; 614 return;
615 } 615 }
616 if (unlikely(status == -ECONNRESET || status == -ESHUTDOWN)) { 616 if (unlikely(status == -ECONNRESET || status == -ESHUTDOWN)) {
617 /* we are killed - set a flag and wake the disconnect handler */ 617 /* we are killed - set a flag and wake the disconnect handler */
618 kaweth->end = 1; 618 kaweth->end = 1;
619 wake_up(&kaweth->term_wait); 619 wake_up(&kaweth->term_wait);
620 dbg("Status was -ECONNRESET or -ESHUTDOWN."); 620 dev_dbg(dev, "Status was -ECONNRESET or -ESHUTDOWN.\n");
621 return; 621 return;
622 } 622 }
623 if (unlikely(status == -EPROTO || status == -ETIME || 623 if (unlikely(status == -EPROTO || status == -ETIME ||
624 status == -EILSEQ)) { 624 status == -EILSEQ)) {
625 kaweth->stats.rx_errors++; 625 kaweth->stats.rx_errors++;
626 dbg("Status was -EPROTO, -ETIME, or -EILSEQ."); 626 dev_dbg(dev, "Status was -EPROTO, -ETIME, or -EILSEQ.\n");
627 return; 627 return;
628 } 628 }
629 if (unlikely(status == -EOVERFLOW)) { 629 if (unlikely(status == -EOVERFLOW)) {
630 kaweth->stats.rx_errors++; 630 kaweth->stats.rx_errors++;
631 dbg("Status was -EOVERFLOW."); 631 dev_dbg(dev, "Status was -EOVERFLOW.\n");
632 } 632 }
633 spin_lock(&kaweth->device_lock); 633 spin_lock(&kaweth->device_lock);
634 if (IS_BLOCKED(kaweth->status)) { 634 if (IS_BLOCKED(kaweth->status)) {
@@ -687,7 +687,7 @@ static int kaweth_open(struct net_device *net)
687 struct kaweth_device *kaweth = netdev_priv(net); 687 struct kaweth_device *kaweth = netdev_priv(net);
688 int res; 688 int res;
689 689
690 dbg("Opening network device."); 690 netdev_dbg(kaweth->net, "Opening network device.\n");
691 691
692 res = usb_autopm_get_interface(kaweth->intf); 692 res = usb_autopm_get_interface(kaweth->intf);
693 if (res) { 693 if (res) {
@@ -787,7 +787,8 @@ static void kaweth_usb_transmit_complete(struct urb *urb)
787 787
788 if (unlikely(status != 0)) 788 if (unlikely(status != 0))
789 if (status != -ENOENT) 789 if (status != -ENOENT)
790 dbg("%s: TX status %d.", kaweth->net->name, status); 790 dev_dbg(&urb->dev->dev, "%s: TX status %d.\n",
791 kaweth->net->name, status);
791 792
792 netif_wake_queue(kaweth->net); 793 netif_wake_queue(kaweth->net);
793 dev_kfree_skb_irq(skb); 794 dev_kfree_skb_irq(skb);
@@ -871,7 +872,7 @@ static void kaweth_set_rx_mode(struct net_device *net)
871 KAWETH_PACKET_FILTER_BROADCAST | 872 KAWETH_PACKET_FILTER_BROADCAST |
872 KAWETH_PACKET_FILTER_MULTICAST; 873 KAWETH_PACKET_FILTER_MULTICAST;
873 874
874 dbg("Setting Rx mode to %d", packet_filter_bitmap); 875 netdev_dbg(net, "Setting Rx mode to %d\n", packet_filter_bitmap);
875 876
876 netif_stop_queue(net); 877 netif_stop_queue(net);
877 878
@@ -916,7 +917,8 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth)
916 result); 917 result);
917 } 918 }
918 else { 919 else {
919 dbg("Set Rx mode to %d", packet_filter_bitmap); 920 netdev_dbg(kaweth->net, "Set Rx mode to %d\n",
921 packet_filter_bitmap);
920 } 922 }
921} 923}
922 924
@@ -951,7 +953,7 @@ static int kaweth_suspend(struct usb_interface *intf, pm_message_t message)
951 struct kaweth_device *kaweth = usb_get_intfdata(intf); 953 struct kaweth_device *kaweth = usb_get_intfdata(intf);
952 unsigned long flags; 954 unsigned long flags;
953 955
954 dbg("Suspending device"); 956 dev_dbg(&intf->dev, "Suspending device\n");
955 spin_lock_irqsave(&kaweth->device_lock, flags); 957 spin_lock_irqsave(&kaweth->device_lock, flags);
956 kaweth->status |= KAWETH_STATUS_SUSPENDING; 958 kaweth->status |= KAWETH_STATUS_SUSPENDING;
957 spin_unlock_irqrestore(&kaweth->device_lock, flags); 959 spin_unlock_irqrestore(&kaweth->device_lock, flags);
@@ -968,7 +970,7 @@ static int kaweth_resume(struct usb_interface *intf)
968 struct kaweth_device *kaweth = usb_get_intfdata(intf); 970 struct kaweth_device *kaweth = usb_get_intfdata(intf);
969 unsigned long flags; 971 unsigned long flags;
970 972
971 dbg("Resuming device"); 973 dev_dbg(&intf->dev, "Resuming device\n");
972 spin_lock_irqsave(&kaweth->device_lock, flags); 974 spin_lock_irqsave(&kaweth->device_lock, flags);
973 kaweth->status &= ~KAWETH_STATUS_SUSPENDING; 975 kaweth->status &= ~KAWETH_STATUS_SUSPENDING;
974 spin_unlock_irqrestore(&kaweth->device_lock, flags); 976 spin_unlock_irqrestore(&kaweth->device_lock, flags);
@@ -1003,36 +1005,37 @@ static int kaweth_probe(
1003 const struct usb_device_id *id /* from id_table */ 1005 const struct usb_device_id *id /* from id_table */
1004 ) 1006 )
1005{ 1007{
1006 struct usb_device *dev = interface_to_usbdev(intf); 1008 struct device *dev = &intf->dev;
1009 struct usb_device *udev = interface_to_usbdev(intf);
1007 struct kaweth_device *kaweth; 1010 struct kaweth_device *kaweth;
1008 struct net_device *netdev; 1011 struct net_device *netdev;
1009 const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; 1012 const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
1010 int result = 0; 1013 int result = 0;
1011 1014
1012 dbg("Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x", 1015 dev_dbg(dev,
1013 dev->devnum, 1016 "Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x\n",
1014 le16_to_cpu(dev->descriptor.idVendor), 1017 udev->devnum, le16_to_cpu(udev->descriptor.idVendor),
1015 le16_to_cpu(dev->descriptor.idProduct), 1018 le16_to_cpu(udev->descriptor.idProduct),
1016 le16_to_cpu(dev->descriptor.bcdDevice)); 1019 le16_to_cpu(udev->descriptor.bcdDevice));
1017 1020
1018 dbg("Device at %p", dev); 1021 dev_dbg(dev, "Device at %p\n", udev);
1019 1022
1020 dbg("Descriptor length: %x type: %x", 1023 dev_dbg(dev, "Descriptor length: %x type: %x\n",
1021 (int)dev->descriptor.bLength, 1024 (int)udev->descriptor.bLength,
1022 (int)dev->descriptor.bDescriptorType); 1025 (int)udev->descriptor.bDescriptorType);
1023 1026
1024 netdev = alloc_etherdev(sizeof(*kaweth)); 1027 netdev = alloc_etherdev(sizeof(*kaweth));
1025 if (!netdev) 1028 if (!netdev)
1026 return -ENOMEM; 1029 return -ENOMEM;
1027 1030
1028 kaweth = netdev_priv(netdev); 1031 kaweth = netdev_priv(netdev);
1029 kaweth->dev = dev; 1032 kaweth->dev = udev;
1030 kaweth->net = netdev; 1033 kaweth->net = netdev;
1031 1034
1032 spin_lock_init(&kaweth->device_lock); 1035 spin_lock_init(&kaweth->device_lock);
1033 init_waitqueue_head(&kaweth->term_wait); 1036 init_waitqueue_head(&kaweth->term_wait);
1034 1037
1035 dbg("Resetting."); 1038 dev_dbg(dev, "Resetting.\n");
1036 1039
1037 kaweth_reset(kaweth); 1040 kaweth_reset(kaweth);
1038 1041
@@ -1041,17 +1044,17 @@ static int kaweth_probe(
1041 * downloaded. Don't try to do it again, or we'll hang the device. 1044 * downloaded. Don't try to do it again, or we'll hang the device.
1042 */ 1045 */
1043 1046
1044 if (le16_to_cpu(dev->descriptor.bcdDevice) >> 8) { 1047 if (le16_to_cpu(udev->descriptor.bcdDevice) >> 8) {
1045 dev_info(&intf->dev, "Firmware present in device.\n"); 1048 dev_info(dev, "Firmware present in device.\n");
1046 } else { 1049 } else {
1047 /* Download the firmware */ 1050 /* Download the firmware */
1048 dev_info(&intf->dev, "Downloading firmware...\n"); 1051 dev_info(dev, "Downloading firmware...\n");
1049 kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL); 1052 kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
1050 if ((result = kaweth_download_firmware(kaweth, 1053 if ((result = kaweth_download_firmware(kaweth,
1051 "kaweth/new_code.bin", 1054 "kaweth/new_code.bin",
1052 100, 1055 100,
1053 2)) < 0) { 1056 2)) < 0) {
1054 dev_err(&intf->dev, "Error downloading firmware (%d)\n", 1057 dev_err(dev, "Error downloading firmware (%d)\n",
1055 result); 1058 result);
1056 goto err_fw; 1059 goto err_fw;
1057 } 1060 }
@@ -1060,8 +1063,7 @@ static int kaweth_probe(
1060 "kaweth/new_code_fix.bin", 1063 "kaweth/new_code_fix.bin",
1061 100, 1064 100,
1062 3)) < 0) { 1065 3)) < 0) {
1063 dev_err(&intf->dev, 1066 dev_err(dev, "Error downloading firmware fix (%d)\n",
1064 "Error downloading firmware fix (%d)\n",
1065 result); 1067 result);
1066 goto err_fw; 1068 goto err_fw;
1067 } 1069 }
@@ -1070,8 +1072,7 @@ static int kaweth_probe(
1070 "kaweth/trigger_code.bin", 1072 "kaweth/trigger_code.bin",
1071 126, 1073 126,
1072 2)) < 0) { 1074 2)) < 0) {
1073 dev_err(&intf->dev, 1075 dev_err(dev, "Error downloading trigger code (%d)\n",
1074 "Error downloading trigger code (%d)\n",
1075 result); 1076 result);
1076 goto err_fw; 1077 goto err_fw;
1077 1078
@@ -1081,19 +1082,18 @@ static int kaweth_probe(
1081 "kaweth/trigger_code_fix.bin", 1082 "kaweth/trigger_code_fix.bin",
1082 126, 1083 126,
1083 3)) < 0) { 1084 3)) < 0) {
1084 dev_err(&intf->dev, "Error downloading trigger code fix (%d)\n", result); 1085 dev_err(dev, "Error downloading trigger code fix (%d)\n", result);
1085 goto err_fw; 1086 goto err_fw;
1086 } 1087 }
1087 1088
1088 1089
1089 if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { 1090 if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) {
1090 dev_err(&intf->dev, "Error triggering firmware (%d)\n", 1091 dev_err(dev, "Error triggering firmware (%d)\n", result);
1091 result);
1092 goto err_fw; 1092 goto err_fw;
1093 } 1093 }
1094 1094
1095 /* Device will now disappear for a moment... */ 1095 /* Device will now disappear for a moment... */
1096 dev_info(&intf->dev, "Firmware loaded. I'll be back...\n"); 1096 dev_info(dev, "Firmware loaded. I'll be back...\n");
1097err_fw: 1097err_fw:
1098 free_page((unsigned long)kaweth->firmware_buf); 1098 free_page((unsigned long)kaweth->firmware_buf);
1099 free_netdev(netdev); 1099 free_netdev(netdev);
@@ -1103,29 +1103,29 @@ err_fw:
1103 result = kaweth_read_configuration(kaweth); 1103 result = kaweth_read_configuration(kaweth);
1104 1104
1105 if(result < 0) { 1105 if(result < 0) {
1106 dev_err(&intf->dev, "Error reading configuration (%d), no net device created\n", result); 1106 dev_err(dev, "Error reading configuration (%d), no net device created\n", result);
1107 goto err_free_netdev; 1107 goto err_free_netdev;
1108 } 1108 }
1109 1109
1110 dev_info(&intf->dev, "Statistics collection: %x\n", kaweth->configuration.statistics_mask); 1110 dev_info(dev, "Statistics collection: %x\n", kaweth->configuration.statistics_mask);
1111 dev_info(&intf->dev, "Multicast filter limit: %x\n", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1)); 1111 dev_info(dev, "Multicast filter limit: %x\n", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1));
1112 dev_info(&intf->dev, "MTU: %d\n", le16_to_cpu(kaweth->configuration.segment_size)); 1112 dev_info(dev, "MTU: %d\n", le16_to_cpu(kaweth->configuration.segment_size));
1113 dev_info(&intf->dev, "Read MAC address %pM\n", kaweth->configuration.hw_addr); 1113 dev_info(dev, "Read MAC address %pM\n", kaweth->configuration.hw_addr);
1114 1114
1115 if(!memcmp(&kaweth->configuration.hw_addr, 1115 if(!memcmp(&kaweth->configuration.hw_addr,
1116 &bcast_addr, 1116 &bcast_addr,
1117 sizeof(bcast_addr))) { 1117 sizeof(bcast_addr))) {
1118 dev_err(&intf->dev, "Firmware not functioning properly, no net device created\n"); 1118 dev_err(dev, "Firmware not functioning properly, no net device created\n");
1119 goto err_free_netdev; 1119 goto err_free_netdev;
1120 } 1120 }
1121 1121
1122 if(kaweth_set_urb_size(kaweth, KAWETH_BUF_SIZE) < 0) { 1122 if(kaweth_set_urb_size(kaweth, KAWETH_BUF_SIZE) < 0) {
1123 dbg("Error setting URB size"); 1123 dev_dbg(dev, "Error setting URB size\n");
1124 goto err_free_netdev; 1124 goto err_free_netdev;
1125 } 1125 }
1126 1126
1127 if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { 1127 if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) {
1128 dev_err(&intf->dev, "Error setting SOFS wait\n"); 1128 dev_err(dev, "Error setting SOFS wait\n");
1129 goto err_free_netdev; 1129 goto err_free_netdev;
1130 } 1130 }
1131 1131
@@ -1135,11 +1135,11 @@ err_fw:
1135 KAWETH_PACKET_FILTER_MULTICAST); 1135 KAWETH_PACKET_FILTER_MULTICAST);
1136 1136
1137 if(result < 0) { 1137 if(result < 0) {
1138 dev_err(&intf->dev, "Error setting receive filter\n"); 1138 dev_err(dev, "Error setting receive filter\n");
1139 goto err_free_netdev; 1139 goto err_free_netdev;
1140 } 1140 }
1141 1141
1142 dbg("Initializing net device."); 1142 dev_dbg(dev, "Initializing net device.\n");
1143 1143
1144 kaweth->intf = intf; 1144 kaweth->intf = intf;
1145 1145
@@ -1181,20 +1181,20 @@ err_fw:
1181 1181
1182#if 0 1182#if 0
1183// dma_supported() is deeply broken on almost all architectures 1183// dma_supported() is deeply broken on almost all architectures
1184 if (dma_supported (&intf->dev, 0xffffffffffffffffULL)) 1184 if (dma_supported (dev, 0xffffffffffffffffULL))
1185 kaweth->net->features |= NETIF_F_HIGHDMA; 1185 kaweth->net->features |= NETIF_F_HIGHDMA;
1186#endif 1186#endif
1187 1187
1188 SET_NETDEV_DEV(netdev, &intf->dev); 1188 SET_NETDEV_DEV(netdev, dev);
1189 if (register_netdev(netdev) != 0) { 1189 if (register_netdev(netdev) != 0) {
1190 dev_err(&intf->dev, "Error registering netdev.\n"); 1190 dev_err(dev, "Error registering netdev.\n");
1191 goto err_intfdata; 1191 goto err_intfdata;
1192 } 1192 }
1193 1193
1194 dev_info(&intf->dev, "kaweth interface created at %s\n", 1194 dev_info(dev, "kaweth interface created at %s\n",
1195 kaweth->net->name); 1195 kaweth->net->name);
1196 1196
1197 dbg("Kaweth probe returning."); 1197 dev_dbg(dev, "Kaweth probe returning.\n");
1198 1198
1199 return 0; 1199 return 0;
1200 1200
@@ -1232,7 +1232,7 @@ static void kaweth_disconnect(struct usb_interface *intf)
1232 } 1232 }
1233 netdev = kaweth->net; 1233 netdev = kaweth->net;
1234 1234
1235 dbg("Unregistering net device"); 1235 netdev_dbg(kaweth->net, "Unregistering net device\n");
1236 unregister_netdev(netdev); 1236 unregister_netdev(netdev);
1237 1237
1238 usb_free_urb(kaweth->rx_urb); 1238 usb_free_urb(kaweth->rx_urb);
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
index 28c4d513ba85..29e06e1a34f4 100644
--- a/drivers/net/usb/net1080.c
+++ b/drivers/net/usb/net1080.c
@@ -155,12 +155,10 @@ static void nc_dump_registers(struct usbnet *dev)
155 u8 reg; 155 u8 reg;
156 u16 *vp = kmalloc(sizeof (u16)); 156 u16 *vp = kmalloc(sizeof (u16));
157 157
158 if (!vp) { 158 if (!vp)
159 dbg("no memory?");
160 return; 159 return;
161 }
162 160
163 dbg("%s registers:", dev->net->name); 161 netdev_dbg(dev->net, "registers:\n");
164 for (reg = 0; reg < 0x20; reg++) { 162 for (reg = 0; reg < 0x20; reg++) {
165 int retval; 163 int retval;
166 164
@@ -172,11 +170,10 @@ static void nc_dump_registers(struct usbnet *dev)
172 170
173 retval = nc_register_read(dev, reg, vp); 171 retval = nc_register_read(dev, reg, vp);
174 if (retval < 0) 172 if (retval < 0)
175 dbg("%s reg [0x%x] ==> error %d", 173 netdev_dbg(dev->net, "reg [0x%x] ==> error %d\n",
176 dev->net->name, reg, retval); 174 reg, retval);
177 else 175 else
178 dbg("%s reg [0x%x] = 0x%x", 176 netdev_dbg(dev->net, "reg [0x%x] = 0x%x\n", reg, *vp);
179 dev->net->name, reg, *vp);
180 } 177 }
181 kfree(vp); 178 kfree(vp);
182} 179}
@@ -300,15 +297,15 @@ static int net1080_reset(struct usbnet *dev)
300 // nc_dump_registers(dev); 297 // nc_dump_registers(dev);
301 298
302 if ((retval = nc_register_read(dev, REG_STATUS, vp)) < 0) { 299 if ((retval = nc_register_read(dev, REG_STATUS, vp)) < 0) {
303 dbg("can't read %s-%s status: %d", 300 netdev_dbg(dev->net, "can't read %s-%s status: %d\n",
304 dev->udev->bus->bus_name, dev->udev->devpath, retval); 301 dev->udev->bus->bus_name, dev->udev->devpath, retval);
305 goto done; 302 goto done;
306 } 303 }
307 status = *vp; 304 status = *vp;
308 nc_dump_status(dev, status); 305 nc_dump_status(dev, status);
309 306
310 if ((retval = nc_register_read(dev, REG_USBCTL, vp)) < 0) { 307 if ((retval = nc_register_read(dev, REG_USBCTL, vp)) < 0) {
311 dbg("can't read USBCTL, %d", retval); 308 netdev_dbg(dev->net, "can't read USBCTL, %d\n", retval);
312 goto done; 309 goto done;
313 } 310 }
314 usbctl = *vp; 311 usbctl = *vp;
@@ -318,7 +315,7 @@ static int net1080_reset(struct usbnet *dev)
318 USBCTL_FLUSH_THIS | USBCTL_FLUSH_OTHER); 315 USBCTL_FLUSH_THIS | USBCTL_FLUSH_OTHER);
319 316
320 if ((retval = nc_register_read(dev, REG_TTL, vp)) < 0) { 317 if ((retval = nc_register_read(dev, REG_TTL, vp)) < 0) {
321 dbg("can't read TTL, %d", retval); 318 netdev_dbg(dev->net, "can't read TTL, %d\n", retval);
322 goto done; 319 goto done;
323 } 320 }
324 ttl = *vp; 321 ttl = *vp;
@@ -326,7 +323,7 @@ static int net1080_reset(struct usbnet *dev)
326 323
327 nc_register_write(dev, REG_TTL, 324 nc_register_write(dev, REG_TTL,
328 MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) ); 325 MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) );
329 dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); 326 netdev_dbg(dev->net, "assigned TTL, %d ms\n", NC_READ_TTL_MS);
330 327
331 netif_info(dev, link, dev->net, "port %c, peer %sconnected\n", 328 netif_info(dev, link, dev->net, "port %c, peer %sconnected\n",
332 (status & STATUS_PORT_A) ? 'A' : 'B', 329 (status & STATUS_PORT_A) ? 'A' : 'B',
@@ -350,7 +347,7 @@ static int net1080_check_connect(struct usbnet *dev)
350 status = *vp; 347 status = *vp;
351 kfree(vp); 348 kfree(vp);
352 if (retval != 0) { 349 if (retval != 0) {
353 dbg("%s net1080_check_conn read - %d", dev->net->name, retval); 350 netdev_dbg(dev->net, "net1080_check_conn read - %d\n", retval);
354 return retval; 351 return retval;
355 } 352 }
356 if ((status & STATUS_CONN_OTHER) != STATUS_CONN_OTHER) 353 if ((status & STATUS_CONN_OTHER) != STATUS_CONN_OTHER)
@@ -422,8 +419,9 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
422 if (!(skb->len & 0x01)) { 419 if (!(skb->len & 0x01)) {
423#ifdef DEBUG 420#ifdef DEBUG
424 struct net_device *net = dev->net; 421 struct net_device *net = dev->net;
425 dbg("rx framesize %d range %d..%d mtu %d", skb->len, 422 netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n",
426 net->hard_header_len, dev->hard_mtu, net->mtu); 423 skb->len, net->hard_header_len, dev->hard_mtu,
424 net->mtu);
427#endif 425#endif
428 dev->net->stats.rx_frame_errors++; 426 dev->net->stats.rx_frame_errors++;
429 nc_ensure_sync(dev); 427 nc_ensure_sync(dev);
@@ -435,17 +433,17 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
435 packet_len = le16_to_cpup(&header->packet_len); 433 packet_len = le16_to_cpup(&header->packet_len);
436 if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { 434 if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) {
437 dev->net->stats.rx_frame_errors++; 435 dev->net->stats.rx_frame_errors++;
438 dbg("packet too big, %d", packet_len); 436 netdev_dbg(dev->net, "packet too big, %d\n", packet_len);
439 nc_ensure_sync(dev); 437 nc_ensure_sync(dev);
440 return 0; 438 return 0;
441 } else if (hdr_len < MIN_HEADER) { 439 } else if (hdr_len < MIN_HEADER) {
442 dev->net->stats.rx_frame_errors++; 440 dev->net->stats.rx_frame_errors++;
443 dbg("header too short, %d", hdr_len); 441 netdev_dbg(dev->net, "header too short, %d\n", hdr_len);
444 nc_ensure_sync(dev); 442 nc_ensure_sync(dev);
445 return 0; 443 return 0;
446 } else if (hdr_len > MIN_HEADER) { 444 } else if (hdr_len > MIN_HEADER) {
447 // out of band data for us? 445 // out of band data for us?
448 dbg("header OOB, %d bytes", hdr_len - MIN_HEADER); 446 netdev_dbg(dev->net, "header OOB, %d bytes\n", hdr_len - MIN_HEADER);
449 nc_ensure_sync(dev); 447 nc_ensure_sync(dev);
450 // switch (vendor/product ids) { ... } 448 // switch (vendor/product ids) { ... }
451 } 449 }
@@ -458,23 +456,23 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
458 if ((packet_len & 0x01) == 0) { 456 if ((packet_len & 0x01) == 0) {
459 if (skb->data [packet_len] != PAD_BYTE) { 457 if (skb->data [packet_len] != PAD_BYTE) {
460 dev->net->stats.rx_frame_errors++; 458 dev->net->stats.rx_frame_errors++;
461 dbg("bad pad"); 459 netdev_dbg(dev->net, "bad pad\n");
462 return 0; 460 return 0;
463 } 461 }
464 skb_trim(skb, skb->len - 1); 462 skb_trim(skb, skb->len - 1);
465 } 463 }
466 if (skb->len != packet_len) { 464 if (skb->len != packet_len) {
467 dev->net->stats.rx_frame_errors++; 465 dev->net->stats.rx_frame_errors++;
468 dbg("bad packet len %d (expected %d)", 466 netdev_dbg(dev->net, "bad packet len %d (expected %d)\n",
469 skb->len, packet_len); 467 skb->len, packet_len);
470 nc_ensure_sync(dev); 468 nc_ensure_sync(dev);
471 return 0; 469 return 0;
472 } 470 }
473 if (header->packet_id != get_unaligned(&trailer->packet_id)) { 471 if (header->packet_id != get_unaligned(&trailer->packet_id)) {
474 dev->net->stats.rx_fifo_errors++; 472 dev->net->stats.rx_fifo_errors++;
475 dbg("(2+ dropped) rx packet_id mismatch 0x%x 0x%x", 473 netdev_dbg(dev->net, "(2+ dropped) rx packet_id mismatch 0x%x 0x%x\n",
476 le16_to_cpu(header->packet_id), 474 le16_to_cpu(header->packet_id),
477 le16_to_cpu(trailer->packet_id)); 475 le16_to_cpu(trailer->packet_id));
478 return 0; 476 return 0;
479 } 477 }
480#if 0 478#if 0
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 0e2c92e0e532..5f39a3b225ef 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -275,7 +275,7 @@ static int rtl8150_set_mac_address(struct net_device *netdev, void *p)
275 return -EBUSY; 275 return -EBUSY;
276 276
277 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); 277 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
278 dbg("%s: Setting MAC address to %pM\n", netdev->name, netdev->dev_addr); 278 netdev_dbg(netdev, "Setting MAC address to %pM\n", netdev->dev_addr);
279 /* Set the IDR registers. */ 279 /* Set the IDR registers. */
280 set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr); 280 set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr);
281#ifdef EEPROM_WRITE 281#ifdef EEPROM_WRITE
@@ -503,12 +503,12 @@ static void intr_callback(struct urb *urb)
503 if ((d[INT_MSR] & MSR_LINK) == 0) { 503 if ((d[INT_MSR] & MSR_LINK) == 0) {
504 if (netif_carrier_ok(dev->netdev)) { 504 if (netif_carrier_ok(dev->netdev)) {
505 netif_carrier_off(dev->netdev); 505 netif_carrier_off(dev->netdev);
506 dbg("%s: LINK LOST\n", __func__); 506 netdev_dbg(dev->netdev, "%s: LINK LOST\n", __func__);
507 } 507 }
508 } else { 508 } else {
509 if (!netif_carrier_ok(dev->netdev)) { 509 if (!netif_carrier_ok(dev->netdev)) {
510 netif_carrier_on(dev->netdev); 510 netif_carrier_on(dev->netdev);
511 dbg("%s: LINK CAME BACK\n", __func__); 511 netdev_dbg(dev->netdev, "%s: LINK CAME BACK\n", __func__);
512 } 512 }
513 } 513 }
514 514