diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-07 05:10:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-07 05:10:27 -0400 |
commit | 32bb93b02da8c75031e601ff1f9a25f99febbe5f (patch) | |
tree | 429d2b978f517d366de572fa5058d513ed7b51a6 /drivers/net/e1000e | |
parent | 6edafaaf6f5e70ef1e620ff01bd6bacebe1e0718 (diff) | |
parent | 3859069bc3358772b08bd91efe9edec39a746ea8 (diff) |
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r-- | drivers/net/e1000e/e1000.h | 31 | ||||
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 44 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 246 | ||||
-rw-r--r-- | drivers/net/e1000e/param.c | 31 |
4 files changed, 154 insertions, 198 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 4a4f62e002b2..cf57050d99d8 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -41,24 +41,25 @@ | |||
41 | 41 | ||
42 | struct e1000_info; | 42 | struct e1000_info; |
43 | 43 | ||
44 | #define ndev_printk(level, netdev, format, arg...) \ | 44 | #define e_printk(level, adapter, format, arg...) \ |
45 | printk(level "%s: " format, (netdev)->name, ## arg) | 45 | printk(level "%s: %s: " format, pci_name(adapter->pdev), \ |
46 | adapter->netdev->name, ## arg) | ||
46 | 47 | ||
47 | #ifdef DEBUG | 48 | #ifdef DEBUG |
48 | #define ndev_dbg(netdev, format, arg...) \ | 49 | #define e_dbg(format, arg...) \ |
49 | ndev_printk(KERN_DEBUG , netdev, format, ## arg) | 50 | e_printk(KERN_DEBUG , adapter, format, ## arg) |
50 | #else | 51 | #else |
51 | #define ndev_dbg(netdev, format, arg...) do { (void)(netdev); } while (0) | 52 | #define e_dbg(format, arg...) do { (void)(adapter); } while (0) |
52 | #endif | 53 | #endif |
53 | 54 | ||
54 | #define ndev_err(netdev, format, arg...) \ | 55 | #define e_err(format, arg...) \ |
55 | ndev_printk(KERN_ERR , netdev, format, ## arg) | 56 | e_printk(KERN_ERR, adapter, format, ## arg) |
56 | #define ndev_info(netdev, format, arg...) \ | 57 | #define e_info(format, arg...) \ |
57 | ndev_printk(KERN_INFO , netdev, format, ## arg) | 58 | e_printk(KERN_INFO, adapter, format, ## arg) |
58 | #define ndev_warn(netdev, format, arg...) \ | 59 | #define e_warn(format, arg...) \ |
59 | ndev_printk(KERN_WARNING , netdev, format, ## arg) | 60 | e_printk(KERN_WARNING, adapter, format, ## arg) |
60 | #define ndev_notice(netdev, format, arg...) \ | 61 | #define e_notice(format, arg...) \ |
61 | ndev_printk(KERN_NOTICE , netdev, format, ## arg) | 62 | e_printk(KERN_NOTICE, adapter, format, ## arg) |
62 | 63 | ||
63 | 64 | ||
64 | /* Tx/Rx descriptor defines */ | 65 | /* Tx/Rx descriptor defines */ |
@@ -283,10 +284,6 @@ struct e1000_adapter { | |||
283 | unsigned long led_status; | 284 | unsigned long led_status; |
284 | 285 | ||
285 | unsigned int flags; | 286 | unsigned int flags; |
286 | |||
287 | /* for ioport free */ | ||
288 | int bars; | ||
289 | int need_ioport; | ||
290 | }; | 287 | }; |
291 | 288 | ||
292 | struct e1000_info { | 289 | struct e1000_info { |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 9350564065e7..cf9679f2b7c4 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -189,8 +189,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) | |||
189 | /* Fiber NICs only allow 1000 gbps Full duplex */ | 189 | /* Fiber NICs only allow 1000 gbps Full duplex */ |
190 | if ((adapter->hw.phy.media_type == e1000_media_type_fiber) && | 190 | if ((adapter->hw.phy.media_type == e1000_media_type_fiber) && |
191 | spddplx != (SPEED_1000 + DUPLEX_FULL)) { | 191 | spddplx != (SPEED_1000 + DUPLEX_FULL)) { |
192 | ndev_err(adapter->netdev, "Unsupported Speed/Duplex " | 192 | e_err("Unsupported Speed/Duplex configuration\n"); |
193 | "configuration\n"); | ||
194 | return -EINVAL; | 193 | return -EINVAL; |
195 | } | 194 | } |
196 | 195 | ||
@@ -213,8 +212,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) | |||
213 | break; | 212 | break; |
214 | case SPEED_1000 + DUPLEX_HALF: /* not supported */ | 213 | case SPEED_1000 + DUPLEX_HALF: /* not supported */ |
215 | default: | 214 | default: |
216 | ndev_err(adapter->netdev, "Unsupported Speed/Duplex " | 215 | e_err("Unsupported Speed/Duplex configuration\n"); |
217 | "configuration\n"); | ||
218 | return -EINVAL; | 216 | return -EINVAL; |
219 | } | 217 | } |
220 | return 0; | 218 | return 0; |
@@ -231,8 +229,8 @@ static int e1000_set_settings(struct net_device *netdev, | |||
231 | * cannot be changed | 229 | * cannot be changed |
232 | */ | 230 | */ |
233 | if (e1000_check_reset_block(hw)) { | 231 | if (e1000_check_reset_block(hw)) { |
234 | ndev_err(netdev, "Cannot change link " | 232 | e_err("Cannot change link characteristics when SoL/IDER is " |
235 | "characteristics when SoL/IDER is active.\n"); | 233 | "active.\n"); |
236 | return -EINVAL; | 234 | return -EINVAL; |
237 | } | 235 | } |
238 | 236 | ||
@@ -380,8 +378,7 @@ static int e1000_set_tso(struct net_device *netdev, u32 data) | |||
380 | netdev->features &= ~NETIF_F_TSO6; | 378 | netdev->features &= ~NETIF_F_TSO6; |
381 | } | 379 | } |
382 | 380 | ||
383 | ndev_info(netdev, "TSO is %s\n", | 381 | e_info("TSO is %s\n", data ? "Enabled" : "Disabled"); |
384 | data ? "Enabled" : "Disabled"); | ||
385 | adapter->flags |= FLAG_TSO_FORCE; | 382 | adapter->flags |= FLAG_TSO_FORCE; |
386 | return 0; | 383 | return 0; |
387 | } | 384 | } |
@@ -722,10 +719,9 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, | |||
722 | (test[pat] & write)); | 719 | (test[pat] & write)); |
723 | val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset); | 720 | val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset); |
724 | if (val != (test[pat] & write & mask)) { | 721 | if (val != (test[pat] & write & mask)) { |
725 | ndev_err(adapter->netdev, "pattern test reg %04X " | 722 | e_err("pattern test reg %04X failed: got 0x%08X " |
726 | "failed: got 0x%08X expected 0x%08X\n", | 723 | "expected 0x%08X\n", reg + offset, val, |
727 | reg + offset, | 724 | (test[pat] & write & mask)); |
728 | val, (test[pat] & write & mask)); | ||
729 | *data = reg; | 725 | *data = reg; |
730 | return 1; | 726 | return 1; |
731 | } | 727 | } |
@@ -740,9 +736,8 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, | |||
740 | __ew32(&adapter->hw, reg, write & mask); | 736 | __ew32(&adapter->hw, reg, write & mask); |
741 | val = __er32(&adapter->hw, reg); | 737 | val = __er32(&adapter->hw, reg); |
742 | if ((write & mask) != (val & mask)) { | 738 | if ((write & mask) != (val & mask)) { |
743 | ndev_err(adapter->netdev, "set/check reg %04X test failed: " | 739 | e_err("set/check reg %04X test failed: got 0x%08X " |
744 | "got 0x%08X expected 0x%08X\n", reg, (val & mask), | 740 | "expected 0x%08X\n", reg, (val & mask), (write & mask)); |
745 | (write & mask)); | ||
746 | *data = reg; | 741 | *data = reg; |
747 | return 1; | 742 | return 1; |
748 | } | 743 | } |
@@ -766,7 +761,6 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
766 | { | 761 | { |
767 | struct e1000_hw *hw = &adapter->hw; | 762 | struct e1000_hw *hw = &adapter->hw; |
768 | struct e1000_mac_info *mac = &adapter->hw.mac; | 763 | struct e1000_mac_info *mac = &adapter->hw.mac; |
769 | struct net_device *netdev = adapter->netdev; | ||
770 | u32 value; | 764 | u32 value; |
771 | u32 before; | 765 | u32 before; |
772 | u32 after; | 766 | u32 after; |
@@ -799,8 +793,8 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
799 | ew32(STATUS, toggle); | 793 | ew32(STATUS, toggle); |
800 | after = er32(STATUS) & toggle; | 794 | after = er32(STATUS) & toggle; |
801 | if (value != after) { | 795 | if (value != after) { |
802 | ndev_err(netdev, "failed STATUS register test got: " | 796 | e_err("failed STATUS register test got: 0x%08X expected: " |
803 | "0x%08X expected: 0x%08X\n", after, value); | 797 | "0x%08X\n", after, value); |
804 | *data = 1; | 798 | *data = 1; |
805 | return 1; | 799 | return 1; |
806 | } | 800 | } |
@@ -903,8 +897,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) | |||
903 | *data = 1; | 897 | *data = 1; |
904 | return -1; | 898 | return -1; |
905 | } | 899 | } |
906 | ndev_info(netdev, "testing %s interrupt\n", | 900 | e_info("testing %s interrupt\n", (shared_int ? "shared" : "unshared")); |
907 | (shared_int ? "shared" : "unshared")); | ||
908 | 901 | ||
909 | /* Disable all the interrupts */ | 902 | /* Disable all the interrupts */ |
910 | ew32(IMC, 0xFFFFFFFF); | 903 | ew32(IMC, 0xFFFFFFFF); |
@@ -1526,8 +1519,7 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) | |||
1526 | * sessions are active | 1519 | * sessions are active |
1527 | */ | 1520 | */ |
1528 | if (e1000_check_reset_block(&adapter->hw)) { | 1521 | if (e1000_check_reset_block(&adapter->hw)) { |
1529 | ndev_err(adapter->netdev, "Cannot do PHY loopback test " | 1522 | e_err("Cannot do PHY loopback test when SoL/IDER is active.\n"); |
1530 | "when SoL/IDER is active.\n"); | ||
1531 | *data = 0; | 1523 | *data = 0; |
1532 | goto out; | 1524 | goto out; |
1533 | } | 1525 | } |
@@ -1612,7 +1604,7 @@ static void e1000_diag_test(struct net_device *netdev, | |||
1612 | forced_speed_duplex = adapter->hw.mac.forced_speed_duplex; | 1604 | forced_speed_duplex = adapter->hw.mac.forced_speed_duplex; |
1613 | autoneg = adapter->hw.mac.autoneg; | 1605 | autoneg = adapter->hw.mac.autoneg; |
1614 | 1606 | ||
1615 | ndev_info(netdev, "offline testing starting\n"); | 1607 | e_info("offline testing starting\n"); |
1616 | 1608 | ||
1617 | /* | 1609 | /* |
1618 | * Link test performed before hardware reset so autoneg doesn't | 1610 | * Link test performed before hardware reset so autoneg doesn't |
@@ -1658,7 +1650,7 @@ static void e1000_diag_test(struct net_device *netdev, | |||
1658 | if (if_running) | 1650 | if (if_running) |
1659 | dev_open(netdev); | 1651 | dev_open(netdev); |
1660 | } else { | 1652 | } else { |
1661 | ndev_info(netdev, "online testing starting\n"); | 1653 | e_info("online testing starting\n"); |
1662 | /* Online tests */ | 1654 | /* Online tests */ |
1663 | if (e1000_link_test(adapter, &data[4])) | 1655 | if (e1000_link_test(adapter, &data[4])) |
1664 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1656 | eth_test->flags |= ETH_TEST_FL_FAILED; |
@@ -1694,8 +1686,8 @@ static void e1000_get_wol(struct net_device *netdev, | |||
1694 | wol->supported &= ~WAKE_UCAST; | 1686 | wol->supported &= ~WAKE_UCAST; |
1695 | 1687 | ||
1696 | if (adapter->wol & E1000_WUFC_EX) | 1688 | if (adapter->wol & E1000_WUFC_EX) |
1697 | ndev_err(netdev, "Interface does not support " | 1689 | e_err("Interface does not support directed (unicast) " |
1698 | "directed (unicast) frame wake-up packets\n"); | 1690 | "frame wake-up packets\n"); |
1699 | } | 1691 | } |
1700 | 1692 | ||
1701 | if (adapter->wol & E1000_WUFC_EX) | 1693 | if (adapter->wol & E1000_WUFC_EX) |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index d13677899767..05b0b2f9c54b 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -484,8 +484,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
484 | * packet, also make sure the frame isn't just CRC only */ | 484 | * packet, also make sure the frame isn't just CRC only */ |
485 | if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) { | 485 | if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) { |
486 | /* All receives must fit into a single buffer */ | 486 | /* All receives must fit into a single buffer */ |
487 | ndev_dbg(netdev, "%s: Receive packet consumed " | 487 | e_dbg("%s: Receive packet consumed multiple buffers\n", |
488 | "multiple buffers\n", netdev->name); | 488 | netdev->name); |
489 | /* recycle */ | 489 | /* recycle */ |
490 | buffer_info->skb = skb; | 490 | buffer_info->skb = skb; |
491 | goto next_desc; | 491 | goto next_desc; |
@@ -576,28 +576,26 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter) | |||
576 | unsigned int i = tx_ring->next_to_clean; | 576 | unsigned int i = tx_ring->next_to_clean; |
577 | unsigned int eop = tx_ring->buffer_info[i].next_to_watch; | 577 | unsigned int eop = tx_ring->buffer_info[i].next_to_watch; |
578 | struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop); | 578 | struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop); |
579 | struct net_device *netdev = adapter->netdev; | ||
580 | 579 | ||
581 | /* detected Tx unit hang */ | 580 | /* detected Tx unit hang */ |
582 | ndev_err(netdev, | 581 | e_err("Detected Tx Unit Hang:\n" |
583 | "Detected Tx Unit Hang:\n" | 582 | " TDH <%x>\n" |
584 | " TDH <%x>\n" | 583 | " TDT <%x>\n" |
585 | " TDT <%x>\n" | 584 | " next_to_use <%x>\n" |
586 | " next_to_use <%x>\n" | 585 | " next_to_clean <%x>\n" |
587 | " next_to_clean <%x>\n" | 586 | "buffer_info[next_to_clean]:\n" |
588 | "buffer_info[next_to_clean]:\n" | 587 | " time_stamp <%lx>\n" |
589 | " time_stamp <%lx>\n" | 588 | " next_to_watch <%x>\n" |
590 | " next_to_watch <%x>\n" | 589 | " jiffies <%lx>\n" |
591 | " jiffies <%lx>\n" | 590 | " next_to_watch.status <%x>\n", |
592 | " next_to_watch.status <%x>\n", | 591 | readl(adapter->hw.hw_addr + tx_ring->head), |
593 | readl(adapter->hw.hw_addr + tx_ring->head), | 592 | readl(adapter->hw.hw_addr + tx_ring->tail), |
594 | readl(adapter->hw.hw_addr + tx_ring->tail), | 593 | tx_ring->next_to_use, |
595 | tx_ring->next_to_use, | 594 | tx_ring->next_to_clean, |
596 | tx_ring->next_to_clean, | 595 | tx_ring->buffer_info[eop].time_stamp, |
597 | tx_ring->buffer_info[eop].time_stamp, | 596 | eop, |
598 | eop, | 597 | jiffies, |
599 | jiffies, | 598 | eop_desc->upper.fields.status); |
600 | eop_desc->upper.fields.status); | ||
601 | } | 599 | } |
602 | 600 | ||
603 | /** | 601 | /** |
@@ -747,8 +745,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
747 | buffer_info->dma = 0; | 745 | buffer_info->dma = 0; |
748 | 746 | ||
749 | if (!(staterr & E1000_RXD_STAT_EOP)) { | 747 | if (!(staterr & E1000_RXD_STAT_EOP)) { |
750 | ndev_dbg(netdev, "%s: Packet Split buffers didn't pick " | 748 | e_dbg("%s: Packet Split buffers didn't pick up the " |
751 | "up the full packet\n", netdev->name); | 749 | "full packet\n", netdev->name); |
752 | dev_kfree_skb_irq(skb); | 750 | dev_kfree_skb_irq(skb); |
753 | goto next_desc; | 751 | goto next_desc; |
754 | } | 752 | } |
@@ -761,8 +759,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
761 | length = le16_to_cpu(rx_desc->wb.middle.length0); | 759 | length = le16_to_cpu(rx_desc->wb.middle.length0); |
762 | 760 | ||
763 | if (!length) { | 761 | if (!length) { |
764 | ndev_dbg(netdev, "%s: Last part of the packet spanning" | 762 | e_dbg("%s: Last part of the packet spanning multiple " |
765 | " multiple descriptors\n", netdev->name); | 763 | "descriptors\n", netdev->name); |
766 | dev_kfree_skb_irq(skb); | 764 | dev_kfree_skb_irq(skb); |
767 | goto next_desc; | 765 | goto next_desc; |
768 | } | 766 | } |
@@ -1011,7 +1009,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter, | |||
1011 | 1009 | ||
1012 | /* eth type trans needs skb->data to point to something */ | 1010 | /* eth type trans needs skb->data to point to something */ |
1013 | if (!pskb_may_pull(skb, ETH_HLEN)) { | 1011 | if (!pskb_may_pull(skb, ETH_HLEN)) { |
1014 | ndev_err(netdev, "pskb_may_pull failed.\n"); | 1012 | e_err("pskb_may_pull failed.\n"); |
1015 | dev_kfree_skb(skb); | 1013 | dev_kfree_skb(skb); |
1016 | goto next_desc; | 1014 | goto next_desc; |
1017 | } | 1015 | } |
@@ -1251,10 +1249,8 @@ static int e1000_request_irq(struct e1000_adapter *adapter) | |||
1251 | err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, | 1249 | err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, |
1252 | netdev); | 1250 | netdev); |
1253 | if (err) { | 1251 | if (err) { |
1254 | ndev_err(netdev, | 1252 | e_err("Unable to allocate %s interrupt (return: %d)\n", |
1255 | "Unable to allocate %s interrupt (return: %d)\n", | 1253 | adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx", err); |
1256 | adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx", | ||
1257 | err); | ||
1258 | if (adapter->flags & FLAG_MSI_ENABLED) | 1254 | if (adapter->flags & FLAG_MSI_ENABLED) |
1259 | pci_disable_msi(adapter->pdev); | 1255 | pci_disable_msi(adapter->pdev); |
1260 | } | 1256 | } |
@@ -1395,8 +1391,7 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter) | |||
1395 | return 0; | 1391 | return 0; |
1396 | err: | 1392 | err: |
1397 | vfree(tx_ring->buffer_info); | 1393 | vfree(tx_ring->buffer_info); |
1398 | ndev_err(adapter->netdev, | 1394 | e_err("Unable to allocate memory for the transmit descriptor ring\n"); |
1399 | "Unable to allocate memory for the transmit descriptor ring\n"); | ||
1400 | return err; | 1395 | return err; |
1401 | } | 1396 | } |
1402 | 1397 | ||
@@ -1450,8 +1445,7 @@ err_pages: | |||
1450 | } | 1445 | } |
1451 | err: | 1446 | err: |
1452 | vfree(rx_ring->buffer_info); | 1447 | vfree(rx_ring->buffer_info); |
1453 | ndev_err(adapter->netdev, | 1448 | e_err("Unable to allocate memory for the transmit descriptor ring\n"); |
1454 | "Unable to allocate memory for the transmit descriptor ring\n"); | ||
1455 | return err; | 1449 | return err; |
1456 | } | 1450 | } |
1457 | 1451 | ||
@@ -2450,13 +2444,13 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2450 | * For parts with AMT enabled, let the firmware know | 2444 | * For parts with AMT enabled, let the firmware know |
2451 | * that the network interface is in control | 2445 | * that the network interface is in control |
2452 | */ | 2446 | */ |
2453 | if ((adapter->flags & FLAG_HAS_AMT) && e1000e_check_mng_mode(hw)) | 2447 | if (adapter->flags & FLAG_HAS_AMT) |
2454 | e1000_get_hw_control(adapter); | 2448 | e1000_get_hw_control(adapter); |
2455 | 2449 | ||
2456 | ew32(WUC, 0); | 2450 | ew32(WUC, 0); |
2457 | 2451 | ||
2458 | if (mac->ops.init_hw(hw)) | 2452 | if (mac->ops.init_hw(hw)) |
2459 | ndev_err(adapter->netdev, "Hardware Error\n"); | 2453 | e_err("Hardware Error\n"); |
2460 | 2454 | ||
2461 | e1000_update_mng_vlan(adapter); | 2455 | e1000_update_mng_vlan(adapter); |
2462 | 2456 | ||
@@ -2591,7 +2585,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter) | |||
2591 | return 0; | 2585 | return 0; |
2592 | 2586 | ||
2593 | err: | 2587 | err: |
2594 | ndev_err(netdev, "Unable to allocate memory for queues\n"); | 2588 | e_err("Unable to allocate memory for queues\n"); |
2595 | kfree(adapter->rx_ring); | 2589 | kfree(adapter->rx_ring); |
2596 | kfree(adapter->tx_ring); | 2590 | kfree(adapter->tx_ring); |
2597 | return -ENOMEM; | 2591 | return -ENOMEM; |
@@ -2640,8 +2634,7 @@ static int e1000_open(struct net_device *netdev) | |||
2640 | * If AMT is enabled, let the firmware know that the network | 2634 | * If AMT is enabled, let the firmware know that the network |
2641 | * interface is now open | 2635 | * interface is now open |
2642 | */ | 2636 | */ |
2643 | if ((adapter->flags & FLAG_HAS_AMT) && | 2637 | if (adapter->flags & FLAG_HAS_AMT) |
2644 | e1000e_check_mng_mode(&adapter->hw)) | ||
2645 | e1000_get_hw_control(adapter); | 2638 | e1000_get_hw_control(adapter); |
2646 | 2639 | ||
2647 | /* | 2640 | /* |
@@ -2719,8 +2712,7 @@ static int e1000_close(struct net_device *netdev) | |||
2719 | * If AMT is enabled, let the firmware know that the network | 2712 | * If AMT is enabled, let the firmware know that the network |
2720 | * interface is now closed | 2713 | * interface is now closed |
2721 | */ | 2714 | */ |
2722 | if ((adapter->flags & FLAG_HAS_AMT) && | 2715 | if (adapter->flags & FLAG_HAS_AMT) |
2723 | e1000e_check_mng_mode(&adapter->hw)) | ||
2724 | e1000_release_hw_control(adapter); | 2716 | e1000_release_hw_control(adapter); |
2725 | 2717 | ||
2726 | return 0; | 2718 | return 0; |
@@ -2917,8 +2909,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) | |||
2917 | ret_val |= e1e_rphy(hw, PHY_1000T_STATUS, &phy->stat1000); | 2909 | ret_val |= e1e_rphy(hw, PHY_1000T_STATUS, &phy->stat1000); |
2918 | ret_val |= e1e_rphy(hw, PHY_EXT_STATUS, &phy->estatus); | 2910 | ret_val |= e1e_rphy(hw, PHY_EXT_STATUS, &phy->estatus); |
2919 | if (ret_val) | 2911 | if (ret_val) |
2920 | ndev_warn(adapter->netdev, | 2912 | e_warn("Error reading PHY register\n"); |
2921 | "Error reading PHY register\n"); | ||
2922 | } else { | 2913 | } else { |
2923 | /* | 2914 | /* |
2924 | * Do not read PHY registers if link is not up | 2915 | * Do not read PHY registers if link is not up |
@@ -2943,18 +2934,16 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) | |||
2943 | static void e1000_print_link_info(struct e1000_adapter *adapter) | 2934 | static void e1000_print_link_info(struct e1000_adapter *adapter) |
2944 | { | 2935 | { |
2945 | struct e1000_hw *hw = &adapter->hw; | 2936 | struct e1000_hw *hw = &adapter->hw; |
2946 | struct net_device *netdev = adapter->netdev; | ||
2947 | u32 ctrl = er32(CTRL); | 2937 | u32 ctrl = er32(CTRL); |
2948 | 2938 | ||
2949 | ndev_info(netdev, | 2939 | e_info("Link is Up %d Mbps %s, Flow Control: %s\n", |
2950 | "Link is Up %d Mbps %s, Flow Control: %s\n", | 2940 | adapter->link_speed, |
2951 | adapter->link_speed, | 2941 | (adapter->link_duplex == FULL_DUPLEX) ? |
2952 | (adapter->link_duplex == FULL_DUPLEX) ? | 2942 | "Full Duplex" : "Half Duplex", |
2953 | "Full Duplex" : "Half Duplex", | 2943 | ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ? |
2954 | ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ? | 2944 | "RX/TX" : |
2955 | "RX/TX" : | 2945 | ((ctrl & E1000_CTRL_RFCE) ? "RX" : |
2956 | ((ctrl & E1000_CTRL_RFCE) ? "RX" : | 2946 | ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); |
2957 | ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); | ||
2958 | } | 2947 | } |
2959 | 2948 | ||
2960 | static bool e1000_has_link(struct e1000_adapter *adapter) | 2949 | static bool e1000_has_link(struct e1000_adapter *adapter) |
@@ -2994,8 +2983,7 @@ static bool e1000_has_link(struct e1000_adapter *adapter) | |||
2994 | if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) && | 2983 | if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) && |
2995 | (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) { | 2984 | (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) { |
2996 | /* See e1000_kmrn_lock_loss_workaround_ich8lan() */ | 2985 | /* See e1000_kmrn_lock_loss_workaround_ich8lan() */ |
2997 | ndev_info(adapter->netdev, | 2986 | e_info("Gigabit has been disabled, downgrading speed\n"); |
2998 | "Gigabit has been disabled, downgrading speed\n"); | ||
2999 | } | 2987 | } |
3000 | 2988 | ||
3001 | return link_active; | 2989 | return link_active; |
@@ -3096,8 +3084,7 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3096 | switch (adapter->link_speed) { | 3084 | switch (adapter->link_speed) { |
3097 | case SPEED_10: | 3085 | case SPEED_10: |
3098 | case SPEED_100: | 3086 | case SPEED_100: |
3099 | ndev_info(netdev, | 3087 | e_info("10/100 speed: disabling TSO\n"); |
3100 | "10/100 speed: disabling TSO\n"); | ||
3101 | netdev->features &= ~NETIF_F_TSO; | 3088 | netdev->features &= ~NETIF_F_TSO; |
3102 | netdev->features &= ~NETIF_F_TSO6; | 3089 | netdev->features &= ~NETIF_F_TSO6; |
3103 | break; | 3090 | break; |
@@ -3130,7 +3117,7 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3130 | if (netif_carrier_ok(netdev)) { | 3117 | if (netif_carrier_ok(netdev)) { |
3131 | adapter->link_speed = 0; | 3118 | adapter->link_speed = 0; |
3132 | adapter->link_duplex = 0; | 3119 | adapter->link_duplex = 0; |
3133 | ndev_info(netdev, "Link is Down\n"); | 3120 | e_info("Link is Down\n"); |
3134 | netif_carrier_off(netdev); | 3121 | netif_carrier_off(netdev); |
3135 | netif_tx_stop_all_queues(netdev); | 3122 | netif_tx_stop_all_queues(netdev); |
3136 | if (!test_bit(__E1000_DOWN, &adapter->state)) | 3123 | if (!test_bit(__E1000_DOWN, &adapter->state)) |
@@ -3604,8 +3591,7 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3604 | 3591 | ||
3605 | pull_size = min((unsigned int)4, skb->data_len); | 3592 | pull_size = min((unsigned int)4, skb->data_len); |
3606 | if (!__pskb_pull_tail(skb, pull_size)) { | 3593 | if (!__pskb_pull_tail(skb, pull_size)) { |
3607 | ndev_err(netdev, | 3594 | e_err("__pskb_pull_tail failed.\n"); |
3608 | "__pskb_pull_tail failed.\n"); | ||
3609 | dev_kfree_skb_any(skb); | 3595 | dev_kfree_skb_any(skb); |
3610 | return NETDEV_TX_OK; | 3596 | return NETDEV_TX_OK; |
3611 | } | 3597 | } |
@@ -3737,25 +3723,25 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3737 | 3723 | ||
3738 | if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || | 3724 | if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || |
3739 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { | 3725 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { |
3740 | ndev_err(netdev, "Invalid MTU setting\n"); | 3726 | e_err("Invalid MTU setting\n"); |
3741 | return -EINVAL; | 3727 | return -EINVAL; |
3742 | } | 3728 | } |
3743 | 3729 | ||
3744 | /* Jumbo frame size limits */ | 3730 | /* Jumbo frame size limits */ |
3745 | if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { | 3731 | if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { |
3746 | if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { | 3732 | if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { |
3747 | ndev_err(netdev, "Jumbo Frames not supported.\n"); | 3733 | e_err("Jumbo Frames not supported.\n"); |
3748 | return -EINVAL; | 3734 | return -EINVAL; |
3749 | } | 3735 | } |
3750 | if (adapter->hw.phy.type == e1000_phy_ife) { | 3736 | if (adapter->hw.phy.type == e1000_phy_ife) { |
3751 | ndev_err(netdev, "Jumbo Frames not supported.\n"); | 3737 | e_err("Jumbo Frames not supported.\n"); |
3752 | return -EINVAL; | 3738 | return -EINVAL; |
3753 | } | 3739 | } |
3754 | } | 3740 | } |
3755 | 3741 | ||
3756 | #define MAX_STD_JUMBO_FRAME_SIZE 9234 | 3742 | #define MAX_STD_JUMBO_FRAME_SIZE 9234 |
3757 | if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { | 3743 | if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { |
3758 | ndev_err(netdev, "MTU > 9216 not supported.\n"); | 3744 | e_err("MTU > 9216 not supported.\n"); |
3759 | return -EINVAL; | 3745 | return -EINVAL; |
3760 | } | 3746 | } |
3761 | 3747 | ||
@@ -3792,8 +3778,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3792 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN | 3778 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN |
3793 | + ETH_FCS_LEN; | 3779 | + ETH_FCS_LEN; |
3794 | 3780 | ||
3795 | ndev_info(netdev, "changing MTU from %d to %d\n", | 3781 | e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); |
3796 | netdev->mtu, new_mtu); | ||
3797 | netdev->mtu = new_mtu; | 3782 | netdev->mtu = new_mtu; |
3798 | 3783 | ||
3799 | if (netif_running(netdev)) | 3784 | if (netif_running(netdev)) |
@@ -4006,10 +3991,7 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4006 | pci_restore_state(pdev); | 3991 | pci_restore_state(pdev); |
4007 | e1000e_disable_l1aspm(pdev); | 3992 | e1000e_disable_l1aspm(pdev); |
4008 | 3993 | ||
4009 | if (adapter->need_ioport) | 3994 | err = pci_enable_device_mem(pdev); |
4010 | err = pci_enable_device(pdev); | ||
4011 | else | ||
4012 | err = pci_enable_device_mem(pdev); | ||
4013 | if (err) { | 3995 | if (err) { |
4014 | dev_err(&pdev->dev, | 3996 | dev_err(&pdev->dev, |
4015 | "Cannot enable PCI device from suspend\n"); | 3997 | "Cannot enable PCI device from suspend\n"); |
@@ -4043,7 +4025,7 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4043 | * is up. For all other cases, let the f/w know that the h/w is now | 4025 | * is up. For all other cases, let the f/w know that the h/w is now |
4044 | * under the control of the driver. | 4026 | * under the control of the driver. |
4045 | */ | 4027 | */ |
4046 | if (!(adapter->flags & FLAG_HAS_AMT) || !e1000e_check_mng_mode(&adapter->hw)) | 4028 | if (!(adapter->flags & FLAG_HAS_AMT)) |
4047 | e1000_get_hw_control(adapter); | 4029 | e1000_get_hw_control(adapter); |
4048 | 4030 | ||
4049 | return 0; | 4031 | return 0; |
@@ -4111,10 +4093,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) | |||
4111 | int err; | 4093 | int err; |
4112 | 4094 | ||
4113 | e1000e_disable_l1aspm(pdev); | 4095 | e1000e_disable_l1aspm(pdev); |
4114 | if (adapter->need_ioport) | 4096 | err = pci_enable_device_mem(pdev); |
4115 | err = pci_enable_device(pdev); | ||
4116 | else | ||
4117 | err = pci_enable_device_mem(pdev); | ||
4118 | if (err) { | 4097 | if (err) { |
4119 | dev_err(&pdev->dev, | 4098 | dev_err(&pdev->dev, |
4120 | "Cannot re-enable PCI device after reset.\n"); | 4099 | "Cannot re-enable PCI device after reset.\n"); |
@@ -4162,8 +4141,7 @@ static void e1000_io_resume(struct pci_dev *pdev) | |||
4162 | * is up. For all other cases, let the f/w know that the h/w is now | 4141 | * is up. For all other cases, let the f/w know that the h/w is now |
4163 | * under the control of the driver. | 4142 | * under the control of the driver. |
4164 | */ | 4143 | */ |
4165 | if (!(adapter->flags & FLAG_HAS_AMT) || | 4144 | if (!(adapter->flags & FLAG_HAS_AMT)) |
4166 | !e1000e_check_mng_mode(&adapter->hw)) | ||
4167 | e1000_get_hw_control(adapter); | 4145 | e1000_get_hw_control(adapter); |
4168 | 4146 | ||
4169 | } | 4147 | } |
@@ -4175,36 +4153,40 @@ static void e1000_print_device_info(struct e1000_adapter *adapter) | |||
4175 | u32 pba_num; | 4153 | u32 pba_num; |
4176 | 4154 | ||
4177 | /* print bus type/speed/width info */ | 4155 | /* print bus type/speed/width info */ |
4178 | ndev_info(netdev, "(PCI Express:2.5GB/s:%s) " | 4156 | e_info("(PCI Express:2.5GB/s:%s) %02x:%02x:%02x:%02x:%02x:%02x\n", |
4179 | "%02x:%02x:%02x:%02x:%02x:%02x\n", | 4157 | /* bus width */ |
4180 | /* bus width */ | 4158 | ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : |
4181 | ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : | 4159 | "Width x1"), |
4182 | "Width x1"), | 4160 | /* MAC address */ |
4183 | /* MAC address */ | 4161 | netdev->dev_addr[0], netdev->dev_addr[1], |
4184 | netdev->dev_addr[0], netdev->dev_addr[1], | 4162 | netdev->dev_addr[2], netdev->dev_addr[3], |
4185 | netdev->dev_addr[2], netdev->dev_addr[3], | 4163 | netdev->dev_addr[4], netdev->dev_addr[5]); |
4186 | netdev->dev_addr[4], netdev->dev_addr[5]); | 4164 | e_info("Intel(R) PRO/%s Network Connection\n", |
4187 | ndev_info(netdev, "Intel(R) PRO/%s Network Connection\n", | 4165 | (hw->phy.type == e1000_phy_ife) ? "10/100" : "1000"); |
4188 | (hw->phy.type == e1000_phy_ife) | ||
4189 | ? "10/100" : "1000"); | ||
4190 | e1000e_read_pba_num(hw, &pba_num); | 4166 | e1000e_read_pba_num(hw, &pba_num); |
4191 | ndev_info(netdev, "MAC: %d, PHY: %d, PBA No: %06x-%03x\n", | 4167 | e_info("MAC: %d, PHY: %d, PBA No: %06x-%03x\n", |
4192 | hw->mac.type, hw->phy.type, | 4168 | hw->mac.type, hw->phy.type, (pba_num >> 8), (pba_num & 0xff)); |
4193 | (pba_num >> 8), (pba_num & 0xff)); | ||
4194 | } | 4169 | } |
4195 | 4170 | ||
4196 | /** | 4171 | static void e1000_eeprom_checks(struct e1000_adapter *adapter) |
4197 | * e1000e_is_need_ioport - determine if an adapter needs ioport resources or not | ||
4198 | * @pdev: PCI device information struct | ||
4199 | * | ||
4200 | * Returns true if an adapters needs ioport resources | ||
4201 | **/ | ||
4202 | static int e1000e_is_need_ioport(struct pci_dev *pdev) | ||
4203 | { | 4172 | { |
4204 | switch (pdev->device) { | 4173 | struct e1000_hw *hw = &adapter->hw; |
4205 | /* Currently there are no adapters that need ioport resources */ | 4174 | int ret_val; |
4206 | default: | 4175 | u16 buf = 0; |
4207 | return false; | 4176 | |
4177 | if (hw->mac.type != e1000_82573) | ||
4178 | return; | ||
4179 | |||
4180 | ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &buf); | ||
4181 | if (!(le16_to_cpu(buf) & (1 << 0))) { | ||
4182 | /* Deep Smart Power Down (DSPD) */ | ||
4183 | e_warn("Warning: detected DSPD enabled in EEPROM\n"); | ||
4184 | } | ||
4185 | |||
4186 | ret_val = e1000_read_nvm(hw, NVM_INIT_3GIO_3, 1, &buf); | ||
4187 | if (le16_to_cpu(buf) & (3 << 2)) { | ||
4188 | /* ASPM enable */ | ||
4189 | e_warn("Warning: detected ASPM enabled in EEPROM\n"); | ||
4208 | } | 4190 | } |
4209 | } | 4191 | } |
4210 | 4192 | ||
@@ -4233,19 +4215,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4233 | int i, err, pci_using_dac; | 4215 | int i, err, pci_using_dac; |
4234 | u16 eeprom_data = 0; | 4216 | u16 eeprom_data = 0; |
4235 | u16 eeprom_apme_mask = E1000_EEPROM_APME; | 4217 | u16 eeprom_apme_mask = E1000_EEPROM_APME; |
4236 | int bars, need_ioport; | ||
4237 | 4218 | ||
4238 | e1000e_disable_l1aspm(pdev); | 4219 | e1000e_disable_l1aspm(pdev); |
4239 | 4220 | ||
4240 | /* do not allocate ioport bars when not needed */ | 4221 | err = pci_enable_device_mem(pdev); |
4241 | need_ioport = e1000e_is_need_ioport(pdev); | ||
4242 | if (need_ioport) { | ||
4243 | bars = pci_select_bars(pdev, IORESOURCE_MEM | IORESOURCE_IO); | ||
4244 | err = pci_enable_device(pdev); | ||
4245 | } else { | ||
4246 | bars = pci_select_bars(pdev, IORESOURCE_MEM); | ||
4247 | err = pci_enable_device_mem(pdev); | ||
4248 | } | ||
4249 | if (err) | 4222 | if (err) |
4250 | return err; | 4223 | return err; |
4251 | 4224 | ||
@@ -4268,7 +4241,9 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4268 | } | 4241 | } |
4269 | } | 4242 | } |
4270 | 4243 | ||
4271 | err = pci_request_selected_regions(pdev, bars, e1000e_driver_name); | 4244 | err = pci_request_selected_regions(pdev, |
4245 | pci_select_bars(pdev, IORESOURCE_MEM), | ||
4246 | e1000e_driver_name); | ||
4272 | if (err) | 4247 | if (err) |
4273 | goto err_pci_reg; | 4248 | goto err_pci_reg; |
4274 | 4249 | ||
@@ -4293,8 +4268,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4293 | adapter->hw.adapter = adapter; | 4268 | adapter->hw.adapter = adapter; |
4294 | adapter->hw.mac.type = ei->mac; | 4269 | adapter->hw.mac.type = ei->mac; |
4295 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; | 4270 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; |
4296 | adapter->bars = bars; | ||
4297 | adapter->need_ioport = need_ioport; | ||
4298 | 4271 | ||
4299 | mmio_start = pci_resource_start(pdev, 0); | 4272 | mmio_start = pci_resource_start(pdev, 0); |
4300 | mmio_len = pci_resource_len(pdev, 0); | 4273 | mmio_len = pci_resource_len(pdev, 0); |
@@ -4366,8 +4339,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4366 | } | 4339 | } |
4367 | 4340 | ||
4368 | if (e1000_check_reset_block(&adapter->hw)) | 4341 | if (e1000_check_reset_block(&adapter->hw)) |
4369 | ndev_info(netdev, | 4342 | e_info("PHY reset is blocked due to SOL/IDER session.\n"); |
4370 | "PHY reset is blocked due to SOL/IDER session.\n"); | ||
4371 | 4343 | ||
4372 | netdev->features = NETIF_F_SG | | 4344 | netdev->features = NETIF_F_SG | |
4373 | NETIF_F_HW_CSUM | | 4345 | NETIF_F_HW_CSUM | |
@@ -4411,25 +4383,26 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4411 | if (e1000_validate_nvm_checksum(&adapter->hw) >= 0) | 4383 | if (e1000_validate_nvm_checksum(&adapter->hw) >= 0) |
4412 | break; | 4384 | break; |
4413 | if (i == 2) { | 4385 | if (i == 2) { |
4414 | ndev_err(netdev, "The NVM Checksum Is Not Valid\n"); | 4386 | e_err("The NVM Checksum Is Not Valid\n"); |
4415 | err = -EIO; | 4387 | err = -EIO; |
4416 | goto err_eeprom; | 4388 | goto err_eeprom; |
4417 | } | 4389 | } |
4418 | } | 4390 | } |
4419 | 4391 | ||
4392 | e1000_eeprom_checks(adapter); | ||
4393 | |||
4420 | /* copy the MAC address out of the NVM */ | 4394 | /* copy the MAC address out of the NVM */ |
4421 | if (e1000e_read_mac_addr(&adapter->hw)) | 4395 | if (e1000e_read_mac_addr(&adapter->hw)) |
4422 | ndev_err(netdev, "NVM Read Error while reading MAC address\n"); | 4396 | e_err("NVM Read Error while reading MAC address\n"); |
4423 | 4397 | ||
4424 | memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); | 4398 | memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); |
4425 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); | 4399 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); |
4426 | 4400 | ||
4427 | if (!is_valid_ether_addr(netdev->perm_addr)) { | 4401 | if (!is_valid_ether_addr(netdev->perm_addr)) { |
4428 | ndev_err(netdev, "Invalid MAC Address: " | 4402 | e_err("Invalid MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", |
4429 | "%02x:%02x:%02x:%02x:%02x:%02x\n", | 4403 | netdev->perm_addr[0], netdev->perm_addr[1], |
4430 | netdev->perm_addr[0], netdev->perm_addr[1], | 4404 | netdev->perm_addr[2], netdev->perm_addr[3], |
4431 | netdev->perm_addr[2], netdev->perm_addr[3], | 4405 | netdev->perm_addr[4], netdev->perm_addr[5]); |
4432 | netdev->perm_addr[4], netdev->perm_addr[5]); | ||
4433 | err = -EIO; | 4406 | err = -EIO; |
4434 | goto err_eeprom; | 4407 | goto err_eeprom; |
4435 | } | 4408 | } |
@@ -4499,8 +4472,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4499 | * is up. For all other cases, let the f/w know that the h/w is now | 4472 | * is up. For all other cases, let the f/w know that the h/w is now |
4500 | * under the control of the driver. | 4473 | * under the control of the driver. |
4501 | */ | 4474 | */ |
4502 | if (!(adapter->flags & FLAG_HAS_AMT) || | 4475 | if (!(adapter->flags & FLAG_HAS_AMT)) |
4503 | !e1000e_check_mng_mode(&adapter->hw)) | ||
4504 | e1000_get_hw_control(adapter); | 4476 | e1000_get_hw_control(adapter); |
4505 | 4477 | ||
4506 | /* tell the stack to leave us alone until e1000_open() is called */ | 4478 | /* tell the stack to leave us alone until e1000_open() is called */ |
@@ -4517,24 +4489,25 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4517 | return 0; | 4489 | return 0; |
4518 | 4490 | ||
4519 | err_register: | 4491 | err_register: |
4520 | err_hw_init: | 4492 | if (!(adapter->flags & FLAG_HAS_AMT)) |
4521 | e1000_release_hw_control(adapter); | 4493 | e1000_release_hw_control(adapter); |
4522 | err_eeprom: | 4494 | err_eeprom: |
4523 | if (!e1000_check_reset_block(&adapter->hw)) | 4495 | if (!e1000_check_reset_block(&adapter->hw)) |
4524 | e1000_phy_hw_reset(&adapter->hw); | 4496 | e1000_phy_hw_reset(&adapter->hw); |
4497 | err_hw_init: | ||
4525 | 4498 | ||
4526 | if (adapter->hw.flash_address) | ||
4527 | iounmap(adapter->hw.flash_address); | ||
4528 | |||
4529 | err_flashmap: | ||
4530 | kfree(adapter->tx_ring); | 4499 | kfree(adapter->tx_ring); |
4531 | kfree(adapter->rx_ring); | 4500 | kfree(adapter->rx_ring); |
4532 | err_sw_init: | 4501 | err_sw_init: |
4502 | if (adapter->hw.flash_address) | ||
4503 | iounmap(adapter->hw.flash_address); | ||
4504 | err_flashmap: | ||
4533 | iounmap(adapter->hw.hw_addr); | 4505 | iounmap(adapter->hw.hw_addr); |
4534 | err_ioremap: | 4506 | err_ioremap: |
4535 | free_netdev(netdev); | 4507 | free_netdev(netdev); |
4536 | err_alloc_etherdev: | 4508 | err_alloc_etherdev: |
4537 | pci_release_selected_regions(pdev, bars); | 4509 | pci_release_selected_regions(pdev, |
4510 | pci_select_bars(pdev, IORESOURCE_MEM)); | ||
4538 | err_pci_reg: | 4511 | err_pci_reg: |
4539 | err_dma: | 4512 | err_dma: |
4540 | pci_disable_device(pdev); | 4513 | pci_disable_device(pdev); |
@@ -4582,7 +4555,8 @@ static void __devexit e1000_remove(struct pci_dev *pdev) | |||
4582 | iounmap(adapter->hw.hw_addr); | 4555 | iounmap(adapter->hw.hw_addr); |
4583 | if (adapter->hw.flash_address) | 4556 | if (adapter->hw.flash_address) |
4584 | iounmap(adapter->hw.flash_address); | 4557 | iounmap(adapter->hw.flash_address); |
4585 | pci_release_selected_regions(pdev, adapter->bars); | 4558 | pci_release_selected_regions(pdev, |
4559 | pci_select_bars(pdev, IORESOURCE_MEM)); | ||
4586 | 4560 | ||
4587 | free_netdev(netdev); | 4561 | free_netdev(netdev); |
4588 | 4562 | ||
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c index a66b92efcf80..8effc3107f9a 100644 --- a/drivers/net/e1000e/param.c +++ b/drivers/net/e1000e/param.c | |||
@@ -27,6 +27,7 @@ | |||
27 | *******************************************************************************/ | 27 | *******************************************************************************/ |
28 | 28 | ||
29 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
30 | #include <linux/pci.h> | ||
30 | 31 | ||
31 | #include "e1000.h" | 32 | #include "e1000.h" |
32 | 33 | ||
@@ -162,17 +163,16 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
162 | case enable_option: | 163 | case enable_option: |
163 | switch (*value) { | 164 | switch (*value) { |
164 | case OPTION_ENABLED: | 165 | case OPTION_ENABLED: |
165 | ndev_info(adapter->netdev, "%s Enabled\n", opt->name); | 166 | e_info("%s Enabled\n", opt->name); |
166 | return 0; | 167 | return 0; |
167 | case OPTION_DISABLED: | 168 | case OPTION_DISABLED: |
168 | ndev_info(adapter->netdev, "%s Disabled\n", opt->name); | 169 | e_info("%s Disabled\n", opt->name); |
169 | return 0; | 170 | return 0; |
170 | } | 171 | } |
171 | break; | 172 | break; |
172 | case range_option: | 173 | case range_option: |
173 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { | 174 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { |
174 | ndev_info(adapter->netdev, | 175 | e_info("%s set to %i\n", opt->name, *value); |
175 | "%s set to %i\n", opt->name, *value); | ||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | break; | 178 | break; |
@@ -184,8 +184,7 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
184 | ent = &opt->arg.l.p[i]; | 184 | ent = &opt->arg.l.p[i]; |
185 | if (*value == ent->i) { | 185 | if (*value == ent->i) { |
186 | if (ent->str[0] != '\0') | 186 | if (ent->str[0] != '\0') |
187 | ndev_info(adapter->netdev, "%s\n", | 187 | e_info("%s\n", ent->str); |
188 | ent->str); | ||
189 | return 0; | 188 | return 0; |
190 | } | 189 | } |
191 | } | 190 | } |
@@ -195,8 +194,8 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
195 | BUG(); | 194 | BUG(); |
196 | } | 195 | } |
197 | 196 | ||
198 | ndev_info(adapter->netdev, "Invalid %s value specified (%i) %s\n", | 197 | e_info("Invalid %s value specified (%i) %s\n", opt->name, *value, |
199 | opt->name, *value, opt->err); | 198 | opt->err); |
200 | *value = opt->def; | 199 | *value = opt->def; |
201 | return -1; | 200 | return -1; |
202 | } | 201 | } |
@@ -213,13 +212,11 @@ static int __devinit e1000_validate_option(unsigned int *value, | |||
213 | void __devinit e1000e_check_options(struct e1000_adapter *adapter) | 212 | void __devinit e1000e_check_options(struct e1000_adapter *adapter) |
214 | { | 213 | { |
215 | struct e1000_hw *hw = &adapter->hw; | 214 | struct e1000_hw *hw = &adapter->hw; |
216 | struct net_device *netdev = adapter->netdev; | ||
217 | int bd = adapter->bd_number; | 215 | int bd = adapter->bd_number; |
218 | 216 | ||
219 | if (bd >= E1000_MAX_NIC) { | 217 | if (bd >= E1000_MAX_NIC) { |
220 | ndev_notice(netdev, | 218 | e_notice("Warning: no configuration for board #%i\n", bd); |
221 | "Warning: no configuration for board #%i\n", bd); | 219 | e_notice("Using defaults for all values\n"); |
222 | ndev_notice(netdev, "Using defaults for all values\n"); | ||
223 | } | 220 | } |
224 | 221 | ||
225 | { /* Transmit Interrupt Delay */ | 222 | { /* Transmit Interrupt Delay */ |
@@ -313,19 +310,15 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
313 | adapter->itr = InterruptThrottleRate[bd]; | 310 | adapter->itr = InterruptThrottleRate[bd]; |
314 | switch (adapter->itr) { | 311 | switch (adapter->itr) { |
315 | case 0: | 312 | case 0: |
316 | ndev_info(netdev, "%s turned off\n", | 313 | e_info("%s turned off\n", opt.name); |
317 | opt.name); | ||
318 | break; | 314 | break; |
319 | case 1: | 315 | case 1: |
320 | ndev_info(netdev, | 316 | e_info("%s set to dynamic mode\n", opt.name); |
321 | "%s set to dynamic mode\n", | ||
322 | opt.name); | ||
323 | adapter->itr_setting = adapter->itr; | 317 | adapter->itr_setting = adapter->itr; |
324 | adapter->itr = 20000; | 318 | adapter->itr = 20000; |
325 | break; | 319 | break; |
326 | case 3: | 320 | case 3: |
327 | ndev_info(netdev, | 321 | e_info("%s set to dynamic conservative mode\n", |
328 | "%s set to dynamic conservative mode\n", | ||
329 | opt.name); | 322 | opt.name); |
330 | adapter->itr_setting = adapter->itr; | 323 | adapter->itr_setting = adapter->itr; |
331 | adapter->itr = 20000; | 324 | adapter->itr = 20000; |