ixgbe: Refactor common code between 82598 & 82599 to accommodate new hardware
[safe/jmp/linux-2.6] / drivers / net / eql.c
index 51ead79..b34a2dd 100644 (file)
  * Sorry, I had to rewrite most of this for 2.5.x -DaveM
  */
 
+#include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 #include <linux/timer.h>
 #include <linux/netdevice.h>
 #include <net/net_namespace.h>
 static int eql_open(struct net_device *dev);
 static int eql_close(struct net_device *dev);
 static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev);
 
 #define eql_is_slave(dev)      ((dev->flags & IFF_SLAVE) == IFF_SLAVE)
 #define eql_is_master(dev)     ((dev->flags & IFF_MASTER) == IFF_MASTER)
@@ -194,6 +196,7 @@ static void __init eql_setup(struct net_device *dev)
 
        dev->type               = ARPHRD_SLIP;
        dev->tx_queue_len       = 5;            /* Hands them off fast */
+       dev->priv_flags        &= ~IFF_XMIT_DST_RELEASE;
 }
 
 static int eql_open(struct net_device *dev)
@@ -324,7 +327,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
        return best_slave;
 }
 
-static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        equalizer_t *eql = netdev_priv(dev);
        slave_t *slave;
@@ -347,7 +350,7 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
 
        spin_unlock(&eql->queue.lock);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -542,6 +545,8 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
        }
        spin_unlock_bh(&eql->queue.lock);
 
+       dev_put(slave_dev);
+
        return ret;
 }