diff options
author | Joe Perches <joe@perches.com> | 2010-02-15 03:34:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 18:45:44 -0500 |
commit | 13ff83b90f1dfae1068a250e8d99d3f9991cfa9d (patch) | |
tree | af2082ea4adec312e47152fa840a91157e5e330c /drivers/net/pcnet32.c | |
parent | 249658d5c24e42f19b3721b654d64a46816e9b0e (diff) |
drivers/net/pcnet32.c: Use (pr|netdev|netif)_<levels> macro helpers
Make the output logging messages a bit more consistent.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcnet32.c')
-rw-r--r-- | drivers/net/pcnet32.c | 347 |
1 files changed, 130 insertions, 217 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 3522794550dd..9194abc11eef 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -21,6 +21,8 @@ | |||
21 | * | 21 | * |
22 | *************************************************************************/ | 22 | *************************************************************************/ |
23 | 23 | ||
24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
25 | |||
24 | #define DRV_NAME "pcnet32" | 26 | #define DRV_NAME "pcnet32" |
25 | #define DRV_VERSION "1.35" | 27 | #define DRV_VERSION "1.35" |
26 | #define DRV_RELDATE "21.Apr.2008" | 28 | #define DRV_RELDATE "21.Apr.2008" |
@@ -487,10 +489,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
487 | (1 << size), | 489 | (1 << size), |
488 | &new_ring_dma_addr); | 490 | &new_ring_dma_addr); |
489 | if (new_tx_ring == NULL) { | 491 | if (new_tx_ring == NULL) { |
490 | if (netif_msg_drv(lp)) | 492 | netif_err(lp, drv, dev, "Consistent memory allocation failed\n"); |
491 | printk(KERN_ERR | ||
492 | "%s: Consistent memory allocation failed.\n", | ||
493 | dev->name); | ||
494 | return; | 493 | return; |
495 | } | 494 | } |
496 | memset(new_tx_ring, 0, sizeof(struct pcnet32_tx_head) * (1 << size)); | 495 | memset(new_tx_ring, 0, sizeof(struct pcnet32_tx_head) * (1 << size)); |
@@ -498,18 +497,14 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
498 | new_dma_addr_list = kcalloc((1 << size), sizeof(dma_addr_t), | 497 | new_dma_addr_list = kcalloc((1 << size), sizeof(dma_addr_t), |
499 | GFP_ATOMIC); | 498 | GFP_ATOMIC); |
500 | if (!new_dma_addr_list) { | 499 | if (!new_dma_addr_list) { |
501 | if (netif_msg_drv(lp)) | 500 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
502 | printk(KERN_ERR | ||
503 | "%s: Memory allocation failed.\n", dev->name); | ||
504 | goto free_new_tx_ring; | 501 | goto free_new_tx_ring; |
505 | } | 502 | } |
506 | 503 | ||
507 | new_skb_list = kcalloc((1 << size), sizeof(struct sk_buff *), | 504 | new_skb_list = kcalloc((1 << size), sizeof(struct sk_buff *), |
508 | GFP_ATOMIC); | 505 | GFP_ATOMIC); |
509 | if (!new_skb_list) { | 506 | if (!new_skb_list) { |
510 | if (netif_msg_drv(lp)) | 507 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
511 | printk(KERN_ERR | ||
512 | "%s: Memory allocation failed.\n", dev->name); | ||
513 | goto free_new_lists; | 508 | goto free_new_lists; |
514 | } | 509 | } |
515 | 510 | ||
@@ -565,10 +560,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
565 | (1 << size), | 560 | (1 << size), |
566 | &new_ring_dma_addr); | 561 | &new_ring_dma_addr); |
567 | if (new_rx_ring == NULL) { | 562 | if (new_rx_ring == NULL) { |
568 | if (netif_msg_drv(lp)) | 563 | netif_err(lp, drv, dev, "Consistent memory allocation failed\n"); |
569 | printk(KERN_ERR | ||
570 | "%s: Consistent memory allocation failed.\n", | ||
571 | dev->name); | ||
572 | return; | 564 | return; |
573 | } | 565 | } |
574 | memset(new_rx_ring, 0, sizeof(struct pcnet32_rx_head) * (1 << size)); | 566 | memset(new_rx_ring, 0, sizeof(struct pcnet32_rx_head) * (1 << size)); |
@@ -576,18 +568,14 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
576 | new_dma_addr_list = kcalloc((1 << size), sizeof(dma_addr_t), | 568 | new_dma_addr_list = kcalloc((1 << size), sizeof(dma_addr_t), |
577 | GFP_ATOMIC); | 569 | GFP_ATOMIC); |
578 | if (!new_dma_addr_list) { | 570 | if (!new_dma_addr_list) { |
579 | if (netif_msg_drv(lp)) | 571 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
580 | printk(KERN_ERR | ||
581 | "%s: Memory allocation failed.\n", dev->name); | ||
582 | goto free_new_rx_ring; | 572 | goto free_new_rx_ring; |
583 | } | 573 | } |
584 | 574 | ||
585 | new_skb_list = kcalloc((1 << size), sizeof(struct sk_buff *), | 575 | new_skb_list = kcalloc((1 << size), sizeof(struct sk_buff *), |
586 | GFP_ATOMIC); | 576 | GFP_ATOMIC); |
587 | if (!new_skb_list) { | 577 | if (!new_skb_list) { |
588 | if (netif_msg_drv(lp)) | 578 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
589 | printk(KERN_ERR | ||
590 | "%s: Memory allocation failed.\n", dev->name); | ||
591 | goto free_new_lists; | 579 | goto free_new_lists; |
592 | } | 580 | } |
593 | 581 | ||
@@ -604,10 +592,8 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
604 | new_skb_list[new] = dev_alloc_skb(PKT_BUF_SKB); | 592 | new_skb_list[new] = dev_alloc_skb(PKT_BUF_SKB); |
605 | if (!(rx_skbuff = new_skb_list[new])) { | 593 | if (!(rx_skbuff = new_skb_list[new])) { |
606 | /* keep the original lists and buffers */ | 594 | /* keep the original lists and buffers */ |
607 | if (netif_msg_drv(lp)) | 595 | netif_err(lp, drv, dev, "%s dev_alloc_skb failed\n", |
608 | printk(KERN_ERR | 596 | __func__); |
609 | "%s: pcnet32_realloc_rx_ring dev_alloc_skb failed.\n", | ||
610 | dev->name); | ||
611 | goto free_all_new; | 597 | goto free_all_new; |
612 | } | 598 | } |
613 | skb_reserve(rx_skbuff, NET_IP_ALIGN); | 599 | skb_reserve(rx_skbuff, NET_IP_ALIGN); |
@@ -838,10 +824,8 @@ static int pcnet32_set_ringparam(struct net_device *dev, | |||
838 | 824 | ||
839 | spin_unlock_irqrestore(&lp->lock, flags); | 825 | spin_unlock_irqrestore(&lp->lock, flags); |
840 | 826 | ||
841 | if (netif_msg_drv(lp)) | 827 | netif_info(lp, drv, dev, "Ring Param Settings: RX: %d, TX: %d\n", |
842 | printk(KERN_INFO | 828 | lp->rx_ring_size, lp->tx_ring_size); |
843 | "%s: Ring Param Settings: RX: %d, TX: %d\n", dev->name, | ||
844 | lp->rx_ring_size, lp->tx_ring_size); | ||
845 | 829 | ||
846 | return 0; | 830 | return 0; |
847 | } | 831 | } |
@@ -871,17 +855,15 @@ static void pcnet32_ethtool_test(struct net_device *dev, | |||
871 | if (test->flags == ETH_TEST_FL_OFFLINE) { | 855 | if (test->flags == ETH_TEST_FL_OFFLINE) { |
872 | rc = pcnet32_loopback_test(dev, data); | 856 | rc = pcnet32_loopback_test(dev, data); |
873 | if (rc) { | 857 | if (rc) { |
874 | if (netif_msg_hw(lp)) | 858 | netif_printk(lp, hw, KERN_DEBUG, dev, |
875 | printk(KERN_DEBUG "%s: Loopback test failed.\n", | 859 | "Loopback test failed\n"); |
876 | dev->name); | ||
877 | test->flags |= ETH_TEST_FL_FAILED; | 860 | test->flags |= ETH_TEST_FL_FAILED; |
878 | } else if (netif_msg_hw(lp)) | 861 | } else |
879 | printk(KERN_DEBUG "%s: Loopback test passed.\n", | 862 | netif_printk(lp, hw, KERN_DEBUG, dev, |
880 | dev->name); | 863 | "Loopback test passed\n"); |
881 | } else if (netif_msg_hw(lp)) | 864 | } else |
882 | printk(KERN_DEBUG | 865 | netif_printk(lp, hw, KERN_DEBUG, dev, |
883 | "%s: No tests to run (specify 'Offline' on ethtool).", | 866 | "No tests to run (specify 'Offline' on ethtool)\n"); |
884 | dev->name); | ||
885 | } /* end pcnet32_ethtool_test */ | 867 | } /* end pcnet32_ethtool_test */ |
886 | 868 | ||
887 | static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1) | 869 | static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1) |
@@ -927,10 +909,9 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1) | |||
927 | size = data_len + 15; | 909 | size = data_len + 15; |
928 | for (x = 0; x < numbuffs; x++) { | 910 | for (x = 0; x < numbuffs; x++) { |
929 | if (!(skb = dev_alloc_skb(size))) { | 911 | if (!(skb = dev_alloc_skb(size))) { |
930 | if (netif_msg_hw(lp)) | 912 | netif_printk(lp, hw, KERN_DEBUG, dev, |
931 | printk(KERN_DEBUG | 913 | "Cannot allocate skb at line: %d!\n", |
932 | "%s: Cannot allocate skb at line: %d!\n", | 914 | __LINE__); |
933 | dev->name, __LINE__); | ||
934 | goto clean_up; | 915 | goto clean_up; |
935 | } else { | 916 | } else { |
936 | packet = skb->data; | 917 | packet = skb->data; |
@@ -984,9 +965,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1) | |||
984 | ticks++; | 965 | ticks++; |
985 | } | 966 | } |
986 | if (ticks == 200) { | 967 | if (ticks == 200) { |
987 | if (netif_msg_hw(lp)) | 968 | netif_err(lp, hw, dev, "Desc %d failed to reset!\n", x); |
988 | printk("%s: Desc %d failed to reset!\n", | ||
989 | dev->name, x); | ||
990 | break; | 969 | break; |
991 | } | 970 | } |
992 | } | 971 | } |
@@ -994,15 +973,15 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1) | |||
994 | lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */ | 973 | lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */ |
995 | wmb(); | 974 | wmb(); |
996 | if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) { | 975 | if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) { |
997 | printk(KERN_DEBUG "%s: RX loopback packets:\n", dev->name); | 976 | netdev_printk(KERN_DEBUG, dev, "RX loopback packets:\n"); |
998 | 977 | ||
999 | for (x = 0; x < numbuffs; x++) { | 978 | for (x = 0; x < numbuffs; x++) { |
1000 | printk(KERN_DEBUG "%s: Packet %d:\n", dev->name, x); | 979 | netdev_printk(KERN_DEBUG, dev, "Packet %d: ", x); |
1001 | skb = lp->rx_skbuff[x]; | 980 | skb = lp->rx_skbuff[x]; |
1002 | for (i = 0; i < size; i++) { | 981 | for (i = 0; i < size; i++) { |
1003 | printk("%02x ", *(skb->data + i)); | 982 | pr_cont(" %02x", *(skb->data + i)); |
1004 | } | 983 | } |
1005 | printk("\n"); | 984 | pr_cont("\n"); |
1006 | } | 985 | } |
1007 | } | 986 | } |
1008 | 987 | ||
@@ -1013,11 +992,9 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1) | |||
1013 | packet = lp->tx_skbuff[x]->data; | 992 | packet = lp->tx_skbuff[x]->data; |
1014 | for (i = 0; i < size; i++) { | 993 | for (i = 0; i < size; i++) { |
1015 | if (*(skb->data + i) != packet[i]) { | 994 | if (*(skb->data + i) != packet[i]) { |
1016 | if (netif_msg_hw(lp)) | 995 | netif_printk(lp, hw, KERN_DEBUG, dev, |
1017 | printk(KERN_DEBUG | 996 | "Error in compare! %2x - %02x %02x\n", |
1018 | "%s: Error in compare! %2x - %02x %02x\n", | 997 | i, *(skb->data + i), packet[i]); |
1019 | dev->name, i, *(skb->data + i), | ||
1020 | packet[i]); | ||
1021 | rc = 1; | 998 | rc = 1; |
1022 | break; | 999 | break; |
1023 | } | 1000 | } |
@@ -1136,10 +1113,8 @@ static int pcnet32_suspend(struct net_device *dev, unsigned long *flags, | |||
1136 | spin_lock_irqsave(&lp->lock, *flags); | 1113 | spin_lock_irqsave(&lp->lock, *flags); |
1137 | ticks++; | 1114 | ticks++; |
1138 | if (ticks > 200) { | 1115 | if (ticks > 200) { |
1139 | if (netif_msg_hw(lp)) | 1116 | netif_printk(lp, hw, KERN_DEBUG, dev, |
1140 | printk(KERN_DEBUG | 1117 | "Error getting into suspend!\n"); |
1141 | "%s: Error getting into suspend!\n", | ||
1142 | dev->name); | ||
1143 | return 0; | 1118 | return 0; |
1144 | } | 1119 | } |
1145 | } | 1120 | } |
@@ -1184,15 +1159,13 @@ static void pcnet32_rx_entry(struct net_device *dev, | |||
1184 | 1159 | ||
1185 | /* Discard oversize frames. */ | 1160 | /* Discard oversize frames. */ |
1186 | if (unlikely(pkt_len > PKT_BUF_SIZE)) { | 1161 | if (unlikely(pkt_len > PKT_BUF_SIZE)) { |
1187 | if (netif_msg_drv(lp)) | 1162 | netif_err(lp, drv, dev, "Impossible packet size %d!\n", |
1188 | printk(KERN_ERR "%s: Impossible packet size %d!\n", | 1163 | pkt_len); |
1189 | dev->name, pkt_len); | ||
1190 | dev->stats.rx_errors++; | 1164 | dev->stats.rx_errors++; |
1191 | return; | 1165 | return; |
1192 | } | 1166 | } |
1193 | if (pkt_len < 60) { | 1167 | if (pkt_len < 60) { |
1194 | if (netif_msg_rx_err(lp)) | 1168 | netif_err(lp, rx_err, dev, "Runt packet!\n"); |
1195 | printk(KERN_ERR "%s: Runt packet!\n", dev->name); | ||
1196 | dev->stats.rx_errors++; | 1169 | dev->stats.rx_errors++; |
1197 | return; | 1170 | return; |
1198 | } | 1171 | } |
@@ -1223,10 +1196,7 @@ static void pcnet32_rx_entry(struct net_device *dev, | |||
1223 | } | 1196 | } |
1224 | 1197 | ||
1225 | if (skb == NULL) { | 1198 | if (skb == NULL) { |
1226 | if (netif_msg_drv(lp)) | 1199 | netif_err(lp, drv, dev, "Memory squeeze, dropping packet\n"); |
1227 | printk(KERN_ERR | ||
1228 | "%s: Memory squeeze, dropping packet.\n", | ||
1229 | dev->name); | ||
1230 | dev->stats.rx_dropped++; | 1200 | dev->stats.rx_dropped++; |
1231 | return; | 1201 | return; |
1232 | } | 1202 | } |
@@ -1297,11 +1267,9 @@ static int pcnet32_tx(struct net_device *dev) | |||
1297 | /* There was a major error, log it. */ | 1267 | /* There was a major error, log it. */ |
1298 | int err_status = le32_to_cpu(lp->tx_ring[entry].misc); | 1268 | int err_status = le32_to_cpu(lp->tx_ring[entry].misc); |
1299 | dev->stats.tx_errors++; | 1269 | dev->stats.tx_errors++; |
1300 | if (netif_msg_tx_err(lp)) | 1270 | netif_err(lp, tx_err, dev, |
1301 | printk(KERN_ERR | 1271 | "Tx error status=%04x err_status=%08x\n", |
1302 | "%s: Tx error status=%04x err_status=%08x\n", | 1272 | status, err_status); |
1303 | dev->name, status, | ||
1304 | err_status); | ||
1305 | if (err_status & 0x04000000) | 1273 | if (err_status & 0x04000000) |
1306 | dev->stats.tx_aborted_errors++; | 1274 | dev->stats.tx_aborted_errors++; |
1307 | if (err_status & 0x08000000) | 1275 | if (err_status & 0x08000000) |
@@ -1313,10 +1281,7 @@ static int pcnet32_tx(struct net_device *dev) | |||
1313 | dev->stats.tx_fifo_errors++; | 1281 | dev->stats.tx_fifo_errors++; |
1314 | /* Ackk! On FIFO errors the Tx unit is turned off! */ | 1282 | /* Ackk! On FIFO errors the Tx unit is turned off! */ |
1315 | /* Remove this verbosity later! */ | 1283 | /* Remove this verbosity later! */ |
1316 | if (netif_msg_tx_err(lp)) | 1284 | netif_err(lp, tx_err, dev, "Tx FIFO error!\n"); |
1317 | printk(KERN_ERR | ||
1318 | "%s: Tx FIFO error!\n", | ||
1319 | dev->name); | ||
1320 | must_restart = 1; | 1285 | must_restart = 1; |
1321 | } | 1286 | } |
1322 | #else | 1287 | #else |
@@ -1325,10 +1290,7 @@ static int pcnet32_tx(struct net_device *dev) | |||
1325 | if (!lp->dxsuflo) { /* If controller doesn't recover ... */ | 1290 | if (!lp->dxsuflo) { /* If controller doesn't recover ... */ |
1326 | /* Ackk! On FIFO errors the Tx unit is turned off! */ | 1291 | /* Ackk! On FIFO errors the Tx unit is turned off! */ |
1327 | /* Remove this verbosity later! */ | 1292 | /* Remove this verbosity later! */ |
1328 | if (netif_msg_tx_err(lp)) | 1293 | netif_err(lp, tx_err, dev, "Tx FIFO error!\n"); |
1329 | printk(KERN_ERR | ||
1330 | "%s: Tx FIFO error!\n", | ||
1331 | dev->name); | ||
1332 | must_restart = 1; | 1294 | must_restart = 1; |
1333 | } | 1295 | } |
1334 | } | 1296 | } |
@@ -1354,11 +1316,8 @@ static int pcnet32_tx(struct net_device *dev) | |||
1354 | 1316 | ||
1355 | delta = (lp->cur_tx - dirty_tx) & (lp->tx_mod_mask + lp->tx_ring_size); | 1317 | delta = (lp->cur_tx - dirty_tx) & (lp->tx_mod_mask + lp->tx_ring_size); |
1356 | if (delta > lp->tx_ring_size) { | 1318 | if (delta > lp->tx_ring_size) { |
1357 | if (netif_msg_drv(lp)) | 1319 | netif_err(lp, drv, dev, "out-of-sync dirty pointer, %d vs. %d, full=%d\n", |
1358 | printk(KERN_ERR | 1320 | dirty_tx, lp->cur_tx, lp->tx_full); |
1359 | "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n", | ||
1360 | dev->name, dirty_tx, lp->cur_tx, | ||
1361 | lp->tx_full); | ||
1362 | dirty_tx += lp->tx_ring_size; | 1321 | dirty_tx += lp->tx_ring_size; |
1363 | delta -= lp->tx_ring_size; | 1322 | delta -= lp->tx_ring_size; |
1364 | } | 1323 | } |
@@ -1535,8 +1494,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1535 | err = pci_enable_device(pdev); | 1494 | err = pci_enable_device(pdev); |
1536 | if (err < 0) { | 1495 | if (err < 0) { |
1537 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1496 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1538 | printk(KERN_ERR PFX | 1497 | pr_err("failed to enable device -- err=%d\n", err); |
1539 | "failed to enable device -- err=%d\n", err); | ||
1540 | return err; | 1498 | return err; |
1541 | } | 1499 | } |
1542 | pci_set_master(pdev); | 1500 | pci_set_master(pdev); |
@@ -1544,22 +1502,19 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1544 | ioaddr = pci_resource_start(pdev, 0); | 1502 | ioaddr = pci_resource_start(pdev, 0); |
1545 | if (!ioaddr) { | 1503 | if (!ioaddr) { |
1546 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1504 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1547 | printk(KERN_ERR PFX | 1505 | pr_err("card has no PCI IO resources, aborting\n"); |
1548 | "card has no PCI IO resources, aborting\n"); | ||
1549 | return -ENODEV; | 1506 | return -ENODEV; |
1550 | } | 1507 | } |
1551 | 1508 | ||
1552 | if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) { | 1509 | if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) { |
1553 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1510 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1554 | printk(KERN_ERR PFX | 1511 | pr_err("architecture does not support 32bit PCI busmaster DMA\n"); |
1555 | "architecture does not support 32bit PCI busmaster DMA\n"); | ||
1556 | return -ENODEV; | 1512 | return -ENODEV; |
1557 | } | 1513 | } |
1558 | if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci") == | 1514 | if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci") == |
1559 | NULL) { | 1515 | NULL) { |
1560 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1516 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1561 | printk(KERN_ERR PFX | 1517 | pr_err("io address range already allocated\n"); |
1562 | "io address range already allocated\n"); | ||
1563 | return -EBUSY; | 1518 | return -EBUSY; |
1564 | } | 1519 | } |
1565 | 1520 | ||
@@ -1616,7 +1571,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1616 | a = &pcnet32_dwio; | 1571 | a = &pcnet32_dwio; |
1617 | } else { | 1572 | } else { |
1618 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1573 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1619 | printk(KERN_ERR PFX "No access methods\n"); | 1574 | pr_err("No access methods\n"); |
1620 | goto err_release_region; | 1575 | goto err_release_region; |
1621 | } | 1576 | } |
1622 | } | 1577 | } |
@@ -1624,11 +1579,10 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1624 | chip_version = | 1579 | chip_version = |
1625 | a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr, 89) << 16); | 1580 | a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr, 89) << 16); |
1626 | if ((pcnet32_debug & NETIF_MSG_PROBE) && (pcnet32_debug & NETIF_MSG_HW)) | 1581 | if ((pcnet32_debug & NETIF_MSG_PROBE) && (pcnet32_debug & NETIF_MSG_HW)) |
1627 | printk(KERN_INFO " PCnet chip version is %#x.\n", | 1582 | pr_info(" PCnet chip version is %#x\n", chip_version); |
1628 | chip_version); | ||
1629 | if ((chip_version & 0xfff) != 0x003) { | 1583 | if ((chip_version & 0xfff) != 0x003) { |
1630 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1584 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1631 | printk(KERN_INFO PFX "Unsupported chip version.\n"); | 1585 | pr_info("Unsupported chip version\n"); |
1632 | goto err_release_region; | 1586 | goto err_release_region; |
1633 | } | 1587 | } |
1634 | 1588 | ||
@@ -1681,7 +1635,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1681 | if (cards_found < MAX_UNITS && homepna[cards_found]) | 1635 | if (cards_found < MAX_UNITS && homepna[cards_found]) |
1682 | media |= 1; /* switch to home wiring mode */ | 1636 | media |= 1; /* switch to home wiring mode */ |
1683 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1637 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1684 | printk(KERN_DEBUG PFX "media set to %sMbit mode.\n", | 1638 | printk(KERN_DEBUG PFX "media set to %sMbit mode\n", |
1685 | (media & 1) ? "1" : "10"); | 1639 | (media & 1) ? "1" : "10"); |
1686 | a->write_bcr(ioaddr, 49, media); | 1640 | a->write_bcr(ioaddr, 49, media); |
1687 | break; | 1641 | break; |
@@ -1697,9 +1651,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1697 | break; | 1651 | break; |
1698 | default: | 1652 | default: |
1699 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1653 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1700 | printk(KERN_INFO PFX | 1654 | pr_info("PCnet version %#x, no PCnet32 chip\n", |
1701 | "PCnet version %#x, no PCnet32 chip.\n", | 1655 | chip_version); |
1702 | chip_version); | ||
1703 | goto err_release_region; | 1656 | goto err_release_region; |
1704 | } | 1657 | } |
1705 | 1658 | ||
@@ -1721,7 +1674,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1721 | dev = alloc_etherdev(sizeof(*lp)); | 1674 | dev = alloc_etherdev(sizeof(*lp)); |
1722 | if (!dev) { | 1675 | if (!dev) { |
1723 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1676 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1724 | printk(KERN_ERR PFX "Memory allocation failed.\n"); | 1677 | pr_err("Memory allocation failed\n"); |
1725 | ret = -ENOMEM; | 1678 | ret = -ENOMEM; |
1726 | goto err_release_region; | 1679 | goto err_release_region; |
1727 | } | 1680 | } |
@@ -1730,7 +1683,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1730 | SET_NETDEV_DEV(dev, &pdev->dev); | 1683 | SET_NETDEV_DEV(dev, &pdev->dev); |
1731 | 1684 | ||
1732 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1685 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1733 | printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); | 1686 | pr_info("%s at %#3lx,", chipname, ioaddr); |
1734 | 1687 | ||
1735 | /* In most chips, after a chip reset, the ethernet address is read from the | 1688 | /* In most chips, after a chip reset, the ethernet address is read from the |
1736 | * station address PROM at the base address and programmed into the | 1689 | * station address PROM at the base address and programmed into the |
@@ -1755,9 +1708,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1755 | !is_valid_ether_addr(dev->dev_addr)) { | 1708 | !is_valid_ether_addr(dev->dev_addr)) { |
1756 | if (is_valid_ether_addr(promaddr)) { | 1709 | if (is_valid_ether_addr(promaddr)) { |
1757 | if (pcnet32_debug & NETIF_MSG_PROBE) { | 1710 | if (pcnet32_debug & NETIF_MSG_PROBE) { |
1758 | printk(" warning: CSR address invalid,\n"); | 1711 | pr_cont(" warning: CSR address invalid,\n"); |
1759 | printk(KERN_INFO | 1712 | pr_info(" using instead PROM address of"); |
1760 | " using instead PROM address of"); | ||
1761 | } | 1713 | } |
1762 | memcpy(dev->dev_addr, promaddr, 6); | 1714 | memcpy(dev->dev_addr, promaddr, 6); |
1763 | } | 1715 | } |
@@ -1769,43 +1721,43 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1769 | memset(dev->dev_addr, 0, ETH_ALEN); | 1721 | memset(dev->dev_addr, 0, ETH_ALEN); |
1770 | 1722 | ||
1771 | if (pcnet32_debug & NETIF_MSG_PROBE) { | 1723 | if (pcnet32_debug & NETIF_MSG_PROBE) { |
1772 | printk(" %pM", dev->dev_addr); | 1724 | pr_cont(" %pM", dev->dev_addr); |
1773 | 1725 | ||
1774 | /* Version 0x2623 and 0x2624 */ | 1726 | /* Version 0x2623 and 0x2624 */ |
1775 | if (((chip_version + 1) & 0xfffe) == 0x2624) { | 1727 | if (((chip_version + 1) & 0xfffe) == 0x2624) { |
1776 | i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ | 1728 | i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ |
1777 | printk(KERN_INFO " tx_start_pt(0x%04x):", i); | 1729 | pr_info(" tx_start_pt(0x%04x):", i); |
1778 | switch (i >> 10) { | 1730 | switch (i >> 10) { |
1779 | case 0: | 1731 | case 0: |
1780 | printk(KERN_CONT " 20 bytes,"); | 1732 | pr_cont(" 20 bytes,"); |
1781 | break; | 1733 | break; |
1782 | case 1: | 1734 | case 1: |
1783 | printk(KERN_CONT " 64 bytes,"); | 1735 | pr_cont(" 64 bytes,"); |
1784 | break; | 1736 | break; |
1785 | case 2: | 1737 | case 2: |
1786 | printk(KERN_CONT " 128 bytes,"); | 1738 | pr_cont(" 128 bytes,"); |
1787 | break; | 1739 | break; |
1788 | case 3: | 1740 | case 3: |
1789 | printk(KERN_CONT "~220 bytes,"); | 1741 | pr_cont("~220 bytes,"); |
1790 | break; | 1742 | break; |
1791 | } | 1743 | } |
1792 | i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ | 1744 | i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ |
1793 | printk(KERN_CONT " BCR18(%x):", i & 0xffff); | 1745 | pr_cont(" BCR18(%x):", i & 0xffff); |
1794 | if (i & (1 << 5)) | 1746 | if (i & (1 << 5)) |
1795 | printk(KERN_CONT "BurstWrEn "); | 1747 | pr_cont("BurstWrEn "); |
1796 | if (i & (1 << 6)) | 1748 | if (i & (1 << 6)) |
1797 | printk(KERN_CONT "BurstRdEn "); | 1749 | pr_cont("BurstRdEn "); |
1798 | if (i & (1 << 7)) | 1750 | if (i & (1 << 7)) |
1799 | printk(KERN_CONT "DWordIO "); | 1751 | pr_cont("DWordIO "); |
1800 | if (i & (1 << 11)) | 1752 | if (i & (1 << 11)) |
1801 | printk(KERN_CONT "NoUFlow "); | 1753 | pr_cont("NoUFlow "); |
1802 | i = a->read_bcr(ioaddr, 25); | 1754 | i = a->read_bcr(ioaddr, 25); |
1803 | printk(KERN_INFO " SRAMSIZE=0x%04x,", i << 8); | 1755 | pr_info(" SRAMSIZE=0x%04x,", i << 8); |
1804 | i = a->read_bcr(ioaddr, 26); | 1756 | i = a->read_bcr(ioaddr, 26); |
1805 | printk(KERN_CONT " SRAM_BND=0x%04x,", i << 8); | 1757 | pr_cont(" SRAM_BND=0x%04x,", i << 8); |
1806 | i = a->read_bcr(ioaddr, 27); | 1758 | i = a->read_bcr(ioaddr, 27); |
1807 | if (i & (1 << 14)) | 1759 | if (i & (1 << 14)) |
1808 | printk(KERN_CONT "LowLatRx"); | 1760 | pr_cont("LowLatRx"); |
1809 | } | 1761 | } |
1810 | } | 1762 | } |
1811 | 1763 | ||
@@ -1815,8 +1767,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1815 | if ((lp->init_block = | 1767 | if ((lp->init_block = |
1816 | pci_alloc_consistent(pdev, sizeof(*lp->init_block), &lp->init_dma_addr)) == NULL) { | 1768 | pci_alloc_consistent(pdev, sizeof(*lp->init_block), &lp->init_dma_addr)) == NULL) { |
1817 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1769 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1818 | printk(KERN_ERR PFX | 1770 | pr_err("Consistent memory allocation failed\n"); |
1819 | "Consistent memory allocation failed.\n"); | ||
1820 | ret = -ENOMEM; | 1771 | ret = -ENOMEM; |
1821 | goto err_free_netdev; | 1772 | goto err_free_netdev; |
1822 | } | 1773 | } |
@@ -1890,7 +1841,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1890 | if (pdev) { /* use the IRQ provided by PCI */ | 1841 | if (pdev) { /* use the IRQ provided by PCI */ |
1891 | dev->irq = pdev->irq; | 1842 | dev->irq = pdev->irq; |
1892 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1843 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1893 | printk(" assigned IRQ %d.\n", dev->irq); | 1844 | pr_cont(" assigned IRQ %d\n", dev->irq); |
1894 | } else { | 1845 | } else { |
1895 | unsigned long irq_mask = probe_irq_on(); | 1846 | unsigned long irq_mask = probe_irq_on(); |
1896 | 1847 | ||
@@ -1906,12 +1857,12 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1906 | dev->irq = probe_irq_off(irq_mask); | 1857 | dev->irq = probe_irq_off(irq_mask); |
1907 | if (!dev->irq) { | 1858 | if (!dev->irq) { |
1908 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1859 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1909 | printk(", failed to detect IRQ line.\n"); | 1860 | pr_cont(", failed to detect IRQ line\n"); |
1910 | ret = -ENODEV; | 1861 | ret = -ENODEV; |
1911 | goto err_free_ring; | 1862 | goto err_free_ring; |
1912 | } | 1863 | } |
1913 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1864 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1914 | printk(", probed IRQ %d.\n", dev->irq); | 1865 | pr_cont(", probed IRQ %d\n", dev->irq); |
1915 | } | 1866 | } |
1916 | 1867 | ||
1917 | /* Set the mii phy_id so that we can query the link state */ | 1868 | /* Set the mii phy_id so that we can query the link state */ |
@@ -1935,9 +1886,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1935 | lp->phymask |= (1 << i); | 1886 | lp->phymask |= (1 << i); |
1936 | lp->mii_if.phy_id = i; | 1887 | lp->mii_if.phy_id = i; |
1937 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1888 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1938 | printk(KERN_INFO PFX | 1889 | pr_info("Found PHY %04x:%04x at address %d\n", |
1939 | "Found PHY %04x:%04x at address %d.\n", | 1890 | id1, id2, i); |
1940 | id1, id2, i); | ||
1941 | } | 1891 | } |
1942 | lp->a.write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5); | 1892 | lp->a.write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5); |
1943 | if (lp->phycount > 1) { | 1893 | if (lp->phycount > 1) { |
@@ -1966,7 +1916,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1966 | } | 1916 | } |
1967 | 1917 | ||
1968 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1918 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1969 | printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name); | 1919 | pr_info("%s: registered as %s\n", dev->name, lp->name); |
1970 | cards_found++; | 1920 | cards_found++; |
1971 | 1921 | ||
1972 | /* enable LED writes */ | 1922 | /* enable LED writes */ |
@@ -1995,10 +1945,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
1995 | lp->tx_ring_size, | 1945 | lp->tx_ring_size, |
1996 | &lp->tx_ring_dma_addr); | 1946 | &lp->tx_ring_dma_addr); |
1997 | if (lp->tx_ring == NULL) { | 1947 | if (lp->tx_ring == NULL) { |
1998 | if (netif_msg_drv(lp)) | 1948 | netif_err(lp, drv, dev, "Consistent memory allocation failed\n"); |
1999 | printk(KERN_ERR PFX | ||
2000 | "%s: Consistent memory allocation failed.\n", | ||
2001 | name); | ||
2002 | return -ENOMEM; | 1949 | return -ENOMEM; |
2003 | } | 1950 | } |
2004 | 1951 | ||
@@ -2007,46 +1954,35 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
2007 | lp->rx_ring_size, | 1954 | lp->rx_ring_size, |
2008 | &lp->rx_ring_dma_addr); | 1955 | &lp->rx_ring_dma_addr); |
2009 | if (lp->rx_ring == NULL) { | 1956 | if (lp->rx_ring == NULL) { |
2010 | if (netif_msg_drv(lp)) | 1957 | netif_err(lp, drv, dev, "Consistent memory allocation failed\n"); |
2011 | printk(KERN_ERR PFX | ||
2012 | "%s: Consistent memory allocation failed.\n", | ||
2013 | name); | ||
2014 | return -ENOMEM; | 1958 | return -ENOMEM; |
2015 | } | 1959 | } |
2016 | 1960 | ||
2017 | lp->tx_dma_addr = kcalloc(lp->tx_ring_size, sizeof(dma_addr_t), | 1961 | lp->tx_dma_addr = kcalloc(lp->tx_ring_size, sizeof(dma_addr_t), |
2018 | GFP_ATOMIC); | 1962 | GFP_ATOMIC); |
2019 | if (!lp->tx_dma_addr) { | 1963 | if (!lp->tx_dma_addr) { |
2020 | if (netif_msg_drv(lp)) | 1964 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
2021 | printk(KERN_ERR PFX | ||
2022 | "%s: Memory allocation failed.\n", name); | ||
2023 | return -ENOMEM; | 1965 | return -ENOMEM; |
2024 | } | 1966 | } |
2025 | 1967 | ||
2026 | lp->rx_dma_addr = kcalloc(lp->rx_ring_size, sizeof(dma_addr_t), | 1968 | lp->rx_dma_addr = kcalloc(lp->rx_ring_size, sizeof(dma_addr_t), |
2027 | GFP_ATOMIC); | 1969 | GFP_ATOMIC); |
2028 | if (!lp->rx_dma_addr) { | 1970 | if (!lp->rx_dma_addr) { |
2029 | if (netif_msg_drv(lp)) | 1971 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
2030 | printk(KERN_ERR PFX | ||
2031 | "%s: Memory allocation failed.\n", name); | ||
2032 | return -ENOMEM; | 1972 | return -ENOMEM; |
2033 | } | 1973 | } |
2034 | 1974 | ||
2035 | lp->tx_skbuff = kcalloc(lp->tx_ring_size, sizeof(struct sk_buff *), | 1975 | lp->tx_skbuff = kcalloc(lp->tx_ring_size, sizeof(struct sk_buff *), |
2036 | GFP_ATOMIC); | 1976 | GFP_ATOMIC); |
2037 | if (!lp->tx_skbuff) { | 1977 | if (!lp->tx_skbuff) { |
2038 | if (netif_msg_drv(lp)) | 1978 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
2039 | printk(KERN_ERR PFX | ||
2040 | "%s: Memory allocation failed.\n", name); | ||
2041 | return -ENOMEM; | 1979 | return -ENOMEM; |
2042 | } | 1980 | } |
2043 | 1981 | ||
2044 | lp->rx_skbuff = kcalloc(lp->rx_ring_size, sizeof(struct sk_buff *), | 1982 | lp->rx_skbuff = kcalloc(lp->rx_ring_size, sizeof(struct sk_buff *), |
2045 | GFP_ATOMIC); | 1983 | GFP_ATOMIC); |
2046 | if (!lp->rx_skbuff) { | 1984 | if (!lp->rx_skbuff) { |
2047 | if (netif_msg_drv(lp)) | 1985 | netif_err(lp, drv, dev, "Memory allocation failed\n"); |
2048 | printk(KERN_ERR PFX | ||
2049 | "%s: Memory allocation failed.\n", name); | ||
2050 | return -ENOMEM; | 1986 | return -ENOMEM; |
2051 | } | 1987 | } |
2052 | 1988 | ||
@@ -2115,12 +2051,11 @@ static int pcnet32_open(struct net_device *dev) | |||
2115 | /* switch pcnet32 to 32bit mode */ | 2051 | /* switch pcnet32 to 32bit mode */ |
2116 | lp->a.write_bcr(ioaddr, 20, 2); | 2052 | lp->a.write_bcr(ioaddr, 20, 2); |
2117 | 2053 | ||
2118 | if (netif_msg_ifup(lp)) | 2054 | netif_printk(lp, ifup, KERN_DEBUG, dev, |
2119 | printk(KERN_DEBUG | 2055 | "%s() irq %d tx/rx rings %#x/%#x init %#x\n", |
2120 | "%s: pcnet32_open() irq %d tx/rx rings %#x/%#x init %#x.\n", | 2056 | __func__, dev->irq, (u32) (lp->tx_ring_dma_addr), |
2121 | dev->name, dev->irq, (u32) (lp->tx_ring_dma_addr), | 2057 | (u32) (lp->rx_ring_dma_addr), |
2122 | (u32) (lp->rx_ring_dma_addr), | 2058 | (u32) (lp->init_dma_addr)); |
2123 | (u32) (lp->init_dma_addr)); | ||
2124 | 2059 | ||
2125 | /* set/reset autoselect bit */ | 2060 | /* set/reset autoselect bit */ |
2126 | val = lp->a.read_bcr(ioaddr, 2) & ~2; | 2061 | val = lp->a.read_bcr(ioaddr, 2) & ~2; |
@@ -2155,10 +2090,8 @@ static int pcnet32_open(struct net_device *dev) | |||
2155 | pdev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { | 2090 | pdev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { |
2156 | if (lp->options & PCNET32_PORT_ASEL) { | 2091 | if (lp->options & PCNET32_PORT_ASEL) { |
2157 | lp->options = PCNET32_PORT_FD | PCNET32_PORT_100; | 2092 | lp->options = PCNET32_PORT_FD | PCNET32_PORT_100; |
2158 | if (netif_msg_link(lp)) | 2093 | netif_printk(lp, link, KERN_DEBUG, dev, |
2159 | printk(KERN_DEBUG | 2094 | "Setting 100Mb-Full Duplex\n"); |
2160 | "%s: Setting 100Mb-Full Duplex.\n", | ||
2161 | dev->name); | ||
2162 | } | 2095 | } |
2163 | } | 2096 | } |
2164 | if (lp->phycount < 2) { | 2097 | if (lp->phycount < 2) { |
@@ -2246,9 +2179,7 @@ static int pcnet32_open(struct net_device *dev) | |||
2246 | } | 2179 | } |
2247 | } | 2180 | } |
2248 | lp->mii_if.phy_id = first_phy; | 2181 | lp->mii_if.phy_id = first_phy; |
2249 | if (netif_msg_link(lp)) | 2182 | netif_info(lp, link, dev, "Using PHY number %d\n", first_phy); |
2250 | printk(KERN_INFO "%s: Using PHY number %d.\n", | ||
2251 | dev->name, first_phy); | ||
2252 | } | 2183 | } |
2253 | 2184 | ||
2254 | #ifdef DO_DXSUFLO | 2185 | #ifdef DO_DXSUFLO |
@@ -2295,12 +2226,11 @@ static int pcnet32_open(struct net_device *dev) | |||
2295 | */ | 2226 | */ |
2296 | lp->a.write_csr(ioaddr, CSR0, CSR0_NORMAL); | 2227 | lp->a.write_csr(ioaddr, CSR0, CSR0_NORMAL); |
2297 | 2228 | ||
2298 | if (netif_msg_ifup(lp)) | 2229 | netif_printk(lp, ifup, KERN_DEBUG, dev, |
2299 | printk(KERN_DEBUG | 2230 | "pcnet32 open after %d ticks, init block %#x csr0 %4.4x\n", |
2300 | "%s: pcnet32 open after %d ticks, init block %#x csr0 %4.4x.\n", | 2231 | i, |
2301 | dev->name, i, | 2232 | (u32) (lp->init_dma_addr), |
2302 | (u32) (lp->init_dma_addr), | 2233 | lp->a.read_csr(ioaddr, CSR0)); |
2303 | lp->a.read_csr(ioaddr, CSR0)); | ||
2304 | 2234 | ||
2305 | spin_unlock_irqrestore(&lp->lock, flags); | 2235 | spin_unlock_irqrestore(&lp->lock, flags); |
2306 | 2236 | ||
@@ -2371,10 +2301,8 @@ static int pcnet32_init_ring(struct net_device *dev) | |||
2371 | (rx_skbuff = lp->rx_skbuff[i] = | 2301 | (rx_skbuff = lp->rx_skbuff[i] = |
2372 | dev_alloc_skb(PKT_BUF_SKB))) { | 2302 | dev_alloc_skb(PKT_BUF_SKB))) { |
2373 | /* there is not much, we can do at this point */ | 2303 | /* there is not much, we can do at this point */ |
2374 | if (netif_msg_drv(lp)) | 2304 | netif_err(lp, drv, dev, "%s dev_alloc_skb failed\n", |
2375 | printk(KERN_ERR | 2305 | __func__); |
2376 | "%s: pcnet32_init_ring dev_alloc_skb failed.\n", | ||
2377 | dev->name); | ||
2378 | return -1; | 2306 | return -1; |
2379 | } | 2307 | } |
2380 | skb_reserve(rx_skbuff, NET_IP_ALIGN); | 2308 | skb_reserve(rx_skbuff, NET_IP_ALIGN); |
@@ -2424,10 +2352,9 @@ static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits) | |||
2424 | if (lp->a.read_csr(ioaddr, CSR0) & CSR0_STOP) | 2352 | if (lp->a.read_csr(ioaddr, CSR0) & CSR0_STOP) |
2425 | break; | 2353 | break; |
2426 | 2354 | ||
2427 | if (i >= 100 && netif_msg_drv(lp)) | 2355 | if (i >= 100) |
2428 | printk(KERN_ERR | 2356 | netif_err(lp, drv, dev, "%s timed out waiting for stop\n", |
2429 | "%s: pcnet32_restart timed out waiting for stop.\n", | 2357 | __func__); |
2430 | dev->name); | ||
2431 | 2358 | ||
2432 | pcnet32_purge_tx_ring(dev); | 2359 | pcnet32_purge_tx_ring(dev); |
2433 | if (pcnet32_init_ring(dev)) | 2360 | if (pcnet32_init_ring(dev)) |
@@ -2451,8 +2378,7 @@ static void pcnet32_tx_timeout(struct net_device *dev) | |||
2451 | spin_lock_irqsave(&lp->lock, flags); | 2378 | spin_lock_irqsave(&lp->lock, flags); |
2452 | /* Transmitter timeout, serious problems. */ | 2379 | /* Transmitter timeout, serious problems. */ |
2453 | if (pcnet32_debug & NETIF_MSG_DRV) | 2380 | if (pcnet32_debug & NETIF_MSG_DRV) |
2454 | printk(KERN_ERR | 2381 | pr_err("%s: transmit timed out, status %4.4x, resetting\n", |
2455 | "%s: transmit timed out, status %4.4x, resetting.\n", | ||
2456 | dev->name, lp->a.read_csr(ioaddr, CSR0)); | 2382 | dev->name, lp->a.read_csr(ioaddr, CSR0)); |
2457 | lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); | 2383 | lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); |
2458 | dev->stats.tx_errors++; | 2384 | dev->stats.tx_errors++; |
@@ -2495,11 +2421,9 @@ static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb, | |||
2495 | 2421 | ||
2496 | spin_lock_irqsave(&lp->lock, flags); | 2422 | spin_lock_irqsave(&lp->lock, flags); |
2497 | 2423 | ||
2498 | if (netif_msg_tx_queued(lp)) { | 2424 | netif_printk(lp, tx_queued, KERN_DEBUG, dev, |
2499 | printk(KERN_DEBUG | 2425 | "%s() called, csr0 %4.4x\n", |
2500 | "%s: pcnet32_start_xmit() called, csr0 %4.4x.\n", | 2426 | __func__, lp->a.read_csr(ioaddr, CSR0)); |
2501 | dev->name, lp->a.read_csr(ioaddr, CSR0)); | ||
2502 | } | ||
2503 | 2427 | ||
2504 | /* Default status -- will not enable Successful-TxDone | 2428 | /* Default status -- will not enable Successful-TxDone |
2505 | * interrupt when that option is available to us. | 2429 | * interrupt when that option is available to us. |
@@ -2564,10 +2488,9 @@ pcnet32_interrupt(int irq, void *dev_id) | |||
2564 | /* Acknowledge all of the current interrupt sources ASAP. */ | 2488 | /* Acknowledge all of the current interrupt sources ASAP. */ |
2565 | lp->a.write_csr(ioaddr, CSR0, csr0 & ~0x004f); | 2489 | lp->a.write_csr(ioaddr, CSR0, csr0 & ~0x004f); |
2566 | 2490 | ||
2567 | if (netif_msg_intr(lp)) | 2491 | netif_printk(lp, intr, KERN_DEBUG, dev, |
2568 | printk(KERN_DEBUG | 2492 | "interrupt csr0=%#2.2x new csr=%#2.2x\n", |
2569 | "%s: interrupt csr0=%#2.2x new csr=%#2.2x.\n", | 2493 | csr0, lp->a.read_csr(ioaddr, CSR0)); |
2570 | dev->name, csr0, lp->a.read_csr(ioaddr, CSR0)); | ||
2571 | 2494 | ||
2572 | /* Log misc errors. */ | 2495 | /* Log misc errors. */ |
2573 | if (csr0 & 0x4000) | 2496 | if (csr0 & 0x4000) |
@@ -2587,10 +2510,8 @@ pcnet32_interrupt(int irq, void *dev_id) | |||
2587 | dev->stats.rx_errors++; /* Missed a Rx frame. */ | 2510 | dev->stats.rx_errors++; /* Missed a Rx frame. */ |
2588 | } | 2511 | } |
2589 | if (csr0 & 0x0800) { | 2512 | if (csr0 & 0x0800) { |
2590 | if (netif_msg_drv(lp)) | 2513 | netif_err(lp, drv, dev, "Bus master arbitration failure, status %4.4x\n", |
2591 | printk(KERN_ERR | 2514 | csr0); |
2592 | "%s: Bus master arbitration failure, status %4.4x.\n", | ||
2593 | dev->name, csr0); | ||
2594 | /* unlike for the lance, there is no restart needed */ | 2515 | /* unlike for the lance, there is no restart needed */ |
2595 | } | 2516 | } |
2596 | if (napi_schedule_prep(&lp->napi)) { | 2517 | if (napi_schedule_prep(&lp->napi)) { |
@@ -2606,9 +2527,9 @@ pcnet32_interrupt(int irq, void *dev_id) | |||
2606 | csr0 = lp->a.read_csr(ioaddr, CSR0); | 2527 | csr0 = lp->a.read_csr(ioaddr, CSR0); |
2607 | } | 2528 | } |
2608 | 2529 | ||
2609 | if (netif_msg_intr(lp)) | 2530 | netif_printk(lp, intr, KERN_DEBUG, dev, |
2610 | printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", | 2531 | "exiting interrupt, csr0=%#4.4x\n", |
2611 | dev->name, lp->a.read_csr(ioaddr, CSR0)); | 2532 | lp->a.read_csr(ioaddr, CSR0)); |
2612 | 2533 | ||
2613 | spin_unlock(&lp->lock); | 2534 | spin_unlock(&lp->lock); |
2614 | 2535 | ||
@@ -2630,10 +2551,9 @@ static int pcnet32_close(struct net_device *dev) | |||
2630 | 2551 | ||
2631 | dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112); | 2552 | dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112); |
2632 | 2553 | ||
2633 | if (netif_msg_ifdown(lp)) | 2554 | netif_printk(lp, ifdown, KERN_DEBUG, dev, |
2634 | printk(KERN_DEBUG | 2555 | "Shutting down ethercard, status was %2.2x\n", |
2635 | "%s: Shutting down ethercard, status was %2.2x.\n", | 2556 | lp->a.read_csr(ioaddr, CSR0)); |
2636 | dev->name, lp->a.read_csr(ioaddr, CSR0)); | ||
2637 | 2557 | ||
2638 | /* We stop the PCNET32 here -- it occasionally polls memory if we don't. */ | 2558 | /* We stop the PCNET32 here -- it occasionally polls memory if we don't. */ |
2639 | lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); | 2559 | lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); |
@@ -2730,9 +2650,7 @@ static void pcnet32_set_multicast_list(struct net_device *dev) | |||
2730 | csr15 = lp->a.read_csr(ioaddr, CSR15); | 2650 | csr15 = lp->a.read_csr(ioaddr, CSR15); |
2731 | if (dev->flags & IFF_PROMISC) { | 2651 | if (dev->flags & IFF_PROMISC) { |
2732 | /* Log any net taps. */ | 2652 | /* Log any net taps. */ |
2733 | if (netif_msg_hw(lp)) | 2653 | netif_info(lp, hw, dev, "Promiscuous mode enabled\n"); |
2734 | printk(KERN_INFO "%s: Promiscuous mode enabled.\n", | ||
2735 | dev->name); | ||
2736 | lp->init_block->mode = | 2654 | lp->init_block->mode = |
2737 | cpu_to_le16(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) << | 2655 | cpu_to_le16(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) << |
2738 | 7); | 2656 | 7); |
@@ -2819,10 +2737,8 @@ static int pcnet32_check_otherphy(struct net_device *dev) | |||
2819 | mii.phy_id = i; | 2737 | mii.phy_id = i; |
2820 | if (mii_link_ok(&mii)) { | 2738 | if (mii_link_ok(&mii)) { |
2821 | /* found PHY with active link */ | 2739 | /* found PHY with active link */ |
2822 | if (netif_msg_link(lp)) | 2740 | netif_info(lp, link, dev, "Using PHY number %d\n", |
2823 | printk(KERN_INFO | 2741 | i); |
2824 | "%s: Using PHY number %d.\n", | ||
2825 | dev->name, i); | ||
2826 | 2742 | ||
2827 | /* isolate inactive phy */ | 2743 | /* isolate inactive phy */ |
2828 | bmcr = | 2744 | bmcr = |
@@ -2868,8 +2784,7 @@ static void pcnet32_check_media(struct net_device *dev, int verbose) | |||
2868 | if (!curr_link) { | 2784 | if (!curr_link) { |
2869 | if (prev_link || verbose) { | 2785 | if (prev_link || verbose) { |
2870 | netif_carrier_off(dev); | 2786 | netif_carrier_off(dev); |
2871 | if (netif_msg_link(lp)) | 2787 | netif_info(lp, link, dev, "link down\n"); |
2872 | printk(KERN_INFO "%s: link down\n", dev->name); | ||
2873 | } | 2788 | } |
2874 | if (lp->phycount > 1) { | 2789 | if (lp->phycount > 1) { |
2875 | curr_link = pcnet32_check_otherphy(dev); | 2790 | curr_link = pcnet32_check_otherphy(dev); |
@@ -2881,12 +2796,11 @@ static void pcnet32_check_media(struct net_device *dev, int verbose) | |||
2881 | if (netif_msg_link(lp)) { | 2796 | if (netif_msg_link(lp)) { |
2882 | struct ethtool_cmd ecmd; | 2797 | struct ethtool_cmd ecmd; |
2883 | mii_ethtool_gset(&lp->mii_if, &ecmd); | 2798 | mii_ethtool_gset(&lp->mii_if, &ecmd); |
2884 | printk(KERN_INFO | 2799 | netdev_info(dev, "link up, %sMbps, %s-duplex\n", |
2885 | "%s: link up, %sMbps, %s-duplex\n", | 2800 | (ecmd.speed == SPEED_100) |
2886 | dev->name, | 2801 | ? "100" : "10", |
2887 | (ecmd.speed == SPEED_100) ? "100" : "10", | 2802 | (ecmd.duplex == DUPLEX_FULL) |
2888 | (ecmd.duplex == | 2803 | ? "full" : "half"); |
2889 | DUPLEX_FULL) ? "full" : "half"); | ||
2890 | } | 2804 | } |
2891 | bcr9 = lp->a.read_bcr(dev->base_addr, 9); | 2805 | bcr9 = lp->a.read_bcr(dev->base_addr, 9); |
2892 | if ((bcr9 & (1 << 0)) != lp->mii_if.full_duplex) { | 2806 | if ((bcr9 & (1 << 0)) != lp->mii_if.full_duplex) { |
@@ -2897,8 +2811,7 @@ static void pcnet32_check_media(struct net_device *dev, int verbose) | |||
2897 | lp->a.write_bcr(dev->base_addr, 9, bcr9); | 2811 | lp->a.write_bcr(dev->base_addr, 9, bcr9); |
2898 | } | 2812 | } |
2899 | } else { | 2813 | } else { |
2900 | if (netif_msg_link(lp)) | 2814 | netif_info(lp, link, dev, "link up\n"); |
2901 | printk(KERN_INFO "%s: link up\n", dev->name); | ||
2902 | } | 2815 | } |
2903 | } | 2816 | } |
2904 | } | 2817 | } |
@@ -3010,7 +2923,7 @@ MODULE_LICENSE("GPL"); | |||
3010 | 2923 | ||
3011 | static int __init pcnet32_init_module(void) | 2924 | static int __init pcnet32_init_module(void) |
3012 | { | 2925 | { |
3013 | printk(KERN_INFO "%s", version); | 2926 | pr_info("%s", version); |
3014 | 2927 | ||
3015 | pcnet32_debug = netif_msg_init(debug, PCNET32_MSG_DEFAULT); | 2928 | pcnet32_debug = netif_msg_init(debug, PCNET32_MSG_DEFAULT); |
3016 | 2929 | ||
@@ -3026,7 +2939,7 @@ static int __init pcnet32_init_module(void) | |||
3026 | pcnet32_probe_vlbus(pcnet32_portlist); | 2939 | pcnet32_probe_vlbus(pcnet32_portlist); |
3027 | 2940 | ||
3028 | if (cards_found && (pcnet32_debug & NETIF_MSG_PROBE)) | 2941 | if (cards_found && (pcnet32_debug & NETIF_MSG_PROBE)) |
3029 | printk(KERN_INFO PFX "%d cards_found.\n", cards_found); | 2942 | pr_info("%d cards_found\n", cards_found); |
3030 | 2943 | ||
3031 | return (pcnet32_have_pci + cards_found) ? 0 : -ENODEV; | 2944 | return (pcnet32_have_pci + cards_found) ? 0 : -ENODEV; |
3032 | } | 2945 | } |