aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000.h37
-rw-r--r--drivers/net/e1000/e1000_ethtool.c89
-rw-r--r--drivers/net/e1000/e1000_hw.c356
-rw-r--r--drivers/net/e1000/e1000_hw.h1
-rw-r--r--drivers/net/e1000/e1000_main.c429
-rw-r--r--drivers/net/e1000/e1000_osdep.h14
-rw-r--r--drivers/net/e1000/e1000_param.c112
7 files changed, 517 insertions, 521 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 2f29c2131851..40b62b406b08 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -81,23 +81,6 @@ struct e1000_adapter;
81 81
82#include "e1000_hw.h" 82#include "e1000_hw.h"
83 83
84#ifdef DBG
85#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
86#else
87#define E1000_DBG(args...)
88#endif
89
90#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
91
92#define PFX "e1000: "
93
94#define DPRINTK(nlevel, klevel, fmt, args...) \
95do { \
96 if (NETIF_MSG_##nlevel & adapter->msg_enable) \
97 printk(KERN_##klevel PFX "%s: %s: " fmt, \
98 adapter->netdev->name, __func__, ##args); \
99} while (0)
100
101#define E1000_MAX_INTR 10 84#define E1000_MAX_INTR 10
102 85
103/* TX/RX descriptor defines */ 86/* TX/RX descriptor defines */
@@ -335,6 +318,25 @@ enum e1000_state_t {
335 __E1000_DOWN 318 __E1000_DOWN
336}; 319};
337 320
321#undef pr_fmt
322#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
323
324extern struct net_device *e1000_get_hw_dev(struct e1000_hw *hw);
325#define e_dbg(format, arg...) \
326 netdev_dbg(e1000_get_hw_dev(hw), format, ## arg)
327#define e_err(format, arg...) \
328 netdev_err(adapter->netdev, format, ## arg)
329#define e_info(format, arg...) \
330 netdev_info(adapter->netdev, format, ## arg)
331#define e_warn(format, arg...) \
332 netdev_warn(adapter->netdev, format, ## arg)
333#define e_notice(format, arg...) \
334 netdev_notice(adapter->netdev, format, ## arg)
335#define e_dev_info(format, arg...) \
336 dev_info(&adapter->pdev->dev, format, ## arg)
337#define e_dev_warn(format, arg...) \
338 dev_warn(&adapter->pdev->dev, format, ## arg)
339
338extern char e1000_driver_name[]; 340extern char e1000_driver_name[];
339extern const char e1000_driver_version[]; 341extern const char e1000_driver_version[];
340 342
@@ -352,5 +354,6 @@ extern bool e1000_has_link(struct e1000_adapter *adapter);
352extern void e1000_power_up_phy(struct e1000_adapter *); 354extern void e1000_power_up_phy(struct e1000_adapter *);
353extern void e1000_set_ethtool_ops(struct net_device *netdev); 355extern void e1000_set_ethtool_ops(struct net_device *netdev);
354extern void e1000_check_options(struct e1000_adapter *adapter); 356extern void e1000_check_options(struct e1000_adapter *adapter);
357extern char *e1000_get_hw_dev_name(struct e1000_hw *hw);
355 358
356#endif /* _E1000_H_ */ 359#endif /* _E1000_H_ */
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index c67e93117271..d5ff029aa7b2 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -346,7 +346,7 @@ static int e1000_set_tso(struct net_device *netdev, u32 data)
346 346
347 netdev->features &= ~NETIF_F_TSO6; 347 netdev->features &= ~NETIF_F_TSO6;
348 348
349 DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); 349 e_info("TSO is %s\n", data ? "Enabled" : "Disabled");
350 adapter->tso_force = true; 350 adapter->tso_force = true;
351 return 0; 351 return 0;
352} 352}
@@ -714,9 +714,9 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, int reg,
714 writel(write & test[i], address); 714 writel(write & test[i], address);
715 read = readl(address); 715 read = readl(address);
716 if (read != (write & test[i] & mask)) { 716 if (read != (write & test[i] & mask)) {
717 DPRINTK(DRV, ERR, "pattern test reg %04X failed: " 717 e_info("pattern test reg %04X failed: "
718 "got 0x%08X expected 0x%08X\n", 718 "got 0x%08X expected 0x%08X\n",
719 reg, read, (write & test[i] & mask)); 719 reg, read, (write & test[i] & mask));
720 *data = reg; 720 *data = reg;
721 return true; 721 return true;
722 } 722 }
@@ -734,9 +734,9 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, int reg,
734 writel(write & mask, address); 734 writel(write & mask, address);
735 read = readl(address); 735 read = readl(address);
736 if ((read & mask) != (write & mask)) { 736 if ((read & mask) != (write & mask)) {
737 DPRINTK(DRV, ERR, "set/check reg %04X test failed: " 737 e_err("set/check reg %04X test failed: "
738 "got 0x%08X expected 0x%08X\n", 738 "got 0x%08X expected 0x%08X\n",
739 reg, (read & mask), (write & mask)); 739 reg, (read & mask), (write & mask));
740 *data = reg; 740 *data = reg;
741 return true; 741 return true;
742 } 742 }
@@ -779,8 +779,8 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
779 ew32(STATUS, toggle); 779 ew32(STATUS, toggle);
780 after = er32(STATUS) & toggle; 780 after = er32(STATUS) & toggle;
781 if (value != after) { 781 if (value != after) {
782 DPRINTK(DRV, ERR, "failed STATUS register test got: " 782 e_err("failed STATUS register test got: "
783 "0x%08X expected: 0x%08X\n", after, value); 783 "0x%08X expected: 0x%08X\n", after, value);
784 *data = 1; 784 *data = 1;
785 return 1; 785 return 1;
786 } 786 }
@@ -894,8 +894,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
894 *data = 1; 894 *data = 1;
895 return -1; 895 return -1;
896 } 896 }
897 DPRINTK(HW, INFO, "testing %s interrupt\n", 897 e_info("testing %s interrupt\n", (shared_int ? "shared" : "unshared"));
898 (shared_int ? "shared" : "unshared"));
899 898
900 /* Disable all the interrupts */ 899 /* Disable all the interrupts */
901 ew32(IMC, 0xFFFFFFFF); 900 ew32(IMC, 0xFFFFFFFF);
@@ -980,9 +979,10 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
980 if (txdr->desc && txdr->buffer_info) { 979 if (txdr->desc && txdr->buffer_info) {
981 for (i = 0; i < txdr->count; i++) { 980 for (i = 0; i < txdr->count; i++) {
982 if (txdr->buffer_info[i].dma) 981 if (txdr->buffer_info[i].dma)
983 pci_unmap_single(pdev, txdr->buffer_info[i].dma, 982 dma_unmap_single(&pdev->dev,
983 txdr->buffer_info[i].dma,
984 txdr->buffer_info[i].length, 984 txdr->buffer_info[i].length,
985 PCI_DMA_TODEVICE); 985 DMA_TO_DEVICE);
986 if (txdr->buffer_info[i].skb) 986 if (txdr->buffer_info[i].skb)
987 dev_kfree_skb(txdr->buffer_info[i].skb); 987 dev_kfree_skb(txdr->buffer_info[i].skb);
988 } 988 }
@@ -991,20 +991,23 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
991 if (rxdr->desc && rxdr->buffer_info) { 991 if (rxdr->desc && rxdr->buffer_info) {
992 for (i = 0; i < rxdr->count; i++) { 992 for (i = 0; i < rxdr->count; i++) {
993 if (rxdr->buffer_info[i].dma) 993 if (rxdr->buffer_info[i].dma)
994 pci_unmap_single(pdev, rxdr->buffer_info[i].dma, 994 dma_unmap_single(&pdev->dev,
995 rxdr->buffer_info[i].dma,
995 rxdr->buffer_info[i].length, 996 rxdr->buffer_info[i].length,
996 PCI_DMA_FROMDEVICE); 997 DMA_FROM_DEVICE);
997 if (rxdr->buffer_info[i].skb) 998 if (rxdr->buffer_info[i].skb)
998 dev_kfree_skb(rxdr->buffer_info[i].skb); 999 dev_kfree_skb(rxdr->buffer_info[i].skb);
999 } 1000 }
1000 } 1001 }
1001 1002
1002 if (txdr->desc) { 1003 if (txdr->desc) {
1003 pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma); 1004 dma_free_coherent(&pdev->dev, txdr->size, txdr->desc,
1005 txdr->dma);
1004 txdr->desc = NULL; 1006 txdr->desc = NULL;
1005 } 1007 }
1006 if (rxdr->desc) { 1008 if (rxdr->desc) {
1007 pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma); 1009 dma_free_coherent(&pdev->dev, rxdr->size, rxdr->desc,
1010 rxdr->dma);
1008 rxdr->desc = NULL; 1011 rxdr->desc = NULL;
1009 } 1012 }
1010 1013
@@ -1012,8 +1015,6 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
1012 txdr->buffer_info = NULL; 1015 txdr->buffer_info = NULL;
1013 kfree(rxdr->buffer_info); 1016 kfree(rxdr->buffer_info);
1014 rxdr->buffer_info = NULL; 1017 rxdr->buffer_info = NULL;
1015
1016 return;
1017} 1018}
1018 1019
1019static int e1000_setup_desc_rings(struct e1000_adapter *adapter) 1020static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
@@ -1039,7 +1040,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
1039 1040
1040 txdr->size = txdr->count * sizeof(struct e1000_tx_desc); 1041 txdr->size = txdr->count * sizeof(struct e1000_tx_desc);
1041 txdr->size = ALIGN(txdr->size, 4096); 1042 txdr->size = ALIGN(txdr->size, 4096);
1042 txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); 1043 txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size, &txdr->dma,
1044 GFP_KERNEL);
1043 if (!txdr->desc) { 1045 if (!txdr->desc) {
1044 ret_val = 2; 1046 ret_val = 2;
1045 goto err_nomem; 1047 goto err_nomem;
@@ -1070,8 +1072,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
1070 txdr->buffer_info[i].skb = skb; 1072 txdr->buffer_info[i].skb = skb;
1071 txdr->buffer_info[i].length = skb->len; 1073 txdr->buffer_info[i].length = skb->len;
1072 txdr->buffer_info[i].dma = 1074 txdr->buffer_info[i].dma =
1073 pci_map_single(pdev, skb->data, skb->len, 1075 dma_map_single(&pdev->dev, skb->data, skb->len,
1074 PCI_DMA_TODEVICE); 1076 DMA_TO_DEVICE);
1075 tx_desc->buffer_addr = cpu_to_le64(txdr->buffer_info[i].dma); 1077 tx_desc->buffer_addr = cpu_to_le64(txdr->buffer_info[i].dma);
1076 tx_desc->lower.data = cpu_to_le32(skb->len); 1078 tx_desc->lower.data = cpu_to_le32(skb->len);
1077 tx_desc->lower.data |= cpu_to_le32(E1000_TXD_CMD_EOP | 1079 tx_desc->lower.data |= cpu_to_le32(E1000_TXD_CMD_EOP |
@@ -1093,7 +1095,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
1093 } 1095 }
1094 1096
1095 rxdr->size = rxdr->count * sizeof(struct e1000_rx_desc); 1097 rxdr->size = rxdr->count * sizeof(struct e1000_rx_desc);
1096 rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma); 1098 rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
1099 GFP_KERNEL);
1097 if (!rxdr->desc) { 1100 if (!rxdr->desc) {
1098 ret_val = 5; 1101 ret_val = 5;
1099 goto err_nomem; 1102 goto err_nomem;
@@ -1126,8 +1129,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
1126 rxdr->buffer_info[i].skb = skb; 1129 rxdr->buffer_info[i].skb = skb;
1127 rxdr->buffer_info[i].length = E1000_RXBUFFER_2048; 1130 rxdr->buffer_info[i].length = E1000_RXBUFFER_2048;
1128 rxdr->buffer_info[i].dma = 1131 rxdr->buffer_info[i].dma =
1129 pci_map_single(pdev, skb->data, E1000_RXBUFFER_2048, 1132 dma_map_single(&pdev->dev, skb->data,
1130 PCI_DMA_FROMDEVICE); 1133 E1000_RXBUFFER_2048, DMA_FROM_DEVICE);
1131 rx_desc->buffer_addr = cpu_to_le64(rxdr->buffer_info[i].dma); 1134 rx_desc->buffer_addr = cpu_to_le64(rxdr->buffer_info[i].dma);
1132 memset(skb->data, 0x00, skb->len); 1135 memset(skb->data, 0x00, skb->len);
1133 } 1136 }
@@ -1444,10 +1447,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
1444 for (i = 0; i < 64; i++) { /* send the packets */ 1447 for (i = 0; i < 64; i++) { /* send the packets */
1445 e1000_create_lbtest_frame(txdr->buffer_info[i].skb, 1448 e1000_create_lbtest_frame(txdr->buffer_info[i].skb,
1446 1024); 1449 1024);
1447 pci_dma_sync_single_for_device(pdev, 1450 dma_sync_single_for_device(&pdev->dev,
1448 txdr->buffer_info[k].dma, 1451 txdr->buffer_info[k].dma,
1449 txdr->buffer_info[k].length, 1452 txdr->buffer_info[k].length,
1450 PCI_DMA_TODEVICE); 1453 DMA_TO_DEVICE);
1451 if (unlikely(++k == txdr->count)) k = 0; 1454 if (unlikely(++k == txdr->count)) k = 0;
1452 } 1455 }
1453 ew32(TDT, k); 1456 ew32(TDT, k);
@@ -1455,10 +1458,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
1455 time = jiffies; /* set the start time for the receive */ 1458 time = jiffies; /* set the start time for the receive */
1456 good_cnt = 0; 1459 good_cnt = 0;
1457 do { /* receive the sent packets */ 1460 do { /* receive the sent packets */
1458 pci_dma_sync_single_for_cpu(pdev, 1461 dma_sync_single_for_cpu(&pdev->dev,
1459 rxdr->buffer_info[l].dma, 1462 rxdr->buffer_info[l].dma,
1460 rxdr->buffer_info[l].length, 1463 rxdr->buffer_info[l].length,
1461 PCI_DMA_FROMDEVICE); 1464 DMA_FROM_DEVICE);
1462 1465
1463 ret_val = e1000_check_lbtest_frame( 1466 ret_val = e1000_check_lbtest_frame(
1464 rxdr->buffer_info[l].skb, 1467 rxdr->buffer_info[l].skb,
@@ -1558,7 +1561,7 @@ static void e1000_diag_test(struct net_device *netdev,
1558 u8 forced_speed_duplex = hw->forced_speed_duplex; 1561 u8 forced_speed_duplex = hw->forced_speed_duplex;
1559 u8 autoneg = hw->autoneg; 1562 u8 autoneg = hw->autoneg;
1560 1563
1561 DPRINTK(HW, INFO, "offline testing starting\n"); 1564 e_info("offline testing starting\n");
1562 1565
1563 /* Link test performed before hardware reset so autoneg doesn't 1566 /* Link test performed before hardware reset so autoneg doesn't
1564 * interfere with test result */ 1567 * interfere with test result */
@@ -1598,7 +1601,7 @@ static void e1000_diag_test(struct net_device *netdev,
1598 if (if_running) 1601 if (if_running)
1599 dev_open(netdev); 1602 dev_open(netdev);
1600 } else { 1603 } else {
1601 DPRINTK(HW, INFO, "online testing starting\n"); 1604 e_info("online testing starting\n");
1602 /* Online tests */ 1605 /* Online tests */
1603 if (e1000_link_test(adapter, &data[4])) 1606 if (e1000_link_test(adapter, &data[4]))
1604 eth_test->flags |= ETH_TEST_FL_FAILED; 1607 eth_test->flags |= ETH_TEST_FL_FAILED;
@@ -1691,7 +1694,7 @@ static void e1000_get_wol(struct net_device *netdev,
1691 wol->supported &= ~WAKE_UCAST; 1694 wol->supported &= ~WAKE_UCAST;
1692 1695
1693 if (adapter->wol & E1000_WUFC_EX) 1696 if (adapter->wol & E1000_WUFC_EX)
1694 DPRINTK(DRV, ERR, "Interface does not support " 1697 e_err("Interface does not support "
1695 "directed (unicast) frame wake-up packets\n"); 1698 "directed (unicast) frame wake-up packets\n");
1696 break; 1699 break;
1697 default: 1700 default:
@@ -1706,8 +1709,6 @@ static void e1000_get_wol(struct net_device *netdev,
1706 wol->wolopts |= WAKE_BCAST; 1709 wol->wolopts |= WAKE_BCAST;
1707 if (adapter->wol & E1000_WUFC_MAG) 1710 if (adapter->wol & E1000_WUFC_MAG)
1708 wol->wolopts |= WAKE_MAGIC; 1711 wol->wolopts |= WAKE_MAGIC;
1709
1710 return;
1711} 1712}
1712 1713
1713static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) 1714static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
@@ -1725,8 +1726,8 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
1725 switch (hw->device_id) { 1726 switch (hw->device_id) {
1726 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: 1727 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
1727 if (wol->wolopts & WAKE_UCAST) { 1728 if (wol->wolopts & WAKE_UCAST) {
1728 DPRINTK(DRV, ERR, "Interface does not support " 1729 e_err("Interface does not support "
1729 "directed (unicast) frame wake-up packets\n"); 1730 "directed (unicast) frame wake-up packets\n");
1730 return -EOPNOTSUPP; 1731 return -EOPNOTSUPP;
1731 } 1732 }
1732 break; 1733 break;
@@ -1803,7 +1804,7 @@ static int e1000_get_coalesce(struct net_device *netdev,
1803 if (adapter->hw.mac_type < e1000_82545) 1804 if (adapter->hw.mac_type < e1000_82545)
1804 return -EOPNOTSUPP; 1805 return -EOPNOTSUPP;
1805 1806
1806 if (adapter->itr_setting <= 3) 1807 if (adapter->itr_setting <= 4)
1807 ec->rx_coalesce_usecs = adapter->itr_setting; 1808 ec->rx_coalesce_usecs = adapter->itr_setting;
1808 else 1809 else
1809 ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting; 1810 ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting;
@@ -1821,12 +1822,14 @@ static int e1000_set_coalesce(struct net_device *netdev,
1821 return -EOPNOTSUPP; 1822 return -EOPNOTSUPP;
1822 1823
1823 if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) || 1824 if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) ||
1824 ((ec->rx_coalesce_usecs > 3) && 1825 ((ec->rx_coalesce_usecs > 4) &&
1825 (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) || 1826 (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) ||
1826 (ec->rx_coalesce_usecs == 2)) 1827 (ec->rx_coalesce_usecs == 2))
1827 return -EINVAL; 1828 return -EINVAL;
1828 1829
1829 if (ec->rx_coalesce_usecs <= 3) { 1830 if (ec->rx_coalesce_usecs == 4) {
1831 adapter->itr = adapter->itr_setting = 4;
1832 } else if (ec->rx_coalesce_usecs <= 3) {
1830 adapter->itr = 20000; 1833 adapter->itr = 20000;
1831 adapter->itr_setting = ec->rx_coalesce_usecs; 1834 adapter->itr_setting = ec->rx_coalesce_usecs;
1832 } else { 1835 } else {
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 8d7d87f12827..c7e242b69a18 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -30,7 +30,7 @@
30 * Shared functions for accessing and configuring the MAC 30 * Shared functions for accessing and configuring the MAC
31 */ 31 */
32 32
33#include "e1000_hw.h" 33#include "e1000.h"
34 34
35static s32 e1000_check_downshift(struct e1000_hw *hw); 35static s32 e1000_check_downshift(struct e1000_hw *hw);
36static s32 e1000_check_polarity(struct e1000_hw *hw, 36static s32 e1000_check_polarity(struct e1000_hw *hw,
@@ -114,7 +114,7 @@ static DEFINE_SPINLOCK(e1000_eeprom_lock);
114 */ 114 */
115static s32 e1000_set_phy_type(struct e1000_hw *hw) 115static s32 e1000_set_phy_type(struct e1000_hw *hw)
116{ 116{
117 DEBUGFUNC("e1000_set_phy_type"); 117 e_dbg("e1000_set_phy_type");
118 118
119 if (hw->mac_type == e1000_undefined) 119 if (hw->mac_type == e1000_undefined)
120 return -E1000_ERR_PHY_TYPE; 120 return -E1000_ERR_PHY_TYPE;
@@ -152,7 +152,7 @@ static void e1000_phy_init_script(struct e1000_hw *hw)
152 u32 ret_val; 152 u32 ret_val;
153 u16 phy_saved_data; 153 u16 phy_saved_data;
154 154
155 DEBUGFUNC("e1000_phy_init_script"); 155 e_dbg("e1000_phy_init_script");
156 156
157 if (hw->phy_init_script) { 157 if (hw->phy_init_script) {
158 msleep(20); 158 msleep(20);
@@ -245,7 +245,7 @@ static void e1000_phy_init_script(struct e1000_hw *hw)
245 */ 245 */
246s32 e1000_set_mac_type(struct e1000_hw *hw) 246s32 e1000_set_mac_type(struct e1000_hw *hw)
247{ 247{
248 DEBUGFUNC("e1000_set_mac_type"); 248 e_dbg("e1000_set_mac_type");
249 249
250 switch (hw->device_id) { 250 switch (hw->device_id) {
251 case E1000_DEV_ID_82542: 251 case E1000_DEV_ID_82542:
@@ -354,7 +354,7 @@ void e1000_set_media_type(struct e1000_hw *hw)
354{ 354{
355 u32 status; 355 u32 status;
356 356
357 DEBUGFUNC("e1000_set_media_type"); 357 e_dbg("e1000_set_media_type");
358 358
359 if (hw->mac_type != e1000_82543) { 359 if (hw->mac_type != e1000_82543) {
360 /* tbi_compatibility is only valid on 82543 */ 360 /* tbi_compatibility is only valid on 82543 */
@@ -401,16 +401,16 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
401 u32 led_ctrl; 401 u32 led_ctrl;
402 s32 ret_val; 402 s32 ret_val;
403 403
404 DEBUGFUNC("e1000_reset_hw"); 404 e_dbg("e1000_reset_hw");
405 405
406 /* For 82542 (rev 2.0), disable MWI before issuing a device reset */ 406 /* For 82542 (rev 2.0), disable MWI before issuing a device reset */
407 if (hw->mac_type == e1000_82542_rev2_0) { 407 if (hw->mac_type == e1000_82542_rev2_0) {
408 DEBUGOUT("Disabling MWI on 82542 rev 2.0\n"); 408 e_dbg("Disabling MWI on 82542 rev 2.0\n");
409 e1000_pci_clear_mwi(hw); 409 e1000_pci_clear_mwi(hw);
410 } 410 }
411 411
412 /* Clear interrupt mask to stop board from generating interrupts */ 412 /* Clear interrupt mask to stop board from generating interrupts */
413 DEBUGOUT("Masking off all interrupts\n"); 413 e_dbg("Masking off all interrupts\n");
414 ew32(IMC, 0xffffffff); 414 ew32(IMC, 0xffffffff);
415 415
416 /* Disable the Transmit and Receive units. Then delay to allow 416 /* Disable the Transmit and Receive units. Then delay to allow
@@ -442,7 +442,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
442 * the current PCI configuration. The global reset bit is self- 442 * the current PCI configuration. The global reset bit is self-
443 * clearing, and should clear within a microsecond. 443 * clearing, and should clear within a microsecond.
444 */ 444 */
445 DEBUGOUT("Issuing a global reset to MAC\n"); 445 e_dbg("Issuing a global reset to MAC\n");
446 446
447 switch (hw->mac_type) { 447 switch (hw->mac_type) {
448 case e1000_82544: 448 case e1000_82544:
@@ -516,7 +516,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
516 } 516 }
517 517
518 /* Clear interrupt mask to stop board from generating interrupts */ 518 /* Clear interrupt mask to stop board from generating interrupts */
519 DEBUGOUT("Masking off all interrupts\n"); 519 e_dbg("Masking off all interrupts\n");
520 ew32(IMC, 0xffffffff); 520 ew32(IMC, 0xffffffff);
521 521
522 /* Clear any pending interrupt events. */ 522 /* Clear any pending interrupt events. */
@@ -549,12 +549,12 @@ s32 e1000_init_hw(struct e1000_hw *hw)
549 u32 mta_size; 549 u32 mta_size;
550 u32 ctrl_ext; 550 u32 ctrl_ext;
551 551
552 DEBUGFUNC("e1000_init_hw"); 552 e_dbg("e1000_init_hw");
553 553
554 /* Initialize Identification LED */ 554 /* Initialize Identification LED */
555 ret_val = e1000_id_led_init(hw); 555 ret_val = e1000_id_led_init(hw);
556 if (ret_val) { 556 if (ret_val) {
557 DEBUGOUT("Error Initializing Identification LED\n"); 557 e_dbg("Error Initializing Identification LED\n");
558 return ret_val; 558 return ret_val;
559 } 559 }
560 560
@@ -562,14 +562,14 @@ s32 e1000_init_hw(struct e1000_hw *hw)
562 e1000_set_media_type(hw); 562 e1000_set_media_type(hw);
563 563
564 /* Disabling VLAN filtering. */ 564 /* Disabling VLAN filtering. */
565 DEBUGOUT("Initializing the IEEE VLAN\n"); 565 e_dbg("Initializing the IEEE VLAN\n");
566 if (hw->mac_type < e1000_82545_rev_3) 566 if (hw->mac_type < e1000_82545_rev_3)
567 ew32(VET, 0); 567 ew32(VET, 0);
568 e1000_clear_vfta(hw); 568 e1000_clear_vfta(hw);
569 569
570 /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */ 570 /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */
571 if (hw->mac_type == e1000_82542_rev2_0) { 571 if (hw->mac_type == e1000_82542_rev2_0) {
572 DEBUGOUT("Disabling MWI on 82542 rev 2.0\n"); 572 e_dbg("Disabling MWI on 82542 rev 2.0\n");
573 e1000_pci_clear_mwi(hw); 573 e1000_pci_clear_mwi(hw);
574 ew32(RCTL, E1000_RCTL_RST); 574 ew32(RCTL, E1000_RCTL_RST);
575 E1000_WRITE_FLUSH(); 575 E1000_WRITE_FLUSH();
@@ -591,7 +591,7 @@ s32 e1000_init_hw(struct e1000_hw *hw)
591 } 591 }
592 592
593 /* Zero out the Multicast HASH table */ 593 /* Zero out the Multicast HASH table */
594 DEBUGOUT("Zeroing the MTA\n"); 594 e_dbg("Zeroing the MTA\n");
595 mta_size = E1000_MC_TBL_SIZE; 595 mta_size = E1000_MC_TBL_SIZE;
596 for (i = 0; i < mta_size; i++) { 596 for (i = 0; i < mta_size; i++) {
597 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); 597 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
@@ -662,7 +662,7 @@ static s32 e1000_adjust_serdes_amplitude(struct e1000_hw *hw)
662 u16 eeprom_data; 662 u16 eeprom_data;
663 s32 ret_val; 663 s32 ret_val;
664 664
665 DEBUGFUNC("e1000_adjust_serdes_amplitude"); 665 e_dbg("e1000_adjust_serdes_amplitude");
666 666
667 if (hw->media_type != e1000_media_type_internal_serdes) 667 if (hw->media_type != e1000_media_type_internal_serdes)
668 return E1000_SUCCESS; 668 return E1000_SUCCESS;
@@ -709,7 +709,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
709 s32 ret_val; 709 s32 ret_val;
710 u16 eeprom_data; 710 u16 eeprom_data;
711 711
712 DEBUGFUNC("e1000_setup_link"); 712 e_dbg("e1000_setup_link");
713 713
714 /* Read and store word 0x0F of the EEPROM. This word contains bits 714 /* Read and store word 0x0F of the EEPROM. This word contains bits
715 * that determine the hardware's default PAUSE (flow control) mode, 715 * that determine the hardware's default PAUSE (flow control) mode,
@@ -723,7 +723,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
723 ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 723 ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG,
724 1, &eeprom_data); 724 1, &eeprom_data);
725 if (ret_val) { 725 if (ret_val) {
726 DEBUGOUT("EEPROM Read Error\n"); 726 e_dbg("EEPROM Read Error\n");
727 return -E1000_ERR_EEPROM; 727 return -E1000_ERR_EEPROM;
728 } 728 }
729 if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) 729 if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0)
@@ -747,7 +747,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
747 747
748 hw->original_fc = hw->fc; 748 hw->original_fc = hw->fc;
749 749
750 DEBUGOUT1("After fix-ups FlowControl is now = %x\n", hw->fc); 750 e_dbg("After fix-ups FlowControl is now = %x\n", hw->fc);
751 751
752 /* Take the 4 bits from EEPROM word 0x0F that determine the initial 752 /* Take the 4 bits from EEPROM word 0x0F that determine the initial
753 * polarity value for the SW controlled pins, and setup the 753 * polarity value for the SW controlled pins, and setup the
@@ -760,7 +760,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
760 ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 760 ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG,
761 1, &eeprom_data); 761 1, &eeprom_data);
762 if (ret_val) { 762 if (ret_val) {
763 DEBUGOUT("EEPROM Read Error\n"); 763 e_dbg("EEPROM Read Error\n");
764 return -E1000_ERR_EEPROM; 764 return -E1000_ERR_EEPROM;
765 } 765 }
766 ctrl_ext = ((eeprom_data & EEPROM_WORD0F_SWPDIO_EXT) << 766 ctrl_ext = ((eeprom_data & EEPROM_WORD0F_SWPDIO_EXT) <<
@@ -777,8 +777,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
777 * control is disabled, because it does not hurt anything to 777 * control is disabled, because it does not hurt anything to
778 * initialize these registers. 778 * initialize these registers.
779 */ 779 */
780 DEBUGOUT 780 e_dbg("Initializing the Flow Control address, type and timer regs\n");
781 ("Initializing the Flow Control address, type and timer regs\n");
782 781
783 ew32(FCT, FLOW_CONTROL_TYPE); 782 ew32(FCT, FLOW_CONTROL_TYPE);
784 ew32(FCAH, FLOW_CONTROL_ADDRESS_HIGH); 783 ew32(FCAH, FLOW_CONTROL_ADDRESS_HIGH);
@@ -827,7 +826,7 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
827 u32 signal = 0; 826 u32 signal = 0;
828 s32 ret_val; 827 s32 ret_val;
829 828
830 DEBUGFUNC("e1000_setup_fiber_serdes_link"); 829 e_dbg("e1000_setup_fiber_serdes_link");
831 830
832 /* On adapters with a MAC newer than 82544, SWDP 1 will be 831 /* On adapters with a MAC newer than 82544, SWDP 1 will be
833 * set when the optics detect a signal. On older adapters, it will be 832 * set when the optics detect a signal. On older adapters, it will be
@@ -893,7 +892,7 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
893 txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); 892 txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
894 break; 893 break;
895 default: 894 default:
896 DEBUGOUT("Flow control param set incorrectly\n"); 895 e_dbg("Flow control param set incorrectly\n");
897 return -E1000_ERR_CONFIG; 896 return -E1000_ERR_CONFIG;
898 break; 897 break;
899 } 898 }
@@ -904,7 +903,7 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
904 * link-up status bit will be set and the flow control enable bits (RFCE 903 * link-up status bit will be set and the flow control enable bits (RFCE
905 * and TFCE) will be set according to their negotiated value. 904 * and TFCE) will be set according to their negotiated value.
906 */ 905 */
907 DEBUGOUT("Auto-negotiation enabled\n"); 906 e_dbg("Auto-negotiation enabled\n");
908 907
909 ew32(TXCW, txcw); 908 ew32(TXCW, txcw);
910 ew32(CTRL, ctrl); 909 ew32(CTRL, ctrl);
@@ -921,7 +920,7 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
921 */ 920 */
922 if (hw->media_type == e1000_media_type_internal_serdes || 921 if (hw->media_type == e1000_media_type_internal_serdes ||
923 (er32(CTRL) & E1000_CTRL_SWDPIN1) == signal) { 922 (er32(CTRL) & E1000_CTRL_SWDPIN1) == signal) {
924 DEBUGOUT("Looking for Link\n"); 923 e_dbg("Looking for Link\n");
925 for (i = 0; i < (LINK_UP_TIMEOUT / 10); i++) { 924 for (i = 0; i < (LINK_UP_TIMEOUT / 10); i++) {
926 msleep(10); 925 msleep(10);
927 status = er32(STATUS); 926 status = er32(STATUS);
@@ -929,7 +928,7 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
929 break; 928 break;
930 } 929 }
931 if (i == (LINK_UP_TIMEOUT / 10)) { 930 if (i == (LINK_UP_TIMEOUT / 10)) {
932 DEBUGOUT("Never got a valid link from auto-neg!!!\n"); 931 e_dbg("Never got a valid link from auto-neg!!!\n");
933 hw->autoneg_failed = 1; 932 hw->autoneg_failed = 1;
934 /* AutoNeg failed to achieve a link, so we'll call 933 /* AutoNeg failed to achieve a link, so we'll call
935 * e1000_check_for_link. This routine will force the link up if 934 * e1000_check_for_link. This routine will force the link up if
@@ -938,16 +937,16 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
938 */ 937 */
939 ret_val = e1000_check_for_link(hw); 938 ret_val = e1000_check_for_link(hw);
940 if (ret_val) { 939 if (ret_val) {
941 DEBUGOUT("Error while checking for link\n"); 940 e_dbg("Error while checking for link\n");
942 return ret_val; 941 return ret_val;
943 } 942 }
944 hw->autoneg_failed = 0; 943 hw->autoneg_failed = 0;
945 } else { 944 } else {
946 hw->autoneg_failed = 0; 945 hw->autoneg_failed = 0;
947 DEBUGOUT("Valid Link Found\n"); 946 e_dbg("Valid Link Found\n");
948 } 947 }
949 } else { 948 } else {
950 DEBUGOUT("No Signal Detected\n"); 949 e_dbg("No Signal Detected\n");
951 } 950 }
952 return E1000_SUCCESS; 951 return E1000_SUCCESS;
953} 952}
@@ -964,7 +963,7 @@ static s32 e1000_copper_link_preconfig(struct e1000_hw *hw)
964 s32 ret_val; 963 s32 ret_val;
965 u16 phy_data; 964 u16 phy_data;
966 965
967 DEBUGFUNC("e1000_copper_link_preconfig"); 966 e_dbg("e1000_copper_link_preconfig");
968 967
969 ctrl = er32(CTRL); 968 ctrl = er32(CTRL);
970 /* With 82543, we need to force speed and duplex on the MAC equal to what 969 /* With 82543, we need to force speed and duplex on the MAC equal to what
@@ -987,10 +986,10 @@ static s32 e1000_copper_link_preconfig(struct e1000_hw *hw)
987 /* Make sure we have a valid PHY */ 986 /* Make sure we have a valid PHY */
988 ret_val = e1000_detect_gig_phy(hw); 987 ret_val = e1000_detect_gig_phy(hw);
989 if (ret_val) { 988 if (ret_val) {
990 DEBUGOUT("Error, did not detect valid phy.\n"); 989 e_dbg("Error, did not detect valid phy.\n");
991 return ret_val; 990 return ret_val;
992 } 991 }
993 DEBUGOUT1("Phy ID = %x \n", hw->phy_id); 992 e_dbg("Phy ID = %x\n", hw->phy_id);
994 993
995 /* Set PHY to class A mode (if necessary) */ 994 /* Set PHY to class A mode (if necessary) */
996 ret_val = e1000_set_phy_mode(hw); 995 ret_val = e1000_set_phy_mode(hw);
@@ -1025,14 +1024,14 @@ static s32 e1000_copper_link_igp_setup(struct e1000_hw *hw)
1025 s32 ret_val; 1024 s32 ret_val;
1026 u16 phy_data; 1025 u16 phy_data;
1027 1026
1028 DEBUGFUNC("e1000_copper_link_igp_setup"); 1027 e_dbg("e1000_copper_link_igp_setup");
1029 1028
1030 if (hw->phy_reset_disable) 1029 if (hw->phy_reset_disable)
1031 return E1000_SUCCESS; 1030 return E1000_SUCCESS;
1032 1031
1033 ret_val = e1000_phy_reset(hw); 1032 ret_val = e1000_phy_reset(hw);
1034 if (ret_val) { 1033 if (ret_val) {
1035 DEBUGOUT("Error Resetting the PHY\n"); 1034 e_dbg("Error Resetting the PHY\n");
1036 return ret_val; 1035 return ret_val;
1037 } 1036 }
1038 1037
@@ -1049,7 +1048,7 @@ static s32 e1000_copper_link_igp_setup(struct e1000_hw *hw)
1049 /* disable lplu d3 during driver init */ 1048 /* disable lplu d3 during driver init */
1050 ret_val = e1000_set_d3_lplu_state(hw, false); 1049 ret_val = e1000_set_d3_lplu_state(hw, false);
1051 if (ret_val) { 1050 if (ret_val) {
1052 DEBUGOUT("Error Disabling LPLU D3\n"); 1051 e_dbg("Error Disabling LPLU D3\n");
1053 return ret_val; 1052 return ret_val;
1054 } 1053 }
1055 } 1054 }
@@ -1166,7 +1165,7 @@ static s32 e1000_copper_link_mgp_setup(struct e1000_hw *hw)
1166 s32 ret_val; 1165 s32 ret_val;
1167 u16 phy_data; 1166 u16 phy_data;
1168 1167
1169 DEBUGFUNC("e1000_copper_link_mgp_setup"); 1168 e_dbg("e1000_copper_link_mgp_setup");
1170 1169
1171 if (hw->phy_reset_disable) 1170 if (hw->phy_reset_disable)
1172 return E1000_SUCCESS; 1171 return E1000_SUCCESS;
@@ -1255,7 +1254,7 @@ static s32 e1000_copper_link_mgp_setup(struct e1000_hw *hw)
1255 /* SW Reset the PHY so all changes take effect */ 1254 /* SW Reset the PHY so all changes take effect */
1256 ret_val = e1000_phy_reset(hw); 1255 ret_val = e1000_phy_reset(hw);
1257 if (ret_val) { 1256 if (ret_val) {
1258 DEBUGOUT("Error Resetting the PHY\n"); 1257 e_dbg("Error Resetting the PHY\n");
1259 return ret_val; 1258 return ret_val;
1260 } 1259 }
1261 1260
@@ -1274,7 +1273,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
1274 s32 ret_val; 1273 s32 ret_val;
1275 u16 phy_data; 1274 u16 phy_data;
1276 1275
1277 DEBUGFUNC("e1000_copper_link_autoneg"); 1276 e_dbg("e1000_copper_link_autoneg");
1278 1277
1279 /* Perform some bounds checking on the hw->autoneg_advertised 1278 /* Perform some bounds checking on the hw->autoneg_advertised
1280 * parameter. If this variable is zero, then set it to the default. 1279 * parameter. If this variable is zero, then set it to the default.
@@ -1287,13 +1286,13 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
1287 if (hw->autoneg_advertised == 0) 1286 if (hw->autoneg_advertised == 0)
1288 hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT; 1287 hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT;
1289 1288
1290 DEBUGOUT("Reconfiguring auto-neg advertisement params\n"); 1289 e_dbg("Reconfiguring auto-neg advertisement params\n");
1291 ret_val = e1000_phy_setup_autoneg(hw); 1290 ret_val = e1000_phy_setup_autoneg(hw);
1292 if (ret_val) { 1291 if (ret_val) {
1293 DEBUGOUT("Error Setting up Auto-Negotiation\n"); 1292 e_dbg("Error Setting up Auto-Negotiation\n");
1294 return ret_val; 1293 return ret_val;
1295 } 1294 }
1296 DEBUGOUT("Restarting Auto-Neg\n"); 1295 e_dbg("Restarting Auto-Neg\n");
1297 1296
1298 /* Restart auto-negotiation by setting the Auto Neg Enable bit and 1297 /* Restart auto-negotiation by setting the Auto Neg Enable bit and
1299 * the Auto Neg Restart bit in the PHY control register. 1298 * the Auto Neg Restart bit in the PHY control register.
@@ -1313,7 +1312,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
1313 if (hw->wait_autoneg_complete) { 1312 if (hw->wait_autoneg_complete) {
1314 ret_val = e1000_wait_autoneg(hw); 1313 ret_val = e1000_wait_autoneg(hw);
1315 if (ret_val) { 1314 if (ret_val) {
1316 DEBUGOUT 1315 e_dbg
1317 ("Error while waiting for autoneg to complete\n"); 1316 ("Error while waiting for autoneg to complete\n");
1318 return ret_val; 1317 return ret_val;
1319 } 1318 }
@@ -1340,20 +1339,20 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
1340static s32 e1000_copper_link_postconfig(struct e1000_hw *hw) 1339static s32 e1000_copper_link_postconfig(struct e1000_hw *hw)
1341{ 1340{
1342 s32 ret_val; 1341 s32 ret_val;
1343 DEBUGFUNC("e1000_copper_link_postconfig"); 1342 e_dbg("e1000_copper_link_postconfig");
1344 1343
1345 if (hw->mac_type >= e1000_82544) { 1344 if (hw->mac_type >= e1000_82544) {
1346 e1000_config_collision_dist(hw); 1345 e1000_config_collision_dist(hw);
1347 } else { 1346 } else {
1348 ret_val = e1000_config_mac_to_phy(hw); 1347 ret_val = e1000_config_mac_to_phy(hw);
1349 if (ret_val) { 1348 if (ret_val) {
1350 DEBUGOUT("Error configuring MAC to PHY settings\n"); 1349 e_dbg("Error configuring MAC to PHY settings\n");
1351 return ret_val; 1350 return ret_val;
1352 } 1351 }
1353 } 1352 }
1354 ret_val = e1000_config_fc_after_link_up(hw); 1353 ret_val = e1000_config_fc_after_link_up(hw);
1355 if (ret_val) { 1354 if (ret_val) {
1356 DEBUGOUT("Error Configuring Flow Control\n"); 1355 e_dbg("Error Configuring Flow Control\n");
1357 return ret_val; 1356 return ret_val;
1358 } 1357 }
1359 1358
@@ -1361,7 +1360,7 @@ static s32 e1000_copper_link_postconfig(struct e1000_hw *hw)
1361 if (hw->phy_type == e1000_phy_igp) { 1360 if (hw->phy_type == e1000_phy_igp) {
1362 ret_val = e1000_config_dsp_after_link_change(hw, true); 1361 ret_val = e1000_config_dsp_after_link_change(hw, true);
1363 if (ret_val) { 1362 if (ret_val) {
1364 DEBUGOUT("Error Configuring DSP after link up\n"); 1363 e_dbg("Error Configuring DSP after link up\n");
1365 return ret_val; 1364 return ret_val;
1366 } 1365 }
1367 } 1366 }
@@ -1381,7 +1380,7 @@ static s32 e1000_setup_copper_link(struct e1000_hw *hw)
1381 u16 i; 1380 u16 i;
1382 u16 phy_data; 1381 u16 phy_data;
1383 1382
1384 DEBUGFUNC("e1000_setup_copper_link"); 1383 e_dbg("e1000_setup_copper_link");
1385 1384
1386 /* Check if it is a valid PHY and set PHY mode if necessary. */ 1385 /* Check if it is a valid PHY and set PHY mode if necessary. */
1387 ret_val = e1000_copper_link_preconfig(hw); 1386 ret_val = e1000_copper_link_preconfig(hw);
@@ -1407,10 +1406,10 @@ static s32 e1000_setup_copper_link(struct e1000_hw *hw)
1407 } else { 1406 } else {
1408 /* PHY will be set to 10H, 10F, 100H,or 100F 1407 /* PHY will be set to 10H, 10F, 100H,or 100F
1409 * depending on value from forced_speed_duplex. */ 1408 * depending on value from forced_speed_duplex. */
1410 DEBUGOUT("Forcing speed and duplex\n"); 1409 e_dbg("Forcing speed and duplex\n");
1411 ret_val = e1000_phy_force_speed_duplex(hw); 1410 ret_val = e1000_phy_force_speed_duplex(hw);
1412 if (ret_val) { 1411 if (ret_val) {
1413 DEBUGOUT("Error Forcing Speed and Duplex\n"); 1412 e_dbg("Error Forcing Speed and Duplex\n");
1414 return ret_val; 1413 return ret_val;
1415 } 1414 }
1416 } 1415 }
@@ -1432,13 +1431,13 @@ static s32 e1000_setup_copper_link(struct e1000_hw *hw)
1432 if (ret_val) 1431 if (ret_val)
1433 return ret_val; 1432 return ret_val;
1434 1433
1435 DEBUGOUT("Valid link established!!!\n"); 1434 e_dbg("Valid link established!!!\n");
1436 return E1000_SUCCESS; 1435 return E1000_SUCCESS;
1437 } 1436 }
1438 udelay(10); 1437 udelay(10);
1439 } 1438 }
1440 1439
1441 DEBUGOUT("Unable to establish link!!!\n"); 1440 e_dbg("Unable to establish link!!!\n");
1442 return E1000_SUCCESS; 1441 return E1000_SUCCESS;
1443} 1442}
1444 1443
@@ -1454,7 +1453,7 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
1454 u16 mii_autoneg_adv_reg; 1453 u16 mii_autoneg_adv_reg;
1455 u16 mii_1000t_ctrl_reg; 1454 u16 mii_1000t_ctrl_reg;
1456 1455
1457 DEBUGFUNC("e1000_phy_setup_autoneg"); 1456 e_dbg("e1000_phy_setup_autoneg");
1458 1457
1459 /* Read the MII Auto-Neg Advertisement Register (Address 4). */ 1458 /* Read the MII Auto-Neg Advertisement Register (Address 4). */
1460 ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); 1459 ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg);
@@ -1481,41 +1480,41 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
1481 mii_autoneg_adv_reg &= ~REG4_SPEED_MASK; 1480 mii_autoneg_adv_reg &= ~REG4_SPEED_MASK;
1482 mii_1000t_ctrl_reg &= ~REG9_SPEED_MASK; 1481 mii_1000t_ctrl_reg &= ~REG9_SPEED_MASK;
1483 1482
1484 DEBUGOUT1("autoneg_advertised %x\n", hw->autoneg_advertised); 1483 e_dbg("autoneg_advertised %x\n", hw->autoneg_advertised);
1485 1484
1486 /* Do we want to advertise 10 Mb Half Duplex? */ 1485 /* Do we want to advertise 10 Mb Half Duplex? */
1487 if (hw->autoneg_advertised & ADVERTISE_10_HALF) { 1486 if (hw->autoneg_advertised & ADVERTISE_10_HALF) {
1488 DEBUGOUT("Advertise 10mb Half duplex\n"); 1487 e_dbg("Advertise 10mb Half duplex\n");
1489 mii_autoneg_adv_reg |= NWAY_AR_10T_HD_CAPS; 1488 mii_autoneg_adv_reg |= NWAY_AR_10T_HD_CAPS;
1490 } 1489 }
1491 1490
1492 /* Do we want to advertise 10 Mb Full Duplex? */ 1491 /* Do we want to advertise 10 Mb Full Duplex? */
1493 if (hw->autoneg_advertised & ADVERTISE_10_FULL) { 1492 if (hw->autoneg_advertised & ADVERTISE_10_FULL) {
1494 DEBUGOUT("Advertise 10mb Full duplex\n"); 1493 e_dbg("Advertise 10mb Full duplex\n");
1495 mii_autoneg_adv_reg |= NWAY_AR_10T_FD_CAPS; 1494 mii_autoneg_adv_reg |= NWAY_AR_10T_FD_CAPS;
1496 } 1495 }
1497 1496
1498 /* Do we want to advertise 100 Mb Half Duplex? */ 1497 /* Do we want to advertise 100 Mb Half Duplex? */
1499 if (hw->autoneg_advertised & ADVERTISE_100_HALF) { 1498 if (hw->autoneg_advertised & ADVERTISE_100_HALF) {
1500 DEBUGOUT("Advertise 100mb Half duplex\n"); 1499 e_dbg("Advertise 100mb Half duplex\n");
1501 mii_autoneg_adv_reg |= NWAY_AR_100TX_HD_CAPS; 1500 mii_autoneg_adv_reg |= NWAY_AR_100TX_HD_CAPS;
1502 } 1501 }
1503 1502
1504 /* Do we want to advertise 100 Mb Full Duplex? */ 1503 /* Do we want to advertise 100 Mb Full Duplex? */
1505 if (hw->autoneg_advertised & ADVERTISE_100_FULL) { 1504 if (hw->autoneg_advertised & ADVERTISE_100_FULL) {
1506 DEBUGOUT("Advertise 100mb Full duplex\n"); 1505 e_dbg("Advertise 100mb Full duplex\n");
1507 mii_autoneg_adv_reg |= NWAY_AR_100TX_FD_CAPS; 1506 mii_autoneg_adv_reg |= NWAY_AR_100TX_FD_CAPS;
1508 } 1507 }
1509 1508
1510 /* We do not allow the Phy to advertise 1000 Mb Half Duplex */ 1509 /* We do not allow the Phy to advertise 1000 Mb Half Duplex */
1511 if (hw->autoneg_advertised & ADVERTISE_1000_HALF) { 1510 if (hw->autoneg_advertised & ADVERTISE_1000_HALF) {
1512 DEBUGOUT 1511 e_dbg
1513 ("Advertise 1000mb Half duplex requested, request denied!\n"); 1512 ("Advertise 1000mb Half duplex requested, request denied!\n");
1514 } 1513 }
1515 1514
1516 /* Do we want to advertise 1000 Mb Full Duplex? */ 1515 /* Do we want to advertise 1000 Mb Full Duplex? */
1517 if (hw->autoneg_advertised & ADVERTISE_1000_FULL) { 1516 if (hw->autoneg_advertised & ADVERTISE_1000_FULL) {
1518 DEBUGOUT("Advertise 1000mb Full duplex\n"); 1517 e_dbg("Advertise 1000mb Full duplex\n");
1519 mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS; 1518 mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS;
1520 } 1519 }
1521 1520
@@ -1568,7 +1567,7 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
1568 mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); 1567 mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
1569 break; 1568 break;
1570 default: 1569 default:
1571 DEBUGOUT("Flow control param set incorrectly\n"); 1570 e_dbg("Flow control param set incorrectly\n");
1572 return -E1000_ERR_CONFIG; 1571 return -E1000_ERR_CONFIG;
1573 } 1572 }
1574 1573
@@ -1576,7 +1575,7 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
1576 if (ret_val) 1575 if (ret_val)
1577 return ret_val; 1576 return ret_val;
1578 1577
1579 DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); 1578 e_dbg("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
1580 1579
1581 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); 1580 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
1582 if (ret_val) 1581 if (ret_val)
@@ -1600,12 +1599,12 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1600 u16 phy_data; 1599 u16 phy_data;
1601 u16 i; 1600 u16 i;
1602 1601
1603 DEBUGFUNC("e1000_phy_force_speed_duplex"); 1602 e_dbg("e1000_phy_force_speed_duplex");
1604 1603
1605 /* Turn off Flow control if we are forcing speed and duplex. */ 1604 /* Turn off Flow control if we are forcing speed and duplex. */
1606 hw->fc = E1000_FC_NONE; 1605 hw->fc = E1000_FC_NONE;
1607 1606
1608 DEBUGOUT1("hw->fc = %d\n", hw->fc); 1607 e_dbg("hw->fc = %d\n", hw->fc);
1609 1608
1610 /* Read the Device Control Register. */ 1609 /* Read the Device Control Register. */
1611 ctrl = er32(CTRL); 1610 ctrl = er32(CTRL);
@@ -1634,14 +1633,14 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1634 */ 1633 */
1635 ctrl |= E1000_CTRL_FD; 1634 ctrl |= E1000_CTRL_FD;
1636 mii_ctrl_reg |= MII_CR_FULL_DUPLEX; 1635 mii_ctrl_reg |= MII_CR_FULL_DUPLEX;
1637 DEBUGOUT("Full Duplex\n"); 1636 e_dbg("Full Duplex\n");
1638 } else { 1637 } else {
1639 /* We want to force half duplex so we CLEAR the full duplex bits in 1638 /* We want to force half duplex so we CLEAR the full duplex bits in
1640 * the Device and MII Control Registers. 1639 * the Device and MII Control Registers.
1641 */ 1640 */
1642 ctrl &= ~E1000_CTRL_FD; 1641 ctrl &= ~E1000_CTRL_FD;
1643 mii_ctrl_reg &= ~MII_CR_FULL_DUPLEX; 1642 mii_ctrl_reg &= ~MII_CR_FULL_DUPLEX;
1644 DEBUGOUT("Half Duplex\n"); 1643 e_dbg("Half Duplex\n");
1645 } 1644 }
1646 1645
1647 /* Are we forcing 100Mbps??? */ 1646 /* Are we forcing 100Mbps??? */
@@ -1651,13 +1650,13 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1651 ctrl |= E1000_CTRL_SPD_100; 1650 ctrl |= E1000_CTRL_SPD_100;
1652 mii_ctrl_reg |= MII_CR_SPEED_100; 1651 mii_ctrl_reg |= MII_CR_SPEED_100;
1653 mii_ctrl_reg &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_10); 1652 mii_ctrl_reg &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_10);
1654 DEBUGOUT("Forcing 100mb "); 1653 e_dbg("Forcing 100mb ");
1655 } else { 1654 } else {
1656 /* Set the 10Mb bit and turn off the 1000Mb and 100Mb bits. */ 1655 /* Set the 10Mb bit and turn off the 1000Mb and 100Mb bits. */
1657 ctrl &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100); 1656 ctrl &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100);
1658 mii_ctrl_reg |= MII_CR_SPEED_10; 1657 mii_ctrl_reg |= MII_CR_SPEED_10;
1659 mii_ctrl_reg &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_100); 1658 mii_ctrl_reg &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_100);
1660 DEBUGOUT("Forcing 10mb "); 1659 e_dbg("Forcing 10mb ");
1661 } 1660 }
1662 1661
1663 e1000_config_collision_dist(hw); 1662 e1000_config_collision_dist(hw);
@@ -1680,7 +1679,7 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1680 if (ret_val) 1679 if (ret_val)
1681 return ret_val; 1680 return ret_val;
1682 1681
1683 DEBUGOUT1("M88E1000 PSCR: %x \n", phy_data); 1682 e_dbg("M88E1000 PSCR: %x\n", phy_data);
1684 1683
1685 /* Need to reset the PHY or these changes will be ignored */ 1684 /* Need to reset the PHY or these changes will be ignored */
1686 mii_ctrl_reg |= MII_CR_RESET; 1685 mii_ctrl_reg |= MII_CR_RESET;
@@ -1720,7 +1719,7 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1720 */ 1719 */
1721 if (hw->wait_autoneg_complete) { 1720 if (hw->wait_autoneg_complete) {
1722 /* We will wait for autoneg to complete. */ 1721 /* We will wait for autoneg to complete. */
1723 DEBUGOUT("Waiting for forced speed/duplex link.\n"); 1722 e_dbg("Waiting for forced speed/duplex link.\n");
1724 mii_status_reg = 0; 1723 mii_status_reg = 0;
1725 1724
1726 /* We will wait for autoneg to complete or 4.5 seconds to expire. */ 1725 /* We will wait for autoneg to complete or 4.5 seconds to expire. */
@@ -1746,7 +1745,7 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1746 /* We didn't get link. Reset the DSP and wait again for link. */ 1745 /* We didn't get link. Reset the DSP and wait again for link. */
1747 ret_val = e1000_phy_reset_dsp(hw); 1746 ret_val = e1000_phy_reset_dsp(hw);
1748 if (ret_val) { 1747 if (ret_val) {
1749 DEBUGOUT("Error Resetting PHY DSP\n"); 1748 e_dbg("Error Resetting PHY DSP\n");
1750 return ret_val; 1749 return ret_val;
1751 } 1750 }
1752 } 1751 }
@@ -1826,7 +1825,7 @@ void e1000_config_collision_dist(struct e1000_hw *hw)
1826{ 1825{
1827 u32 tctl, coll_dist; 1826 u32 tctl, coll_dist;
1828 1827
1829 DEBUGFUNC("e1000_config_collision_dist"); 1828 e_dbg("e1000_config_collision_dist");
1830 1829
1831 if (hw->mac_type < e1000_82543) 1830 if (hw->mac_type < e1000_82543)
1832 coll_dist = E1000_COLLISION_DISTANCE_82542; 1831 coll_dist = E1000_COLLISION_DISTANCE_82542;
@@ -1857,7 +1856,7 @@ static s32 e1000_config_mac_to_phy(struct e1000_hw *hw)
1857 s32 ret_val; 1856 s32 ret_val;
1858 u16 phy_data; 1857 u16 phy_data;
1859 1858
1860 DEBUGFUNC("e1000_config_mac_to_phy"); 1859 e_dbg("e1000_config_mac_to_phy");
1861 1860
1862 /* 82544 or newer MAC, Auto Speed Detection takes care of 1861 /* 82544 or newer MAC, Auto Speed Detection takes care of
1863 * MAC speed/duplex configuration.*/ 1862 * MAC speed/duplex configuration.*/
@@ -1913,7 +1912,7 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw)
1913{ 1912{
1914 u32 ctrl; 1913 u32 ctrl;
1915 1914
1916 DEBUGFUNC("e1000_force_mac_fc"); 1915 e_dbg("e1000_force_mac_fc");
1917 1916
1918 /* Get the current configuration of the Device Control Register */ 1917 /* Get the current configuration of the Device Control Register */
1919 ctrl = er32(CTRL); 1918 ctrl = er32(CTRL);
@@ -1952,7 +1951,7 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw)
1952 ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); 1951 ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE);
1953 break; 1952 break;
1954 default: 1953 default:
1955 DEBUGOUT("Flow control param set incorrectly\n"); 1954 e_dbg("Flow control param set incorrectly\n");
1956 return -E1000_ERR_CONFIG; 1955 return -E1000_ERR_CONFIG;
1957 } 1956 }
1958 1957
@@ -1984,7 +1983,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
1984 u16 speed; 1983 u16 speed;
1985 u16 duplex; 1984 u16 duplex;
1986 1985
1987 DEBUGFUNC("e1000_config_fc_after_link_up"); 1986 e_dbg("e1000_config_fc_after_link_up");
1988 1987
1989 /* Check for the case where we have fiber media and auto-neg failed 1988 /* Check for the case where we have fiber media and auto-neg failed
1990 * so we had to force link. In this case, we need to force the 1989 * so we had to force link. In this case, we need to force the
@@ -1997,7 +1996,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
1997 && (!hw->autoneg))) { 1996 && (!hw->autoneg))) {
1998 ret_val = e1000_force_mac_fc(hw); 1997 ret_val = e1000_force_mac_fc(hw);
1999 if (ret_val) { 1998 if (ret_val) {
2000 DEBUGOUT("Error forcing flow control settings\n"); 1999 e_dbg("Error forcing flow control settings\n");
2001 return ret_val; 2000 return ret_val;
2002 } 2001 }
2003 } 2002 }
@@ -2079,10 +2078,10 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
2079 */ 2078 */
2080 if (hw->original_fc == E1000_FC_FULL) { 2079 if (hw->original_fc == E1000_FC_FULL) {
2081 hw->fc = E1000_FC_FULL; 2080 hw->fc = E1000_FC_FULL;
2082 DEBUGOUT("Flow Control = FULL.\n"); 2081 e_dbg("Flow Control = FULL.\n");
2083 } else { 2082 } else {
2084 hw->fc = E1000_FC_RX_PAUSE; 2083 hw->fc = E1000_FC_RX_PAUSE;
2085 DEBUGOUT 2084 e_dbg
2086 ("Flow Control = RX PAUSE frames only.\n"); 2085 ("Flow Control = RX PAUSE frames only.\n");
2087 } 2086 }
2088 } 2087 }
@@ -2100,7 +2099,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
2100 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) 2099 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR))
2101 { 2100 {
2102 hw->fc = E1000_FC_TX_PAUSE; 2101 hw->fc = E1000_FC_TX_PAUSE;
2103 DEBUGOUT 2102 e_dbg
2104 ("Flow Control = TX PAUSE frames only.\n"); 2103 ("Flow Control = TX PAUSE frames only.\n");
2105 } 2104 }
2106 /* For transmitting PAUSE frames ONLY. 2105 /* For transmitting PAUSE frames ONLY.
@@ -2117,7 +2116,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
2117 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) 2116 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR))
2118 { 2117 {
2119 hw->fc = E1000_FC_RX_PAUSE; 2118 hw->fc = E1000_FC_RX_PAUSE;
2120 DEBUGOUT 2119 e_dbg
2121 ("Flow Control = RX PAUSE frames only.\n"); 2120 ("Flow Control = RX PAUSE frames only.\n");
2122 } 2121 }
2123 /* Per the IEEE spec, at this point flow control should be 2122 /* Per the IEEE spec, at this point flow control should be
@@ -2144,10 +2143,10 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
2144 hw->original_fc == E1000_FC_TX_PAUSE) || 2143 hw->original_fc == E1000_FC_TX_PAUSE) ||
2145 hw->fc_strict_ieee) { 2144 hw->fc_strict_ieee) {
2146 hw->fc = E1000_FC_NONE; 2145 hw->fc = E1000_FC_NONE;
2147 DEBUGOUT("Flow Control = NONE.\n"); 2146 e_dbg("Flow Control = NONE.\n");
2148 } else { 2147 } else {
2149 hw->fc = E1000_FC_RX_PAUSE; 2148 hw->fc = E1000_FC_RX_PAUSE;
2150 DEBUGOUT 2149 e_dbg
2151 ("Flow Control = RX PAUSE frames only.\n"); 2150 ("Flow Control = RX PAUSE frames only.\n");
2152 } 2151 }
2153 2152
@@ -2158,7 +2157,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
2158 ret_val = 2157 ret_val =
2159 e1000_get_speed_and_duplex(hw, &speed, &duplex); 2158 e1000_get_speed_and_duplex(hw, &speed, &duplex);
2160 if (ret_val) { 2159 if (ret_val) {
2161 DEBUGOUT 2160 e_dbg
2162 ("Error getting link speed and duplex\n"); 2161 ("Error getting link speed and duplex\n");
2163 return ret_val; 2162 return ret_val;
2164 } 2163 }
@@ -2171,12 +2170,12 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
2171 */ 2170 */
2172 ret_val = e1000_force_mac_fc(hw); 2171 ret_val = e1000_force_mac_fc(hw);
2173 if (ret_val) { 2172 if (ret_val) {
2174 DEBUGOUT 2173 e_dbg
2175 ("Error forcing flow control settings\n"); 2174 ("Error forcing flow control settings\n");
2176 return ret_val; 2175 return ret_val;
2177 } 2176 }
2178 } else { 2177 } else {
2179 DEBUGOUT 2178 e_dbg
2180 ("Copper PHY and Auto Neg has not completed.\n"); 2179 ("Copper PHY and Auto Neg has not completed.\n");
2181 } 2180 }
2182 } 2181 }
@@ -2197,7 +2196,7 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
2197 u32 status; 2196 u32 status;
2198 s32 ret_val = E1000_SUCCESS; 2197 s32 ret_val = E1000_SUCCESS;
2199 2198
2200 DEBUGFUNC("e1000_check_for_serdes_link_generic"); 2199 e_dbg("e1000_check_for_serdes_link_generic");
2201 2200
2202 ctrl = er32(CTRL); 2201 ctrl = er32(CTRL);
2203 status = er32(STATUS); 2202 status = er32(STATUS);
@@ -2216,7 +2215,7 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
2216 hw->autoneg_failed = 1; 2215 hw->autoneg_failed = 1;
2217 goto out; 2216 goto out;
2218 } 2217 }
2219 DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n"); 2218 e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n");
2220 2219
2221 /* Disable auto-negotiation in the TXCW register */ 2220 /* Disable auto-negotiation in the TXCW register */
2222 ew32(TXCW, (hw->txcw & ~E1000_TXCW_ANE)); 2221 ew32(TXCW, (hw->txcw & ~E1000_TXCW_ANE));
@@ -2229,7 +2228,7 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
2229 /* Configure Flow Control after forcing link up. */ 2228 /* Configure Flow Control after forcing link up. */
2230 ret_val = e1000_config_fc_after_link_up(hw); 2229 ret_val = e1000_config_fc_after_link_up(hw);
2231 if (ret_val) { 2230 if (ret_val) {
2232 DEBUGOUT("Error configuring flow control\n"); 2231 e_dbg("Error configuring flow control\n");
2233 goto out; 2232 goto out;
2234 } 2233 }
2235 } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { 2234 } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
@@ -2239,7 +2238,7 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
2239 * and disable forced link in the Device Control register 2238 * and disable forced link in the Device Control register
2240 * in an attempt to auto-negotiate with our link partner. 2239 * in an attempt to auto-negotiate with our link partner.
2241 */ 2240 */
2242 DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\n"); 2241 e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n");
2243 ew32(TXCW, hw->txcw); 2242 ew32(TXCW, hw->txcw);
2244 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); 2243 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
2245 2244
@@ -2256,11 +2255,11 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
2256 if (rxcw & E1000_RXCW_SYNCH) { 2255 if (rxcw & E1000_RXCW_SYNCH) {
2257 if (!(rxcw & E1000_RXCW_IV)) { 2256 if (!(rxcw & E1000_RXCW_IV)) {
2258 hw->serdes_has_link = true; 2257 hw->serdes_has_link = true;
2259 DEBUGOUT("SERDES: Link up - forced.\n"); 2258 e_dbg("SERDES: Link up - forced.\n");
2260 } 2259 }
2261 } else { 2260 } else {
2262 hw->serdes_has_link = false; 2261 hw->serdes_has_link = false;
2263 DEBUGOUT("SERDES: Link down - force failed.\n"); 2262 e_dbg("SERDES: Link down - force failed.\n");
2264 } 2263 }
2265 } 2264 }
2266 2265
@@ -2273,20 +2272,20 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
2273 if (rxcw & E1000_RXCW_SYNCH) { 2272 if (rxcw & E1000_RXCW_SYNCH) {
2274 if (!(rxcw & E1000_RXCW_IV)) { 2273 if (!(rxcw & E1000_RXCW_IV)) {
2275 hw->serdes_has_link = true; 2274 hw->serdes_has_link = true;
2276 DEBUGOUT("SERDES: Link up - autoneg " 2275 e_dbg("SERDES: Link up - autoneg "
2277 "completed successfully.\n"); 2276 "completed successfully.\n");
2278 } else { 2277 } else {
2279 hw->serdes_has_link = false; 2278 hw->serdes_has_link = false;
2280 DEBUGOUT("SERDES: Link down - invalid" 2279 e_dbg("SERDES: Link down - invalid"
2281 "codewords detected in autoneg.\n"); 2280 "codewords detected in autoneg.\n");
2282 } 2281 }
2283 } else { 2282 } else {
2284 hw->serdes_has_link = false; 2283 hw->serdes_has_link = false;
2285 DEBUGOUT("SERDES: Link down - no sync.\n"); 2284 e_dbg("SERDES: Link down - no sync.\n");
2286 } 2285 }
2287 } else { 2286 } else {
2288 hw->serdes_has_link = false; 2287 hw->serdes_has_link = false;
2289 DEBUGOUT("SERDES: Link down - autoneg failed\n"); 2288 e_dbg("SERDES: Link down - autoneg failed\n");
2290 } 2289 }
2291 } 2290 }
2292 2291
@@ -2312,7 +2311,7 @@ s32 e1000_check_for_link(struct e1000_hw *hw)
2312 s32 ret_val; 2311 s32 ret_val;
2313 u16 phy_data; 2312 u16 phy_data;
2314 2313
2315 DEBUGFUNC("e1000_check_for_link"); 2314 e_dbg("e1000_check_for_link");
2316 2315
2317 ctrl = er32(CTRL); 2316 ctrl = er32(CTRL);
2318 status = er32(STATUS); 2317 status = er32(STATUS);
@@ -2407,7 +2406,7 @@ s32 e1000_check_for_link(struct e1000_hw *hw)
2407 else { 2406 else {
2408 ret_val = e1000_config_mac_to_phy(hw); 2407 ret_val = e1000_config_mac_to_phy(hw);
2409 if (ret_val) { 2408 if (ret_val) {
2410 DEBUGOUT 2409 e_dbg
2411 ("Error configuring MAC to PHY settings\n"); 2410 ("Error configuring MAC to PHY settings\n");
2412 return ret_val; 2411 return ret_val;
2413 } 2412 }
@@ -2419,7 +2418,7 @@ s32 e1000_check_for_link(struct e1000_hw *hw)
2419 */ 2418 */
2420 ret_val = e1000_config_fc_after_link_up(hw); 2419 ret_val = e1000_config_fc_after_link_up(hw);
2421 if (ret_val) { 2420 if (ret_val) {
2422 DEBUGOUT("Error configuring flow control\n"); 2421 e_dbg("Error configuring flow control\n");
2423 return ret_val; 2422 return ret_val;
2424 } 2423 }
2425 2424
@@ -2435,7 +2434,7 @@ s32 e1000_check_for_link(struct e1000_hw *hw)
2435 ret_val = 2434 ret_val =
2436 e1000_get_speed_and_duplex(hw, &speed, &duplex); 2435 e1000_get_speed_and_duplex(hw, &speed, &duplex);
2437 if (ret_val) { 2436 if (ret_val) {
2438 DEBUGOUT 2437 e_dbg
2439 ("Error getting link speed and duplex\n"); 2438 ("Error getting link speed and duplex\n");
2440 return ret_val; 2439 return ret_val;
2441 } 2440 }
@@ -2487,30 +2486,30 @@ s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex)
2487 s32 ret_val; 2486 s32 ret_val;
2488 u16 phy_data; 2487 u16 phy_data;
2489 2488
2490 DEBUGFUNC("e1000_get_speed_and_duplex"); 2489 e_dbg("e1000_get_speed_and_duplex");
2491 2490
2492 if (hw->mac_type >= e1000_82543) { 2491 if (hw->mac_type >= e1000_82543) {
2493 status = er32(STATUS); 2492 status = er32(STATUS);
2494 if (status & E1000_STATUS_SPEED_1000) { 2493 if (status & E1000_STATUS_SPEED_1000) {
2495 *speed = SPEED_1000; 2494 *speed = SPEED_1000;
2496 DEBUGOUT("1000 Mbs, "); 2495 e_dbg("1000 Mbs, ");
2497 } else if (status & E1000_STATUS_SPEED_100) { 2496 } else if (status & E1000_STATUS_SPEED_100) {
2498 *speed = SPEED_100; 2497 *speed = SPEED_100;
2499 DEBUGOUT("100 Mbs, "); 2498 e_dbg("100 Mbs, ");
2500 } else { 2499 } else {
2501 *speed = SPEED_10; 2500 *speed = SPEED_10;
2502 DEBUGOUT("10 Mbs, "); 2501 e_dbg("10 Mbs, ");
2503 } 2502 }
2504 2503
2505 if (status & E1000_STATUS_FD) { 2504 if (status & E1000_STATUS_FD) {
2506 *duplex = FULL_DUPLEX; 2505 *duplex = FULL_DUPLEX;
2507 DEBUGOUT("Full Duplex\n"); 2506 e_dbg("Full Duplex\n");
2508 } else { 2507 } else {
2509 *duplex = HALF_DUPLEX; 2508 *duplex = HALF_DUPLEX;
2510 DEBUGOUT(" Half Duplex\n"); 2509 e_dbg(" Half Duplex\n");
2511 } 2510 }
2512 } else { 2511 } else {
2513 DEBUGOUT("1000 Mbs, Full Duplex\n"); 2512 e_dbg("1000 Mbs, Full Duplex\n");
2514 *speed = SPEED_1000; 2513 *speed = SPEED_1000;
2515 *duplex = FULL_DUPLEX; 2514 *duplex = FULL_DUPLEX;
2516 } 2515 }
@@ -2554,8 +2553,8 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)
2554 u16 i; 2553 u16 i;
2555 u16 phy_data; 2554 u16 phy_data;
2556 2555
2557 DEBUGFUNC("e1000_wait_autoneg"); 2556 e_dbg("e1000_wait_autoneg");
2558 DEBUGOUT("Waiting for Auto-Neg to complete.\n"); 2557 e_dbg("Waiting for Auto-Neg to complete.\n");
2559 2558
2560 /* We will wait for autoneg to complete or 4.5 seconds to expire. */ 2559 /* We will wait for autoneg to complete or 4.5 seconds to expire. */
2561 for (i = PHY_AUTO_NEG_TIME; i > 0; i--) { 2560 for (i = PHY_AUTO_NEG_TIME; i > 0; i--) {
@@ -2718,7 +2717,7 @@ s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 *phy_data)
2718{ 2717{
2719 u32 ret_val; 2718 u32 ret_val;
2720 2719
2721 DEBUGFUNC("e1000_read_phy_reg"); 2720 e_dbg("e1000_read_phy_reg");
2722 2721
2723 if ((hw->phy_type == e1000_phy_igp) && 2722 if ((hw->phy_type == e1000_phy_igp) &&
2724 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { 2723 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
@@ -2741,10 +2740,10 @@ static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
2741 u32 mdic = 0; 2740 u32 mdic = 0;
2742 const u32 phy_addr = 1; 2741 const u32 phy_addr = 1;
2743 2742
2744 DEBUGFUNC("e1000_read_phy_reg_ex"); 2743 e_dbg("e1000_read_phy_reg_ex");
2745 2744
2746 if (reg_addr > MAX_PHY_REG_ADDRESS) { 2745 if (reg_addr > MAX_PHY_REG_ADDRESS) {
2747 DEBUGOUT1("PHY Address %d is out of range\n", reg_addr); 2746 e_dbg("PHY Address %d is out of range\n", reg_addr);
2748 return -E1000_ERR_PARAM; 2747 return -E1000_ERR_PARAM;
2749 } 2748 }
2750 2749
@@ -2767,11 +2766,11 @@ static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
2767 break; 2766 break;
2768 } 2767 }
2769 if (!(mdic & E1000_MDIC_READY)) { 2768 if (!(mdic & E1000_MDIC_READY)) {
2770 DEBUGOUT("MDI Read did not complete\n"); 2769 e_dbg("MDI Read did not complete\n");
2771 return -E1000_ERR_PHY; 2770 return -E1000_ERR_PHY;
2772 } 2771 }
2773 if (mdic & E1000_MDIC_ERROR) { 2772 if (mdic & E1000_MDIC_ERROR) {
2774 DEBUGOUT("MDI Error\n"); 2773 e_dbg("MDI Error\n");
2775 return -E1000_ERR_PHY; 2774 return -E1000_ERR_PHY;
2776 } 2775 }
2777 *phy_data = (u16) mdic; 2776 *phy_data = (u16) mdic;
@@ -2820,7 +2819,7 @@ s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 phy_data)
2820{ 2819{
2821 u32 ret_val; 2820 u32 ret_val;
2822 2821
2823 DEBUGFUNC("e1000_write_phy_reg"); 2822 e_dbg("e1000_write_phy_reg");
2824 2823
2825 if ((hw->phy_type == e1000_phy_igp) && 2824 if ((hw->phy_type == e1000_phy_igp) &&
2826 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { 2825 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
@@ -2843,10 +2842,10 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
2843 u32 mdic = 0; 2842 u32 mdic = 0;
2844 const u32 phy_addr = 1; 2843 const u32 phy_addr = 1;
2845 2844
2846 DEBUGFUNC("e1000_write_phy_reg_ex"); 2845 e_dbg("e1000_write_phy_reg_ex");
2847 2846
2848 if (reg_addr > MAX_PHY_REG_ADDRESS) { 2847 if (reg_addr > MAX_PHY_REG_ADDRESS) {
2849 DEBUGOUT1("PHY Address %d is out of range\n", reg_addr); 2848 e_dbg("PHY Address %d is out of range\n", reg_addr);
2850 return -E1000_ERR_PARAM; 2849 return -E1000_ERR_PARAM;
2851 } 2850 }
2852 2851
@@ -2870,7 +2869,7 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
2870 break; 2869 break;
2871 } 2870 }
2872 if (!(mdic & E1000_MDIC_READY)) { 2871 if (!(mdic & E1000_MDIC_READY)) {
2873 DEBUGOUT("MDI Write did not complete\n"); 2872 e_dbg("MDI Write did not complete\n");
2874 return -E1000_ERR_PHY; 2873 return -E1000_ERR_PHY;
2875 } 2874 }
2876 } else { 2875 } else {
@@ -2910,9 +2909,9 @@ s32 e1000_phy_hw_reset(struct e1000_hw *hw)
2910 u32 led_ctrl; 2909 u32 led_ctrl;
2911 s32 ret_val; 2910 s32 ret_val;
2912 2911
2913 DEBUGFUNC("e1000_phy_hw_reset"); 2912 e_dbg("e1000_phy_hw_reset");
2914 2913
2915 DEBUGOUT("Resetting Phy...\n"); 2914 e_dbg("Resetting Phy...\n");
2916 2915
2917 if (hw->mac_type > e1000_82543) { 2916 if (hw->mac_type > e1000_82543) {
2918 /* Read the device control register and assert the E1000_CTRL_PHY_RST 2917 /* Read the device control register and assert the E1000_CTRL_PHY_RST
@@ -2973,7 +2972,7 @@ s32 e1000_phy_reset(struct e1000_hw *hw)
2973 s32 ret_val; 2972 s32 ret_val;
2974 u16 phy_data; 2973 u16 phy_data;
2975 2974
2976 DEBUGFUNC("e1000_phy_reset"); 2975 e_dbg("e1000_phy_reset");
2977 2976
2978 switch (hw->phy_type) { 2977 switch (hw->phy_type) {
2979 case e1000_phy_igp: 2978 case e1000_phy_igp:
@@ -3013,7 +3012,7 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw)
3013 u16 phy_id_high, phy_id_low; 3012 u16 phy_id_high, phy_id_low;
3014 bool match = false; 3013 bool match = false;
3015 3014
3016 DEBUGFUNC("e1000_detect_gig_phy"); 3015 e_dbg("e1000_detect_gig_phy");
3017 3016
3018 if (hw->phy_id != 0) 3017 if (hw->phy_id != 0)
3019 return E1000_SUCCESS; 3018 return E1000_SUCCESS;
@@ -3057,16 +3056,16 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw)
3057 match = true; 3056 match = true;
3058 break; 3057 break;
3059 default: 3058 default:
3060 DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type); 3059 e_dbg("Invalid MAC type %d\n", hw->mac_type);
3061 return -E1000_ERR_CONFIG; 3060 return -E1000_ERR_CONFIG;
3062 } 3061 }
3063 phy_init_status = e1000_set_phy_type(hw); 3062 phy_init_status = e1000_set_phy_type(hw);
3064 3063
3065 if ((match) && (phy_init_status == E1000_SUCCESS)) { 3064 if ((match) && (phy_init_status == E1000_SUCCESS)) {
3066 DEBUGOUT1("PHY ID 0x%X detected\n", hw->phy_id); 3065 e_dbg("PHY ID 0x%X detected\n", hw->phy_id);
3067 return E1000_SUCCESS; 3066 return E1000_SUCCESS;
3068 } 3067 }
3069 DEBUGOUT1("Invalid PHY ID 0x%X\n", hw->phy_id); 3068 e_dbg("Invalid PHY ID 0x%X\n", hw->phy_id);
3070 return -E1000_ERR_PHY; 3069 return -E1000_ERR_PHY;
3071} 3070}
3072 3071
@@ -3079,7 +3078,7 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw)
3079static s32 e1000_phy_reset_dsp(struct e1000_hw *hw) 3078static s32 e1000_phy_reset_dsp(struct e1000_hw *hw)
3080{ 3079{
3081 s32 ret_val; 3080 s32 ret_val;
3082 DEBUGFUNC("e1000_phy_reset_dsp"); 3081 e_dbg("e1000_phy_reset_dsp");
3083 3082
3084 do { 3083 do {
3085 ret_val = e1000_write_phy_reg(hw, 29, 0x001d); 3084 ret_val = e1000_write_phy_reg(hw, 29, 0x001d);
@@ -3111,7 +3110,7 @@ static s32 e1000_phy_igp_get_info(struct e1000_hw *hw,
3111 u16 phy_data, min_length, max_length, average; 3110 u16 phy_data, min_length, max_length, average;
3112 e1000_rev_polarity polarity; 3111 e1000_rev_polarity polarity;
3113 3112
3114 DEBUGFUNC("e1000_phy_igp_get_info"); 3113 e_dbg("e1000_phy_igp_get_info");
3115 3114
3116 /* The downshift status is checked only once, after link is established, 3115 /* The downshift status is checked only once, after link is established,
3117 * and it stored in the hw->speed_downgraded parameter. */ 3116 * and it stored in the hw->speed_downgraded parameter. */
@@ -3189,7 +3188,7 @@ static s32 e1000_phy_m88_get_info(struct e1000_hw *hw,
3189 u16 phy_data; 3188 u16 phy_data;
3190 e1000_rev_polarity polarity; 3189 e1000_rev_polarity polarity;
3191 3190
3192 DEBUGFUNC("e1000_phy_m88_get_info"); 3191 e_dbg("e1000_phy_m88_get_info");
3193 3192
3194 /* The downshift status is checked only once, after link is established, 3193 /* The downshift status is checked only once, after link is established,
3195 * and it stored in the hw->speed_downgraded parameter. */ 3194 * and it stored in the hw->speed_downgraded parameter. */
@@ -3261,7 +3260,7 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info)
3261 s32 ret_val; 3260 s32 ret_val;
3262 u16 phy_data; 3261 u16 phy_data;
3263 3262
3264 DEBUGFUNC("e1000_phy_get_info"); 3263 e_dbg("e1000_phy_get_info");
3265 3264
3266 phy_info->cable_length = e1000_cable_length_undefined; 3265 phy_info->cable_length = e1000_cable_length_undefined;
3267 phy_info->extended_10bt_distance = e1000_10bt_ext_dist_enable_undefined; 3266 phy_info->extended_10bt_distance = e1000_10bt_ext_dist_enable_undefined;
@@ -3273,7 +3272,7 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info)
3273 phy_info->remote_rx = e1000_1000t_rx_status_undefined; 3272 phy_info->remote_rx = e1000_1000t_rx_status_undefined;
3274 3273
3275 if (hw->media_type != e1000_media_type_copper) { 3274 if (hw->media_type != e1000_media_type_copper) {
3276 DEBUGOUT("PHY info is only valid for copper media\n"); 3275 e_dbg("PHY info is only valid for copper media\n");
3277 return -E1000_ERR_CONFIG; 3276 return -E1000_ERR_CONFIG;
3278 } 3277 }
3279 3278
@@ -3286,7 +3285,7 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info)
3286 return ret_val; 3285 return ret_val;
3287 3286
3288 if ((phy_data & MII_SR_LINK_STATUS) != MII_SR_LINK_STATUS) { 3287 if ((phy_data & MII_SR_LINK_STATUS) != MII_SR_LINK_STATUS) {
3289 DEBUGOUT("PHY info is only valid if link is up\n"); 3288 e_dbg("PHY info is only valid if link is up\n");
3290 return -E1000_ERR_CONFIG; 3289 return -E1000_ERR_CONFIG;
3291 } 3290 }
3292 3291
@@ -3298,10 +3297,10 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info)
3298 3297
3299s32 e1000_validate_mdi_setting(struct e1000_hw *hw) 3298s32 e1000_validate_mdi_setting(struct e1000_hw *hw)
3300{ 3299{
3301 DEBUGFUNC("e1000_validate_mdi_settings"); 3300 e_dbg("e1000_validate_mdi_settings");
3302 3301
3303 if (!hw->autoneg && (hw->mdix == 0 || hw->mdix == 3)) { 3302 if (!hw->autoneg && (hw->mdix == 0 || hw->mdix == 3)) {
3304 DEBUGOUT("Invalid MDI setting detected\n"); 3303 e_dbg("Invalid MDI setting detected\n");
3305 hw->mdix = 1; 3304 hw->mdix = 1;
3306 return -E1000_ERR_CONFIG; 3305 return -E1000_ERR_CONFIG;
3307 } 3306 }
@@ -3322,7 +3321,7 @@ s32 e1000_init_eeprom_params(struct e1000_hw *hw)
3322 s32 ret_val = E1000_SUCCESS; 3321 s32 ret_val = E1000_SUCCESS;
3323 u16 eeprom_size; 3322 u16 eeprom_size;
3324 3323
3325 DEBUGFUNC("e1000_init_eeprom_params"); 3324 e_dbg("e1000_init_eeprom_params");
3326 3325
3327 switch (hw->mac_type) { 3326 switch (hw->mac_type) {
3328 case e1000_82542_rev2_0: 3327 case e1000_82542_rev2_0:
@@ -3539,7 +3538,7 @@ static s32 e1000_acquire_eeprom(struct e1000_hw *hw)
3539 struct e1000_eeprom_info *eeprom = &hw->eeprom; 3538 struct e1000_eeprom_info *eeprom = &hw->eeprom;
3540 u32 eecd, i = 0; 3539 u32 eecd, i = 0;
3541 3540
3542 DEBUGFUNC("e1000_acquire_eeprom"); 3541 e_dbg("e1000_acquire_eeprom");
3543 3542
3544 eecd = er32(EECD); 3543 eecd = er32(EECD);
3545 3544
@@ -3557,7 +3556,7 @@ static s32 e1000_acquire_eeprom(struct e1000_hw *hw)
3557 if (!(eecd & E1000_EECD_GNT)) { 3556 if (!(eecd & E1000_EECD_GNT)) {
3558 eecd &= ~E1000_EECD_REQ; 3557 eecd &= ~E1000_EECD_REQ;
3559 ew32(EECD, eecd); 3558 ew32(EECD, eecd);
3560 DEBUGOUT("Could not acquire EEPROM grant\n"); 3559 e_dbg("Could not acquire EEPROM grant\n");
3561 return -E1000_ERR_EEPROM; 3560 return -E1000_ERR_EEPROM;
3562 } 3561 }
3563 } 3562 }
@@ -3639,7 +3638,7 @@ static void e1000_release_eeprom(struct e1000_hw *hw)
3639{ 3638{
3640 u32 eecd; 3639 u32 eecd;
3641 3640
3642 DEBUGFUNC("e1000_release_eeprom"); 3641 e_dbg("e1000_release_eeprom");
3643 3642
3644 eecd = er32(EECD); 3643 eecd = er32(EECD);
3645 3644
@@ -3687,7 +3686,7 @@ static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw)
3687 u16 retry_count = 0; 3686 u16 retry_count = 0;
3688 u8 spi_stat_reg; 3687 u8 spi_stat_reg;
3689 3688
3690 DEBUGFUNC("e1000_spi_eeprom_ready"); 3689 e_dbg("e1000_spi_eeprom_ready");
3691 3690
3692 /* Read "Status Register" repeatedly until the LSB is cleared. The 3691 /* Read "Status Register" repeatedly until the LSB is cleared. The
3693 * EEPROM will signal that the command has been completed by clearing 3692 * EEPROM will signal that the command has been completed by clearing
@@ -3712,7 +3711,7 @@ static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw)
3712 * only 0-5mSec on 5V devices) 3711 * only 0-5mSec on 5V devices)
3713 */ 3712 */
3714 if (retry_count >= EEPROM_MAX_RETRY_SPI) { 3713 if (retry_count >= EEPROM_MAX_RETRY_SPI) {
3715 DEBUGOUT("SPI EEPROM Status error\n"); 3714 e_dbg("SPI EEPROM Status error\n");
3716 return -E1000_ERR_EEPROM; 3715 return -E1000_ERR_EEPROM;
3717 } 3716 }
3718 3717
@@ -3741,7 +3740,7 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
3741 struct e1000_eeprom_info *eeprom = &hw->eeprom; 3740 struct e1000_eeprom_info *eeprom = &hw->eeprom;
3742 u32 i = 0; 3741 u32 i = 0;
3743 3742
3744 DEBUGFUNC("e1000_read_eeprom"); 3743 e_dbg("e1000_read_eeprom");
3745 3744
3746 /* If eeprom is not yet detected, do so now */ 3745 /* If eeprom is not yet detected, do so now */
3747 if (eeprom->word_size == 0) 3746 if (eeprom->word_size == 0)
@@ -3752,9 +3751,8 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
3752 */ 3751 */
3753 if ((offset >= eeprom->word_size) 3752 if ((offset >= eeprom->word_size)
3754 || (words > eeprom->word_size - offset) || (words == 0)) { 3753 || (words > eeprom->word_size - offset) || (words == 0)) {
3755 DEBUGOUT2 3754 e_dbg("\"words\" parameter out of bounds. Words = %d,"
3756 ("\"words\" parameter out of bounds. Words = %d, size = %d\n", 3755 "size = %d\n", offset, eeprom->word_size);
3757 offset, eeprom->word_size);
3758 return -E1000_ERR_EEPROM; 3756 return -E1000_ERR_EEPROM;
3759 } 3757 }
3760 3758
@@ -3832,11 +3830,11 @@ s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw)
3832 u16 checksum = 0; 3830 u16 checksum = 0;
3833 u16 i, eeprom_data; 3831 u16 i, eeprom_data;
3834 3832
3835 DEBUGFUNC("e1000_validate_eeprom_checksum"); 3833 e_dbg("e1000_validate_eeprom_checksum");
3836 3834
3837 for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) { 3835 for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) {
3838 if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { 3836 if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) {
3839 DEBUGOUT("EEPROM Read Error\n"); 3837 e_dbg("EEPROM Read Error\n");
3840 return -E1000_ERR_EEPROM; 3838 return -E1000_ERR_EEPROM;
3841 } 3839 }
3842 checksum += eeprom_data; 3840 checksum += eeprom_data;
@@ -3845,7 +3843,7 @@ s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw)
3845 if (checksum == (u16) EEPROM_SUM) 3843 if (checksum == (u16) EEPROM_SUM)
3846 return E1000_SUCCESS; 3844 return E1000_SUCCESS;
3847 else { 3845 else {
3848 DEBUGOUT("EEPROM Checksum Invalid\n"); 3846 e_dbg("EEPROM Checksum Invalid\n");
3849 return -E1000_ERR_EEPROM; 3847 return -E1000_ERR_EEPROM;
3850 } 3848 }
3851} 3849}
@@ -3862,18 +3860,18 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw)
3862 u16 checksum = 0; 3860 u16 checksum = 0;
3863 u16 i, eeprom_data; 3861 u16 i, eeprom_data;
3864 3862
3865 DEBUGFUNC("e1000_update_eeprom_checksum"); 3863 e_dbg("e1000_update_eeprom_checksum");
3866 3864
3867 for (i = 0; i < EEPROM_CHECKSUM_REG; i++) { 3865 for (i = 0; i < EEPROM_CHECKSUM_REG; i++) {
3868 if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { 3866 if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) {
3869 DEBUGOUT("EEPROM Read Error\n"); 3867 e_dbg("EEPROM Read Error\n");
3870 return -E1000_ERR_EEPROM; 3868 return -E1000_ERR_EEPROM;
3871 } 3869 }
3872 checksum += eeprom_data; 3870 checksum += eeprom_data;
3873 } 3871 }
3874 checksum = (u16) EEPROM_SUM - checksum; 3872 checksum = (u16) EEPROM_SUM - checksum;
3875 if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) { 3873 if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) {
3876 DEBUGOUT("EEPROM Write Error\n"); 3874 e_dbg("EEPROM Write Error\n");
3877 return -E1000_ERR_EEPROM; 3875 return -E1000_ERR_EEPROM;
3878 } 3876 }
3879 return E1000_SUCCESS; 3877 return E1000_SUCCESS;
@@ -3904,7 +3902,7 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
3904 struct e1000_eeprom_info *eeprom = &hw->eeprom; 3902 struct e1000_eeprom_info *eeprom = &hw->eeprom;
3905 s32 status = 0; 3903 s32 status = 0;
3906 3904
3907 DEBUGFUNC("e1000_write_eeprom"); 3905 e_dbg("e1000_write_eeprom");
3908 3906
3909 /* If eeprom is not yet detected, do so now */ 3907 /* If eeprom is not yet detected, do so now */
3910 if (eeprom->word_size == 0) 3908 if (eeprom->word_size == 0)
@@ -3915,7 +3913,7 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
3915 */ 3913 */
3916 if ((offset >= eeprom->word_size) 3914 if ((offset >= eeprom->word_size)
3917 || (words > eeprom->word_size - offset) || (words == 0)) { 3915 || (words > eeprom->word_size - offset) || (words == 0)) {
3918 DEBUGOUT("\"words\" parameter out of bounds\n"); 3916 e_dbg("\"words\" parameter out of bounds\n");
3919 return -E1000_ERR_EEPROM; 3917 return -E1000_ERR_EEPROM;
3920 } 3918 }
3921 3919
@@ -3949,7 +3947,7 @@ static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, u16 words,
3949 struct e1000_eeprom_info *eeprom = &hw->eeprom; 3947 struct e1000_eeprom_info *eeprom = &hw->eeprom;
3950 u16 widx = 0; 3948 u16 widx = 0;
3951 3949
3952 DEBUGFUNC("e1000_write_eeprom_spi"); 3950 e_dbg("e1000_write_eeprom_spi");
3953 3951
3954 while (widx < words) { 3952 while (widx < words) {
3955 u8 write_opcode = EEPROM_WRITE_OPCODE_SPI; 3953 u8 write_opcode = EEPROM_WRITE_OPCODE_SPI;
@@ -4013,7 +4011,7 @@ static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset,
4013 u16 words_written = 0; 4011 u16 words_written = 0;
4014 u16 i = 0; 4012 u16 i = 0;
4015 4013
4016 DEBUGFUNC("e1000_write_eeprom_microwire"); 4014 e_dbg("e1000_write_eeprom_microwire");
4017 4015
4018 /* Send the write enable command to the EEPROM (3-bit opcode plus 4016 /* Send the write enable command to the EEPROM (3-bit opcode plus
4019 * 6/8-bit dummy address beginning with 11). It's less work to include 4017 * 6/8-bit dummy address beginning with 11). It's less work to include
@@ -4056,7 +4054,7 @@ static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset,
4056 udelay(50); 4054 udelay(50);
4057 } 4055 }
4058 if (i == 200) { 4056 if (i == 200) {
4059 DEBUGOUT("EEPROM Write did not complete\n"); 4057 e_dbg("EEPROM Write did not complete\n");
4060 return -E1000_ERR_EEPROM; 4058 return -E1000_ERR_EEPROM;
4061 } 4059 }
4062 4060
@@ -4092,12 +4090,12 @@ s32 e1000_read_mac_addr(struct e1000_hw *hw)
4092 u16 offset; 4090 u16 offset;
4093 u16 eeprom_data, i; 4091 u16 eeprom_data, i;
4094 4092
4095 DEBUGFUNC("e1000_read_mac_addr"); 4093 e_dbg("e1000_read_mac_addr");
4096 4094
4097 for (i = 0; i < NODE_ADDRESS_SIZE; i += 2) { 4095 for (i = 0; i < NODE_ADDRESS_SIZE; i += 2) {
4098 offset = i >> 1; 4096 offset = i >> 1;
4099 if (e1000_read_eeprom(hw, offset, 1, &eeprom_data) < 0) { 4097 if (e1000_read_eeprom(hw, offset, 1, &eeprom_data) < 0) {
4100 DEBUGOUT("EEPROM Read Error\n"); 4098 e_dbg("EEPROM Read Error\n");
4101 return -E1000_ERR_EEPROM; 4099 return -E1000_ERR_EEPROM;
4102 } 4100 }
4103 hw->perm_mac_addr[i] = (u8) (eeprom_data & 0x00FF); 4101 hw->perm_mac_addr[i] = (u8) (eeprom_data & 0x00FF);
@@ -4132,17 +4130,17 @@ static void e1000_init_rx_addrs(struct e1000_hw *hw)
4132 u32 i; 4130 u32 i;
4133 u32 rar_num; 4131 u32 rar_num;
4134 4132
4135 DEBUGFUNC("e1000_init_rx_addrs"); 4133 e_dbg("e1000_init_rx_addrs");
4136 4134
4137 /* Setup the receive address. */ 4135 /* Setup the receive address. */
4138 DEBUGOUT("Programming MAC Address into RAR[0]\n"); 4136 e_dbg("Programming MAC Address into RAR[0]\n");
4139 4137
4140 e1000_rar_set(hw, hw->mac_addr, 0); 4138 e1000_rar_set(hw, hw->mac_addr, 0);
4141 4139
4142 rar_num = E1000_RAR_ENTRIES; 4140 rar_num = E1000_RAR_ENTRIES;
4143 4141
4144 /* Zero out the other 15 receive addresses. */ 4142 /* Zero out the other 15 receive addresses. */
4145 DEBUGOUT("Clearing RAR[1-15]\n"); 4143 e_dbg("Clearing RAR[1-15]\n");
4146 for (i = 1; i < rar_num; i++) { 4144 for (i = 1; i < rar_num; i++) {
4147 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); 4145 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
4148 E1000_WRITE_FLUSH(); 4146 E1000_WRITE_FLUSH();
@@ -4290,7 +4288,7 @@ static s32 e1000_id_led_init(struct e1000_hw *hw)
4290 u16 eeprom_data, i, temp; 4288 u16 eeprom_data, i, temp;
4291 const u16 led_mask = 0x0F; 4289 const u16 led_mask = 0x0F;
4292 4290
4293 DEBUGFUNC("e1000_id_led_init"); 4291 e_dbg("e1000_id_led_init");
4294 4292
4295 if (hw->mac_type < e1000_82540) { 4293 if (hw->mac_type < e1000_82540) {
4296 /* Nothing to do */ 4294 /* Nothing to do */
@@ -4303,7 +4301,7 @@ static s32 e1000_id_led_init(struct e1000_hw *hw)
4303 hw->ledctl_mode2 = hw->ledctl_default; 4301 hw->ledctl_mode2 = hw->ledctl_default;
4304 4302
4305 if (e1000_read_eeprom(hw, EEPROM_ID_LED_SETTINGS, 1, &eeprom_data) < 0) { 4303 if (e1000_read_eeprom(hw, EEPROM_ID_LED_SETTINGS, 1, &eeprom_data) < 0) {
4306 DEBUGOUT("EEPROM Read Error\n"); 4304 e_dbg("EEPROM Read Error\n");
4307 return -E1000_ERR_EEPROM; 4305 return -E1000_ERR_EEPROM;
4308 } 4306 }
4309 4307
@@ -4363,7 +4361,7 @@ s32 e1000_setup_led(struct e1000_hw *hw)
4363 u32 ledctl; 4361 u32 ledctl;
4364 s32 ret_val = E1000_SUCCESS; 4362 s32 ret_val = E1000_SUCCESS;
4365 4363
4366 DEBUGFUNC("e1000_setup_led"); 4364 e_dbg("e1000_setup_led");
4367 4365
4368 switch (hw->mac_type) { 4366 switch (hw->mac_type) {
4369 case e1000_82542_rev2_0: 4367 case e1000_82542_rev2_0:
@@ -4415,7 +4413,7 @@ s32 e1000_cleanup_led(struct e1000_hw *hw)
4415{ 4413{
4416 s32 ret_val = E1000_SUCCESS; 4414 s32 ret_val = E1000_SUCCESS;
4417 4415
4418 DEBUGFUNC("e1000_cleanup_led"); 4416 e_dbg("e1000_cleanup_led");
4419 4417
4420 switch (hw->mac_type) { 4418 switch (hw->mac_type) {
4421 case e1000_82542_rev2_0: 4419 case e1000_82542_rev2_0:
@@ -4451,7 +4449,7 @@ s32 e1000_led_on(struct e1000_hw *hw)
4451{ 4449{
4452 u32 ctrl = er32(CTRL); 4450 u32 ctrl = er32(CTRL);
4453 4451
4454 DEBUGFUNC("e1000_led_on"); 4452 e_dbg("e1000_led_on");
4455 4453
4456 switch (hw->mac_type) { 4454 switch (hw->mac_type) {
4457 case e1000_82542_rev2_0: 4455 case e1000_82542_rev2_0:
@@ -4497,7 +4495,7 @@ s32 e1000_led_off(struct e1000_hw *hw)
4497{ 4495{
4498 u32 ctrl = er32(CTRL); 4496 u32 ctrl = er32(CTRL);
4499 4497
4500 DEBUGFUNC("e1000_led_off"); 4498 e_dbg("e1000_led_off");
4501 4499
4502 switch (hw->mac_type) { 4500 switch (hw->mac_type) {
4503 case e1000_82542_rev2_0: 4501 case e1000_82542_rev2_0:
@@ -4626,7 +4624,7 @@ static void e1000_clear_hw_cntrs(struct e1000_hw *hw)
4626 */ 4624 */
4627void e1000_reset_adaptive(struct e1000_hw *hw) 4625void e1000_reset_adaptive(struct e1000_hw *hw)
4628{ 4626{
4629 DEBUGFUNC("e1000_reset_adaptive"); 4627 e_dbg("e1000_reset_adaptive");
4630 4628
4631 if (hw->adaptive_ifs) { 4629 if (hw->adaptive_ifs) {
4632 if (!hw->ifs_params_forced) { 4630 if (!hw->ifs_params_forced) {
@@ -4639,7 +4637,7 @@ void e1000_reset_adaptive(struct e1000_hw *hw)
4639 hw->in_ifs_mode = false; 4637 hw->in_ifs_mode = false;
4640 ew32(AIT, 0); 4638 ew32(AIT, 0);
4641 } else { 4639 } else {
4642 DEBUGOUT("Not in Adaptive IFS mode!\n"); 4640 e_dbg("Not in Adaptive IFS mode!\n");
4643 } 4641 }
4644} 4642}
4645 4643
@@ -4654,7 +4652,7 @@ void e1000_reset_adaptive(struct e1000_hw *hw)
4654 */ 4652 */
4655void e1000_update_adaptive(struct e1000_hw *hw) 4653void e1000_update_adaptive(struct e1000_hw *hw)
4656{ 4654{
4657 DEBUGFUNC("e1000_update_adaptive"); 4655 e_dbg("e1000_update_adaptive");
4658 4656
4659 if (hw->adaptive_ifs) { 4657 if (hw->adaptive_ifs) {
4660 if ((hw->collision_delta *hw->ifs_ratio) > hw->tx_packet_delta) { 4658 if ((hw->collision_delta *hw->ifs_ratio) > hw->tx_packet_delta) {
@@ -4679,7 +4677,7 @@ void e1000_update_adaptive(struct e1000_hw *hw)
4679 } 4677 }
4680 } 4678 }
4681 } else { 4679 } else {
4682 DEBUGOUT("Not in Adaptive IFS mode!\n"); 4680 e_dbg("Not in Adaptive IFS mode!\n");
4683 } 4681 }
4684} 4682}
4685 4683
@@ -4851,7 +4849,7 @@ static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length,
4851 u16 i, phy_data; 4849 u16 i, phy_data;
4852 u16 cable_length; 4850 u16 cable_length;
4853 4851
4854 DEBUGFUNC("e1000_get_cable_length"); 4852 e_dbg("e1000_get_cable_length");
4855 4853
4856 *min_length = *max_length = 0; 4854 *min_length = *max_length = 0;
4857 4855
@@ -4968,7 +4966,7 @@ static s32 e1000_check_polarity(struct e1000_hw *hw,
4968 s32 ret_val; 4966 s32 ret_val;
4969 u16 phy_data; 4967 u16 phy_data;
4970 4968
4971 DEBUGFUNC("e1000_check_polarity"); 4969 e_dbg("e1000_check_polarity");
4972 4970
4973 if (hw->phy_type == e1000_phy_m88) { 4971 if (hw->phy_type == e1000_phy_m88) {
4974 /* return the Polarity bit in the Status register. */ 4972 /* return the Polarity bit in the Status register. */
@@ -5034,7 +5032,7 @@ static s32 e1000_check_downshift(struct e1000_hw *hw)
5034 s32 ret_val; 5032 s32 ret_val;
5035 u16 phy_data; 5033 u16 phy_data;
5036 5034
5037 DEBUGFUNC("e1000_check_downshift"); 5035 e_dbg("e1000_check_downshift");
5038 5036
5039 if (hw->phy_type == e1000_phy_igp) { 5037 if (hw->phy_type == e1000_phy_igp) {
5040 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, 5038 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH,
@@ -5081,7 +5079,7 @@ static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up)
5081 }; 5079 };
5082 u16 min_length, max_length; 5080 u16 min_length, max_length;
5083 5081
5084 DEBUGFUNC("e1000_config_dsp_after_link_change"); 5082 e_dbg("e1000_config_dsp_after_link_change");
5085 5083
5086 if (hw->phy_type != e1000_phy_igp) 5084 if (hw->phy_type != e1000_phy_igp)
5087 return E1000_SUCCESS; 5085 return E1000_SUCCESS;
@@ -5089,7 +5087,7 @@ static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up)
5089 if (link_up) { 5087 if (link_up) {
5090 ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex); 5088 ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex);
5091 if (ret_val) { 5089 if (ret_val) {
5092 DEBUGOUT("Error getting link speed and duplex\n"); 5090 e_dbg("Error getting link speed and duplex\n");
5093 return ret_val; 5091 return ret_val;
5094 } 5092 }
5095 5093
@@ -5289,7 +5287,7 @@ static s32 e1000_set_phy_mode(struct e1000_hw *hw)
5289 s32 ret_val; 5287 s32 ret_val;
5290 u16 eeprom_data; 5288 u16 eeprom_data;
5291 5289
5292 DEBUGFUNC("e1000_set_phy_mode"); 5290 e_dbg("e1000_set_phy_mode");
5293 5291
5294 if ((hw->mac_type == e1000_82545_rev_3) && 5292 if ((hw->mac_type == e1000_82545_rev_3) &&
5295 (hw->media_type == e1000_media_type_copper)) { 5293 (hw->media_type == e1000_media_type_copper)) {
@@ -5337,7 +5335,7 @@ static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
5337{ 5335{
5338 s32 ret_val; 5336 s32 ret_val;
5339 u16 phy_data; 5337 u16 phy_data;
5340 DEBUGFUNC("e1000_set_d3_lplu_state"); 5338 e_dbg("e1000_set_d3_lplu_state");
5341 5339
5342 if (hw->phy_type != e1000_phy_igp) 5340 if (hw->phy_type != e1000_phy_igp)
5343 return E1000_SUCCESS; 5341 return E1000_SUCCESS;
@@ -5440,7 +5438,7 @@ static s32 e1000_set_vco_speed(struct e1000_hw *hw)
5440 u16 default_page = 0; 5438 u16 default_page = 0;
5441 u16 phy_data; 5439 u16 phy_data;
5442 5440
5443 DEBUGFUNC("e1000_set_vco_speed"); 5441 e_dbg("e1000_set_vco_speed");
5444 5442
5445 switch (hw->mac_type) { 5443 switch (hw->mac_type) {
5446 case e1000_82545_rev_3: 5444 case e1000_82545_rev_3:
@@ -5613,7 +5611,7 @@ static s32 e1000_polarity_reversal_workaround(struct e1000_hw *hw)
5613 */ 5611 */
5614static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) 5612static s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
5615{ 5613{
5616 DEBUGFUNC("e1000_get_auto_rd_done"); 5614 e_dbg("e1000_get_auto_rd_done");
5617 msleep(5); 5615 msleep(5);
5618 return E1000_SUCCESS; 5616 return E1000_SUCCESS;
5619} 5617}
@@ -5628,7 +5626,7 @@ static s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
5628 */ 5626 */
5629static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) 5627static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw)
5630{ 5628{
5631 DEBUGFUNC("e1000_get_phy_cfg_done"); 5629 e_dbg("e1000_get_phy_cfg_done");
5632 mdelay(10); 5630 mdelay(10);
5633 return E1000_SUCCESS; 5631 return E1000_SUCCESS;
5634} 5632}
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 9acfddb0dafb..ecd9f6c6bcd5 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -35,6 +35,7 @@
35 35
36#include "e1000_osdep.h" 36#include "e1000_osdep.h"
37 37
38
38/* Forward declarations of structures used by the shared code */ 39/* Forward declarations of structures used by the shared code */
39struct e1000_hw; 40struct e1000_hw;
40struct e1000_hw_stats; 41struct e1000_hw_stats;
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b15ece26ed84..ebdea0891665 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -31,7 +31,7 @@
31 31
32char e1000_driver_name[] = "e1000"; 32char e1000_driver_name[] = "e1000";
33static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; 33static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
34#define DRV_VERSION "7.3.21-k5-NAPI" 34#define DRV_VERSION "7.3.21-k6-NAPI"
35const char e1000_driver_version[] = DRV_VERSION; 35const char e1000_driver_version[] = DRV_VERSION;
36static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; 36static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
37 37
@@ -214,6 +214,17 @@ module_param(debug, int, 0);
214MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); 214MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
215 215
216/** 216/**
217 * e1000_get_hw_dev - return device
218 * used by hardware layer to print debugging information
219 *
220 **/
221struct net_device *e1000_get_hw_dev(struct e1000_hw *hw)
222{
223 struct e1000_adapter *adapter = hw->back;
224 return adapter->netdev;
225}
226
227/**
217 * e1000_init_module - Driver Registration Routine 228 * e1000_init_module - Driver Registration Routine
218 * 229 *
219 * e1000_init_module is the first routine called when the driver is 230 * e1000_init_module is the first routine called when the driver is
@@ -223,18 +234,17 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
223static int __init e1000_init_module(void) 234static int __init e1000_init_module(void)
224{ 235{
225 int ret; 236 int ret;
226 printk(KERN_INFO "%s - version %s\n", 237 pr_info("%s - version %s\n", e1000_driver_string, e1000_driver_version);
227 e1000_driver_string, e1000_driver_version);
228 238
229 printk(KERN_INFO "%s\n", e1000_copyright); 239 pr_info("%s\n", e1000_copyright);
230 240
231 ret = pci_register_driver(&e1000_driver); 241 ret = pci_register_driver(&e1000_driver);
232 if (copybreak != COPYBREAK_DEFAULT) { 242 if (copybreak != COPYBREAK_DEFAULT) {
233 if (copybreak == 0) 243 if (copybreak == 0)
234 printk(KERN_INFO "e1000: copybreak disabled\n"); 244 pr_info("copybreak disabled\n");
235 else 245 else
236 printk(KERN_INFO "e1000: copybreak enabled for " 246 pr_info("copybreak enabled for "
237 "packets <= %u bytes\n", copybreak); 247 "packets <= %u bytes\n", copybreak);
238 } 248 }
239 return ret; 249 return ret;
240} 250}
@@ -265,8 +275,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
265 err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, 275 err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
266 netdev); 276 netdev);
267 if (err) { 277 if (err) {
268 DPRINTK(PROBE, ERR, 278 e_err("Unable to allocate interrupt Error: %d\n", err);
269 "Unable to allocate interrupt Error: %d\n", err);
270 } 279 }
271 280
272 return err; 281 return err;
@@ -648,7 +657,7 @@ void e1000_reset(struct e1000_adapter *adapter)
648 ew32(WUC, 0); 657 ew32(WUC, 0);
649 658
650 if (e1000_init_hw(hw)) 659 if (e1000_init_hw(hw))
651 DPRINTK(PROBE, ERR, "Hardware Error\n"); 660 e_err("Hardware Error\n");
652 e1000_update_mng_vlan(adapter); 661 e1000_update_mng_vlan(adapter);
653 662
654 /* if (adapter->hwflags & HWFLAGS_PHY_PWR_BIT) { */ 663 /* if (adapter->hwflags & HWFLAGS_PHY_PWR_BIT) { */
@@ -689,8 +698,7 @@ static void e1000_dump_eeprom(struct e1000_adapter *adapter)
689 698
690 data = kmalloc(eeprom.len, GFP_KERNEL); 699 data = kmalloc(eeprom.len, GFP_KERNEL);
691 if (!data) { 700 if (!data) {
692 printk(KERN_ERR "Unable to allocate memory to dump EEPROM" 701 pr_err("Unable to allocate memory to dump EEPROM data\n");
693 " data\n");
694 return; 702 return;
695 } 703 }
696 704
@@ -702,30 +710,25 @@ static void e1000_dump_eeprom(struct e1000_adapter *adapter)
702 csum_new += data[i] + (data[i + 1] << 8); 710 csum_new += data[i] + (data[i + 1] << 8);
703 csum_new = EEPROM_SUM - csum_new; 711 csum_new = EEPROM_SUM - csum_new;
704 712
705 printk(KERN_ERR "/*********************/\n"); 713 pr_err("/*********************/\n");
706 printk(KERN_ERR "Current EEPROM Checksum : 0x%04x\n", csum_old); 714 pr_err("Current EEPROM Checksum : 0x%04x\n", csum_old);
707 printk(KERN_ERR "Calculated : 0x%04x\n", csum_new); 715 pr_err("Calculated : 0x%04x\n", csum_new);
708 716
709 printk(KERN_ERR "Offset Values\n"); 717 pr_err("Offset Values\n");
710 printk(KERN_ERR "======== ======\n"); 718 pr_err("======== ======\n");
711 print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, data, 128, 0); 719 print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, data, 128, 0);
712 720
713 printk(KERN_ERR "Include this output when contacting your support " 721 pr_err("Include this output when contacting your support provider.\n");
714 "provider.\n"); 722 pr_err("This is not a software error! Something bad happened to\n");
715 printk(KERN_ERR "This is not a software error! Something bad " 723 pr_err("your hardware or EEPROM image. Ignoring this problem could\n");
716 "happened to your hardware or\n"); 724 pr_err("result in further problems, possibly loss of data,\n");
717 printk(KERN_ERR "EEPROM image. Ignoring this " 725 pr_err("corruption or system hangs!\n");
718 "problem could result in further problems,\n"); 726 pr_err("The MAC Address will be reset to 00:00:00:00:00:00,\n");
719 printk(KERN_ERR "possibly loss of data, corruption or system hangs!\n"); 727 pr_err("which is invalid and requires you to set the proper MAC\n");
720 printk(KERN_ERR "The MAC Address will be reset to 00:00:00:00:00:00, " 728 pr_err("address manually before continuing to enable this network\n");
721 "which is invalid\n"); 729 pr_err("device. Please inspect the EEPROM dump and report the\n");
722 printk(KERN_ERR "and requires you to set the proper MAC " 730 pr_err("issue to your hardware vendor or Intel Customer Support.\n");
723 "address manually before continuing\n"); 731 pr_err("/*********************/\n");
724 printk(KERN_ERR "to enable this network device.\n");
725 printk(KERN_ERR "Please inspect the EEPROM dump and report the issue "
726 "to your hardware vendor\n");
727 printk(KERN_ERR "or Intel Customer Support.\n");
728 printk(KERN_ERR "/*********************/\n");
729 732
730 kfree(data); 733 kfree(data);
731} 734}
@@ -823,16 +826,16 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
823 if (err) 826 if (err)
824 return err; 827 return err;
825 828
826 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && 829 if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
827 !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { 830 !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
828 pci_using_dac = 1; 831 pci_using_dac = 1;
829 } else { 832 } else {
830 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); 833 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
831 if (err) { 834 if (err) {
832 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 835 err = dma_set_coherent_mask(&pdev->dev,
836 DMA_BIT_MASK(32));
833 if (err) { 837 if (err) {
834 E1000_ERR("No usable DMA configuration, " 838 pr_err("No usable DMA config, aborting\n");
835 "aborting\n");
836 goto err_dma; 839 goto err_dma;
837 } 840 }
838 } 841 }
@@ -922,7 +925,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
922 925
923 /* initialize eeprom parameters */ 926 /* initialize eeprom parameters */
924 if (e1000_init_eeprom_params(hw)) { 927 if (e1000_init_eeprom_params(hw)) {
925 E1000_ERR("EEPROM initialization failed\n"); 928 e_err("EEPROM initialization failed\n");
926 goto err_eeprom; 929 goto err_eeprom;
927 } 930 }
928 931
@@ -933,7 +936,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
933 936
934 /* make sure the EEPROM is good */ 937 /* make sure the EEPROM is good */
935 if (e1000_validate_eeprom_checksum(hw) < 0) { 938 if (e1000_validate_eeprom_checksum(hw) < 0) {
936 DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n"); 939 e_err("The EEPROM Checksum Is Not Valid\n");
937 e1000_dump_eeprom(adapter); 940 e1000_dump_eeprom(adapter);
938 /* 941 /*
939 * set MAC address to all zeroes to invalidate and temporary 942 * set MAC address to all zeroes to invalidate and temporary
@@ -947,14 +950,14 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
947 } else { 950 } else {
948 /* copy the MAC address out of the EEPROM */ 951 /* copy the MAC address out of the EEPROM */
949 if (e1000_read_mac_addr(hw)) 952 if (e1000_read_mac_addr(hw))
950 DPRINTK(PROBE, ERR, "EEPROM Read Error\n"); 953 e_err("EEPROM Read Error\n");
951 } 954 }
952 /* don't block initalization here due to bad MAC address */ 955 /* don't block initalization here due to bad MAC address */
953 memcpy(netdev->dev_addr, hw->mac_addr, netdev->addr_len); 956 memcpy(netdev->dev_addr, hw->mac_addr, netdev->addr_len);
954 memcpy(netdev->perm_addr, hw->mac_addr, netdev->addr_len); 957 memcpy(netdev->perm_addr, hw->mac_addr, netdev->addr_len);
955 958
956 if (!is_valid_ether_addr(netdev->perm_addr)) 959 if (!is_valid_ether_addr(netdev->perm_addr))
957 DPRINTK(PROBE, ERR, "Invalid MAC Address\n"); 960 e_err("Invalid MAC Address\n");
958 961
959 e1000_get_bus_info(hw); 962 e1000_get_bus_info(hw);
960 963
@@ -1035,8 +1038,16 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1035 adapter->wol = adapter->eeprom_wol; 1038 adapter->wol = adapter->eeprom_wol;
1036 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 1039 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
1037 1040
1041 /* reset the hardware with the new settings */
1042 e1000_reset(adapter);
1043
1044 strcpy(netdev->name, "eth%d");
1045 err = register_netdev(netdev);
1046 if (err)
1047 goto err_register;
1048
1038 /* print bus type/speed/width info */ 1049 /* print bus type/speed/width info */
1039 DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ", 1050 e_info("(PCI%s:%s:%s) ",
1040 ((hw->bus_type == e1000_bus_type_pcix) ? "-X" : ""), 1051 ((hw->bus_type == e1000_bus_type_pcix) ? "-X" : ""),
1041 ((hw->bus_speed == e1000_bus_speed_133) ? "133MHz" : 1052 ((hw->bus_speed == e1000_bus_speed_133) ? "133MHz" :
1042 (hw->bus_speed == e1000_bus_speed_120) ? "120MHz" : 1053 (hw->bus_speed == e1000_bus_speed_120) ? "120MHz" :
@@ -1044,20 +1055,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1044 (hw->bus_speed == e1000_bus_speed_66) ? "66MHz" : "33MHz"), 1055 (hw->bus_speed == e1000_bus_speed_66) ? "66MHz" : "33MHz"),
1045 ((hw->bus_width == e1000_bus_width_64) ? "64-bit" : "32-bit")); 1056 ((hw->bus_width == e1000_bus_width_64) ? "64-bit" : "32-bit"));
1046 1057
1047 printk("%pM\n", netdev->dev_addr); 1058 e_info("%pM\n", netdev->dev_addr);
1048
1049 /* reset the hardware with the new settings */
1050 e1000_reset(adapter);
1051
1052 strcpy(netdev->name, "eth%d");
1053 err = register_netdev(netdev);
1054 if (err)
1055 goto err_register;
1056 1059
1057 /* carrier off reporting is important to ethtool even BEFORE open */ 1060 /* carrier off reporting is important to ethtool even BEFORE open */
1058 netif_carrier_off(netdev); 1061 netif_carrier_off(netdev);
1059 1062
1060 DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n"); 1063 e_info("Intel(R) PRO/1000 Network Connection\n");
1061 1064
1062 cards_found++; 1065 cards_found++;
1063 return 0; 1066 return 0;
@@ -1157,7 +1160,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
1157 /* identify the MAC */ 1160 /* identify the MAC */
1158 1161
1159 if (e1000_set_mac_type(hw)) { 1162 if (e1000_set_mac_type(hw)) {
1160 DPRINTK(PROBE, ERR, "Unknown MAC Type\n"); 1163 e_err("Unknown MAC Type\n");
1161 return -EIO; 1164 return -EIO;
1162 } 1165 }
1163 1166
@@ -1190,7 +1193,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
1190 adapter->num_rx_queues = 1; 1193 adapter->num_rx_queues = 1;
1191 1194
1192 if (e1000_alloc_queues(adapter)) { 1195 if (e1000_alloc_queues(adapter)) {
1193 DPRINTK(PROBE, ERR, "Unable to allocate memory for queues\n"); 1196 e_err("Unable to allocate memory for queues\n");
1194 return -ENOMEM; 1197 return -ENOMEM;
1195 } 1198 }
1196 1199
@@ -1384,8 +1387,7 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
1384 size = sizeof(struct e1000_buffer) * txdr->count; 1387 size = sizeof(struct e1000_buffer) * txdr->count;
1385 txdr->buffer_info = vmalloc(size); 1388 txdr->buffer_info = vmalloc(size);
1386 if (!txdr->buffer_info) { 1389 if (!txdr->buffer_info) {
1387 DPRINTK(PROBE, ERR, 1390 e_err("Unable to allocate memory for the Tx descriptor ring\n");
1388 "Unable to allocate memory for the transmit descriptor ring\n");
1389 return -ENOMEM; 1391 return -ENOMEM;
1390 } 1392 }
1391 memset(txdr->buffer_info, 0, size); 1393 memset(txdr->buffer_info, 0, size);
@@ -1395,12 +1397,12 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
1395 txdr->size = txdr->count * sizeof(struct e1000_tx_desc); 1397 txdr->size = txdr->count * sizeof(struct e1000_tx_desc);
1396 txdr->size = ALIGN(txdr->size, 4096); 1398 txdr->size = ALIGN(txdr->size, 4096);
1397 1399
1398 txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); 1400 txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size, &txdr->dma,
1401 GFP_KERNEL);
1399 if (!txdr->desc) { 1402 if (!txdr->desc) {
1400setup_tx_desc_die: 1403setup_tx_desc_die:
1401 vfree(txdr->buffer_info); 1404 vfree(txdr->buffer_info);
1402 DPRINTK(PROBE, ERR, 1405 e_err("Unable to allocate memory for the Tx descriptor ring\n");
1403 "Unable to allocate memory for the transmit descriptor ring\n");
1404 return -ENOMEM; 1406 return -ENOMEM;
1405 } 1407 }
1406 1408
@@ -1408,29 +1410,32 @@ setup_tx_desc_die:
1408 if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) { 1410 if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) {
1409 void *olddesc = txdr->desc; 1411 void *olddesc = txdr->desc;
1410 dma_addr_t olddma = txdr->dma; 1412 dma_addr_t olddma = txdr->dma;
1411 DPRINTK(TX_ERR, ERR, "txdr align check failed: %u bytes " 1413 e_err("txdr align check failed: %u bytes at %p\n",
1412 "at %p\n", txdr->size, txdr->desc); 1414 txdr->size, txdr->desc);
1413 /* Try again, without freeing the previous */ 1415 /* Try again, without freeing the previous */
1414 txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); 1416 txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size,
1417 &txdr->dma, GFP_KERNEL);
1415 /* Failed allocation, critical failure */ 1418 /* Failed allocation, critical failure */
1416 if (!txdr->desc) { 1419 if (!txdr->desc) {
1417 pci_free_consistent(pdev, txdr->size, olddesc, olddma); 1420 dma_free_coherent(&pdev->dev, txdr->size, olddesc,
1421 olddma);
1418 goto setup_tx_desc_die; 1422 goto setup_tx_desc_die;
1419 } 1423 }
1420 1424
1421 if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) { 1425 if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) {
1422 /* give up */ 1426 /* give up */
1423 pci_free_consistent(pdev, txdr->size, txdr->desc, 1427 dma_free_coherent(&pdev->dev, txdr->size, txdr->desc,
1424 txdr->dma); 1428 txdr->dma);
1425 pci_free_consistent(pdev, txdr->size, olddesc, olddma); 1429 dma_free_coherent(&pdev->dev, txdr->size, olddesc,
1426 DPRINTK(PROBE, ERR, 1430 olddma);
1427 "Unable to allocate aligned memory " 1431 e_err("Unable to allocate aligned memory "
1428 "for the transmit descriptor ring\n"); 1432 "for the transmit descriptor ring\n");
1429 vfree(txdr->buffer_info); 1433 vfree(txdr->buffer_info);
1430 return -ENOMEM; 1434 return -ENOMEM;
1431 } else { 1435 } else {
1432 /* Free old allocation, new allocation was successful */ 1436 /* Free old allocation, new allocation was successful */
1433 pci_free_consistent(pdev, txdr->size, olddesc, olddma); 1437 dma_free_coherent(&pdev->dev, txdr->size, olddesc,
1438 olddma);
1434 } 1439 }
1435 } 1440 }
1436 memset(txdr->desc, 0, txdr->size); 1441 memset(txdr->desc, 0, txdr->size);
@@ -1456,8 +1461,7 @@ int e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
1456 for (i = 0; i < adapter->num_tx_queues; i++) { 1461 for (i = 0; i < adapter->num_tx_queues; i++) {
1457 err = e1000_setup_tx_resources(adapter, &adapter->tx_ring[i]); 1462 err = e1000_setup_tx_resources(adapter, &adapter->tx_ring[i]);
1458 if (err) { 1463 if (err) {
1459 DPRINTK(PROBE, ERR, 1464 e_err("Allocation for Tx Queue %u failed\n", i);
1460 "Allocation for Tx Queue %u failed\n", i);
1461 for (i-- ; i >= 0; i--) 1465 for (i-- ; i >= 0; i--)
1462 e1000_free_tx_resources(adapter, 1466 e1000_free_tx_resources(adapter,
1463 &adapter->tx_ring[i]); 1467 &adapter->tx_ring[i]);
@@ -1577,8 +1581,7 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
1577 size = sizeof(struct e1000_buffer) * rxdr->count; 1581 size = sizeof(struct e1000_buffer) * rxdr->count;
1578 rxdr->buffer_info = vmalloc(size); 1582 rxdr->buffer_info = vmalloc(size);
1579 if (!rxdr->buffer_info) { 1583 if (!rxdr->buffer_info) {
1580 DPRINTK(PROBE, ERR, 1584 e_err("Unable to allocate memory for the Rx descriptor ring\n");
1581 "Unable to allocate memory for the receive descriptor ring\n");
1582 return -ENOMEM; 1585 return -ENOMEM;
1583 } 1586 }
1584 memset(rxdr->buffer_info, 0, size); 1587 memset(rxdr->buffer_info, 0, size);
@@ -1590,11 +1593,11 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
1590 rxdr->size = rxdr->count * desc_len; 1593 rxdr->size = rxdr->count * desc_len;
1591 rxdr->size = ALIGN(rxdr->size, 4096); 1594 rxdr->size = ALIGN(rxdr->size, 4096);
1592 1595
1593 rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma); 1596 rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
1597 GFP_KERNEL);
1594 1598
1595 if (!rxdr->desc) { 1599 if (!rxdr->desc) {
1596 DPRINTK(PROBE, ERR, 1600 e_err("Unable to allocate memory for the Rx descriptor ring\n");
1597 "Unable to allocate memory for the receive descriptor ring\n");
1598setup_rx_desc_die: 1601setup_rx_desc_die:
1599 vfree(rxdr->buffer_info); 1602 vfree(rxdr->buffer_info);
1600 return -ENOMEM; 1603 return -ENOMEM;
@@ -1604,31 +1607,33 @@ setup_rx_desc_die:
1604 if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) { 1607 if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {
1605 void *olddesc = rxdr->desc; 1608 void *olddesc = rxdr->desc;
1606 dma_addr_t olddma = rxdr->dma; 1609 dma_addr_t olddma = rxdr->dma;
1607 DPRINTK(RX_ERR, ERR, "rxdr align check failed: %u bytes " 1610 e_err("rxdr align check failed: %u bytes at %p\n",
1608 "at %p\n", rxdr->size, rxdr->desc); 1611 rxdr->size, rxdr->desc);
1609 /* Try again, without freeing the previous */ 1612 /* Try again, without freeing the previous */
1610 rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma); 1613 rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size,
1614 &rxdr->dma, GFP_KERNEL);
1611 /* Failed allocation, critical failure */ 1615 /* Failed allocation, critical failure */
1612 if (!rxdr->desc) { 1616 if (!rxdr->desc) {
1613 pci_free_consistent(pdev, rxdr->size, olddesc, olddma); 1617 dma_free_coherent(&pdev->dev, rxdr->size, olddesc,
1614 DPRINTK(PROBE, ERR, 1618 olddma);
1615 "Unable to allocate memory " 1619 e_err("Unable to allocate memory for the Rx descriptor "
1616 "for the receive descriptor ring\n"); 1620 "ring\n");
1617 goto setup_rx_desc_die; 1621 goto setup_rx_desc_die;
1618 } 1622 }
1619 1623
1620 if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) { 1624 if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {
1621 /* give up */ 1625 /* give up */
1622 pci_free_consistent(pdev, rxdr->size, rxdr->desc, 1626 dma_free_coherent(&pdev->dev, rxdr->size, rxdr->desc,
1623 rxdr->dma); 1627 rxdr->dma);
1624 pci_free_consistent(pdev, rxdr->size, olddesc, olddma); 1628 dma_free_coherent(&pdev->dev, rxdr->size, olddesc,
1625 DPRINTK(PROBE, ERR, 1629 olddma);
1626 "Unable to allocate aligned memory " 1630 e_err("Unable to allocate aligned memory for the Rx "
1627 "for the receive descriptor ring\n"); 1631 "descriptor ring\n");
1628 goto setup_rx_desc_die; 1632 goto setup_rx_desc_die;
1629 } else { 1633 } else {
1630 /* Free old allocation, new allocation was successful */ 1634 /* Free old allocation, new allocation was successful */
1631 pci_free_consistent(pdev, rxdr->size, olddesc, olddma); 1635 dma_free_coherent(&pdev->dev, rxdr->size, olddesc,
1636 olddma);
1632 } 1637 }
1633 } 1638 }
1634 memset(rxdr->desc, 0, rxdr->size); 1639 memset(rxdr->desc, 0, rxdr->size);
@@ -1655,8 +1660,7 @@ int e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
1655 for (i = 0; i < adapter->num_rx_queues; i++) { 1660 for (i = 0; i < adapter->num_rx_queues; i++) {
1656 err = e1000_setup_rx_resources(adapter, &adapter->rx_ring[i]); 1661 err = e1000_setup_rx_resources(adapter, &adapter->rx_ring[i]);
1657 if (err) { 1662 if (err) {
1658 DPRINTK(PROBE, ERR, 1663 e_err("Allocation for Rx Queue %u failed\n", i);
1659 "Allocation for Rx Queue %u failed\n", i);
1660 for (i-- ; i >= 0; i--) 1664 for (i-- ; i >= 0; i--)
1661 e1000_free_rx_resources(adapter, 1665 e1000_free_rx_resources(adapter,
1662 &adapter->rx_ring[i]); 1666 &adapter->rx_ring[i]);
@@ -1804,7 +1808,8 @@ static void e1000_free_tx_resources(struct e1000_adapter *adapter,
1804 vfree(tx_ring->buffer_info); 1808 vfree(tx_ring->buffer_info);
1805 tx_ring->buffer_info = NULL; 1809 tx_ring->buffer_info = NULL;
1806 1810
1807 pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma); 1811 dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc,
1812 tx_ring->dma);
1808 1813
1809 tx_ring->desc = NULL; 1814 tx_ring->desc = NULL;
1810} 1815}
@@ -1829,12 +1834,12 @@ static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
1829{ 1834{
1830 if (buffer_info->dma) { 1835 if (buffer_info->dma) {
1831 if (buffer_info->mapped_as_page) 1836 if (buffer_info->mapped_as_page)
1832 pci_unmap_page(adapter->pdev, buffer_info->dma, 1837 dma_unmap_page(&adapter->pdev->dev, buffer_info->dma,
1833 buffer_info->length, PCI_DMA_TODEVICE); 1838 buffer_info->length, DMA_TO_DEVICE);
1834 else 1839 else
1835 pci_unmap_single(adapter->pdev, buffer_info->dma, 1840 dma_unmap_single(&adapter->pdev->dev, buffer_info->dma,
1836 buffer_info->length, 1841 buffer_info->length,
1837 PCI_DMA_TODEVICE); 1842 DMA_TO_DEVICE);
1838 buffer_info->dma = 0; 1843 buffer_info->dma = 0;
1839 } 1844 }
1840 if (buffer_info->skb) { 1845 if (buffer_info->skb) {
@@ -1912,7 +1917,8 @@ static void e1000_free_rx_resources(struct e1000_adapter *adapter,
1912 vfree(rx_ring->buffer_info); 1917 vfree(rx_ring->buffer_info);
1913 rx_ring->buffer_info = NULL; 1918 rx_ring->buffer_info = NULL;
1914 1919
1915 pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma); 1920 dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc,
1921 rx_ring->dma);
1916 1922
1917 rx_ring->desc = NULL; 1923 rx_ring->desc = NULL;
1918} 1924}
@@ -1952,14 +1958,14 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
1952 buffer_info = &rx_ring->buffer_info[i]; 1958 buffer_info = &rx_ring->buffer_info[i];
1953 if (buffer_info->dma && 1959 if (buffer_info->dma &&
1954 adapter->clean_rx == e1000_clean_rx_irq) { 1960 adapter->clean_rx == e1000_clean_rx_irq) {
1955 pci_unmap_single(pdev, buffer_info->dma, 1961 dma_unmap_single(&pdev->dev, buffer_info->dma,
1956 buffer_info->length, 1962 buffer_info->length,
1957 PCI_DMA_FROMDEVICE); 1963 DMA_FROM_DEVICE);
1958 } else if (buffer_info->dma && 1964 } else if (buffer_info->dma &&
1959 adapter->clean_rx == e1000_clean_jumbo_rx_irq) { 1965 adapter->clean_rx == e1000_clean_jumbo_rx_irq) {
1960 pci_unmap_page(pdev, buffer_info->dma, 1966 dma_unmap_page(&pdev->dev, buffer_info->dma,
1961 buffer_info->length, 1967 buffer_info->length,
1962 PCI_DMA_FROMDEVICE); 1968 DMA_FROM_DEVICE);
1963 } 1969 }
1964 1970
1965 buffer_info->dma = 0; 1971 buffer_info->dma = 0;
@@ -2098,7 +2104,6 @@ static void e1000_set_rx_mode(struct net_device *netdev)
2098 struct e1000_hw *hw = &adapter->hw; 2104 struct e1000_hw *hw = &adapter->hw;
2099 struct netdev_hw_addr *ha; 2105 struct netdev_hw_addr *ha;
2100 bool use_uc = false; 2106 bool use_uc = false;
2101 struct dev_addr_list *mc_ptr;
2102 u32 rctl; 2107 u32 rctl;
2103 u32 hash_value; 2108 u32 hash_value;
2104 int i, rar_entries = E1000_RAR_ENTRIES; 2109 int i, rar_entries = E1000_RAR_ENTRIES;
@@ -2106,7 +2111,7 @@ static void e1000_set_rx_mode(struct net_device *netdev)
2106 u32 *mcarray = kcalloc(mta_reg_count, sizeof(u32), GFP_ATOMIC); 2111 u32 *mcarray = kcalloc(mta_reg_count, sizeof(u32), GFP_ATOMIC);
2107 2112
2108 if (!mcarray) { 2113 if (!mcarray) {
2109 DPRINTK(PROBE, ERR, "memory allocation failed\n"); 2114 e_err("memory allocation failed\n");
2110 return; 2115 return;
2111 } 2116 }
2112 2117
@@ -2156,19 +2161,17 @@ static void e1000_set_rx_mode(struct net_device *netdev)
2156 e1000_rar_set(hw, ha->addr, i++); 2161 e1000_rar_set(hw, ha->addr, i++);
2157 } 2162 }
2158 2163
2159 WARN_ON(i == rar_entries); 2164 netdev_for_each_mc_addr(ha, netdev) {
2160
2161 netdev_for_each_mc_addr(mc_ptr, netdev) {
2162 if (i == rar_entries) { 2165 if (i == rar_entries) {
2163 /* load any remaining addresses into the hash table */ 2166 /* load any remaining addresses into the hash table */
2164 u32 hash_reg, hash_bit, mta; 2167 u32 hash_reg, hash_bit, mta;
2165 hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr); 2168 hash_value = e1000_hash_mc_addr(hw, ha->addr);
2166 hash_reg = (hash_value >> 5) & 0x7F; 2169 hash_reg = (hash_value >> 5) & 0x7F;
2167 hash_bit = hash_value & 0x1F; 2170 hash_bit = hash_value & 0x1F;
2168 mta = (1 << hash_bit); 2171 mta = (1 << hash_bit);
2169 mcarray[hash_reg] |= mta; 2172 mcarray[hash_reg] |= mta;
2170 } else { 2173 } else {
2171 e1000_rar_set(hw, mc_ptr->da_addr, i++); 2174 e1000_rar_set(hw, ha->addr, i++);
2172 } 2175 }
2173 } 2176 }
2174 2177
@@ -2302,16 +2305,16 @@ static void e1000_watchdog(unsigned long data)
2302 &adapter->link_duplex); 2305 &adapter->link_duplex);
2303 2306
2304 ctrl = er32(CTRL); 2307 ctrl = er32(CTRL);
2305 printk(KERN_INFO "e1000: %s NIC Link is Up %d Mbps %s, " 2308 pr_info("%s NIC Link is Up %d Mbps %s, "
2306 "Flow Control: %s\n", 2309 "Flow Control: %s\n",
2307 netdev->name, 2310 netdev->name,
2308 adapter->link_speed, 2311 adapter->link_speed,
2309 adapter->link_duplex == FULL_DUPLEX ? 2312 adapter->link_duplex == FULL_DUPLEX ?
2310 "Full Duplex" : "Half Duplex", 2313 "Full Duplex" : "Half Duplex",
2311 ((ctrl & E1000_CTRL_TFCE) && (ctrl & 2314 ((ctrl & E1000_CTRL_TFCE) && (ctrl &
2312 E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl & 2315 E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
2313 E1000_CTRL_RFCE) ? "RX" : ((ctrl & 2316 E1000_CTRL_RFCE) ? "RX" : ((ctrl &
2314 E1000_CTRL_TFCE) ? "TX" : "None" ))); 2317 E1000_CTRL_TFCE) ? "TX" : "None")));
2315 2318
2316 /* adjust timeout factor according to speed/duplex */ 2319 /* adjust timeout factor according to speed/duplex */
2317 adapter->tx_timeout_factor = 1; 2320 adapter->tx_timeout_factor = 1;
@@ -2341,8 +2344,8 @@ static void e1000_watchdog(unsigned long data)
2341 if (netif_carrier_ok(netdev)) { 2344 if (netif_carrier_ok(netdev)) {
2342 adapter->link_speed = 0; 2345 adapter->link_speed = 0;
2343 adapter->link_duplex = 0; 2346 adapter->link_duplex = 0;
2344 printk(KERN_INFO "e1000: %s NIC Link is Down\n", 2347 pr_info("%s NIC Link is Down\n",
2345 netdev->name); 2348 netdev->name);
2346 netif_carrier_off(netdev); 2349 netif_carrier_off(netdev);
2347 2350
2348 if (!test_bit(__E1000_DOWN, &adapter->flags)) 2351 if (!test_bit(__E1000_DOWN, &adapter->flags))
@@ -2381,6 +2384,22 @@ link_up:
2381 } 2384 }
2382 } 2385 }
2383 2386
2387 /* Simple mode for Interrupt Throttle Rate (ITR) */
2388 if (hw->mac_type >= e1000_82540 && adapter->itr_setting == 4) {
2389 /*
2390 * Symmetric Tx/Rx gets a reduced ITR=2000;
2391 * Total asymmetrical Tx or Rx gets ITR=8000;
2392 * everyone else is between 2000-8000.
2393 */
2394 u32 goc = (adapter->gotcl + adapter->gorcl) / 10000;
2395 u32 dif = (adapter->gotcl > adapter->gorcl ?
2396 adapter->gotcl - adapter->gorcl :
2397 adapter->gorcl - adapter->gotcl) / 10000;
2398 u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000;
2399
2400 ew32(ITR, 1000000000 / (itr * 256));
2401 }
2402
2384 /* Cause software interrupt to ensure rx ring is cleaned */ 2403 /* Cause software interrupt to ensure rx ring is cleaned */
2385 ew32(ICS, E1000_ICS_RXDMT0); 2404 ew32(ICS, E1000_ICS_RXDMT0);
2386 2405
@@ -2525,8 +2544,6 @@ set_itr_now:
2525 adapter->itr = new_itr; 2544 adapter->itr = new_itr;
2526 ew32(ITR, 1000000000 / (new_itr * 256)); 2545 ew32(ITR, 1000000000 / (new_itr * 256));
2527 } 2546 }
2528
2529 return;
2530} 2547}
2531 2548
2532#define E1000_TX_FLAGS_CSUM 0x00000001 2549#define E1000_TX_FLAGS_CSUM 0x00000001
@@ -2632,8 +2649,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
2632 break; 2649 break;
2633 default: 2650 default:
2634 if (unlikely(net_ratelimit())) 2651 if (unlikely(net_ratelimit()))
2635 DPRINTK(DRV, WARNING, 2652 e_warn("checksum_partial proto=%x!\n", skb->protocol);
2636 "checksum_partial proto=%x!\n", skb->protocol);
2637 break; 2653 break;
2638 } 2654 }
2639 2655
@@ -2715,9 +2731,10 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
2715 /* set time_stamp *before* dma to help avoid a possible race */ 2731 /* set time_stamp *before* dma to help avoid a possible race */
2716 buffer_info->time_stamp = jiffies; 2732 buffer_info->time_stamp = jiffies;
2717 buffer_info->mapped_as_page = false; 2733 buffer_info->mapped_as_page = false;
2718 buffer_info->dma = pci_map_single(pdev, skb->data + offset, 2734 buffer_info->dma = dma_map_single(&pdev->dev,
2719 size, PCI_DMA_TODEVICE); 2735 skb->data + offset,
2720 if (pci_dma_mapping_error(pdev, buffer_info->dma)) 2736 size, DMA_TO_DEVICE);
2737 if (dma_mapping_error(&pdev->dev, buffer_info->dma))
2721 goto dma_error; 2738 goto dma_error;
2722 buffer_info->next_to_watch = i; 2739 buffer_info->next_to_watch = i;
2723 2740
@@ -2761,10 +2778,10 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
2761 buffer_info->length = size; 2778 buffer_info->length = size;
2762 buffer_info->time_stamp = jiffies; 2779 buffer_info->time_stamp = jiffies;
2763 buffer_info->mapped_as_page = true; 2780 buffer_info->mapped_as_page = true;
2764 buffer_info->dma = pci_map_page(pdev, frag->page, 2781 buffer_info->dma = dma_map_page(&pdev->dev, frag->page,
2765 offset, size, 2782 offset, size,
2766 PCI_DMA_TODEVICE); 2783 DMA_TO_DEVICE);
2767 if (pci_dma_mapping_error(pdev, buffer_info->dma)) 2784 if (dma_mapping_error(&pdev->dev, buffer_info->dma))
2768 goto dma_error; 2785 goto dma_error;
2769 buffer_info->next_to_watch = i; 2786 buffer_info->next_to_watch = i;
2770 2787
@@ -2930,7 +2947,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
2930 unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD; 2947 unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD;
2931 unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; 2948 unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
2932 unsigned int tx_flags = 0; 2949 unsigned int tx_flags = 0;
2933 unsigned int len = skb->len - skb->data_len; 2950 unsigned int len = skb_headlen(skb);
2934 unsigned int nr_frags; 2951 unsigned int nr_frags;
2935 unsigned int mss; 2952 unsigned int mss;
2936 int count = 0; 2953 int count = 0;
@@ -2976,12 +2993,11 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
2976 /* fall through */ 2993 /* fall through */
2977 pull_size = min((unsigned int)4, skb->data_len); 2994 pull_size = min((unsigned int)4, skb->data_len);
2978 if (!__pskb_pull_tail(skb, pull_size)) { 2995 if (!__pskb_pull_tail(skb, pull_size)) {
2979 DPRINTK(DRV, ERR, 2996 e_err("__pskb_pull_tail failed.\n");
2980 "__pskb_pull_tail failed.\n");
2981 dev_kfree_skb_any(skb); 2997 dev_kfree_skb_any(skb);
2982 return NETDEV_TX_OK; 2998 return NETDEV_TX_OK;
2983 } 2999 }
2984 len = skb->len - skb->data_len; 3000 len = skb_headlen(skb);
2985 break; 3001 break;
2986 default: 3002 default:
2987 /* do nothing */ 3003 /* do nothing */
@@ -3125,7 +3141,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3125 3141
3126 if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || 3142 if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
3127 (max_frame > MAX_JUMBO_FRAME_SIZE)) { 3143 (max_frame > MAX_JUMBO_FRAME_SIZE)) {
3128 DPRINTK(PROBE, ERR, "Invalid MTU setting\n"); 3144 e_err("Invalid MTU setting\n");
3129 return -EINVAL; 3145 return -EINVAL;
3130 } 3146 }
3131 3147
@@ -3133,7 +3149,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3133 switch (hw->mac_type) { 3149 switch (hw->mac_type) {
3134 case e1000_undefined ... e1000_82542_rev2_1: 3150 case e1000_undefined ... e1000_82542_rev2_1:
3135 if (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)) { 3151 if (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)) {
3136 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n"); 3152 e_err("Jumbo Frames not supported.\n");
3137 return -EINVAL; 3153 return -EINVAL;
3138 } 3154 }
3139 break; 3155 break;
@@ -3171,8 +3187,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3171 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))) 3187 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
3172 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE; 3188 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
3173 3189
3174 printk(KERN_INFO "e1000: %s changing MTU from %d to %d\n", 3190 pr_info("%s changing MTU from %d to %d\n",
3175 netdev->name, netdev->mtu, new_mtu); 3191 netdev->name, netdev->mtu, new_mtu);
3176 netdev->mtu = new_mtu; 3192 netdev->mtu = new_mtu;
3177 3193
3178 if (netif_running(netdev)) 3194 if (netif_running(netdev))
@@ -3485,17 +3501,17 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
3485 !(er32(STATUS) & E1000_STATUS_TXOFF)) { 3501 !(er32(STATUS) & E1000_STATUS_TXOFF)) {
3486 3502
3487 /* detected Tx unit hang */ 3503 /* detected Tx unit hang */
3488 DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" 3504 e_err("Detected Tx Unit Hang\n"
3489 " Tx Queue <%lu>\n" 3505 " Tx Queue <%lu>\n"
3490 " TDH <%x>\n" 3506 " TDH <%x>\n"
3491 " TDT <%x>\n" 3507 " TDT <%x>\n"
3492 " next_to_use <%x>\n" 3508 " next_to_use <%x>\n"
3493 " next_to_clean <%x>\n" 3509 " next_to_clean <%x>\n"
3494 "buffer_info[next_to_clean]\n" 3510 "buffer_info[next_to_clean]\n"
3495 " time_stamp <%lx>\n" 3511 " time_stamp <%lx>\n"
3496 " next_to_watch <%x>\n" 3512 " next_to_watch <%x>\n"
3497 " jiffies <%lx>\n" 3513 " jiffies <%lx>\n"
3498 " next_to_watch.status <%x>\n", 3514 " next_to_watch.status <%x>\n",
3499 (unsigned long)((tx_ring - adapter->tx_ring) / 3515 (unsigned long)((tx_ring - adapter->tx_ring) /
3500 sizeof(struct e1000_tx_ring)), 3516 sizeof(struct e1000_tx_ring)),
3501 readl(hw->hw_addr + tx_ring->tdh), 3517 readl(hw->hw_addr + tx_ring->tdh),
@@ -3635,8 +3651,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
3635 3651
3636 cleaned = true; 3652 cleaned = true;
3637 cleaned_count++; 3653 cleaned_count++;
3638 pci_unmap_page(pdev, buffer_info->dma, buffer_info->length, 3654 dma_unmap_page(&pdev->dev, buffer_info->dma,
3639 PCI_DMA_FROMDEVICE); 3655 buffer_info->length, DMA_FROM_DEVICE);
3640 buffer_info->dma = 0; 3656 buffer_info->dma = 0;
3641 3657
3642 length = le16_to_cpu(rx_desc->length); 3658 length = le16_to_cpu(rx_desc->length);
@@ -3734,7 +3750,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
3734 3750
3735 /* eth type trans needs skb->data to point to something */ 3751 /* eth type trans needs skb->data to point to something */
3736 if (!pskb_may_pull(skb, ETH_HLEN)) { 3752 if (!pskb_may_pull(skb, ETH_HLEN)) {
3737 DPRINTK(DRV, ERR, "pskb_may_pull failed.\n"); 3753 e_err("pskb_may_pull failed.\n");
3738 dev_kfree_skb(skb); 3754 dev_kfree_skb(skb);
3739 goto next_desc; 3755 goto next_desc;
3740 } 3756 }
@@ -3769,6 +3785,31 @@ next_desc:
3769 return cleaned; 3785 return cleaned;
3770} 3786}
3771 3787
3788/*
3789 * this should improve performance for small packets with large amounts
3790 * of reassembly being done in the stack
3791 */
3792static void e1000_check_copybreak(struct net_device *netdev,
3793 struct e1000_buffer *buffer_info,
3794 u32 length, struct sk_buff **skb)
3795{
3796 struct sk_buff *new_skb;
3797
3798 if (length > copybreak)
3799 return;
3800
3801 new_skb = netdev_alloc_skb_ip_align(netdev, length);
3802 if (!new_skb)
3803 return;
3804
3805 skb_copy_to_linear_data_offset(new_skb, -NET_IP_ALIGN,
3806 (*skb)->data - NET_IP_ALIGN,
3807 length + NET_IP_ALIGN);
3808 /* save the skb in buffer_info as good */
3809 buffer_info->skb = *skb;
3810 *skb = new_skb;
3811}
3812
3772/** 3813/**
3773 * e1000_clean_rx_irq - Send received data up the network stack; legacy 3814 * e1000_clean_rx_irq - Send received data up the network stack; legacy
3774 * @adapter: board private structure 3815 * @adapter: board private structure
@@ -3818,8 +3859,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
3818 3859
3819 cleaned = true; 3860 cleaned = true;
3820 cleaned_count++; 3861 cleaned_count++;
3821 pci_unmap_single(pdev, buffer_info->dma, buffer_info->length, 3862 dma_unmap_single(&pdev->dev, buffer_info->dma,
3822 PCI_DMA_FROMDEVICE); 3863 buffer_info->length, DMA_FROM_DEVICE);
3823 buffer_info->dma = 0; 3864 buffer_info->dma = 0;
3824 3865
3825 length = le16_to_cpu(rx_desc->length); 3866 length = le16_to_cpu(rx_desc->length);
@@ -3834,8 +3875,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
3834 3875
3835 if (adapter->discarding) { 3876 if (adapter->discarding) {
3836 /* All receives must fit into a single buffer */ 3877 /* All receives must fit into a single buffer */
3837 E1000_DBG("%s: Receive packet consumed multiple" 3878 e_info("Receive packet consumed multiple buffers\n");
3838 " buffers\n", netdev->name);
3839 /* recycle */ 3879 /* recycle */
3840 buffer_info->skb = skb; 3880 buffer_info->skb = skb;
3841 if (status & E1000_RXD_STAT_EOP) 3881 if (status & E1000_RXD_STAT_EOP)
@@ -3868,26 +3908,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
3868 total_rx_bytes += length; 3908 total_rx_bytes += length;
3869 total_rx_packets++; 3909 total_rx_packets++;
3870 3910
3871 /* code added for copybreak, this should improve 3911 e1000_check_copybreak(netdev, buffer_info, length, &skb);
3872 * performance for small packets with large amounts 3912
3873 * of reassembly being done in the stack */
3874 if (length < copybreak) {
3875 struct sk_buff *new_skb =
3876 netdev_alloc_skb_ip_align(netdev, length);
3877 if (new_skb) {
3878 skb_copy_to_linear_data_offset(new_skb,
3879 -NET_IP_ALIGN,
3880 (skb->data -
3881 NET_IP_ALIGN),
3882 (length +
3883 NET_IP_ALIGN));
3884 /* save the skb in buffer_info as good */
3885 buffer_info->skb = skb;
3886 skb = new_skb;
3887 }
3888 /* else just continue with the old one */
3889 }
3890 /* end copybreak code */
3891 skb_put(skb, length); 3913 skb_put(skb, length);
3892 3914
3893 /* Receive Checksum Offload */ 3915 /* Receive Checksum Offload */
@@ -3965,8 +3987,8 @@ e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
3965 /* Fix for errata 23, can't cross 64kB boundary */ 3987 /* Fix for errata 23, can't cross 64kB boundary */
3966 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) { 3988 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
3967 struct sk_buff *oldskb = skb; 3989 struct sk_buff *oldskb = skb;
3968 DPRINTK(PROBE, ERR, "skb align check failed: %u bytes " 3990 e_err("skb align check failed: %u bytes at %p\n",
3969 "at %p\n", bufsz, skb->data); 3991 bufsz, skb->data);
3970 /* Try again, without freeing the previous */ 3992 /* Try again, without freeing the previous */
3971 skb = netdev_alloc_skb_ip_align(netdev, bufsz); 3993 skb = netdev_alloc_skb_ip_align(netdev, bufsz);
3972 /* Failed allocation, critical failure */ 3994 /* Failed allocation, critical failure */
@@ -3999,11 +4021,11 @@ check_page:
3999 } 4021 }
4000 4022
4001 if (!buffer_info->dma) { 4023 if (!buffer_info->dma) {
4002 buffer_info->dma = pci_map_page(pdev, 4024 buffer_info->dma = dma_map_page(&pdev->dev,
4003 buffer_info->page, 0, 4025 buffer_info->page, 0,
4004 buffer_info->length, 4026 buffer_info->length,
4005 PCI_DMA_FROMDEVICE); 4027 DMA_FROM_DEVICE);
4006 if (pci_dma_mapping_error(pdev, buffer_info->dma)) { 4028 if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
4007 put_page(buffer_info->page); 4029 put_page(buffer_info->page);
4008 dev_kfree_skb(skb); 4030 dev_kfree_skb(skb);
4009 buffer_info->page = NULL; 4031 buffer_info->page = NULL;
@@ -4074,8 +4096,8 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
4074 /* Fix for errata 23, can't cross 64kB boundary */ 4096 /* Fix for errata 23, can't cross 64kB boundary */
4075 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) { 4097 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
4076 struct sk_buff *oldskb = skb; 4098 struct sk_buff *oldskb = skb;
4077 DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes " 4099 e_err("skb align check failed: %u bytes at %p\n",
4078 "at %p\n", bufsz, skb->data); 4100 bufsz, skb->data);
4079 /* Try again, without freeing the previous */ 4101 /* Try again, without freeing the previous */
4080 skb = netdev_alloc_skb_ip_align(netdev, bufsz); 4102 skb = netdev_alloc_skb_ip_align(netdev, bufsz);
4081 /* Failed allocation, critical failure */ 4103 /* Failed allocation, critical failure */
@@ -4099,11 +4121,11 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
4099 buffer_info->skb = skb; 4121 buffer_info->skb = skb;
4100 buffer_info->length = adapter->rx_buffer_len; 4122 buffer_info->length = adapter->rx_buffer_len;
4101map_skb: 4123map_skb:
4102 buffer_info->dma = pci_map_single(pdev, 4124 buffer_info->dma = dma_map_single(&pdev->dev,
4103 skb->data, 4125 skb->data,
4104 buffer_info->length, 4126 buffer_info->length,
4105 PCI_DMA_FROMDEVICE); 4127 DMA_FROM_DEVICE);
4106 if (pci_dma_mapping_error(pdev, buffer_info->dma)) { 4128 if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
4107 dev_kfree_skb(skb); 4129 dev_kfree_skb(skb);
4108 buffer_info->skb = NULL; 4130 buffer_info->skb = NULL;
4109 buffer_info->dma = 0; 4131 buffer_info->dma = 0;
@@ -4120,16 +4142,15 @@ map_skb:
4120 if (!e1000_check_64k_bound(adapter, 4142 if (!e1000_check_64k_bound(adapter,
4121 (void *)(unsigned long)buffer_info->dma, 4143 (void *)(unsigned long)buffer_info->dma,
4122 adapter->rx_buffer_len)) { 4144 adapter->rx_buffer_len)) {
4123 DPRINTK(RX_ERR, ERR, 4145 e_err("dma align check failed: %u bytes at %p\n",
4124 "dma align check failed: %u bytes at %p\n", 4146 adapter->rx_buffer_len,
4125 adapter->rx_buffer_len, 4147 (void *)(unsigned long)buffer_info->dma);
4126 (void *)(unsigned long)buffer_info->dma);
4127 dev_kfree_skb(skb); 4148 dev_kfree_skb(skb);
4128 buffer_info->skb = NULL; 4149 buffer_info->skb = NULL;
4129 4150
4130 pci_unmap_single(pdev, buffer_info->dma, 4151 dma_unmap_single(&pdev->dev, buffer_info->dma,
4131 adapter->rx_buffer_len, 4152 adapter->rx_buffer_len,
4132 PCI_DMA_FROMDEVICE); 4153 DMA_FROM_DEVICE);
4133 buffer_info->dma = 0; 4154 buffer_info->dma = 0;
4134 4155
4135 adapter->alloc_rx_buff_failed++; 4156 adapter->alloc_rx_buff_failed++;
@@ -4335,7 +4356,7 @@ void e1000_pci_set_mwi(struct e1000_hw *hw)
4335 int ret_val = pci_set_mwi(adapter->pdev); 4356 int ret_val = pci_set_mwi(adapter->pdev);
4336 4357
4337 if (ret_val) 4358 if (ret_val)
4338 DPRINTK(PROBE, ERR, "Error in setting MWI\n"); 4359 e_err("Error in setting MWI\n");
4339} 4360}
4340 4361
4341void e1000_pci_clear_mwi(struct e1000_hw *hw) 4362void e1000_pci_clear_mwi(struct e1000_hw *hw)
@@ -4466,7 +4487,7 @@ int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
4466 /* Fiber NICs only allow 1000 gbps Full duplex */ 4487 /* Fiber NICs only allow 1000 gbps Full duplex */
4467 if ((hw->media_type == e1000_media_type_fiber) && 4488 if ((hw->media_type == e1000_media_type_fiber) &&
4468 spddplx != (SPEED_1000 + DUPLEX_FULL)) { 4489 spddplx != (SPEED_1000 + DUPLEX_FULL)) {
4469 DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n"); 4490 e_err("Unsupported Speed/Duplex configuration\n");
4470 return -EINVAL; 4491 return -EINVAL;
4471 } 4492 }
4472 4493
@@ -4489,7 +4510,7 @@ int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
4489 break; 4510 break;
4490 case SPEED_1000 + DUPLEX_HALF: /* not supported */ 4511 case SPEED_1000 + DUPLEX_HALF: /* not supported */
4491 default: 4512 default:
4492 DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n"); 4513 e_err("Unsupported Speed/Duplex configuration\n");
4493 return -EINVAL; 4514 return -EINVAL;
4494 } 4515 }
4495 return 0; 4516 return 0;
@@ -4612,7 +4633,7 @@ static int e1000_resume(struct pci_dev *pdev)
4612 else 4633 else
4613 err = pci_enable_device_mem(pdev); 4634 err = pci_enable_device_mem(pdev);
4614 if (err) { 4635 if (err) {
4615 printk(KERN_ERR "e1000: Cannot enable PCI device from suspend\n"); 4636 pr_err("Cannot enable PCI device from suspend\n");
4616 return err; 4637 return err;
4617 } 4638 }
4618 pci_set_master(pdev); 4639 pci_set_master(pdev);
@@ -4715,7 +4736,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
4715 else 4736 else
4716 err = pci_enable_device_mem(pdev); 4737 err = pci_enable_device_mem(pdev);
4717 if (err) { 4738 if (err) {
4718 printk(KERN_ERR "e1000: Cannot re-enable PCI device after reset.\n"); 4739 pr_err("Cannot re-enable PCI device after reset.\n");
4719 return PCI_ERS_RESULT_DISCONNECT; 4740 return PCI_ERS_RESULT_DISCONNECT;
4720 } 4741 }
4721 pci_set_master(pdev); 4742 pci_set_master(pdev);
@@ -4746,7 +4767,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
4746 4767
4747 if (netif_running(netdev)) { 4768 if (netif_running(netdev)) {
4748 if (e1000_up(adapter)) { 4769 if (e1000_up(adapter)) {
4749 printk("e1000: can't bring device back up after reset\n"); 4770 pr_info("can't bring device back up after reset\n");
4750 return; 4771 return;
4751 } 4772 }
4752 } 4773 }
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index d9298522f5ae..edd1c75aa895 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -41,20 +41,6 @@
41#include <linux/interrupt.h> 41#include <linux/interrupt.h>
42#include <linux/sched.h> 42#include <linux/sched.h>
43 43
44#ifdef DBG
45#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
46#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
47#else
48#define DEBUGOUT(S)
49#define DEBUGOUT1(S, A...)
50#endif
51
52#define DEBUGFUNC(F) DEBUGOUT(F "\n")
53#define DEBUGOUT2 DEBUGOUT1
54#define DEBUGOUT3 DEBUGOUT2
55#define DEBUGOUT7 DEBUGOUT3
56
57
58#define er32(reg) \ 44#define er32(reg) \
59 (readl(hw->hw_addr + ((hw->mac_type >= e1000_82543) \ 45 (readl(hw->hw_addr + ((hw->mac_type >= e1000_82543) \
60 ? E1000_##reg : E1000_82542_##reg))) 46 ? E1000_##reg : E1000_82542_##reg)))
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 38d2741ccae9..10d8d98bb797 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -188,14 +188,6 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
188 */ 188 */
189E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down"); 189E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
190 190
191/* Enable Kumeran Lock Loss workaround
192 *
193 * Valid Range: 0, 1
194 *
195 * Default Value: 1 (enabled)
196 */
197E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
198
199struct e1000_option { 191struct e1000_option {
200 enum { enable_option, range_option, list_option } type; 192 enum { enable_option, range_option, list_option } type;
201 const char *name; 193 const char *name;
@@ -226,17 +218,16 @@ static int __devinit e1000_validate_option(unsigned int *value,
226 case enable_option: 218 case enable_option:
227 switch (*value) { 219 switch (*value) {
228 case OPTION_ENABLED: 220 case OPTION_ENABLED:
229 DPRINTK(PROBE, INFO, "%s Enabled\n", opt->name); 221 e_dev_info("%s Enabled\n", opt->name);
230 return 0; 222 return 0;
231 case OPTION_DISABLED: 223 case OPTION_DISABLED:
232 DPRINTK(PROBE, INFO, "%s Disabled\n", opt->name); 224 e_dev_info("%s Disabled\n", opt->name);
233 return 0; 225 return 0;
234 } 226 }
235 break; 227 break;
236 case range_option: 228 case range_option:
237 if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { 229 if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
238 DPRINTK(PROBE, INFO, 230 e_dev_info("%s set to %i\n", opt->name, *value);
239 "%s set to %i\n", opt->name, *value);
240 return 0; 231 return 0;
241 } 232 }
242 break; 233 break;
@@ -248,7 +239,7 @@ static int __devinit e1000_validate_option(unsigned int *value,
248 ent = &opt->arg.l.p[i]; 239 ent = &opt->arg.l.p[i];
249 if (*value == ent->i) { 240 if (*value == ent->i) {
250 if (ent->str[0] != '\0') 241 if (ent->str[0] != '\0')
251 DPRINTK(PROBE, INFO, "%s\n", ent->str); 242 e_dev_info("%s\n", ent->str);
252 return 0; 243 return 0;
253 } 244 }
254 } 245 }
@@ -258,7 +249,7 @@ static int __devinit e1000_validate_option(unsigned int *value,
258 BUG(); 249 BUG();
259 } 250 }
260 251
261 DPRINTK(PROBE, INFO, "Invalid %s value specified (%i) %s\n", 252 e_dev_info("Invalid %s value specified (%i) %s\n",
262 opt->name, *value, opt->err); 253 opt->name, *value, opt->err);
263 *value = opt->def; 254 *value = opt->def;
264 return -1; 255 return -1;
@@ -283,9 +274,8 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
283 int bd = adapter->bd_number; 274 int bd = adapter->bd_number;
284 275
285 if (bd >= E1000_MAX_NIC) { 276 if (bd >= E1000_MAX_NIC) {
286 DPRINTK(PROBE, NOTICE, 277 e_dev_warn("Warning: no configuration for board #%i "
287 "Warning: no configuration for board #%i\n", bd); 278 "using defaults for all values\n", bd);
288 DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
289 } 279 }
290 280
291 { /* Transmit Descriptor Count */ 281 { /* Transmit Descriptor Count */
@@ -472,27 +462,31 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
472 adapter->itr = InterruptThrottleRate[bd]; 462 adapter->itr = InterruptThrottleRate[bd];
473 switch (adapter->itr) { 463 switch (adapter->itr) {
474 case 0: 464 case 0:
475 DPRINTK(PROBE, INFO, "%s turned off\n", 465 e_dev_info("%s turned off\n", opt.name);
476 opt.name);
477 break; 466 break;
478 case 1: 467 case 1:
479 DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", 468 e_dev_info("%s set to dynamic mode\n",
480 opt.name); 469 opt.name);
481 adapter->itr_setting = adapter->itr; 470 adapter->itr_setting = adapter->itr;
482 adapter->itr = 20000; 471 adapter->itr = 20000;
483 break; 472 break;
484 case 3: 473 case 3:
485 DPRINTK(PROBE, INFO, 474 e_dev_info("%s set to dynamic conservative "
486 "%s set to dynamic conservative mode\n", 475 "mode\n", opt.name);
487 opt.name);
488 adapter->itr_setting = adapter->itr; 476 adapter->itr_setting = adapter->itr;
489 adapter->itr = 20000; 477 adapter->itr = 20000;
490 break; 478 break;
479 case 4:
480 e_dev_info("%s set to simplified "
481 "(2000-8000) ints mode\n", opt.name);
482 adapter->itr_setting = adapter->itr;
483 break;
491 default: 484 default:
492 e1000_validate_option(&adapter->itr, &opt, 485 e1000_validate_option(&adapter->itr, &opt,
493 adapter); 486 adapter);
494 /* save the setting, because the dynamic bits change itr */ 487 /* save the setting, because the dynamic bits
495 /* clear the lower two bits because they are 488 * change itr.
489 * clear the lower two bits because they are
496 * used as control */ 490 * used as control */
497 adapter->itr_setting = adapter->itr & ~3; 491 adapter->itr_setting = adapter->itr & ~3;
498 break; 492 break;
@@ -543,19 +537,18 @@ static void __devinit e1000_check_fiber_options(struct e1000_adapter *adapter)
543{ 537{
544 int bd = adapter->bd_number; 538 int bd = adapter->bd_number;
545 if (num_Speed > bd) { 539 if (num_Speed > bd) {
546 DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, " 540 e_dev_info("Speed not valid for fiber adapters, parameter "
547 "parameter ignored\n"); 541 "ignored\n");
548 } 542 }
549 543
550 if (num_Duplex > bd) { 544 if (num_Duplex > bd) {
551 DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, " 545 e_dev_info("Duplex not valid for fiber adapters, parameter "
552 "parameter ignored\n"); 546 "ignored\n");
553 } 547 }
554 548
555 if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) { 549 if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) {
556 DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is " 550 e_dev_info("AutoNeg other than 1000/Full is not valid for fiber"
557 "not valid for fiber adapters, " 551 "adapters, parameter ignored\n");
558 "parameter ignored\n");
559 } 552 }
560} 553}
561 554
@@ -619,9 +612,8 @@ static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter)
619 } 612 }
620 613
621 if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) { 614 if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) {
622 DPRINTK(PROBE, INFO, 615 e_dev_info("AutoNeg specified along with Speed or Duplex, "
623 "AutoNeg specified along with Speed or Duplex, " 616 "parameter ignored\n");
624 "parameter ignored\n");
625 adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT; 617 adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
626 } else { /* Autoneg */ 618 } else { /* Autoneg */
627 static const struct e1000_opt_list an_list[] = 619 static const struct e1000_opt_list an_list[] =
@@ -680,79 +672,72 @@ static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter)
680 case 0: 672 case 0:
681 adapter->hw.autoneg = adapter->fc_autoneg = 1; 673 adapter->hw.autoneg = adapter->fc_autoneg = 1;
682 if ((num_Speed > bd) && (speed != 0 || dplx != 0)) 674 if ((num_Speed > bd) && (speed != 0 || dplx != 0))
683 DPRINTK(PROBE, INFO, 675 e_dev_info("Speed and duplex autonegotiation "
684 "Speed and duplex autonegotiation enabled\n"); 676 "enabled\n");
685 break; 677 break;
686 case HALF_DUPLEX: 678 case HALF_DUPLEX:
687 DPRINTK(PROBE, INFO, "Half Duplex specified without Speed\n"); 679 e_dev_info("Half Duplex specified without Speed\n");
688 DPRINTK(PROBE, INFO, "Using Autonegotiation at " 680 e_dev_info("Using Autonegotiation at Half Duplex only\n");
689 "Half Duplex only\n");
690 adapter->hw.autoneg = adapter->fc_autoneg = 1; 681 adapter->hw.autoneg = adapter->fc_autoneg = 1;
691 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF | 682 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
692 ADVERTISE_100_HALF; 683 ADVERTISE_100_HALF;
693 break; 684 break;
694 case FULL_DUPLEX: 685 case FULL_DUPLEX:
695 DPRINTK(PROBE, INFO, "Full Duplex specified without Speed\n"); 686 e_dev_info("Full Duplex specified without Speed\n");
696 DPRINTK(PROBE, INFO, "Using Autonegotiation at " 687 e_dev_info("Using Autonegotiation at Full Duplex only\n");
697 "Full Duplex only\n");
698 adapter->hw.autoneg = adapter->fc_autoneg = 1; 688 adapter->hw.autoneg = adapter->fc_autoneg = 1;
699 adapter->hw.autoneg_advertised = ADVERTISE_10_FULL | 689 adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
700 ADVERTISE_100_FULL | 690 ADVERTISE_100_FULL |
701 ADVERTISE_1000_FULL; 691 ADVERTISE_1000_FULL;
702 break; 692 break;
703 case SPEED_10: 693 case SPEED_10:
704 DPRINTK(PROBE, INFO, "10 Mbps Speed specified " 694 e_dev_info("10 Mbps Speed specified without Duplex\n");
705 "without Duplex\n"); 695 e_dev_info("Using Autonegotiation at 10 Mbps only\n");
706 DPRINTK(PROBE, INFO, "Using Autonegotiation at 10 Mbps only\n");
707 adapter->hw.autoneg = adapter->fc_autoneg = 1; 696 adapter->hw.autoneg = adapter->fc_autoneg = 1;
708 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF | 697 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
709 ADVERTISE_10_FULL; 698 ADVERTISE_10_FULL;
710 break; 699 break;
711 case SPEED_10 + HALF_DUPLEX: 700 case SPEED_10 + HALF_DUPLEX:
712 DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Half Duplex\n"); 701 e_dev_info("Forcing to 10 Mbps Half Duplex\n");
713 adapter->hw.autoneg = adapter->fc_autoneg = 0; 702 adapter->hw.autoneg = adapter->fc_autoneg = 0;
714 adapter->hw.forced_speed_duplex = e1000_10_half; 703 adapter->hw.forced_speed_duplex = e1000_10_half;
715 adapter->hw.autoneg_advertised = 0; 704 adapter->hw.autoneg_advertised = 0;
716 break; 705 break;
717 case SPEED_10 + FULL_DUPLEX: 706 case SPEED_10 + FULL_DUPLEX:
718 DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Full Duplex\n"); 707 e_dev_info("Forcing to 10 Mbps Full Duplex\n");
719 adapter->hw.autoneg = adapter->fc_autoneg = 0; 708 adapter->hw.autoneg = adapter->fc_autoneg = 0;
720 adapter->hw.forced_speed_duplex = e1000_10_full; 709 adapter->hw.forced_speed_duplex = e1000_10_full;
721 adapter->hw.autoneg_advertised = 0; 710 adapter->hw.autoneg_advertised = 0;
722 break; 711 break;
723 case SPEED_100: 712 case SPEED_100:
724 DPRINTK(PROBE, INFO, "100 Mbps Speed specified " 713 e_dev_info("100 Mbps Speed specified without Duplex\n");
725 "without Duplex\n"); 714 e_dev_info("Using Autonegotiation at 100 Mbps only\n");
726 DPRINTK(PROBE, INFO, "Using Autonegotiation at "
727 "100 Mbps only\n");
728 adapter->hw.autoneg = adapter->fc_autoneg = 1; 715 adapter->hw.autoneg = adapter->fc_autoneg = 1;
729 adapter->hw.autoneg_advertised = ADVERTISE_100_HALF | 716 adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
730 ADVERTISE_100_FULL; 717 ADVERTISE_100_FULL;
731 break; 718 break;
732 case SPEED_100 + HALF_DUPLEX: 719 case SPEED_100 + HALF_DUPLEX:
733 DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Half Duplex\n"); 720 e_dev_info("Forcing to 100 Mbps Half Duplex\n");
734 adapter->hw.autoneg = adapter->fc_autoneg = 0; 721 adapter->hw.autoneg = adapter->fc_autoneg = 0;
735 adapter->hw.forced_speed_duplex = e1000_100_half; 722 adapter->hw.forced_speed_duplex = e1000_100_half;
736 adapter->hw.autoneg_advertised = 0; 723 adapter->hw.autoneg_advertised = 0;
737 break; 724 break;
738 case SPEED_100 + FULL_DUPLEX: 725 case SPEED_100 + FULL_DUPLEX:
739 DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Full Duplex\n"); 726 e_dev_info("Forcing to 100 Mbps Full Duplex\n");
740 adapter->hw.autoneg = adapter->fc_autoneg = 0; 727 adapter->hw.autoneg = adapter->fc_autoneg = 0;
741 adapter->hw.forced_speed_duplex = e1000_100_full; 728 adapter->hw.forced_speed_duplex = e1000_100_full;
742 adapter->hw.autoneg_advertised = 0; 729 adapter->hw.autoneg_advertised = 0;
743 break; 730 break;
744 case SPEED_1000: 731 case SPEED_1000:
745 DPRINTK(PROBE, INFO, "1000 Mbps Speed specified without " 732 e_dev_info("1000 Mbps Speed specified without Duplex\n");
746 "Duplex\n");
747 goto full_duplex_only; 733 goto full_duplex_only;
748 case SPEED_1000 + HALF_DUPLEX: 734 case SPEED_1000 + HALF_DUPLEX:
749 DPRINTK(PROBE, INFO, 735 e_dev_info("Half Duplex is not supported at 1000 Mbps\n");
750 "Half Duplex is not supported at 1000 Mbps\n");
751 /* fall through */ 736 /* fall through */
752 case SPEED_1000 + FULL_DUPLEX: 737 case SPEED_1000 + FULL_DUPLEX:
753full_duplex_only: 738full_duplex_only:
754 DPRINTK(PROBE, INFO, 739 e_dev_info("Using Autonegotiation at 1000 Mbps Full Duplex "
755 "Using Autonegotiation at 1000 Mbps Full Duplex only\n"); 740 "only\n");
756 adapter->hw.autoneg = adapter->fc_autoneg = 1; 741 adapter->hw.autoneg = adapter->fc_autoneg = 1;
757 adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL; 742 adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
758 break; 743 break;
@@ -762,9 +747,8 @@ full_duplex_only:
762 747
763 /* Speed, AutoNeg and MDI/MDI-X must all play nice */ 748 /* Speed, AutoNeg and MDI/MDI-X must all play nice */
764 if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) { 749 if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
765 DPRINTK(PROBE, INFO, 750 e_dev_info("Speed, AutoNeg and MDI-X specs are incompatible. "
766 "Speed, AutoNeg and MDI-X specifications are " 751 "Setting MDI-X to a compatible value.\n");
767 "incompatible. Setting MDI-X to a compatible value.\n");
768 } 752 }
769} 753}
770 754