net: use symbolic values for ndo_start_xmit() return codes
[safe/jmp/linux-2.6] / drivers / net / myri10ge / myri10ge.c
index dfd0994..1f6e36e 100644 (file)
@@ -75,7 +75,7 @@
 #include "myri10ge_mcp.h"
 #include "myri10ge_mcp_gen_header.h"
 
-#define MYRI10GE_VERSION_STR "1.4.4-1.412"
+#define MYRI10GE_VERSION_STR "1.5.0-1.418"
 
 MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
 MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -327,10 +327,6 @@ static int myri10ge_debug = -1;    /* defaults above */
 module_param(myri10ge_debug, int, 0);
 MODULE_PARM_DESC(myri10ge_debug, "Debug level (0=none,...,16=all)");
 
-static int myri10ge_lro = 1;
-module_param(myri10ge_lro, int, S_IRUGO);
-MODULE_PARM_DESC(myri10ge_lro, "Enable large receive offload");
-
 static int myri10ge_lro_max_pkts = MYRI10GE_LRO_MAX_PKTS;
 module_param(myri10ge_lro_max_pkts, int, S_IRUGO);
 MODULE_PARM_DESC(myri10ge_lro_max_pkts,
@@ -1422,6 +1418,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
 {
        struct myri10ge_rx_done *rx_done = &ss->rx_done;
        struct myri10ge_priv *mgp = ss->mgp;
+       struct net_device *netdev = mgp->dev;
        unsigned long rx_bytes = 0;
        unsigned long rx_packets = 0;
        unsigned long rx_ok;
@@ -1455,7 +1452,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
        ss->stats.rx_packets += rx_packets;
        ss->stats.rx_bytes += rx_bytes;
 
-       if (myri10ge_lro)
+       if (netdev->features & NETIF_F_LRO)
                lro_flush_all(&rx_done->lro_mgr);
 
        /* restock receive rings if needed */
@@ -2690,7 +2687,7 @@ again:
                /* we are out of transmit resources */
                tx->stop_queue++;
                netif_tx_stop_queue(netdev_queue);
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        /* Setup checksum offloading, if needed */
@@ -2895,7 +2892,6 @@ again:
                tx->stop_queue++;
                netif_tx_stop_queue(netdev_queue);
        }
-       dev->trans_start = jiffies;
        return 0;
 
 abort_linearize:
@@ -3917,8 +3913,13 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        if (dac_enabled)
                netdev->features |= NETIF_F_HIGHDMA;
-       if (myri10ge_lro)
-               netdev->features |= NETIF_F_LRO;
+       netdev->features |= NETIF_F_LRO;
+
+       netdev->vlan_features |= mgp->features;
+       if (mgp->fw_ver_tiny < 37)
+               netdev->vlan_features &= ~NETIF_F_TSO6;
+       if (mgp->fw_ver_tiny < 32)
+               netdev->vlan_features &= ~NETIF_F_TSO;
 
        /* make sure we can get an irq, and that MSI can be
         * setup (if available).  Also ensure netdev->irq