fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / sched / sch_teql.c
index 6cf0342..4c16ad5 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/in.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/if_arp.h>
 #include <linux/if_ether.h>
 #include <linux/inet.h>
 #include <linux/netdevice.h>
@@ -273,7 +274,7 @@ teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *de
 
 static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct teql_master *master = (void*)dev->priv;
+       struct teql_master *master = netdev_priv(dev);
        struct Qdisc *start, *q;
        int busy;
        int nores;
@@ -301,20 +302,17 @@ restart:
 
                switch (teql_resolve(skb, skb_res, slave)) {
                case 0:
-                       if (spin_trylock(&slave->xmit_lock)) {
-                               slave->xmit_lock_owner = smp_processor_id();
+                       if (netif_tx_trylock(slave)) {
                                if (!netif_queue_stopped(slave) &&
                                    slave->hard_start_xmit(skb, slave) == 0) {
-                                       slave->xmit_lock_owner = -1;
-                                       spin_unlock(&slave->xmit_lock);
+                                       netif_tx_unlock(slave);
                                        master->slaves = NEXT_SLAVE(q);
                                        netif_wake_queue(dev);
                                        master->stats.tx_packets++;
                                        master->stats.tx_bytes += len;
                                        return 0;
                                }
-                               slave->xmit_lock_owner = -1;
-                               spin_unlock(&slave->xmit_lock);
+                               netif_tx_unlock(slave);
                        }
                        if (netif_queue_stopped(dev))
                                busy = 1;
@@ -349,7 +347,7 @@ drop:
 static int teql_master_open(struct net_device *dev)
 {
        struct Qdisc * q;
-       struct teql_master *m = (void*)dev->priv;
+       struct teql_master *m = netdev_priv(dev);
        int mtu = 0xFFFE;
        unsigned flags = IFF_NOARP|IFF_MULTICAST;
 
@@ -396,13 +394,13 @@ static int teql_master_close(struct net_device *dev)
 
 static struct net_device_stats *teql_master_stats(struct net_device *dev)
 {
-       struct teql_master *m = (void*)dev->priv;
+       struct teql_master *m = netdev_priv(dev);
        return &m->stats;
 }
 
 static int teql_master_mtu(struct net_device *dev, int new_mtu)
 {
-       struct teql_master *m = (void*)dev->priv;
+       struct teql_master *m = netdev_priv(dev);
        struct Qdisc *q;
 
        if (new_mtu < 68)
@@ -422,7 +420,7 @@ static int teql_master_mtu(struct net_device *dev, int new_mtu)
 
 static __init void teql_master_setup(struct net_device *dev)
 {
-       struct teql_master *master = dev->priv;
+       struct teql_master *master = netdev_priv(dev);
        struct Qdisc_ops *ops = &master->qops;
 
        master->dev     = dev;
@@ -475,7 +473,7 @@ static int __init teql_init(void)
                        break;
                }
 
-               master = dev->priv;
+               master = netdev_priv(dev);
 
                strlcpy(master->qops.id, dev->name, IFNAMSIZ);
                err = register_qdisc(&master->qops);