]> err.no Git - linux-2.6/blobdiff - drivers/net/e1000/e1000_main.c
e1000: FIX: Disable Packet Split for non jumbo frames
[linux-2.6] / drivers / net / e1000 / e1000_main.c
index 7dca38fba6a1809605340915aa7c9d65abeaa206..7362e1240178244fbf2892c5f51abf4caac0bbba 100644 (file)
@@ -153,7 +153,7 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
 static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
 static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
 static int e1000_set_mac(struct net_device *netdev, void *p);
-static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs);
+static irqreturn_t e1000_intr(int irq, void *data);
 static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter,
                                     struct e1000_tx_ring *tx_ring);
 #ifdef CONFIG_E1000_NAPI
@@ -699,7 +699,10 @@ e1000_reset(struct e1000_adapter *adapter)
                                    phy_data);
        }
 
-       if ((adapter->en_mng_pt) && (adapter->hw.mac_type < e1000_82571)) {
+       if ((adapter->en_mng_pt) &&
+           (adapter->hw.mac_type >= e1000_82540) &&
+           (adapter->hw.mac_type < e1000_82571) &&
+           (adapter->hw.media_type == e1000_media_type_copper)) {
                manc = E1000_READ_REG(&adapter->hw, MANC);
                manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
                E1000_WRITE_REG(&adapter->hw, MANC, manc);
@@ -1076,8 +1079,9 @@ e1000_remove(struct pci_dev *pdev)
 
        flush_scheduled_work();
 
-       if (adapter->hw.mac_type < e1000_82571 &&
-          adapter->hw.media_type == e1000_media_type_copper) {
+       if (adapter->hw.mac_type >= e1000_82540 &&
+           adapter->hw.mac_type < e1000_82571 &&
+           adapter->hw.media_type == e1000_media_type_copper) {
                manc = E1000_READ_REG(&adapter->hw, MANC);
                if (manc & E1000_MANC_SMBUS_EN) {
                        manc |= E1000_MANC_ARP_EN;
@@ -1804,9 +1808,11 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
         * followed by the page buffers.  Therefore, skb->data is
         * sized to hold the largest protocol header.
         */
+       /* allocations using alloc_page take too long for regular MTU
+        * so only enable packet split for jumbo frames */
        pages = PAGE_USE_COUNT(adapter->netdev->mtu);
-       if ((adapter->hw.mac_type > e1000_82547_rev_2) && (pages <= 3) &&
-           PAGE_SIZE <= 16384)
+       if ((adapter->hw.mac_type >= e1000_82571) && (pages <= 3) &&
+           PAGE_SIZE <= 16384 && (rctl & E1000_RCTL_LPE))
                adapter->rx_ps_pages = pages;
        else
                adapter->rx_ps_pages = 0;
@@ -3436,11 +3442,10 @@ e1000_update_stats(struct e1000_adapter *adapter)
  * e1000_intr - Interrupt Handler
  * @irq: interrupt number
  * @data: pointer to a network interface device structure
- * @pt_regs: CPU registers structure
  **/
 
 static irqreturn_t
-e1000_intr(int irq, void *data, struct pt_regs *regs)
+e1000_intr(int irq, void *data)
 {
        struct net_device *netdev = data;
        struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -4774,8 +4779,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
                pci_enable_wake(pdev, PCI_D3cold, 0);
        }
 
-       if (adapter->hw.mac_type < e1000_82571 &&
-          adapter->hw.media_type == e1000_media_type_copper) {
+       if (adapter->hw.mac_type >= e1000_82540 &&
+           adapter->hw.mac_type < e1000_82571 &&
+           adapter->hw.media_type == e1000_media_type_copper) {
                manc = E1000_READ_REG(&adapter->hw, MANC);
                if (manc & E1000_MANC_SMBUS_EN) {
                        manc |= E1000_MANC_ARP_EN;
@@ -4826,8 +4832,9 @@ e1000_resume(struct pci_dev *pdev)
 
        netif_device_attach(netdev);
 
-       if (adapter->hw.mac_type < e1000_82571 &&
-          adapter->hw.media_type == e1000_media_type_copper) {
+       if (adapter->hw.mac_type >= e1000_82540 &&
+           adapter->hw.mac_type < e1000_82571 &&
+           adapter->hw.media_type == e1000_media_type_copper) {
                manc = E1000_READ_REG(&adapter->hw, MANC);
                manc &= ~(E1000_MANC_ARP_EN);
                E1000_WRITE_REG(&adapter->hw, MANC, manc);
@@ -4862,7 +4869,7 @@ e1000_netpoll(struct net_device *netdev)
        struct e1000_adapter *adapter = netdev_priv(netdev);
 
        disable_irq(adapter->pdev->irq);
-       e1000_intr(adapter->pdev->irq, netdev, NULL);
+       e1000_intr(adapter->pdev->irq, netdev);
        e1000_clean_tx_irq(adapter, adapter->tx_ring);
 #ifndef CONFIG_E1000_NAPI
        adapter->clean_rx(adapter, adapter->rx_ring);
@@ -4915,10 +4922,6 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
        pci_enable_wake(pdev, PCI_D3hot, 0);
        pci_enable_wake(pdev, PCI_D3cold, 0);
 
-       /* Perform card reset only on one instance of the card */
-       if (PCI_FUNC (pdev->devfn) != 0)
-               return PCI_ERS_RESULT_RECOVERED;
-
        e1000_reset(adapter);
        E1000_WRITE_REG(&adapter->hw, WUS, ~0);
 
@@ -4949,6 +4952,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
        netif_device_attach(netdev);
 
        if (adapter->hw.mac_type >= e1000_82540 &&
+           adapter->hw.mac_type < e1000_82571 &&
            adapter->hw.media_type == e1000_media_type_copper) {
                manc = E1000_READ_REG(&adapter->hw, MANC);
                manc &= ~(E1000_MANC_ARP_EN);