diff options
author | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2008-08-04 20:20:41 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-08-07 01:54:49 -0400 |
commit | 44defeb3f6f98ea9bb48a2fe6eb9004e9e1a49a1 (patch) | |
tree | a7a9b4d9091acaf32fe55da274a7c55f5e77f66d | |
parent | 77970ea50b8e7ee9733a6589bf61ed9c02f20ee9 (diff) |
e1000e: convert ndev_ printks to something smaller
The ndev_* printk's are too lenghty and we don't need to specify
the adapter/netdev struct at all, making this a lot more readable.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/e1000e/e1000.h | 27 | ||||
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 44 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 154 | ||||
-rw-r--r-- | drivers/net/e1000e/param.c | 31 |
4 files changed, 112 insertions, 144 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 4a4f62e002b2..d3ed1ed63292 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -41,24 +41,25 @@ | |||
41 | 41 | ||
42 | struct e1000_info; | 42 | struct e1000_info; |
43 | 43 | ||
44 | #define ndev_printk(level, netdev, format, arg...) \ | 44 | #define e_printk(level, adapter, format, arg...) \ |
45 | printk(level "%s: " format, (netdev)->name, ## arg) | 45 | printk(level "%s: %s: " format, pci_name(adapter->pdev), \ |
46 | adapter->netdev->name, ## arg) | ||
46 | 47 | ||
47 | #ifdef DEBUG | 48 | #ifdef DEBUG |
48 | #define ndev_dbg(netdev, format, arg...) \ | 49 | #define e_dbg(format, arg...) \ |
49 | ndev_printk(KERN_DEBUG , netdev, format, ## arg) | 50 | e_printk(KERN_DEBUG , adapter, format, ## arg) |
50 | #else | 51 | #else |
51 | #define ndev_dbg(netdev, format, arg...) do { (void)(netdev); } while (0) | 52 | #define e_dbg(format, arg...) do { (void)(adapter); } while (0) |
52 | #endif | 53 | #endif |
53 | 54 | ||
54 | #define ndev_err(netdev, format, arg...) \ | 55 | #define e_err(format, arg...) \ |
55 | ndev_printk(KERN_ERR , netdev, format, ## arg) | 56 | e_printk(KERN_ERR, adapter, format, ## arg) |
56 | #define ndev_info(netdev, format, arg...) \ | 57 | #define e_info(format, arg...) \ |
57 | ndev_printk(KERN_INFO , netdev, format, ## arg) | 58 | e_printk(KERN_INFO, adapter, format, ## arg) |
58 | #define ndev_warn(netdev, format, arg...) \ | 59 | #define e_warn(format, arg...) \ |
59 | ndev_printk(KERN_WARNING , netdev, format, ## arg) | 60 | e_printk(KERN_WARNING, adapter, format, ## arg) |
60 | #define ndev_notice(netdev, format, arg...) \ | 61 | #define e_notice(format, arg...) \ |
61 | ndev_printk(KERN_NOTICE , netdev, format, ## arg) | 62 | e_printk(KERN_NOTICE, adapter, format, ## arg) |
62 | 63 | ||
63 | 64 | ||
64 | /* Tx/Rx descriptor defines */ | 65 | /* Tx/Rx descriptor defines */ |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 9350564065e7..cf9679f2b7c4 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -189,8 +189,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) | |||
189 | /* Fiber NICs only allow 1000 gbps Full duplex */ | 189 | /* Fiber NICs only allow 1000 gbps Full duplex */ |
190 | if ((adapter->hw.phy.media_type == e1000_media_type_fiber) && | 190 | if ((adapter->hw.phy.media_type == e1000_media_type_fiber) && |
191 | spddplx != (SPEED_1000 + DUPLEX_FULL)) { | 191 | spddplx != (SPEED_1000 + DUPLEX_FULL)) { |
192 | ndev_err(adapter->netdev, "Unsupported Speed/Duplex " | 192 | e_err("Unsupported Speed/Duplex configuration\n"); |
193 | "configuration\n"); | ||
194 | return -EINVAL; | 193 | return -EINVAL; |
195 | } | 194 | } |
196 | 195 | ||
@@ -213,8 +212,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) | |||
213 | break; | 212 | break; |
214 | case SPEED_1000 + DUPLEX_HALF: /* not supported */ | 213 | case SPEED_1000 + DUPLEX_HALF: /* not supported */ |
215 | default: | 214 | default: |
216 | ndev_err(adapter->netdev, "Unsupported Speed/Duplex " | 215 | e_err("Unsupported Speed/Duplex configuration\n"); |
217 | "configuration\n"); | ||
218 | return -EINVAL; | 216 | return -EINVAL; |
219 | } | 217 | } |
220 | return 0; | 218 | return 0; |
@@ -231,8 +229,8 @@ static int e1000_set_settings(struct net_device *netdev, | |||
231 | * cannot be changed | 229 | * cannot be changed |
232 | */ | 230 | */ |
233 | if (e1000_check_reset_block(hw)) { | 231 | if (e1000_check_reset_block(hw)) { |
234 | ndev_err(netdev, "Cannot change link " | 232 | e_err("Cannot change link characteristics when SoL/IDER is " |
235 | "characteristics when SoL/IDER is active.\n"); | 233 | "active.\n"); |
236 | return -EINVAL; | 234 | return -EINVAL; |
237 | } | 235 | } |
238 | 236 | ||
@@ -380,8 +378,7 @@ static int e1000_set_tso(struct net_device *netdev, u32 data) | |||
380 | netdev->features &= ~NETIF_F_TSO6; | 378 | netdev->features &= ~NETIF_F_TSO6; |
381 | } | 379 | } |
382 | 380 | ||
383 | ndev_info(netdev, "TSO is %s\n", | 381 | e_info("TSO is %s\n", data ? "Enabled" : "Disabled"); |
384 | data ? "Enabled" : "Disabled"); | ||
385 | adapter->flags |= FLAG_TSO_FORCE; | 382 | adapter->flags |= FLAG_TSO_FORCE; |
386 | return 0; | 383 | return 0; |
387 | } | 384 | } |
@@ -722,10 +719,9 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, | |||
722 | (test[pat] & write)); | 719 | (test[pat] & write)); |
723 | val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset); | 720 | val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset); |
724 | if (val != (test[pat] & write & mask)) { | 721 | if (val != (test[pat] & write & mask)) { |
725 | ndev_err(adapter->netdev, "pattern test reg %04X " | 722 | e_err("pattern test reg %04X failed: got 0x%08X " |
726 | "failed: got 0x%08X expected 0x%08X\n", | 723 | "expected 0x%08X\n", reg + offset, val, |
727 | reg + offset, | 724 | (test[pat] & write & mask)); |
728 | val, (test[pat] & write & mask)); | ||
729 | *data = reg; | 725 | *data = reg; |
730 | return 1; | 726 | return 1; |
731 | } | 727 | } |
@@ -740,9 +736,8 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, | |||
740 | __ew32(&adapter->hw, reg, write & mask); | 736 | __ew32(&adapter->hw, reg, write & mask); |
741 | val = __er32(&adapter->hw, reg); | 737 | val = __er32(&adapter->hw, reg); |
742 | if ((write & mask) != (val & mask)) { | 738 | if ((write & mask) != (val & mask)) { |
743 | ndev_err(adapter->netdev, "set/check reg %04X test failed: " | 739 | e_err("set/check reg %04X test failed: got 0x%08X " |
744 | "got 0x%08X expected 0x%08X\n", reg, (val & mask), | 740 | "expected 0x%08X\n", reg, (val & mask), (write & mask)); |
745 | (write & mask)); | ||
746 | *data = reg; | 741 | *data = reg; |
747 | return 1; | 742 | return 1; |
748 | } | 743 | } |
@@ -766,7 +761,6 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
766 | { | 761 | { |
767 | struct e1000_hw *hw = &adapter->hw; | 762 | struct e1000_hw *hw = &adapter->hw; |
768 | struct e1000_mac_info *mac = &adapter->hw.mac; | 763 | struct e1000_mac_info *mac = &adapter->hw.mac; |
769 | struct net_device *netdev = adapter->netdev; | ||
770 | u32 value; | 764 | u32 value; |
771 | u32 before; | 765 | u32 before; |
772 | u32 after; | 766 | u32 after; |
@@ -799,8 +793,8 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
799 | ew32(STATUS, toggle); | 793 | ew32(STATUS, toggle); |
800 | after = er32(STATUS) & toggle; | 794 | after = er32(STATUS) & toggle; |
801 | if (value != after) { | 795 | if (value != after) { |
802 | ndev_err(netdev, "failed STATUS register test got: " | 796 | e_err("failed STATUS register test got: 0x%08X expected: " |
803 | "0x%08X expected: 0x%08X\n", after, value); | 797 | "0x%08X\n", after, value); |
804 | *data = 1; | 798 | *data = 1; |
805 | return 1; | 799 | return 1; |
806 | } | 800 | } |
@@ -903,8 +897,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) | |||
903 | *data = 1; | 897 | *data = 1; |
904 | return -1; | 898 | return -1; |
905 | } | 899 | } |
906 | ndev_info(netdev, "testing %s interrupt\n", | 900 | e_info("testing %s interrupt\n", (shared_int ? "shared" : "unshared")); |
907 | (shared_int ? "shared" : "unshared")); | ||
908 | 901 | ||
909 | /* Disable all the interrupts */ | 902 | /* Disable all the interrupts */ |
910 | ew32(IMC, 0xFFFFFFFF); | 903 | ew32(IMC, 0xFFFFFFFF); |
@@ -1526,8 +1519,7 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) | |||
1526 | * sessions are active | 1519 | * sessions are active |
1527 | */ | 1520 | */ |
1528 | if (e1000_check_reset_block(&adapter->hw)) { | 1521 | if (e1000_check_reset_block(&adapter->hw)) { |
1529 | ndev_err(adapter->netdev, "Cannot do PHY loopback test " | 1522 | e_err("Cannot do PHY loopback test when SoL/IDER is active.\n"); |
1530 | "when SoL/IDER is active.\n"); | ||
1531 | *data = 0; | 1523 | *data = 0; |
1532 | goto out; | 1524 | goto out; |
1533 | } | 1525 | } |
@@ -1612,7 +1604,7 @@ static void e1000_diag_test(struct net_device *netdev, | |||
1612 | forced_speed_duplex = adapter->hw.mac.forced_speed_duplex; | 1604 | forced_speed_duplex = adapter->hw.mac.forced_speed_duplex; |
1613 | autoneg = adapter->hw.mac.autoneg; | 1605 | autoneg = adapter->hw.mac.autoneg; |
1614 | 1606 | ||
1615 | ndev_info(netdev, "offline testing starting\n"); | 1607 | e_info("offline testing starting\n"); |
1616 | 1608 | ||
1617 | /* | 1609 | /* |
1618 | * Link test performed before hardware reset so autoneg doesn't | 1610 | * Link test performed before hardware reset so autoneg doesn't |
@@ -1658,7 +1650,7 @@ static void e1000_diag_test(struct net_device *netdev, | |||
1658 | if (if_running) | 1650 | if (if_running) |
1659 | dev_open(netdev); | 1651 | dev_open(netdev); |
1660 | } else { | 1652 | } else { |
1661 | ndev_info(netdev, "online testing starting\n"); | 1653 | e_info("online testing starting\n"); |
1662 | /* Online tests */ | 1654 | /* Online tests */ |
1663 | if (e1000_link_test(adapter, &data[4])) | 1655 | if (e1000_link_test(adapter, &data[4])) |
1664 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1656 | eth_test->flags |= ETH_TEST_FL_FAILED; |
@@ -1694,8 +1686,8 @@ static void e1000_get_wol(struct net_device *netdev, | |||
1694 | wol->supported &= ~WAKE_UCAST; | 1686 | wol->supported &= ~WAKE_UCAST; |
1695 | 1687 | ||
1696 | if (adapter->wol & E1000_WUFC_EX) | 1688 | if (adapter->wol & E1000_WUFC_EX) |
1697 | ndev_err(netdev, "Interface does not support " | 1689 | e_err("Interface does not support directed (unicast) " |
1698 | "directed (unicast) frame wake-up packets\n"); | 1690 | "frame wake-up packets\n"); |
1699 | } | 1691 | } |
1700 | 1692 | ||
1701 | if (adapter->wol & E1000_WUFC_EX) | 1693 | if (adapter->wol & E1000_WUFC_EX) |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index d13677899767..378335f2b237 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -484,8 +484,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
484 | * packet, also make sure the frame isn't just CRC only */ | 484 | * packet, also make sure the frame isn't just CRC only */ |
485 | if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) { | 485 | if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) { |
486 | /* All receives must fit into a single buffer */ | 486 | /* All receives must fit into a single buffer */ |
487 | ndev_dbg(netdev, "%s: Receive packet consumed " | 487 | e_dbg("%s: Receive packet consumed multiple buffers\n", |
488 | "multiple buffers\n", netdev->name); | 488 | netdev->name); |
489 | /* recycle */ | 489 | /* recycle */ |
490 | buffer_info->skb = skb; | 490 | buffer_info->skb = skb; |
491 | goto next_desc; | 491 | goto next_desc; |
@@ -576,28 +576,26 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter) | |||
576 | unsigned int i = tx_ring->next_to_clean; | 576 | unsigned int i = tx_ring->next_to_clean; |
577 | unsigned int eop = tx_ring->buffer_info[i].next_to_watch; | 577 | unsigned int eop = tx_ring->buffer_info[i].next_to_watch; |
578 | struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop); | 578 | struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop); |
579 | struct net_device *netdev = adapter->netdev; | ||
580 | 579 | ||
581 | /* detected Tx unit hang */ | 580 | /* detected Tx unit hang */ |
582 | ndev_err(netdev, | 581 | e_err("Detected Tx Unit Hang:\n" |
583 | "Detected Tx Unit Hang:\n" | 582 | " TDH <%x>\n" |
584 | " TDH <%x>\n" | 583 | " TDT <%x>\n" |
585 | " TDT <%x>\n" | 584 | " next_to_use <%x>\n" |
586 | " next_to_use <%x>\n" | 585 | " next_to_clean <%x>\n" |
587 | " next_to_clean <%x>\n" | 586 | "buffer_info[next_to_clean]:\n" |
588 | "buffer_info[next_to_clean]:\n" | 587 | " time_stamp <%lx>\n" |
589 | " time_stamp <%lx>\n" | 588 | " next_to_watch <%x>\n" |
590 | " next_to_watch <%x>\n" | 589 | " jiffies <%lx>\n" |
591 | " jiffies <%lx>\n" | 590 | " next_to_watch.status <%x>\n", |
592 | " next_to_watch.status <%x>\n", | 591 | readl(adapter->hw.hw_addr + tx_ring->head), |
593 | readl(adapter->hw.hw_addr + tx_ring->head), | 592 | readl(adapter->hw.hw_addr + tx_ring->tail), |
594 | readl(adapter->hw.hw_addr + tx_ring->tail), | 593 | tx_ring->next_to_use, |
595 | tx_ring->next_to_use, | 594 | tx_ring->next_to_clean, |
596 | tx_ring->next_to_clean, | 595 | tx_ring->buffer_info[eop].time_stamp, |
597 | tx_ring->buffer_info[eop].time_stamp, | 596 | eop, |
598 | eop, | 597 | jiffies, |
599 | jiffies, | 598 | eop_desc->upper.fields.status); |
600 | eop_desc->upper.fields.status); | ||
601 | } | 599 | } |
602 | 600 | ||
603 | /** | 601 | /** |
@@ -747,8 +745,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
747 | buffer_info->dma = 0; | 745 | buffer_info->dma = 0; |
748 | 746 | ||
749 | if (!(staterr & E1000_RXD_STAT_EOP)) { | 747 | if (!(staterr & E1000_RXD_STAT_EOP)) { |
750 | ndev_dbg(netdev, "%s: Packet Split buffers didn't pick " | 748 | e_dbg("%s: Packet Split buffers didn't pick up the " |
751 | "up the full packet\n", netdev->name); | 749 | "full packet\n", netdev->name); |
752 | dev_kfree_skb_irq(skb); | 750 | dev_kfree_skb_irq(skb); |
753 | goto next_desc; | 751 | goto next_desc; |
754 | } | 752 | } |
@@ -761,8 +759,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
761 | length = le16_to_cpu(rx_desc->wb.middle.length0); | 759 | length = le16_to_cpu(rx_desc->wb.middle.length0); |
762 | 760 | ||
763 | if (!length) { | 761 | if (!length) { |
764 | ndev_dbg(netdev, "%s: Last part of the packet spanning" | 762 | e_dbg("%s: Last part of the packet spanning multiple " |
765 | " multiple descriptors\n", netdev->name); | 763 | "descriptors\n", netdev->name); |
766 | dev_kfree_skb_irq(skb); | 764 | dev_kfree_skb_irq(skb); |
767 | goto next_desc; | 765 | goto next_desc; |
768 | } | 766 | } |
@@ -1011,7 +1009,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter, | |||
1011 | 1009 | ||
1012 | /* eth type trans needs skb->data to point to something */ | 1010 | /* eth type trans needs skb->data to point to something */ |
1013 | if (!pskb_may_pull(skb, ETH_HLEN)) { | 1011 | if (!pskb_may_pull(skb, ETH_HLEN)) { |
1014 | ndev_err(netdev, "pskb_may_pull failed.\n"); | 1012 | e_err("pskb_may_pull failed.\n"); |
1015 | dev_kfree_skb(skb); | 1013 | dev_kfree_skb(skb); |
1016 | goto next_desc; | 1014 | goto next_desc; |
1017 | } | 1015 | } |
@@ -1251,10 +1249,8 @@ static int e1000_request_irq(struct e1000_adapter *adapter) | |||
1251 | err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, | 1249 | err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, |
1252 | netdev); | 1250 | netdev); |
1253 | if (err) { | 1251 | if (err) { |
1254 | ndev_err(netdev, | 1252 | e_err("Unable to allocate %s interrupt (return: %d)\n", |
1255 | "Unable to allocate %s interrupt (return: %d)\n", | 1253 | adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx", err); |
1256 | adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx", | ||
1257 | err); | ||
1258 | if (adapter->flags & FLAG_MSI_ENABLED) | 1254 | if (adapter->flags & FLAG_MSI_ENABLED) |
1259 | pci_disable_msi(adapter->pdev); | 1255 | pci_disable_msi(adapter->pdev); |
1260 | } | 1256 | } |
@@ -1395,8 +1391,7 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter) | |||
1395 | return 0; | 1391 | return 0; |
1396 | err: | 1392 | err: |
1397 | vfree(tx_ring->buffer_info); | 1393 | vfree(tx_ring->buffer_info); |
1398 | ndev_err(adapter->netdev, | 1394 | e_err("Unable to allocate memory for the transmit descriptor ring\n"); |
1399 | "Unable to allocate memory for the transmit descriptor ring\n"); | ||
1400 | return err; | 1395 | return err; |
1401 | } | 1396 | } |
1402 | 1397 | ||
@@ -1450,8 +1445,7 @@ err_pages: | |||
1450 | } | 1445 | } |
1451 | err: | 1446 | err: |
1452 | vfree(rx_ring->buffer_info); | 1447 | vfree(rx_ring->buffer_info); |
1453 | ndev_err(adapter->netdev, | 1448 | e_err("Unable to allocate memory for the transmit descriptor ring\n"); |
1454 | "Unable to allocate memory for the transmit descriptor ring\n"); | ||
1455 | return err; | 1449 | return err; |
1456 | } | 1450 | } |
1457 | 1451 | ||
@@ -2456,7 +2450,7 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2456 | ew32(WUC, 0); | 2450 | ew32(WUC, 0); |
2457 | 2451 | ||
2458 | if (mac->ops.init_hw(hw)) | 2452 | if (mac->ops.init_hw(hw)) |
2459 | ndev_err(adapter->netdev, "Hardware Error\n"); | 2453 | e_err("Hardware Error\n"); |
2460 | 2454 | ||
2461 | e1000_update_mng_vlan(adapter); | 2455 | e1000_update_mng_vlan(adapter); |
2462 | 2456 | ||
@@ -2591,7 +2585,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter) | |||
2591 | return 0; | 2585 | return 0; |
2592 | 2586 | ||
2593 | err: | 2587 | err: |
2594 | ndev_err(netdev, "Unable to allocate memory for queues\n"); | 2588 | e_err("Unable to allocate memory for queues\n"); |
2595 | kfree(adapter->rx_ring); | 2589 | kfree(adapter->rx_ring); |
2596 | kfree(adapter->tx_ring); | 2590 | kfree(adapter->tx_ring); |
2597 | return -ENOMEM; | 2591 | return -ENOMEM; |
@@ -2917,8 +2911,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) | |||
2917 | ret_val |= e1e_rphy(hw, PHY_1000T_STATUS, &phy->stat1000); | 2911 | ret_val |= e1e_rphy(hw, PHY_1000T_STATUS, &phy->stat1000); |
2918 | ret_val |= e1e_rphy(hw, PHY_EXT_STATUS, &phy->estatus); | 2912 | ret_val |= e1e_rphy(hw, PHY_EXT_STATUS, &phy->estatus); |
2919 | if (ret_val) | 2913 | if (ret_val) |
2920 | ndev_warn(adapter->netdev, | 2914 | e_warn("Error reading PHY register\n"); |
2921 | "Error reading PHY register\n"); | ||
2922 | } else { | 2915 | } else { |
2923 | /* | 2916 | /* |
2924 | * Do not read PHY registers if link is not up | 2917 | * Do not read PHY registers if link is not up |
@@ -2943,18 +2936,16 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) | |||
2943 | static void e1000_print_link_info(struct e1000_adapter *adapter) | 2936 | static void e1000_print_link_info(struct e1000_adapter *adapter) |
2944 | { | 2937 | { |
2945 | struct e1000_hw *hw = &adapter->hw; | 2938 | struct e1000_hw *hw = &adapter->hw; |
2946 | struct net_device *netdev = adapter->netdev; | ||
2947 | u32 ctrl = er32(CTRL); | 2939 | u32 ctrl = er32(CTRL); |
2948 | 2940 | ||
2949 | ndev_info(netdev, | 2941 | e_info("Link is Up %d Mbps %s, Flow Control: %s\n", |
2950 | "Link is Up %d Mbps %s, Flow Control: %s\n", | 2942 | adapter->link_speed, |
2951 | adapter->link_speed, | 2943 | (adapter->link_duplex == FULL_DUPLEX) ? |
2952 | (adapter->link_duplex == FULL_DUPLEX) ? | 2944 | "Full Duplex" : "Half Duplex", |
2953 | "Full Duplex" : "Half Duplex", | 2945 | ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ? |
2954 | ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ? | 2946 | "RX/TX" : |
2955 | "RX/TX" : | 2947 | ((ctrl & E1000_CTRL_RFCE) ? "RX" : |
2956 | ((ctrl & E1000_CTRL_RFCE) ? "RX" : | 2948 | ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); |
2957 | ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); | ||
2958 | } | 2949 | } |
2959 | 2950 | ||
2960 | static bool e1000_has_link(struct e1000_adapter *adapter) | 2951 | static bool e1000_has_link(struct e1000_adapter *adapter) |
@@ -2994,8 +2985,7 @@ static bool e1000_has_link(struct e1000_adapter *adapter) | |||
2994 | if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) && | 2985 | if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) && |
2995 | (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) { | 2986 | (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) { |
2996 | /* See e1000_kmrn_lock_loss_workaround_ich8lan() */ | 2987 | /* See e1000_kmrn_lock_loss_workaround_ich8lan() */ |
2997 | ndev_info(adapter->netdev, | 2988 | e_info("Gigabit has been disabled, downgrading speed\n"); |
2998 | "Gigabit has been disabled, downgrading speed\n"); | ||
2999 | } | 2989 | } |
3000 | 2990 | ||
3001 | return link_active; | 2991 | return link_active; |
@@ -3096,8 +3086,7 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3096 | switch (adapter->link_speed) { | 3086 | switch (adapter->link_speed) { |
3097 | case SPEED_10: | 3087 | case SPEED_10: |
3098 | case SPEED_100: | 3088 | case SPEED_100: |
3099 | ndev_info(netdev, | 3089 | e_info("10/100 speed: disabling TSO\n"); |
3100 | "10/100 speed: disabling TSO\n"); | ||
3101 | netdev->features &= ~NETIF_F_TSO; | 3090 | netdev->features &= ~NETIF_F_TSO; |
3102 | netdev->features &= ~NETIF_F_TSO6; | 3091 | netdev->features &= ~NETIF_F_TSO6; |
3103 | break; | 3092 | break; |
@@ -3130,7 +3119,7 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3130 | if (netif_carrier_ok(netdev)) { | 3119 | if (netif_carrier_ok(netdev)) { |
3131 | adapter->link_speed = 0; | 3120 | adapter->link_speed = 0; |
3132 | adapter->link_duplex = 0; | 3121 | adapter->link_duplex = 0; |
3133 | ndev_info(netdev, "Link is Down\n"); | 3122 | e_info("Link is Down\n"); |
3134 | netif_carrier_off(netdev); | 3123 | netif_carrier_off(netdev); |
3135 | netif_tx_stop_all_queues(netdev); | 3124 | netif_tx_stop_all_queues(netdev); |
3136 | if (!test_bit(__E1000_DOWN, &adapter->state)) | 3125 | if (!test_bit(__E1000_DOWN, &adapter->state)) |
@@ -3604,8 +3593,7 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3604 | 3593 | ||
3605 | pull_size = min((unsigned int)4, skb->data_len); | 3594 | pull_size = min((unsigned int)4, skb->data_len); |
3606 | if (!__pskb_pull_tail(skb, pull_size)) { | 3595 | if (!__pskb_pull_tail(skb, pull_size)) { |
3607 | ndev_err(netdev, | 3596 | e_err("__pskb_pull_tail failed.\n"); |
3608 | "__pskb_pull_tail failed.\n"); | ||
3609 | dev_kfree_skb_any(skb); | 3597 | dev_kfree_skb_any(skb); |
3610 | return NETDEV_TX_OK; | 3598 | return NETDEV_TX_OK; |
3611 | } | 3599 | } |
@@ -3737,25 +3725,25 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3737 | 3725 | ||
3738 | if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || | 3726 | if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || |
3739 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { | 3727 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { |
3740 | ndev_err(netdev, "Invalid MTU setting\n"); | 3728 | e_err("Invalid MTU setting\n"); |
3741 | return -EINVAL; | 3729 | return -EINVAL; |
3742 | } | 3730 | } |
3743 | 3731 | ||
3744 | /* Jumbo frame size limits */ | 3732 | /* Jumbo frame size limits */ |
3745 | if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { | 3733 | if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { |
3746 | if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { | 3734 | if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { |
3747 | ndev_err(netdev, "Jumbo Frames not supported.\n"); | 3735 | e_err("Jumbo Frames not supported.\n"); |
3748 | return -EINVAL; | 3736 | return -EINVAL; |
3749 | } | 3737 | } |
3750 | if (adapter->hw.phy.type == e1000_phy_ife) { | 3738 | if (adapter->hw.phy.type == e1000_phy_ife) { |
3751 | ndev_err(netdev, "Jumbo Frames not supported.\n"); | 3739 | e_err("Jumbo Frames not supported.\n"); |
3752 | return -EINVAL; | 3740 | return -EINVAL; |
3753 | } | 3741 | } |
3754 | } | 3742 | } |
3755 | 3743 | ||
3756 | #define MAX_STD_JUMBO_FRAME_SIZE 9234 | 3744 | #define MAX_STD_JUMBO_FRAME_SIZE 9234 |
3757 | if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { | 3745 | if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { |
3758 | ndev_err(netdev, "MTU > 9216 not supported.\n"); | 3746 | e_err("MTU > 9216 not supported.\n"); |
3759 | return -EINVAL; | 3747 | return -EINVAL; |
3760 | } | 3748 | } |
3761 | 3749 | ||
@@ -3792,8 +3780,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3792 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN | 3780 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN |
3793 | + ETH_FCS_LEN; | 3781 | + ETH_FCS_LEN; |
3794 | 3782 | ||
3795 | ndev_info(netdev, "changing MTU from %d to %d\n", | 3783 | e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); |
3796 | netdev->mtu, new_mtu); | ||
3797 | netdev->mtu = new_mtu; | 3784 | netdev->mtu = new_mtu; |
3798 | 3785 | ||
3799 | if (netif_running(netdev)) | 3786 | if (netif_running(netdev)) |
@@ -4175,22 +4162,19 @@ static void e1000_print_device_info(struct e1000_adapter *adapter) | |||
4175 | u32 pba_num; | 4162 | u32 pba_num; |
4176 | 4163 | ||
4177 | /* print bus type/speed/width info */ | 4164 | /* print bus type/speed/width info */ |
4178 | ndev_info(netdev, "(PCI Express:2.5GB/s:%s) " | 4165 | e_info("(PCI Express:2.5GB/s:%s) %02x:%02x:%02x:%02x:%02x:%02x\n", |
4179 | "%02x:%02x:%02x:%02x:%02x:%02x\n", | 4166 | /* bus width */ |
4180 | /* bus width */ | 4167 | ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : |
4181 | ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : | 4168 | "Width x1"), |
4182 | "Width x1"), | 4169 | /* MAC address */ |
4183 | /* MAC address */ | 4170 | netdev->dev_addr[0], netdev->dev_addr[1], |
4184 | netdev->dev_addr[0], netdev->dev_addr[1], | 4171 | netdev->dev_addr[2], netdev->dev_addr[3], |
4185 | netdev->dev_addr[2], netdev->dev_addr[3], | 4172 | netdev->dev_addr[4], netdev->dev_addr[5]); |
4186 | netdev->dev_addr[4], netdev->dev_addr[5]); | 4173 | e_info("Intel(R) PRO/%s Network Connection\n", |
4187 | ndev_info(netdev, "Intel(R) PRO/%s Network Connection\n", | 4174 | (hw->phy.type == e1000_phy_ife) ? "10/100" : "1000"); |
4188 | (hw->phy.type == e1000_phy_ife) | ||
4189 | ? "10/100" : "1000"); | ||
4190 | e1000e_read_pba_num(hw, &pba_num); | 4175 | e1000e_read_pba_num(hw, &pba_num); |
4191 | ndev_info(netdev, "MAC: %d, PHY: %d, PBA No: %06x-%03x\n", | 4176 | e_info("MAC: %d, PHY: %d, PBA No: %06x-%03x\n", |
4192 | hw->mac.type, hw->phy.type, | 4177 | hw->mac.type, hw->phy.type, (pba_num >> 8), (pba_num & 0xff)); |
4193 | (pba_num >> 8), (pba_num & 0xff)); | ||
4194 | } | 4178 | } |
4195 | 4179 | ||
4196 | /** | 4180 | /** |
@@ -4366,8 +4350,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4366 | } | 4350 | } |
4367 | 4351 | ||
4368 | if (e1000_check_reset_block(&adapter->hw)) | 4352 | if (e1000_check_reset_block(&adapter->hw)) |
4369 | ndev_info(netdev, | 4353 | e_info("PHY reset is blocked due to SOL/IDER session.\n"); |
4370 | "PHY reset is blocked due to SOL/IDER session.\n"); | ||
4371 | 4354 | ||
4372 | netdev->features = NETIF_F_SG | | 4355 | netdev->features = NETIF_F_SG | |
4373 | NETIF_F_HW_CSUM | | 4356 | NETIF_F_HW_CSUM | |
@@ -4411,7 +4394,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4411 | if (e1000_validate_nvm_checksum(&adapter->hw) >= 0) | 4394 | if (e1000_validate_nvm_checksum(&adapter->hw) >= 0) |
4412 | break; | 4395 | break; |
4413 | if (i == 2) { | 4396 | if (i == 2) { |
4414 | ndev_err(netdev, "The NVM Checksum Is Not Valid\n"); | 4397 | e_err("The NVM Checksum Is Not Valid\n"); |
4415 | err = -EIO; | 4398 | err = -EIO; |
4416 | goto err_eeprom; | 4399 | goto err_eeprom; |
4417 | } | 4400 | } |
@@ -4419,17 +4402,16 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4419 | 4402 | ||
4420 | /* copy the MAC address out of the NVM */ | 4403 | /* copy the MAC address out of the NVM */ |
4421 | if (e1000e_read_mac_addr(&adapter->hw)) | 4404 | if (e1000e_read_mac_addr(&adapter->hw)) |
4422 | ndev_err(netdev, "NVM Read Error while reading MAC address\n"); | 4405 | e_err("NVM Read Error while reading MAC address\n"); |
4423 | 4406 | ||
4424 | memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); | 4407 | memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); |
4425 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); | 4408 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); |
4426 | 4409 | ||
4427 | if (!is_valid_ether_addr(netdev->perm_addr)) { | 4410 | if (!is_valid_ether_addr(netdev->perm_addr)) { |
4428 | ndev_err(netdev, "Invalid MAC Address: " | 4411 | e_err("Invalid MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", |
4429 | "%02x:%02x:%02x:%02x:%02x:%02x\n", | 4412 | netdev->perm_addr[0], netdev->perm_addr[1], |
4430 | netdev->perm_addr[0], netdev->perm_addr[1], | 4413 | netdev->perm_addr[2], netdev->perm_addr[3], |
4431 | netdev->perm_addr[2], netdev->perm_addr[3], | 4414 | netdev->perm_addr[4], netdev->perm_addr[5]); |
4432 | netdev->perm_addr[4], netdev->perm_addr[5]); | ||
4433 | err = -EIO; | 4415 | err = -EIO; |
4434 | goto err_eeprom; | 4416 | goto err_eeprom; |
4435 | } | 4417 | } |
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c index a66b92efcf80..8effc3107f9a 100644 --- a/drivers/net/e1000e/param.c +++ b/drivers/net/e1000e/param.c | |||
@@ -27,6 +27,7 @@ | |||
27 | *******************************************************************************/ | 27 | *******************************************************************************/ |
28 | 28 | ||
29 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
30 | #include <linux/pci.h> | ||
30 | 31 | ||
31 | #include "e1000.h" | 32 | #include "e1000.h" |
32 | 33 | ||
@@ -162,17 +163,16 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
162 | case enable_option: | 163 | case enable_option: |
163 | switch (*value) { | 164 | switch (*value) { |
164 | case OPTION_ENABLED: | 165 | case OPTION_ENABLED: |
165 | ndev_info(adapter->netdev, "%s Enabled\n", opt->name); | 166 | e_info("%s Enabled\n", opt->name); |
166 | return 0; | 167 | return 0; |
167 | case OPTION_DISABLED: | 168 | case OPTION_DISABLED: |
168 | ndev_info(adapter->netdev, "%s Disabled\n", opt->name); | 169 | e_info("%s Disabled\n", opt->name); |
169 | return 0; | 170 | return 0; |
170 | } | 171 | } |
171 | break; | 172 | break; |
172 | case range_option: | 173 | case range_option: |
173 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { | 174 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { |
174 | ndev_info(adapter->netdev, | 175 | e_info("%s set to %i\n", opt->name, *value); |
175 | "%s set to %i\n", opt->name, *value); | ||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | break; | 178 | break; |
@@ -184,8 +184,7 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
184 | ent = &opt->arg.l.p[i]; | 184 | ent = &opt->arg.l.p[i]; |
185 | if (*value == ent->i) { | 185 | if (*value == ent->i) { |
186 | if (ent->str[0] != '\0') | 186 | if (ent->str[0] != '\0') |
187 | ndev_info(adapter->netdev, "%s\n", | 187 | e_info("%s\n", ent->str); |
188 | ent->str); | ||
189 | return 0; | 188 | return 0; |
190 | } | 189 | } |
191 | } | 190 | } |
@@ -195,8 +194,8 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
195 | BUG(); | 194 | BUG(); |
196 | } | 195 | } |
197 | 196 | ||
198 | ndev_info(adapter->netdev, "Invalid %s value specified (%i) %s\n", | 197 | e_info("Invalid %s value specified (%i) %s\n", opt->name, *value, |
199 | opt->name, *value, opt->err); | 198 | opt->err); |
200 | *value = opt->def; | 199 | *value = opt->def; |
201 | return -1; | 200 | return -1; |
202 | } | 201 | } |
@@ -213,13 +212,11 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
213 | void __devinit e1000e_check_options(struct e1000_adapter *adapter) | 212 | void __devinit e1000e_check_options(struct e1000_adapter *adapter) |
214 | { | 213 | { |
215 | struct e1000_hw *hw = &adapter->hw; | 214 | struct e1000_hw *hw = &adapter->hw; |
216 | struct net_device *netdev = adapter->netdev; | ||
217 | int bd = adapter->bd_number; | 215 | int bd = adapter->bd_number; |
218 | 216 | ||
219 | if (bd >= E1000_MAX_NIC) { | 217 | if (bd >= E1000_MAX_NIC) { |
220 | ndev_notice(netdev, | 218 | e_notice("Warning: no configuration for board #%i\n", bd); |
221 | "Warning: no configuration for board #%i\n", bd); | 219 | e_notice("Using defaults for all values\n"); |
222 | ndev_notice(netdev, "Using defaults for all values\n"); | ||
223 | } | 220 | } |
224 | 221 | ||
225 | { /* Transmit Interrupt Delay */ | 222 | { /* Transmit Interrupt Delay */ |
@@ -313,19 +310,15 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
313 | adapter->itr = InterruptThrottleRate[bd]; | 310 | adapter->itr = InterruptThrottleRate[bd]; |
314 | switch (adapter->itr) { | 311 | switch (adapter->itr) { |
315 | case 0: | 312 | case 0: |
316 | ndev_info(netdev, "%s turned off\n", | 313 | e_info("%s turned off\n", opt.name); |
317 | opt.name); | ||
318 | break; | 314 | break; |
319 | case 1: | 315 | case 1: |
320 | ndev_info(netdev, | 316 | e_info("%s set to dynamic mode\n", opt.name); |
321 | "%s set to dynamic mode\n", | ||
322 | opt.name); | ||
323 | adapter->itr_setting = adapter->itr; | 317 | adapter->itr_setting = adapter->itr; |
324 | adapter->itr = 20000; | 318 | adapter->itr = 20000; |
325 | break; | 319 | break; |
326 | case 3: | 320 | case 3: |
327 | ndev_info(netdev, | 321 | e_info("%s set to dynamic conservative mode\n", |
328 | "%s set to dynamic conservative mode\n", | ||
329 | opt.name); | 322 | opt.name); |
330 | adapter->itr_setting = adapter->itr; | 323 | adapter->itr_setting = adapter->itr; |
331 | adapter->itr = 20000; | 324 | adapter->itr = 20000; |