diff options
author | Joe Perches <joe@perches.com> | 2011-05-09 05:45:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-09 15:51:15 -0400 |
commit | 163ef0b5922b14751e93218bdf2c9fe8f74b9c9d (patch) | |
tree | 9a4179070e26d63170ec005e1f9ffff48b0e541b /drivers/net/tulip | |
parent | 54668b84bd2ee808e6b43ed9bd7aa3338fa95857 (diff) |
tulip: Convert printks to netdev_<level>
Use the current more descriptive logging styles.
Add pr_fmt and remove PFX where appropriate.
Use netif_<level>, netdev_<level>
Indent a few blocks in xircom_cb where appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r-- | drivers/net/tulip/de2104x.c | 139 | ||||
-rw-r--r-- | drivers/net/tulip/dmfe.c | 2 | ||||
-rw-r--r-- | drivers/net/tulip/eeprom.c | 4 | ||||
-rw-r--r-- | drivers/net/tulip/tulip_core.c | 25 | ||||
-rw-r--r-- | drivers/net/tulip/uli526x.c | 42 | ||||
-rw-r--r-- | drivers/net/tulip/winbond-840.c | 6 | ||||
-rw-r--r-- | drivers/net/tulip/xircom_cb.c | 132 |
7 files changed, 170 insertions, 180 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 46d5a1b15036..62883a0b0618 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -27,6 +27,8 @@ | |||
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
31 | |||
30 | #define DRV_NAME "de2104x" | 32 | #define DRV_NAME "de2104x" |
31 | #define DRV_VERSION "0.7" | 33 | #define DRV_VERSION "0.7" |
32 | #define DRV_RELDATE "Mar 17, 2004" | 34 | #define DRV_RELDATE "Mar 17, 2004" |
@@ -73,8 +75,6 @@ static int rx_copybreak = 100; | |||
73 | module_param (rx_copybreak, int, 0); | 75 | module_param (rx_copybreak, int, 0); |
74 | MODULE_PARM_DESC (rx_copybreak, "de2104x Breakpoint at which Rx packets are copied"); | 76 | MODULE_PARM_DESC (rx_copybreak, "de2104x Breakpoint at which Rx packets are copied"); |
75 | 77 | ||
76 | #define PFX DRV_NAME ": " | ||
77 | |||
78 | #define DE_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ | 78 | #define DE_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ |
79 | NETIF_MSG_PROBE | \ | 79 | NETIF_MSG_PROBE | \ |
80 | NETIF_MSG_LINK | \ | 80 | NETIF_MSG_LINK | \ |
@@ -377,18 +377,16 @@ static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; | |||
377 | static void de_rx_err_acct (struct de_private *de, unsigned rx_tail, | 377 | static void de_rx_err_acct (struct de_private *de, unsigned rx_tail, |
378 | u32 status, u32 len) | 378 | u32 status, u32 len) |
379 | { | 379 | { |
380 | if (netif_msg_rx_err (de)) | 380 | netif_printk(de, rx_err, KERN_DEBUG, de->dev, |
381 | printk (KERN_DEBUG | 381 | "rx err, slot %d status 0x%x len %d\n", |
382 | "%s: rx err, slot %d status 0x%x len %d\n", | 382 | rx_tail, status, len); |
383 | de->dev->name, rx_tail, status, len); | ||
384 | 383 | ||
385 | if ((status & 0x38000300) != 0x0300) { | 384 | if ((status & 0x38000300) != 0x0300) { |
386 | /* Ingore earlier buffers. */ | 385 | /* Ingore earlier buffers. */ |
387 | if ((status & 0xffff) != 0x7fff) { | 386 | if ((status & 0xffff) != 0x7fff) { |
388 | if (netif_msg_rx_err(de)) | 387 | netif_warn(de, rx_err, de->dev, |
389 | dev_warn(&de->dev->dev, | 388 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", |
390 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", | 389 | status); |
391 | status); | ||
392 | de->net_stats.rx_length_errors++; | 390 | de->net_stats.rx_length_errors++; |
393 | } | 391 | } |
394 | } else if (status & RxError) { | 392 | } else if (status & RxError) { |
@@ -491,7 +489,7 @@ rx_next: | |||
491 | } | 489 | } |
492 | 490 | ||
493 | if (!rx_work) | 491 | if (!rx_work) |
494 | dev_warn(&de->dev->dev, "rx work limit reached\n"); | 492 | netdev_warn(de->dev, "rx work limit reached\n"); |
495 | 493 | ||
496 | de->rx_tail = rx_tail; | 494 | de->rx_tail = rx_tail; |
497 | } | 495 | } |
@@ -534,9 +532,9 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance) | |||
534 | 532 | ||
535 | pci_read_config_word(de->pdev, PCI_STATUS, &pci_status); | 533 | pci_read_config_word(de->pdev, PCI_STATUS, &pci_status); |
536 | pci_write_config_word(de->pdev, PCI_STATUS, pci_status); | 534 | pci_write_config_word(de->pdev, PCI_STATUS, pci_status); |
537 | dev_err(&de->dev->dev, | 535 | netdev_err(de->dev, |
538 | "PCI bus error, status=%08x, PCI status=%04x\n", | 536 | "PCI bus error, status=%08x, PCI status=%04x\n", |
539 | status, pci_status); | 537 | status, pci_status); |
540 | } | 538 | } |
541 | 539 | ||
542 | return IRQ_HANDLED; | 540 | return IRQ_HANDLED; |
@@ -873,7 +871,7 @@ static void de_stop_rxtx (struct de_private *de) | |||
873 | udelay(100); | 871 | udelay(100); |
874 | } | 872 | } |
875 | 873 | ||
876 | dev_warn(&de->dev->dev, "timeout expired stopping DMA\n"); | 874 | netdev_warn(de->dev, "timeout expired, stopping DMA\n"); |
877 | } | 875 | } |
878 | 876 | ||
879 | static inline void de_start_rxtx (struct de_private *de) | 877 | static inline void de_start_rxtx (struct de_private *de) |
@@ -907,9 +905,8 @@ static void de_link_up(struct de_private *de) | |||
907 | { | 905 | { |
908 | if (!netif_carrier_ok(de->dev)) { | 906 | if (!netif_carrier_ok(de->dev)) { |
909 | netif_carrier_on(de->dev); | 907 | netif_carrier_on(de->dev); |
910 | if (netif_msg_link(de)) | 908 | netif_info(de, link, de->dev, "link up, media %s\n", |
911 | dev_info(&de->dev->dev, "link up, media %s\n", | 909 | media_name[de->media_type]); |
912 | media_name[de->media_type]); | ||
913 | } | 910 | } |
914 | } | 911 | } |
915 | 912 | ||
@@ -917,8 +914,7 @@ static void de_link_down(struct de_private *de) | |||
917 | { | 914 | { |
918 | if (netif_carrier_ok(de->dev)) { | 915 | if (netif_carrier_ok(de->dev)) { |
919 | netif_carrier_off(de->dev); | 916 | netif_carrier_off(de->dev); |
920 | if (netif_msg_link(de)) | 917 | netif_info(de, link, de->dev, "link down\n"); |
921 | dev_info(&de->dev->dev, "link down\n"); | ||
922 | } | 918 | } |
923 | } | 919 | } |
924 | 920 | ||
@@ -928,8 +924,7 @@ static void de_set_media (struct de_private *de) | |||
928 | u32 macmode = dr32(MacMode); | 924 | u32 macmode = dr32(MacMode); |
929 | 925 | ||
930 | if (de_is_running(de)) | 926 | if (de_is_running(de)) |
931 | dev_warn(&de->dev->dev, | 927 | netdev_warn(de->dev, "chip is running while changing media!\n"); |
932 | "chip is running while changing media!\n"); | ||
933 | 928 | ||
934 | if (de->de21040) | 929 | if (de->de21040) |
935 | dw32(CSR11, FULL_DUPLEX_MAGIC); | 930 | dw32(CSR11, FULL_DUPLEX_MAGIC); |
@@ -948,18 +943,13 @@ static void de_set_media (struct de_private *de) | |||
948 | else | 943 | else |
949 | macmode &= ~FullDuplex; | 944 | macmode &= ~FullDuplex; |
950 | 945 | ||
951 | if (netif_msg_link(de)) | 946 | netif_info(de, link, de->dev, "set link %s\n", media_name[media]); |
952 | dev_info(&de->dev->dev, "set link %s\n", media_name[media]); | 947 | netif_info(de, hw, de->dev, "mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n", |
953 | if (netif_msg_hw(de)) { | 948 | dr32(MacMode), dr32(SIAStatus), |
954 | dev_info(&de->dev->dev, "mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n", | 949 | dr32(CSR13), dr32(CSR14), dr32(CSR15)); |
955 | dr32(MacMode), dr32(SIAStatus), | 950 | netif_info(de, hw, de->dev, "set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", |
956 | dr32(CSR13), dr32(CSR14), dr32(CSR15)); | 951 | macmode, de->media[media].csr13, |
957 | 952 | de->media[media].csr14, de->media[media].csr15); | |
958 | dev_info(&de->dev->dev, | ||
959 | "set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", | ||
960 | macmode, de->media[media].csr13, | ||
961 | de->media[media].csr14, de->media[media].csr15); | ||
962 | } | ||
963 | if (macmode != dr32(MacMode)) | 953 | if (macmode != dr32(MacMode)) |
964 | dw32(MacMode, macmode); | 954 | dw32(MacMode, macmode); |
965 | } | 955 | } |
@@ -996,9 +986,8 @@ static void de21040_media_timer (unsigned long data) | |||
996 | if (!netif_carrier_ok(dev)) | 986 | if (!netif_carrier_ok(dev)) |
997 | de_link_up(de); | 987 | de_link_up(de); |
998 | else | 988 | else |
999 | if (netif_msg_timer(de)) | 989 | netif_info(de, timer, dev, "%s link ok, status %x\n", |
1000 | dev_info(&dev->dev, "%s link ok, status %x\n", | 990 | media_name[de->media_type], status); |
1001 | media_name[de->media_type], status); | ||
1002 | return; | 991 | return; |
1003 | } | 992 | } |
1004 | 993 | ||
@@ -1025,9 +1014,8 @@ no_link_yet: | |||
1025 | de->media_timer.expires = jiffies + DE_TIMER_NO_LINK; | 1014 | de->media_timer.expires = jiffies + DE_TIMER_NO_LINK; |
1026 | add_timer(&de->media_timer); | 1015 | add_timer(&de->media_timer); |
1027 | 1016 | ||
1028 | if (netif_msg_timer(de)) | 1017 | netif_info(de, timer, dev, "no link, trying media %s, status %x\n", |
1029 | dev_info(&dev->dev, "no link, trying media %s, status %x\n", | 1018 | media_name[de->media_type], status); |
1030 | media_name[de->media_type], status); | ||
1031 | } | 1019 | } |
1032 | 1020 | ||
1033 | static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media) | 1021 | static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media) |
@@ -1085,11 +1073,10 @@ static void de21041_media_timer (unsigned long data) | |||
1085 | if (!netif_carrier_ok(dev)) | 1073 | if (!netif_carrier_ok(dev)) |
1086 | de_link_up(de); | 1074 | de_link_up(de); |
1087 | else | 1075 | else |
1088 | if (netif_msg_timer(de)) | 1076 | netif_info(de, timer, dev, |
1089 | dev_info(&dev->dev, | 1077 | "%s link ok, mode %x status %x\n", |
1090 | "%s link ok, mode %x status %x\n", | 1078 | media_name[de->media_type], |
1091 | media_name[de->media_type], | 1079 | dr32(MacMode), status); |
1092 | dr32(MacMode), status); | ||
1093 | return; | 1080 | return; |
1094 | } | 1081 | } |
1095 | 1082 | ||
@@ -1163,9 +1150,8 @@ no_link_yet: | |||
1163 | de->media_timer.expires = jiffies + DE_TIMER_NO_LINK; | 1150 | de->media_timer.expires = jiffies + DE_TIMER_NO_LINK; |
1164 | add_timer(&de->media_timer); | 1151 | add_timer(&de->media_timer); |
1165 | 1152 | ||
1166 | if (netif_msg_timer(de)) | 1153 | netif_info(de, timer, dev, "no link, trying media %s, status %x\n", |
1167 | dev_info(&dev->dev, "no link, trying media %s, status %x\n", | 1154 | media_name[de->media_type], status); |
1168 | media_name[de->media_type], status); | ||
1169 | } | 1155 | } |
1170 | 1156 | ||
1171 | static void de_media_interrupt (struct de_private *de, u32 status) | 1157 | static void de_media_interrupt (struct de_private *de, u32 status) |
@@ -1401,14 +1387,13 @@ static int de_open (struct net_device *dev) | |||
1401 | struct de_private *de = netdev_priv(dev); | 1387 | struct de_private *de = netdev_priv(dev); |
1402 | int rc; | 1388 | int rc; |
1403 | 1389 | ||
1404 | if (netif_msg_ifup(de)) | 1390 | netif_printk(de, ifup, KERN_DEBUG, dev, "enabling interface\n"); |
1405 | printk(KERN_DEBUG "%s: enabling interface\n", dev->name); | ||
1406 | 1391 | ||
1407 | de->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); | 1392 | de->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); |
1408 | 1393 | ||
1409 | rc = de_alloc_rings(de); | 1394 | rc = de_alloc_rings(de); |
1410 | if (rc) { | 1395 | if (rc) { |
1411 | dev_err(&dev->dev, "ring allocation failure, err=%d\n", rc); | 1396 | netdev_err(dev, "ring allocation failure, err=%d\n", rc); |
1412 | return rc; | 1397 | return rc; |
1413 | } | 1398 | } |
1414 | 1399 | ||
@@ -1416,14 +1401,14 @@ static int de_open (struct net_device *dev) | |||
1416 | 1401 | ||
1417 | rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); | 1402 | rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); |
1418 | if (rc) { | 1403 | if (rc) { |
1419 | dev_err(&dev->dev, "IRQ %d request failure, err=%d\n", | 1404 | netdev_err(dev, "IRQ %d request failure, err=%d\n", |
1420 | dev->irq, rc); | 1405 | dev->irq, rc); |
1421 | goto err_out_free; | 1406 | goto err_out_free; |
1422 | } | 1407 | } |
1423 | 1408 | ||
1424 | rc = de_init_hw(de); | 1409 | rc = de_init_hw(de); |
1425 | if (rc) { | 1410 | if (rc) { |
1426 | dev_err(&dev->dev, "h/w init failure, err=%d\n", rc); | 1411 | netdev_err(dev, "h/w init failure, err=%d\n", rc); |
1427 | goto err_out_free_irq; | 1412 | goto err_out_free_irq; |
1428 | } | 1413 | } |
1429 | 1414 | ||
@@ -1444,8 +1429,7 @@ static int de_close (struct net_device *dev) | |||
1444 | struct de_private *de = netdev_priv(dev); | 1429 | struct de_private *de = netdev_priv(dev); |
1445 | unsigned long flags; | 1430 | unsigned long flags; |
1446 | 1431 | ||
1447 | if (netif_msg_ifdown(de)) | 1432 | netif_printk(de, ifdown, KERN_DEBUG, dev, "disabling interface\n"); |
1448 | printk(KERN_DEBUG "%s: disabling interface\n", dev->name); | ||
1449 | 1433 | ||
1450 | del_timer_sync(&de->media_timer); | 1434 | del_timer_sync(&de->media_timer); |
1451 | 1435 | ||
@@ -1466,9 +1450,10 @@ static void de_tx_timeout (struct net_device *dev) | |||
1466 | { | 1450 | { |
1467 | struct de_private *de = netdev_priv(dev); | 1451 | struct de_private *de = netdev_priv(dev); |
1468 | 1452 | ||
1469 | printk(KERN_DEBUG "%s: NIC status %08x mode %08x sia %08x desc %u/%u/%u\n", | 1453 | netdev_printk(KERN_DEBUG, dev, |
1470 | dev->name, dr32(MacStatus), dr32(MacMode), dr32(SIAStatus), | 1454 | "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n", |
1471 | de->rx_tail, de->tx_head, de->tx_tail); | 1455 | dr32(MacStatus), dr32(MacMode), dr32(SIAStatus), |
1456 | de->rx_tail, de->tx_head, de->tx_tail); | ||
1472 | 1457 | ||
1473 | del_timer_sync(&de->media_timer); | 1458 | del_timer_sync(&de->media_timer); |
1474 | 1459 | ||
@@ -1693,9 +1678,8 @@ static int de_nway_reset(struct net_device *dev) | |||
1693 | 1678 | ||
1694 | status = dr32(SIAStatus); | 1679 | status = dr32(SIAStatus); |
1695 | dw32(SIAStatus, (status & ~NWayState) | NWayRestart); | 1680 | dw32(SIAStatus, (status & ~NWayState) | NWayRestart); |
1696 | if (netif_msg_link(de)) | 1681 | netif_info(de, link, dev, "link nway restart, status %x,%x\n", |
1697 | dev_info(&de->dev->dev, "link nway restart, status %x,%x\n", | 1682 | status, dr32(SIAStatus)); |
1698 | status, dr32(SIAStatus)); | ||
1699 | return 0; | 1683 | return 0; |
1700 | } | 1684 | } |
1701 | 1685 | ||
@@ -1740,7 +1724,8 @@ static void __devinit de21040_get_mac_address (struct de_private *de) | |||
1740 | de->dev->dev_addr[i] = value; | 1724 | de->dev->dev_addr[i] = value; |
1741 | udelay(1); | 1725 | udelay(1); |
1742 | if (boguscnt <= 0) | 1726 | if (boguscnt <= 0) |
1743 | pr_warning(PFX "timeout reading 21040 MAC address byte %u\n", i); | 1727 | pr_warn("timeout reading 21040 MAC address byte %u\n", |
1728 | i); | ||
1744 | } | 1729 | } |
1745 | } | 1730 | } |
1746 | 1731 | ||
@@ -1926,8 +1911,10 @@ static void __devinit de21041_get_srom_info (struct de_private *de) | |||
1926 | de->media[idx].csr14, | 1911 | de->media[idx].csr14, |
1927 | de->media[idx].csr15); | 1912 | de->media[idx].csr15); |
1928 | 1913 | ||
1929 | } else if (netif_msg_probe(de)) | 1914 | } else { |
1930 | pr_cont("\n"); | 1915 | if (netif_msg_probe(de)) |
1916 | pr_cont("\n"); | ||
1917 | } | ||
1931 | 1918 | ||
1932 | if (bufp > ((void *)&ee_data[DE_EEPROM_SIZE - 3])) | 1919 | if (bufp > ((void *)&ee_data[DE_EEPROM_SIZE - 3])) |
1933 | break; | 1920 | break; |
@@ -2038,7 +2025,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2038 | /* check for invalid IRQ value */ | 2025 | /* check for invalid IRQ value */ |
2039 | if (pdev->irq < 2) { | 2026 | if (pdev->irq < 2) { |
2040 | rc = -EIO; | 2027 | rc = -EIO; |
2041 | pr_err(PFX "invalid irq (%d) for pci dev %s\n", | 2028 | pr_err("invalid irq (%d) for pci dev %s\n", |
2042 | pdev->irq, pci_name(pdev)); | 2029 | pdev->irq, pci_name(pdev)); |
2043 | goto err_out_res; | 2030 | goto err_out_res; |
2044 | } | 2031 | } |
@@ -2049,12 +2036,12 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2049 | pciaddr = pci_resource_start(pdev, 1); | 2036 | pciaddr = pci_resource_start(pdev, 1); |
2050 | if (!pciaddr) { | 2037 | if (!pciaddr) { |
2051 | rc = -EIO; | 2038 | rc = -EIO; |
2052 | pr_err(PFX "no MMIO resource for pci dev %s\n", pci_name(pdev)); | 2039 | pr_err("no MMIO resource for pci dev %s\n", pci_name(pdev)); |
2053 | goto err_out_res; | 2040 | goto err_out_res; |
2054 | } | 2041 | } |
2055 | if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) { | 2042 | if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) { |
2056 | rc = -EIO; | 2043 | rc = -EIO; |
2057 | pr_err(PFX "MMIO resource (%llx) too small on pci dev %s\n", | 2044 | pr_err("MMIO resource (%llx) too small on pci dev %s\n", |
2058 | (unsigned long long)pci_resource_len(pdev, 1), | 2045 | (unsigned long long)pci_resource_len(pdev, 1), |
2059 | pci_name(pdev)); | 2046 | pci_name(pdev)); |
2060 | goto err_out_res; | 2047 | goto err_out_res; |
@@ -2064,7 +2051,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2064 | regs = ioremap_nocache(pciaddr, DE_REGS_SIZE); | 2051 | regs = ioremap_nocache(pciaddr, DE_REGS_SIZE); |
2065 | if (!regs) { | 2052 | if (!regs) { |
2066 | rc = -EIO; | 2053 | rc = -EIO; |
2067 | pr_err(PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n", | 2054 | pr_err("Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n", |
2068 | (unsigned long long)pci_resource_len(pdev, 1), | 2055 | (unsigned long long)pci_resource_len(pdev, 1), |
2069 | pciaddr, pci_name(pdev)); | 2056 | pciaddr, pci_name(pdev)); |
2070 | goto err_out_res; | 2057 | goto err_out_res; |
@@ -2077,7 +2064,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2077 | /* make sure hardware is not running */ | 2064 | /* make sure hardware is not running */ |
2078 | rc = de_reset_mac(de); | 2065 | rc = de_reset_mac(de); |
2079 | if (rc) { | 2066 | if (rc) { |
2080 | pr_err(PFX "Cannot reset MAC, pci dev %s\n", pci_name(pdev)); | 2067 | pr_err("Cannot reset MAC, pci dev %s\n", pci_name(pdev)); |
2081 | goto err_out_iomap; | 2068 | goto err_out_iomap; |
2082 | } | 2069 | } |
2083 | 2070 | ||
@@ -2097,11 +2084,11 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2097 | goto err_out_iomap; | 2084 | goto err_out_iomap; |
2098 | 2085 | ||
2099 | /* print info about board and interface just registered */ | 2086 | /* print info about board and interface just registered */ |
2100 | dev_info(&dev->dev, "%s at 0x%lx, %pM, IRQ %d\n", | 2087 | netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n", |
2101 | de->de21040 ? "21040" : "21041", | 2088 | de->de21040 ? "21040" : "21041", |
2102 | dev->base_addr, | 2089 | dev->base_addr, |
2103 | dev->dev_addr, | 2090 | dev->dev_addr, |
2104 | dev->irq); | 2091 | dev->irq); |
2105 | 2092 | ||
2106 | pci_set_drvdata(pdev, dev); | 2093 | pci_set_drvdata(pdev, dev); |
2107 | 2094 | ||
@@ -2189,7 +2176,7 @@ static int de_resume (struct pci_dev *pdev) | |||
2189 | if (!netif_running(dev)) | 2176 | if (!netif_running(dev)) |
2190 | goto out_attach; | 2177 | goto out_attach; |
2191 | if ((retval = pci_enable_device(pdev))) { | 2178 | if ((retval = pci_enable_device(pdev))) { |
2192 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); | 2179 | netdev_err(dev, "pci_enable_device failed in resume\n"); |
2193 | goto out; | 2180 | goto out; |
2194 | } | 2181 | } |
2195 | pci_set_master(pdev); | 2182 | pci_set_master(pdev); |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index fb07f48910ae..96e8541a76e9 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -406,7 +406,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
406 | SET_NETDEV_DEV(dev, &pdev->dev); | 406 | SET_NETDEV_DEV(dev, &pdev->dev); |
407 | 407 | ||
408 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 408 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { |
409 | pr_warning("32-bit PCI DMA not available\n"); | 409 | pr_warn("32-bit PCI DMA not available\n"); |
410 | err = -ENODEV; | 410 | err = -ENODEV; |
411 | goto err_out_free; | 411 | goto err_out_free; |
412 | } | 412 | } |
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c index 296486bf0956..fa5eee925f25 100644 --- a/drivers/net/tulip/eeprom.c +++ b/drivers/net/tulip/eeprom.c | |||
@@ -222,8 +222,8 @@ subsequent_board: | |||
222 | /* there is no phy information, don't even try to build mtable */ | 222 | /* there is no phy information, don't even try to build mtable */ |
223 | if (count == 0) { | 223 | if (count == 0) { |
224 | if (tulip_debug > 0) | 224 | if (tulip_debug > 0) |
225 | pr_warning("%s: no phy info, aborting mtable build\n", | 225 | pr_warn("%s: no phy info, aborting mtable build\n", |
226 | dev->name); | 226 | dev->name); |
227 | return; | 227 | return; |
228 | } | 228 | } |
229 | 229 | ||
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 5c01e260f1ba..f46898a588d1 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -12,6 +12,7 @@ | |||
12 | Please submit bugs to http://bugzilla.kernel.org/ . | 12 | Please submit bugs to http://bugzilla.kernel.org/ . |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define pr_fmt(fmt) "tulip: " fmt | ||
15 | 16 | ||
16 | #define DRV_NAME "tulip" | 17 | #define DRV_NAME "tulip" |
17 | #ifdef CONFIG_TULIP_NAPI | 18 | #ifdef CONFIG_TULIP_NAPI |
@@ -119,8 +120,6 @@ module_param(csr0, int, 0); | |||
119 | module_param_array(options, int, NULL, 0); | 120 | module_param_array(options, int, NULL, 0); |
120 | module_param_array(full_duplex, int, NULL, 0); | 121 | module_param_array(full_duplex, int, NULL, 0); |
121 | 122 | ||
122 | #define PFX DRV_NAME ": " | ||
123 | |||
124 | #ifdef TULIP_DEBUG | 123 | #ifdef TULIP_DEBUG |
125 | int tulip_debug = TULIP_DEBUG; | 124 | int tulip_debug = TULIP_DEBUG; |
126 | #else | 125 | #else |
@@ -1340,13 +1339,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1340 | */ | 1339 | */ |
1341 | 1340 | ||
1342 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) { | 1341 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) { |
1343 | pr_err(PFX "skipping LMC card\n"); | 1342 | pr_err("skipping LMC card\n"); |
1344 | return -ENODEV; | 1343 | return -ENODEV; |
1345 | } else if (pdev->subsystem_vendor == PCI_VENDOR_ID_SBE && | 1344 | } else if (pdev->subsystem_vendor == PCI_VENDOR_ID_SBE && |
1346 | (pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_T3E3 || | 1345 | (pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_T3E3 || |
1347 | pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P0 || | 1346 | pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P0 || |
1348 | pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P1)) { | 1347 | pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P1)) { |
1349 | pr_err(PFX "skipping SBE T3E3 port\n"); | 1348 | pr_err("skipping SBE T3E3 port\n"); |
1350 | return -ENODEV; | 1349 | return -ENODEV; |
1351 | } | 1350 | } |
1352 | 1351 | ||
@@ -1362,13 +1361,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1362 | 1361 | ||
1363 | if (pdev->vendor == 0x1282 && pdev->device == 0x9100 && | 1362 | if (pdev->vendor == 0x1282 && pdev->device == 0x9100 && |
1364 | pdev->revision < 0x30) { | 1363 | pdev->revision < 0x30) { |
1365 | pr_info(PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); | 1364 | pr_info("skipping early DM9100 with Crc bug (use dmfe)\n"); |
1366 | return -ENODEV; | 1365 | return -ENODEV; |
1367 | } | 1366 | } |
1368 | 1367 | ||
1369 | dp = pci_device_to_OF_node(pdev); | 1368 | dp = pci_device_to_OF_node(pdev); |
1370 | if (!(dp && of_get_property(dp, "local-mac-address", NULL))) { | 1369 | if (!(dp && of_get_property(dp, "local-mac-address", NULL))) { |
1371 | pr_info(PFX "skipping DM910x expansion card (use dmfe)\n"); | 1370 | pr_info("skipping DM910x expansion card (use dmfe)\n"); |
1372 | return -ENODEV; | 1371 | return -ENODEV; |
1373 | } | 1372 | } |
1374 | } | 1373 | } |
@@ -1415,16 +1414,14 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1415 | 1414 | ||
1416 | i = pci_enable_device(pdev); | 1415 | i = pci_enable_device(pdev); |
1417 | if (i) { | 1416 | if (i) { |
1418 | pr_err(PFX "Cannot enable tulip board #%d, aborting\n", | 1417 | pr_err("Cannot enable tulip board #%d, aborting\n", board_idx); |
1419 | board_idx); | ||
1420 | return i; | 1418 | return i; |
1421 | } | 1419 | } |
1422 | 1420 | ||
1423 | /* The chip will fail to enter a low-power state later unless | 1421 | /* The chip will fail to enter a low-power state later unless |
1424 | * first explicitly commanded into D0 */ | 1422 | * first explicitly commanded into D0 */ |
1425 | if (pci_set_power_state(pdev, PCI_D0)) { | 1423 | if (pci_set_power_state(pdev, PCI_D0)) { |
1426 | printk (KERN_NOTICE PFX | 1424 | pr_notice("Failed to set power state to D0\n"); |
1427 | "Failed to set power state to D0\n"); | ||
1428 | } | 1425 | } |
1429 | 1426 | ||
1430 | irq = pdev->irq; | 1427 | irq = pdev->irq; |
@@ -1432,13 +1429,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1432 | /* alloc_etherdev ensures aligned and zeroed private structures */ | 1429 | /* alloc_etherdev ensures aligned and zeroed private structures */ |
1433 | dev = alloc_etherdev (sizeof (*tp)); | 1430 | dev = alloc_etherdev (sizeof (*tp)); |
1434 | if (!dev) { | 1431 | if (!dev) { |
1435 | pr_err(PFX "ether device alloc failed, aborting\n"); | 1432 | pr_err("ether device alloc failed, aborting\n"); |
1436 | return -ENOMEM; | 1433 | return -ENOMEM; |
1437 | } | 1434 | } |
1438 | 1435 | ||
1439 | SET_NETDEV_DEV(dev, &pdev->dev); | 1436 | SET_NETDEV_DEV(dev, &pdev->dev); |
1440 | if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) { | 1437 | if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) { |
1441 | pr_err(PFX "%s: I/O region (0x%llx@0x%llx) too small, aborting\n", | 1438 | pr_err("%s: I/O region (0x%llx@0x%llx) too small, aborting\n", |
1442 | pci_name(pdev), | 1439 | pci_name(pdev), |
1443 | (unsigned long long)pci_resource_len (pdev, 0), | 1440 | (unsigned long long)pci_resource_len (pdev, 0), |
1444 | (unsigned long long)pci_resource_start (pdev, 0)); | 1441 | (unsigned long long)pci_resource_start (pdev, 0)); |
@@ -1905,12 +1902,12 @@ static int tulip_resume(struct pci_dev *pdev) | |||
1905 | return 0; | 1902 | return 0; |
1906 | 1903 | ||
1907 | if ((retval = pci_enable_device(pdev))) { | 1904 | if ((retval = pci_enable_device(pdev))) { |
1908 | pr_err(PFX "pci_enable_device failed in resume\n"); | 1905 | pr_err("pci_enable_device failed in resume\n"); |
1909 | return retval; | 1906 | return retval; |
1910 | } | 1907 | } |
1911 | 1908 | ||
1912 | if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) { | 1909 | if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) { |
1913 | pr_err(PFX "request_irq failed in resume\n"); | 1910 | pr_err("request_irq failed in resume\n"); |
1914 | return retval; | 1911 | return retval; |
1915 | } | 1912 | } |
1916 | 1913 | ||
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index a4375c406b5f..92c00ee55961 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c | |||
@@ -292,7 +292,7 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev, | |||
292 | SET_NETDEV_DEV(dev, &pdev->dev); | 292 | SET_NETDEV_DEV(dev, &pdev->dev); |
293 | 293 | ||
294 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 294 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { |
295 | pr_warning("32-bit PCI DMA not available\n"); | 295 | pr_warn("32-bit PCI DMA not available\n"); |
296 | err = -ENODEV; | 296 | err = -ENODEV; |
297 | goto err_out_free; | 297 | goto err_out_free; |
298 | } | 298 | } |
@@ -390,9 +390,9 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev, | |||
390 | if (err) | 390 | if (err) |
391 | goto err_out_res; | 391 | goto err_out_res; |
392 | 392 | ||
393 | dev_info(&dev->dev, "ULi M%04lx at pci%s, %pM, irq %d\n", | 393 | netdev_info(dev, "ULi M%04lx at pci%s, %pM, irq %d\n", |
394 | ent->driver_data >> 16, pci_name(pdev), | 394 | ent->driver_data >> 16, pci_name(pdev), |
395 | dev->dev_addr, dev->irq); | 395 | dev->dev_addr, dev->irq); |
396 | 396 | ||
397 | pci_set_master(pdev); | 397 | pci_set_master(pdev); |
398 | 398 | ||
@@ -524,7 +524,7 @@ static void uli526x_init(struct net_device *dev) | |||
524 | } | 524 | } |
525 | } | 525 | } |
526 | if(phy_tmp == 32) | 526 | if(phy_tmp == 32) |
527 | pr_warning("Can not find the phy address!!!"); | 527 | pr_warn("Can not find the phy address!!!\n"); |
528 | /* Parser SROM and media mode */ | 528 | /* Parser SROM and media mode */ |
529 | db->media_mode = uli526x_media_mode; | 529 | db->media_mode = uli526x_media_mode; |
530 | 530 | ||
@@ -590,7 +590,7 @@ static netdev_tx_t uli526x_start_xmit(struct sk_buff *skb, | |||
590 | 590 | ||
591 | /* Too large packet check */ | 591 | /* Too large packet check */ |
592 | if (skb->len > MAX_PACKET_SIZE) { | 592 | if (skb->len > MAX_PACKET_SIZE) { |
593 | pr_err("big packet = %d\n", (u16)skb->len); | 593 | netdev_err(dev, "big packet = %d\n", (u16)skb->len); |
594 | dev_kfree_skb(skb); | 594 | dev_kfree_skb(skb); |
595 | return NETDEV_TX_OK; | 595 | return NETDEV_TX_OK; |
596 | } | 596 | } |
@@ -600,7 +600,7 @@ static netdev_tx_t uli526x_start_xmit(struct sk_buff *skb, | |||
600 | /* No Tx resource check, it never happen nromally */ | 600 | /* No Tx resource check, it never happen nromally */ |
601 | if (db->tx_packet_cnt >= TX_FREE_DESC_CNT) { | 601 | if (db->tx_packet_cnt >= TX_FREE_DESC_CNT) { |
602 | spin_unlock_irqrestore(&db->lock, flags); | 602 | spin_unlock_irqrestore(&db->lock, flags); |
603 | pr_err("No Tx resource %ld\n", db->tx_packet_cnt); | 603 | netdev_err(dev, "No Tx resource %ld\n", db->tx_packet_cnt); |
604 | return NETDEV_TX_BUSY; | 604 | return NETDEV_TX_BUSY; |
605 | } | 605 | } |
606 | 606 | ||
@@ -1024,7 +1024,6 @@ static void uli526x_timer(unsigned long data) | |||
1024 | struct net_device *dev = (struct net_device *) data; | 1024 | struct net_device *dev = (struct net_device *) data; |
1025 | struct uli526x_board_info *db = netdev_priv(dev); | 1025 | struct uli526x_board_info *db = netdev_priv(dev); |
1026 | unsigned long flags; | 1026 | unsigned long flags; |
1027 | u8 TmpSpeed=10; | ||
1028 | 1027 | ||
1029 | //ULI526X_DBUG(0, "uli526x_timer()", 0); | 1028 | //ULI526X_DBUG(0, "uli526x_timer()", 0); |
1030 | spin_lock_irqsave(&db->lock, flags); | 1029 | spin_lock_irqsave(&db->lock, flags); |
@@ -1070,7 +1069,7 @@ static void uli526x_timer(unsigned long data) | |||
1070 | /* Link Failed */ | 1069 | /* Link Failed */ |
1071 | ULI526X_DBUG(0, "Link Failed", tmp_cr12); | 1070 | ULI526X_DBUG(0, "Link Failed", tmp_cr12); |
1072 | netif_carrier_off(dev); | 1071 | netif_carrier_off(dev); |
1073 | pr_info("%s NIC Link is Down\n",dev->name); | 1072 | netdev_info(dev, "NIC Link is Down\n"); |
1074 | db->link_failed = 1; | 1073 | db->link_failed = 1; |
1075 | 1074 | ||
1076 | /* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */ | 1075 | /* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */ |
@@ -1096,18 +1095,13 @@ static void uli526x_timer(unsigned long data) | |||
1096 | 1095 | ||
1097 | if(db->link_failed==0) | 1096 | if(db->link_failed==0) |
1098 | { | 1097 | { |
1099 | if(db->op_mode==ULI526X_100MHF || db->op_mode==ULI526X_100MFD) | 1098 | netdev_info(dev, "NIC Link is Up %d Mbps %s duplex\n", |
1100 | { | 1099 | (db->op_mode == ULI526X_100MHF || |
1101 | TmpSpeed = 100; | 1100 | db->op_mode == ULI526X_100MFD) |
1102 | } | 1101 | ? 100 : 10, |
1103 | if(db->op_mode==ULI526X_10MFD || db->op_mode==ULI526X_100MFD) | 1102 | (db->op_mode == ULI526X_10MFD || |
1104 | { | 1103 | db->op_mode == ULI526X_100MFD) |
1105 | pr_info("%s NIC Link is Up %d Mbps Full duplex\n",dev->name,TmpSpeed); | 1104 | ? "Full" : "Half"); |
1106 | } | ||
1107 | else | ||
1108 | { | ||
1109 | pr_info("%s NIC Link is Up %d Mbps Half duplex\n",dev->name,TmpSpeed); | ||
1110 | } | ||
1111 | netif_carrier_on(dev); | 1105 | netif_carrier_on(dev); |
1112 | } | 1106 | } |
1113 | /* SHOW_MEDIA_TYPE(db->op_mode); */ | 1107 | /* SHOW_MEDIA_TYPE(db->op_mode); */ |
@@ -1116,7 +1110,7 @@ static void uli526x_timer(unsigned long data) | |||
1116 | { | 1110 | { |
1117 | if(db->init==1) | 1111 | if(db->init==1) |
1118 | { | 1112 | { |
1119 | pr_info("%s NIC Link is Down\n",dev->name); | 1113 | netdev_info(dev, "NIC Link is Down\n"); |
1120 | netif_carrier_off(dev); | 1114 | netif_carrier_off(dev); |
1121 | } | 1115 | } |
1122 | } | 1116 | } |
@@ -1242,7 +1236,7 @@ static int uli526x_resume(struct pci_dev *pdev) | |||
1242 | 1236 | ||
1243 | err = pci_set_power_state(pdev, PCI_D0); | 1237 | err = pci_set_power_state(pdev, PCI_D0); |
1244 | if (err) { | 1238 | if (err) { |
1245 | dev_warn(&dev->dev, "Could not put device into D0\n"); | 1239 | netdev_warn(dev, "Could not put device into D0\n"); |
1246 | return err; | 1240 | return err; |
1247 | } | 1241 | } |
1248 | 1242 | ||
@@ -1443,7 +1437,7 @@ static void send_filter_frame(struct net_device *dev, int mc_cnt) | |||
1443 | update_cr6(db->cr6_data, dev->base_addr); | 1437 | update_cr6(db->cr6_data, dev->base_addr); |
1444 | dev->trans_start = jiffies; | 1438 | dev->trans_start = jiffies; |
1445 | } else | 1439 | } else |
1446 | pr_err("No Tx resource - Send_filter_frame!\n"); | 1440 | netdev_err(dev, "No Tx resource - Send_filter_frame!\n"); |
1447 | } | 1441 | } |
1448 | 1442 | ||
1449 | 1443 | ||
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index f0b231035dee..939c96e2438a 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
@@ -44,6 +44,8 @@ | |||
44 | * Wake-On-LAN | 44 | * Wake-On-LAN |
45 | */ | 45 | */ |
46 | 46 | ||
47 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
48 | |||
47 | #define DRV_NAME "winbond-840" | 49 | #define DRV_NAME "winbond-840" |
48 | #define DRV_VERSION "1.01-e" | 50 | #define DRV_VERSION "1.01-e" |
49 | #define DRV_RELDATE "Sep-11-2006" | 51 | #define DRV_RELDATE "Sep-11-2006" |
@@ -375,8 +377,8 @@ static int __devinit w840_probe1 (struct pci_dev *pdev, | |||
375 | irq = pdev->irq; | 377 | irq = pdev->irq; |
376 | 378 | ||
377 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 379 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { |
378 | pr_warning("Winbond-840: Device %s disabled due to DMA limitations\n", | 380 | pr_warn("Device %s disabled due to DMA limitations\n", |
379 | pci_name(pdev)); | 381 | pci_name(pdev)); |
380 | return -EIO; | 382 | return -EIO; |
381 | } | 383 | } |
382 | dev = alloc_etherdev(sizeof(*np)); | 384 | dev = alloc_etherdev(sizeof(*np)); |
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index d0d0cbe3dc17..7e8287260c2f 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -262,8 +262,8 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
262 | goto reg_fail; | 262 | goto reg_fail; |
263 | } | 263 | } |
264 | 264 | ||
265 | dev_info(&dev->dev, "Xircom cardbus revision %i at irq %i\n", | 265 | netdev_info(dev, "Xircom cardbus revision %i at irq %i\n", |
266 | pdev->revision, pdev->irq); | 266 | pdev->revision, pdev->irq); |
267 | /* start the transmitter to get a heartbeat */ | 267 | /* start the transmitter to get a heartbeat */ |
268 | /* TODO: send 2 dummy packets here */ | 268 | /* TODO: send 2 dummy packets here */ |
269 | transceiver_voodoo(private); | 269 | transceiver_voodoo(private); |
@@ -335,7 +335,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance) | |||
335 | int newlink; | 335 | int newlink; |
336 | printk(KERN_DEBUG "xircom_cb: Link status has changed\n"); | 336 | printk(KERN_DEBUG "xircom_cb: Link status has changed\n"); |
337 | newlink = link_status(card); | 337 | newlink = link_status(card); |
338 | dev_info(&dev->dev, "Link is %i mbit\n", newlink); | 338 | netdev_info(dev, "Link is %d mbit\n", newlink); |
339 | if (newlink) | 339 | if (newlink) |
340 | netif_carrier_on(dev); | 340 | netif_carrier_on(dev); |
341 | else | 341 | else |
@@ -426,8 +426,8 @@ static int xircom_open(struct net_device *dev) | |||
426 | struct xircom_private *xp = netdev_priv(dev); | 426 | struct xircom_private *xp = netdev_priv(dev); |
427 | int retval; | 427 | int retval; |
428 | 428 | ||
429 | pr_info("xircom cardbus adaptor found, registering as %s, using irq %i\n", | 429 | netdev_info(dev, "xircom cardbus adaptor found, using irq %i\n", |
430 | dev->name, dev->irq); | 430 | dev->irq); |
431 | retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev); | 431 | retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev); |
432 | if (retval) | 432 | if (retval) |
433 | return retval; | 433 | return retval; |
@@ -703,7 +703,7 @@ static void activate_receiver(struct xircom_private *card) | |||
703 | udelay(50); | 703 | udelay(50); |
704 | counter--; | 704 | counter--; |
705 | if (counter <= 0) | 705 | if (counter <= 0) |
706 | pr_err("Receiver failed to deactivate\n"); | 706 | netdev_err(card->dev, "Receiver failed to deactivate\n"); |
707 | } | 707 | } |
708 | 708 | ||
709 | /* enable the receiver */ | 709 | /* enable the receiver */ |
@@ -720,7 +720,8 @@ static void activate_receiver(struct xircom_private *card) | |||
720 | udelay(50); | 720 | udelay(50); |
721 | counter--; | 721 | counter--; |
722 | if (counter <= 0) | 722 | if (counter <= 0) |
723 | pr_err("Receiver failed to re-activate\n"); | 723 | netdev_err(card->dev, |
724 | "Receiver failed to re-activate\n"); | ||
724 | } | 725 | } |
725 | } | 726 | } |
726 | 727 | ||
@@ -748,7 +749,7 @@ static void deactivate_receiver(struct xircom_private *card) | |||
748 | udelay(50); | 749 | udelay(50); |
749 | counter--; | 750 | counter--; |
750 | if (counter <= 0) | 751 | if (counter <= 0) |
751 | pr_err("Receiver failed to deactivate\n"); | 752 | netdev_err(card->dev, "Receiver failed to deactivate\n"); |
752 | } | 753 | } |
753 | } | 754 | } |
754 | 755 | ||
@@ -786,7 +787,8 @@ static void activate_transmitter(struct xircom_private *card) | |||
786 | udelay(50); | 787 | udelay(50); |
787 | counter--; | 788 | counter--; |
788 | if (counter <= 0) | 789 | if (counter <= 0) |
789 | pr_err("Transmitter failed to deactivate\n"); | 790 | netdev_err(card->dev, |
791 | "Transmitter failed to deactivate\n"); | ||
790 | } | 792 | } |
791 | 793 | ||
792 | /* enable the transmitter */ | 794 | /* enable the transmitter */ |
@@ -803,7 +805,8 @@ static void activate_transmitter(struct xircom_private *card) | |||
803 | udelay(50); | 805 | udelay(50); |
804 | counter--; | 806 | counter--; |
805 | if (counter <= 0) | 807 | if (counter <= 0) |
806 | pr_err("Transmitter failed to re-activate\n"); | 808 | netdev_err(card->dev, |
809 | "Transmitter failed to re-activate\n"); | ||
807 | } | 810 | } |
808 | } | 811 | } |
809 | 812 | ||
@@ -831,7 +834,8 @@ static void deactivate_transmitter(struct xircom_private *card) | |||
831 | udelay(50); | 834 | udelay(50); |
832 | counter--; | 835 | counter--; |
833 | if (counter <= 0) | 836 | if (counter <= 0) |
834 | pr_err("Transmitter failed to deactivate\n"); | 837 | netdev_err(card->dev, |
838 | "Transmitter failed to deactivate\n"); | ||
835 | } | 839 | } |
836 | } | 840 | } |
837 | 841 | ||
@@ -1060,75 +1064,81 @@ static void xircom_up(struct xircom_private *card) | |||
1060 | } | 1064 | } |
1061 | 1065 | ||
1062 | /* Bufferoffset is in BYTES */ | 1066 | /* Bufferoffset is in BYTES */ |
1063 | static void investigate_read_descriptor(struct net_device *dev,struct xircom_private *card, int descnr, unsigned int bufferoffset) | 1067 | static void |
1068 | investigate_read_descriptor(struct net_device *dev, struct xircom_private *card, | ||
1069 | int descnr, unsigned int bufferoffset) | ||
1064 | { | 1070 | { |
1065 | int status; | 1071 | int status; |
1066 | 1072 | ||
1067 | status = le32_to_cpu(card->rx_buffer[4*descnr]); | 1073 | status = le32_to_cpu(card->rx_buffer[4*descnr]); |
1068 | 1074 | ||
1069 | if ((status > 0)) { /* packet received */ | 1075 | if (status > 0) { /* packet received */ |
1070 | 1076 | ||
1071 | /* TODO: discard error packets */ | 1077 | /* TODO: discard error packets */ |
1072 | 1078 | ||
1073 | short pkt_len = ((status >> 16) & 0x7ff) - 4; /* minus 4, we don't want the CRC */ | 1079 | short pkt_len = ((status >> 16) & 0x7ff) - 4; |
1074 | struct sk_buff *skb; | 1080 | /* minus 4, we don't want the CRC */ |
1081 | struct sk_buff *skb; | ||
1075 | 1082 | ||
1076 | if (pkt_len > 1518) { | 1083 | if (pkt_len > 1518) { |
1077 | pr_err("Packet length %i is bogus\n", pkt_len); | 1084 | netdev_err(dev, "Packet length %i is bogus\n", pkt_len); |
1078 | pkt_len = 1518; | 1085 | pkt_len = 1518; |
1079 | } | 1086 | } |
1080 | 1087 | ||
1081 | skb = dev_alloc_skb(pkt_len + 2); | 1088 | skb = dev_alloc_skb(pkt_len + 2); |
1082 | if (skb == NULL) { | 1089 | if (skb == NULL) { |
1083 | dev->stats.rx_dropped++; | 1090 | dev->stats.rx_dropped++; |
1084 | goto out; | 1091 | goto out; |
1085 | } | ||
1086 | skb_reserve(skb, 2); | ||
1087 | skb_copy_to_linear_data(skb, (unsigned char*)&card->rx_buffer[bufferoffset / 4], pkt_len); | ||
1088 | skb_put(skb, pkt_len); | ||
1089 | skb->protocol = eth_type_trans(skb, dev); | ||
1090 | netif_rx(skb); | ||
1091 | dev->stats.rx_packets++; | ||
1092 | dev->stats.rx_bytes += pkt_len; | ||
1093 | |||
1094 | out: | ||
1095 | /* give the buffer back to the card */ | ||
1096 | card->rx_buffer[4*descnr] = cpu_to_le32(0x80000000); | ||
1097 | trigger_receive(card); | ||
1098 | } | 1092 | } |
1093 | skb_reserve(skb, 2); | ||
1094 | skb_copy_to_linear_data(skb, | ||
1095 | &card->rx_buffer[bufferoffset / 4], | ||
1096 | pkt_len); | ||
1097 | skb_put(skb, pkt_len); | ||
1098 | skb->protocol = eth_type_trans(skb, dev); | ||
1099 | netif_rx(skb); | ||
1100 | dev->stats.rx_packets++; | ||
1101 | dev->stats.rx_bytes += pkt_len; | ||
1102 | |||
1103 | out: | ||
1104 | /* give the buffer back to the card */ | ||
1105 | card->rx_buffer[4*descnr] = cpu_to_le32(0x80000000); | ||
1106 | trigger_receive(card); | ||
1107 | } | ||
1099 | } | 1108 | } |
1100 | 1109 | ||
1101 | 1110 | ||
1102 | /* Bufferoffset is in BYTES */ | 1111 | /* Bufferoffset is in BYTES */ |
1103 | static void investigate_write_descriptor(struct net_device *dev, struct xircom_private *card, int descnr, unsigned int bufferoffset) | 1112 | static void |
1113 | investigate_write_descriptor(struct net_device *dev, | ||
1114 | struct xircom_private *card, | ||
1115 | int descnr, unsigned int bufferoffset) | ||
1104 | { | 1116 | { |
1105 | int status; | 1117 | int status; |
1106 | 1118 | ||
1107 | status = le32_to_cpu(card->tx_buffer[4*descnr]); | 1119 | status = le32_to_cpu(card->tx_buffer[4*descnr]); |
1108 | #if 0 | 1120 | #if 0 |
1109 | if (status & 0x8000) { /* Major error */ | 1121 | if (status & 0x8000) { /* Major error */ |
1110 | pr_err("Major transmit error status %x\n", status); | 1122 | pr_err("Major transmit error status %x\n", status); |
1111 | card->tx_buffer[4*descnr] = 0; | 1123 | card->tx_buffer[4*descnr] = 0; |
1112 | netif_wake_queue (dev); | 1124 | netif_wake_queue (dev); |
1113 | } | 1125 | } |
1114 | #endif | 1126 | #endif |
1115 | if (status > 0) { /* bit 31 is 0 when done */ | 1127 | if (status > 0) { /* bit 31 is 0 when done */ |
1116 | if (card->tx_skb[descnr]!=NULL) { | 1128 | if (card->tx_skb[descnr]!=NULL) { |
1117 | dev->stats.tx_bytes += card->tx_skb[descnr]->len; | 1129 | dev->stats.tx_bytes += card->tx_skb[descnr]->len; |
1118 | dev_kfree_skb_irq(card->tx_skb[descnr]); | 1130 | dev_kfree_skb_irq(card->tx_skb[descnr]); |
1119 | } | ||
1120 | card->tx_skb[descnr] = NULL; | ||
1121 | /* Bit 8 in the status field is 1 if there was a collision */ | ||
1122 | if (status&(1<<8)) | ||
1123 | dev->stats.collisions++; | ||
1124 | card->tx_buffer[4*descnr] = 0; /* descriptor is free again */ | ||
1125 | netif_wake_queue (dev); | ||
1126 | dev->stats.tx_packets++; | ||
1127 | } | 1131 | } |
1128 | 1132 | card->tx_skb[descnr] = NULL; | |
1133 | /* Bit 8 in the status field is 1 if there was a collision */ | ||
1134 | if (status & (1 << 8)) | ||
1135 | dev->stats.collisions++; | ||
1136 | card->tx_buffer[4*descnr] = 0; /* descriptor is free again */ | ||
1137 | netif_wake_queue (dev); | ||
1138 | dev->stats.tx_packets++; | ||
1139 | } | ||
1129 | } | 1140 | } |
1130 | 1141 | ||
1131 | |||
1132 | static int __init xircom_init(void) | 1142 | static int __init xircom_init(void) |
1133 | { | 1143 | { |
1134 | return pci_register_driver(&xircom_ops); | 1144 | return pci_register_driver(&xircom_ops); |