]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/8139cp.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / drivers / net / 8139cp.c
index 807e6992e6142ef9399466f53ab038b89807d2cc..a79f28c7a1009aac9cc023807b27d903a52807a4 100644 (file)
@@ -26,7 +26,6 @@
 
        TODO:
        * Test Tx checksumming thoroughly
-       * Implement dev->tx_timeout
 
        Low priority TODO:
        * Complete reset on PciErr
@@ -1218,6 +1217,30 @@ static int cp_close (struct net_device *dev)
        return 0;
 }
 
+static void cp_tx_timeout(struct net_device *dev)
+{
+       struct cp_private *cp = netdev_priv(dev);
+       unsigned long flags;
+       int rc;
+
+       printk(KERN_WARNING "%s: Transmit timeout, status %2x %4x %4x %4x\n",
+              dev->name, cpr8(Cmd), cpr16(CpCmd),
+              cpr16(IntrStatus), cpr16(IntrMask));
+
+       spin_lock_irqsave(&cp->lock, flags);
+
+       cp_stop_hw(cp);
+       cp_clean_rings(cp);
+       rc = cp_init_rings(cp);
+       cp_start_hw(cp);
+
+       netif_wake_queue(dev);
+
+       spin_unlock_irqrestore(&cp->lock, flags);
+
+       return;
+}
+
 #ifdef BROKEN
 static int cp_change_mtu(struct net_device *dev, int new_mtu)
 {
@@ -1555,7 +1578,6 @@ static const struct ethtool_ops cp_ethtool_ops = {
        .set_wol                = cp_set_wol,
        .get_strings            = cp_get_strings,
        .get_ethtool_stats      = cp_get_ethtool_stats,
-       .get_perm_addr          = ethtool_op_get_perm_addr,
        .get_eeprom_len         = cp_get_eeprom_len,
        .get_eeprom             = cp_get_eeprom,
        .set_eeprom             = cp_set_eeprom,
@@ -1920,10 +1942,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        dev->change_mtu = cp_change_mtu;
 #endif
        dev->ethtool_ops = &cp_ethtool_ops;
-#if 0
        dev->tx_timeout = cp_tx_timeout;
        dev->watchdog_timeo = TX_TIMEOUT;
-#endif
 
 #if CP_VLAN_TAG_USED
        dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;