]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/atlx/atl2.c
Merge branch 'linus' into oprofile-v2
[mv-sheeva.git] / drivers / net / atlx / atl2.c
index d548a67da1e881501f243e2335b18367b028cc27..f5bdc92c1a658932cb2de2663e8aad88478c9da6 100644 (file)
@@ -116,7 +116,6 @@ static int __devinit atl2_sw_init(struct atl2_adapter *adapter)
        hw->max_frame_size = adapter->netdev->mtu;
 
        spin_lock_init(&adapter->stats_lock);
-       spin_lock_init(&adapter->tx_lock);
 
        set_bit(__ATL2_DOWN, &adapter->flags);
 
@@ -522,8 +521,10 @@ static void atl2_intr_tx(struct atl2_adapter *adapter)
                atomic_set(&adapter->txd_read_ptr, (int)txd_read_ptr);
 
                /* tx statistics: */
-               if (txs->ok)
+               if (txs->ok) {
+                       adapter->net_stats.tx_bytes += txs->pkt_size;
                        adapter->net_stats.tx_packets++;
+               }
                else
                        adapter->net_stats.tx_errors++;
 
@@ -749,11 +750,7 @@ static void atl2_down(struct atl2_adapter *adapter)
         * reschedule our watchdog timer */
        set_bit(__ATL2_DOWN, &adapter->flags);
 
-#ifdef NETIF_F_LLTX
-       netif_stop_queue(netdev);
-#else
        netif_tx_disable(netdev);
-#endif
 
        /* reset MAC to disable all RX/TX */
        atl2_reset_hw(&adapter->hw);
@@ -829,7 +826,6 @@ static inline int TxdFreeBytes(struct atl2_adapter *adapter)
 static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
        struct atl2_adapter *adapter = netdev_priv(netdev);
-       unsigned long flags;
        struct tx_pkt_header *txph;
        u32 offset, copy_len;
        int txs_unused;
@@ -845,16 +841,6 @@ static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                return NETDEV_TX_OK;
        }
 
-#ifdef NETIF_F_LLTX
-       local_irq_save(flags);
-       if (!spin_trylock(&adapter->tx_lock)) {
-               /* Collision - tell upper layer to requeue */
-               local_irq_restore(flags);
-               return NETDEV_TX_LOCKED;
-       }
-#else
-       spin_lock_irqsave(&adapter->tx_lock, flags);
-#endif
        txs_unused = TxsFreeUnit(adapter);
        txbuf_unused = TxdFreeBytes(adapter);
 
@@ -862,7 +848,6 @@ static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                txs_unused < 1) {
                /* not enough resources */
                netif_stop_queue(netdev);
-               spin_unlock_irqrestore(&adapter->tx_lock, flags);
                return NETDEV_TX_BUSY;
        }
 
@@ -908,8 +893,7 @@ static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        ATL2_WRITE_REGW(&adapter->hw, REG_MB_TXD_WR_IDX,
                (adapter->txd_write_ptr >> 2));
 
-       spin_unlock_irqrestore(&adapter->tx_lock, flags);
-
+       mmiowb();
        netdev->trans_start = jiffies;
        dev_kfree_skb_any(skb);
        return NETDEV_TX_OK;
@@ -1327,6 +1311,15 @@ static void atl2_setup_pcicmd(struct pci_dev *pdev)
        pci_write_config_dword(pdev, REG_PM_CTRLSTAT, 0);
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void atl2_poll_controller(struct net_device *netdev)
+{
+       disable_irq(netdev->irq);
+       atl2_intr(netdev->irq, netdev);
+       enable_irq(netdev->irq);
+}
+#endif
+
 /*
  * atl2_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -1410,6 +1403,9 @@ static int __devinit atl2_probe(struct pci_dev *pdev,
        netdev->do_ioctl = &atl2_ioctl;
        atl2_set_ethtool_ops(netdev);
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       netdev->poll_controller = atl2_poll_controller;
+#endif
 #ifdef HAVE_TX_TIMEOUT
        netdev->tx_timeout = &atl2_tx_timeout;
        netdev->watchdog_timeo = 5 * HZ;
@@ -1435,10 +1431,6 @@ static int __devinit atl2_probe(struct pci_dev *pdev,
        netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
 #endif
 
-#ifdef NETIF_F_LLTX
-       netdev->features |= NETIF_F_LLTX;
-#endif
-
        /* Init PHY as early as possible due to power saving issue  */
        atl2_phy_init(&adapter->hw);