]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/igb/igb_main.c
sundance: set carrier status on link change events
[linux-2.6-omap-h63xx.git] / drivers / net / igb / igb_main.c
index cfed2b07f3a4a041f048b9e7cec1fcd0ec538924..93d02efa9a0a614167d6dc533178aeaa02cf5556 100644 (file)
@@ -61,7 +61,6 @@ static struct pci_device_id igb_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER), board_82575 },
@@ -521,7 +520,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
                              adapter->msix_entries,
                              numvecs);
        if (err == 0)
-               return;
+               goto out;
 
        igb_reset_interrupt_capability(adapter);
 
@@ -531,7 +530,7 @@ msi_only:
        adapter->num_tx_queues = 1;
        if (!pci_enable_msi(adapter->pdev))
                adapter->flags |= IGB_FLAG_HAS_MSI;
-
+out:
        /* Notify the stack of the (possibly) reduced Tx Queue count. */
        adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
        return;
@@ -720,28 +719,6 @@ static void igb_get_hw_control(struct igb_adapter *adapter)
                        ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
 }
 
-static void igb_init_manageability(struct igb_adapter *adapter)
-{
-       struct e1000_hw *hw = &adapter->hw;
-
-       if (adapter->en_mng_pt) {
-               u32 manc2h = rd32(E1000_MANC2H);
-               u32 manc = rd32(E1000_MANC);
-
-               /* enable receiving management packets to the host */
-               /* this will probably generate destination unreachable messages
-                * from the host OS, but the packets will be handled on SMBUS */
-               manc |= E1000_MANC_EN_MNG2HOST;
-#define E1000_MNG2HOST_PORT_623 (1 << 5)
-#define E1000_MNG2HOST_PORT_664 (1 << 6)
-               manc2h |= E1000_MNG2HOST_PORT_623;
-               manc2h |= E1000_MNG2HOST_PORT_664;
-               wr32(E1000_MANC2H, manc2h);
-
-               wr32(E1000_MANC, manc);
-       }
-}
-
 /**
  * igb_configure - configure the hardware for RX and TX
  * @adapter: private board structure
@@ -755,7 +732,6 @@ static void igb_configure(struct igb_adapter *adapter)
        igb_set_multi(netdev);
 
        igb_restore_vlan(adapter);
-       igb_init_manageability(adapter);
 
        igb_configure_tx(adapter);
        igb_setup_rctl(adapter);
@@ -1240,16 +1216,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
                if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1)
                        adapter->eeprom_wol = 0;
                break;
-       case E1000_DEV_ID_82576_QUAD_COPPER:
-               /* if quad port adapter, disable WoL on all but port A */
-               if (global_quad_port_a != 0)
-                       adapter->eeprom_wol = 0;
-               else
-                       adapter->flags |= IGB_FLAG_QUAD_PORT_A;
-               /* Reset for multiple quad port adapters */
-               if (++global_quad_port_a == 4)
-                       global_quad_port_a = 0;
-               break;
        }
 
        /* initialize the wol settings based on the eeprom settings */
@@ -2313,7 +2279,9 @@ static void igb_watchdog_task(struct work_struct *work)
        struct igb_ring *tx_ring = adapter->tx_ring;
        struct e1000_mac_info *mac = &adapter->hw.mac;
        u32 link;
+       u32 eics = 0;
        s32 ret_val;
+       int i;
 
        if ((netif_carrier_ok(netdev)) &&
            (rd32(E1000_STATUS) & E1000_STATUS_LU))
@@ -2415,7 +2383,13 @@ link_up:
        }
 
        /* Cause software interrupt to ensure rx ring is cleaned */
-       wr32(E1000_ICS, E1000_ICS_RXDMT0);
+       if (adapter->msix_entries) {
+               for (i = 0; i < adapter->num_rx_queues; i++)
+                       eics |= adapter->rx_ring[i].eims_value;
+               wr32(E1000_EICS, eics);
+       } else {
+               wr32(E1000_ICS, E1000_ICS_RXDMT0);
+       }
 
        /* Force detection of hung controller every watchdog period */
        tx_ring->detect_tx_hung = true;
@@ -3589,10 +3563,6 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget)
        struct net_device *netdev = adapter->netdev;
        int work_done = 0;
 
-       /* Keep link state information with original netdev */
-       if (!netif_carrier_ok(netdev))
-               goto quit_polling;
-
 #ifdef CONFIG_DCA
        if (adapter->flags & IGB_FLAG_DCA_ENABLED)
                igb_update_rx_dca(rx_ring);
@@ -3602,7 +3572,6 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget)
 
        /* If not enough Rx work done, exit the polling mode */
        if ((work_done == 0) || !netif_running(netdev)) {
-quit_polling:
                netif_rx_complete(netdev, napi);
 
                if (adapter->itr_setting & 3) {
@@ -3643,16 +3612,14 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
        unsigned int i;
        u32 head, oldhead;
        unsigned int count = 0;
-       bool cleaned = false;
-       bool retval = true;
        unsigned int total_bytes = 0, total_packets = 0;
+       bool retval = true;
 
        rmb();
        head = get_head(tx_ring);
        i = tx_ring->next_to_clean;
        while (1) {
                while (i != head) {
-                       cleaned = true;
                        tx_desc = E1000_TX_DESC(*tx_ring, i);
                        buffer_info = &tx_ring->buffer_info[i];
                        skb = buffer_info->skb;
@@ -3669,7 +3636,6 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
                        }
 
                        igb_unmap_and_free_tx_resource(adapter, buffer_info);
-                       tx_desc->upper.data = 0;
 
                        i++;
                        if (i == tx_ring->count)
@@ -3691,7 +3657,7 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
 done_cleaning:
        tx_ring->next_to_clean = i;
 
-       if (unlikely(cleaned &&
+       if (unlikely(count &&
                     netif_carrier_ok(netdev) &&
                     IGB_DESC_UNUSED(tx_ring) >= IGB_TX_QUEUE_WAKE)) {
                /* Make sure that anybody stopping the queue after this
@@ -4524,8 +4490,6 @@ static void igb_io_resume(struct pci_dev *pdev)
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct igb_adapter *adapter = netdev_priv(netdev);
 
-       igb_init_manageability(adapter);
-
        if (netif_running(netdev)) {
                if (igb_up(adapter)) {
                        dev_err(&pdev->dev, "igb_up failed after reset\n");