aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/jme.c54
-rw-r--r--drivers/net/jme.h41
2 files changed, 34 insertions, 61 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index d44c39dfbef1..558b6a0b15fc 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -288,7 +288,7 @@ jme_set_rx_pcc(struct jme_adapter *jme, int p)
288 wmb(); 288 wmb();
289 289
290 if (!(test_bit(JME_FLAG_POLL, &jme->flags))) 290 if (!(test_bit(JME_FLAG_POLL, &jme->flags)))
291 msg_rx_status(jme, "Switched to PCC_P%d\n", p); 291 netif_info(jme, rx_status, jme->dev, "Switched to PCC_P%d\n", p);
292} 292}
293 293
294static void 294static void
@@ -483,13 +483,13 @@ jme_check_link(struct net_device *netdev, int testonly)
483 strcat(linkmsg, (phylink & PHY_LINK_MDI_STAT) ? 483 strcat(linkmsg, (phylink & PHY_LINK_MDI_STAT) ?
484 "MDI-X" : 484 "MDI-X" :
485 "MDI"); 485 "MDI");
486 msg_link(jme, "Link is up at %s.\n", linkmsg); 486 netif_info(jme, link, jme->dev, "Link is up at %s.\n", linkmsg);
487 netif_carrier_on(netdev); 487 netif_carrier_on(netdev);
488 } else { 488 } else {
489 if (testonly) 489 if (testonly)
490 goto out; 490 goto out;
491 491
492 msg_link(jme, "Link is down.\n"); 492 netif_info(jme, link, jme->dev, "Link is down.\n");
493 jme->phylink = 0; 493 jme->phylink = 0;
494 netif_carrier_off(netdev); 494 netif_carrier_off(netdev);
495 } 495 }
@@ -883,20 +883,20 @@ jme_rxsum_ok(struct jme_adapter *jme, u16 flags)
883 if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_TCPON | RXWBFLAG_TCPCS)) 883 if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_TCPON | RXWBFLAG_TCPCS))
884 == RXWBFLAG_TCPON)) { 884 == RXWBFLAG_TCPON)) {
885 if (flags & RXWBFLAG_IPV4) 885 if (flags & RXWBFLAG_IPV4)
886 msg_rx_err(jme, "TCP Checksum error\n"); 886 netif_err(jme, rx_err, jme->dev, "TCP Checksum error\n");
887 return false; 887 return false;
888 } 888 }
889 889
890 if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_UDPON | RXWBFLAG_UDPCS)) 890 if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_UDPON | RXWBFLAG_UDPCS))
891 == RXWBFLAG_UDPON)) { 891 == RXWBFLAG_UDPON)) {
892 if (flags & RXWBFLAG_IPV4) 892 if (flags & RXWBFLAG_IPV4)
893 msg_rx_err(jme, "UDP Checksum error.\n"); 893 netif_err(jme, rx_err, jme->dev, "UDP Checksum error.\n");
894 return false; 894 return false;
895 } 895 }
896 896
897 if (unlikely((flags & (RXWBFLAG_IPV4 | RXWBFLAG_IPCS)) 897 if (unlikely((flags & (RXWBFLAG_IPV4 | RXWBFLAG_IPCS))
898 == RXWBFLAG_IPV4)) { 898 == RXWBFLAG_IPV4)) {
899 msg_rx_err(jme, "IPv4 Checksum error.\n"); 899 netif_err(jme, rx_err, jme->dev, "IPv4 Checksum error.\n");
900 return false; 900 return false;
901 } 901 }
902 902
@@ -1186,9 +1186,9 @@ jme_link_change_tasklet(unsigned long arg)
1186 1186
1187 while (!atomic_dec_and_test(&jme->link_changing)) { 1187 while (!atomic_dec_and_test(&jme->link_changing)) {
1188 atomic_inc(&jme->link_changing); 1188 atomic_inc(&jme->link_changing);
1189 msg_intr(jme, "Get link change lock failed.\n"); 1189 netif_info(jme, intr, jme->dev, "Get link change lock failed.\n");
1190 while (atomic_read(&jme->link_changing) != 1) 1190 while (atomic_read(&jme->link_changing) != 1)
1191 msg_intr(jme, "Waiting link change lock.\n"); 1191 netif_info(jme, intr, jme->dev, "Waiting link change lock.\n");
1192 } 1192 }
1193 1193
1194 if (jme_check_link(netdev, 1) && jme->old_mtu == netdev->mtu) 1194 if (jme_check_link(netdev, 1) && jme->old_mtu == netdev->mtu)
@@ -1305,7 +1305,7 @@ jme_rx_empty_tasklet(unsigned long arg)
1305 if (unlikely(!netif_carrier_ok(jme->dev))) 1305 if (unlikely(!netif_carrier_ok(jme->dev)))
1306 return; 1306 return;
1307 1307
1308 msg_rx_status(jme, "RX Queue Full!\n"); 1308 netif_info(jme, rx_status, jme->dev, "RX Queue Full!\n");
1309 1309
1310 jme_rx_clean_tasklet(arg); 1310 jme_rx_clean_tasklet(arg);
1311 1311
@@ -1325,7 +1325,7 @@ jme_wake_queue_if_stopped(struct jme_adapter *jme)
1325 smp_wmb(); 1325 smp_wmb();
1326 if (unlikely(netif_queue_stopped(jme->dev) && 1326 if (unlikely(netif_queue_stopped(jme->dev) &&
1327 atomic_read(&txring->nr_free) >= (jme->tx_wake_threshold))) { 1327 atomic_read(&txring->nr_free) >= (jme->tx_wake_threshold))) {
1328 msg_tx_done(jme, "TX Queue Waked.\n"); 1328 netif_info(jme, tx_done, jme->dev, "TX Queue Waked.\n");
1329 netif_wake_queue(jme->dev); 1329 netif_wake_queue(jme->dev);
1330 } 1330 }
1331 1331
@@ -1835,7 +1835,7 @@ jme_tx_csum(struct jme_adapter *jme, struct sk_buff *skb, u8 *flags)
1835 *flags |= TXFLAG_UDPCS; 1835 *flags |= TXFLAG_UDPCS;
1836 break; 1836 break;
1837 default: 1837 default:
1838 msg_tx_err(jme, "Error upper layer protocol.\n"); 1838 netif_err(jme, tx_err, jme->dev, "Error upper layer protocol.\n");
1839 break; 1839 break;
1840 } 1840 }
1841 } 1841 }
@@ -1910,12 +1910,12 @@ jme_stop_queue_if_full(struct jme_adapter *jme)
1910 smp_wmb(); 1910 smp_wmb();
1911 if (unlikely(atomic_read(&txring->nr_free) < (MAX_SKB_FRAGS+2))) { 1911 if (unlikely(atomic_read(&txring->nr_free) < (MAX_SKB_FRAGS+2))) {
1912 netif_stop_queue(jme->dev); 1912 netif_stop_queue(jme->dev);
1913 msg_tx_queued(jme, "TX Queue Paused.\n"); 1913 netif_info(jme, tx_queued, jme->dev, "TX Queue Paused.\n");
1914 smp_wmb(); 1914 smp_wmb();
1915 if (atomic_read(&txring->nr_free) 1915 if (atomic_read(&txring->nr_free)
1916 >= (jme->tx_wake_threshold)) { 1916 >= (jme->tx_wake_threshold)) {
1917 netif_wake_queue(jme->dev); 1917 netif_wake_queue(jme->dev);
1918 msg_tx_queued(jme, "TX Queue Fast Waked.\n"); 1918 netif_info(jme, tx_queued, jme->dev, "TX Queue Fast Waked.\n");
1919 } 1919 }
1920 } 1920 }
1921 1921
@@ -1923,7 +1923,7 @@ jme_stop_queue_if_full(struct jme_adapter *jme)
1923 (jiffies - txbi->start_xmit) >= TX_TIMEOUT && 1923 (jiffies - txbi->start_xmit) >= TX_TIMEOUT &&
1924 txbi->skb)) { 1924 txbi->skb)) {
1925 netif_stop_queue(jme->dev); 1925 netif_stop_queue(jme->dev);
1926 msg_tx_queued(jme, "TX Queue Stopped %d@%lu.\n", idx, jiffies); 1926 netif_info(jme, tx_queued, jme->dev, "TX Queue Stopped %d@%lu.\n", idx, jiffies);
1927 } 1927 }
1928} 1928}
1929 1929
@@ -1946,7 +1946,7 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev)
1946 1946
1947 if (unlikely(idx < 0)) { 1947 if (unlikely(idx < 0)) {
1948 netif_stop_queue(netdev); 1948 netif_stop_queue(netdev);
1949 msg_tx_err(jme, "BUG! Tx ring full when queue awake!\n"); 1949 netif_err(jme, tx_err, jme->dev, "BUG! Tx ring full when queue awake!\n");
1950 1950
1951 return NETDEV_TX_BUSY; 1951 return NETDEV_TX_BUSY;
1952 } 1952 }
@@ -2473,7 +2473,7 @@ jme_smb_read(struct jme_adapter *jme, unsigned int addr)
2473 val = jread32(jme, JME_SMBCSR); 2473 val = jread32(jme, JME_SMBCSR);
2474 } 2474 }
2475 if (!to) { 2475 if (!to) {
2476 msg_hw(jme, "SMB Bus Busy.\n"); 2476 netif_err(jme, hw, jme->dev, "SMB Bus Busy.\n");
2477 return 0xFF; 2477 return 0xFF;
2478 } 2478 }
2479 2479
@@ -2489,7 +2489,7 @@ jme_smb_read(struct jme_adapter *jme, unsigned int addr)
2489 val = jread32(jme, JME_SMBINTF); 2489 val = jread32(jme, JME_SMBINTF);
2490 } 2490 }
2491 if (!to) { 2491 if (!to) {
2492 msg_hw(jme, "SMB Bus Busy.\n"); 2492 netif_err(jme, hw, jme->dev, "SMB Bus Busy.\n");
2493 return 0xFF; 2493 return 0xFF;
2494 } 2494 }
2495 2495
@@ -2509,7 +2509,7 @@ jme_smb_write(struct jme_adapter *jme, unsigned int addr, u8 data)
2509 val = jread32(jme, JME_SMBCSR); 2509 val = jread32(jme, JME_SMBCSR);
2510 } 2510 }
2511 if (!to) { 2511 if (!to) {
2512 msg_hw(jme, "SMB Bus Busy.\n"); 2512 netif_err(jme, hw, jme->dev, "SMB Bus Busy.\n");
2513 return; 2513 return;
2514 } 2514 }
2515 2515
@@ -2526,7 +2526,7 @@ jme_smb_write(struct jme_adapter *jme, unsigned int addr, u8 data)
2526 val = jread32(jme, JME_SMBINTF); 2526 val = jread32(jme, JME_SMBINTF);
2527 } 2527 }
2528 if (!to) { 2528 if (!to) {
2529 msg_hw(jme, "SMB Bus Busy.\n"); 2529 netif_err(jme, hw, jme->dev, "SMB Bus Busy.\n");
2530 return; 2530 return;
2531 } 2531 }
2532 2532
@@ -2876,14 +2876,14 @@ jme_init_one(struct pci_dev *pdev,
2876 goto err_out_unmap; 2876 goto err_out_unmap;
2877 } 2877 }
2878 2878
2879 msg_probe(jme, "%s%s ver:%x rev:%x macaddr:%pM\n", 2879 netif_info(jme, probe, jme->dev, "%s%s ver:%x rev:%x macaddr:%pM\n",
2880 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ? 2880 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ?
2881 "JMC250 Gigabit Ethernet" : 2881 "JMC250 Gigabit Ethernet" :
2882 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ? 2882 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ?
2883 "JMC260 Fast Ethernet" : "Unknown", 2883 "JMC260 Fast Ethernet" : "Unknown",
2884 (jme->fpgaver != 0) ? " (FPGA)" : "", 2884 (jme->fpgaver != 0) ? " (FPGA)" : "",
2885 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, 2885 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev,
2886 jme->rev, netdev->dev_addr); 2886 jme->rev, netdev->dev_addr);
2887 2887
2888 return 0; 2888 return 0;
2889 2889
diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index 251abed3817e..c19db9146a2f 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -45,43 +45,16 @@
45 printk(KERN_ERR PFX fmt, ## args) 45 printk(KERN_ERR PFX fmt, ## args)
46 46
47#ifdef TX_DEBUG 47#ifdef TX_DEBUG
48#define tx_dbg(priv, fmt, args...) \ 48#define tx_dbg(priv, fmt, args...) \
49 printk(KERN_DEBUG "%s: " fmt, (priv)->dev->name, ## args) 49 printk(KERN_DEBUG "%s: " fmt, (priv)->dev->name, ##args)
50#else 50#else
51#define tx_dbg(priv, fmt, args...) 51#define tx_dbg(priv, fmt, args...) \
52do { \
53 if (0) \
54 printk(KERN_DEBUG "%s: " fmt, (priv)->dev->name, ##args); \
55} while (0)
52#endif 56#endif
53 57
54#define jme_msg(msglvl, type, priv, fmt, args...) \
55 if (netif_msg_##type(priv)) \
56 printk(msglvl "%s: " fmt, (priv)->dev->name, ## args)
57
58#define msg_probe(priv, fmt, args...) \
59 jme_msg(KERN_INFO, probe, priv, fmt, ## args)
60
61#define msg_link(priv, fmt, args...) \
62 jme_msg(KERN_INFO, link, priv, fmt, ## args)
63
64#define msg_intr(priv, fmt, args...) \
65 jme_msg(KERN_INFO, intr, priv, fmt, ## args)
66
67#define msg_rx_err(priv, fmt, args...) \
68 jme_msg(KERN_ERR, rx_err, priv, fmt, ## args)
69
70#define msg_rx_status(priv, fmt, args...) \
71 jme_msg(KERN_INFO, rx_status, priv, fmt, ## args)
72
73#define msg_tx_err(priv, fmt, args...) \
74 jme_msg(KERN_ERR, tx_err, priv, fmt, ## args)
75
76#define msg_tx_done(priv, fmt, args...) \
77 jme_msg(KERN_INFO, tx_done, priv, fmt, ## args)
78
79#define msg_tx_queued(priv, fmt, args...) \
80 jme_msg(KERN_INFO, tx_queued, priv, fmt, ## args)
81
82#define msg_hw(priv, fmt, args...) \
83 jme_msg(KERN_ERR, hw, priv, fmt, ## args)
84
85/* 58/*
86 * Extra PCI Configuration space interface 59 * Extra PCI Configuration space interface
87 */ 60 */