]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sched/sch_teql.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[linux-2.6-omap-h63xx.git] / net / sched / sch_teql.c
index dfe7e45209881286224be077df71b91af073e74c..0444fd0f0d2298228934a6f06ca54913f3280b8b 100644 (file)
@@ -9,30 +9,17 @@
  */
 
 #include <linux/module.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <linux/bitops.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/socket.h>
-#include <linux/sockios.h>
-#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>
-#include <linux/etherdevice.h>
-#include <linux/notifier.h>
 #include <linux/init.h>
-#include <net/ip.h>
-#include <net/route.h>
 #include <linux/skbuff.h>
 #include <linux/moduleparam.h>
-#include <net/sock.h>
+#include <net/dst.h>
+#include <net/neighbour.h>
 #include <net/pkt_sched.h>
 
 /*
@@ -84,7 +71,7 @@ struct teql_sched_data
 
 #define NEXT_SLAVE(q) (((struct teql_sched_data*)qdisc_priv(q))->next)
 
-#define FMASK (IFF_BROADCAST|IFF_POINTOPOINT|IFF_BROADCAST)
+#define FMASK (IFF_BROADCAST|IFF_POINTOPOINT)
 
 /* "teql*" qdisc routines */
 
@@ -181,7 +168,7 @@ teql_destroy(struct Qdisc* sch)
        }
 }
 
-static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
+static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt)
 {
        struct net_device *dev = sch->dev;
        struct teql_master *m = (struct teql_master*)sch->ops;
@@ -225,7 +212,6 @@ static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
        return 0;
 }
 
-/* "teql*" netdevice routines */
 
 static int
 __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev)
@@ -246,9 +232,12 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *
        }
        if (neigh_event_send(n, skb_res) == 0) {
                int err;
+
                read_lock(&n->lock);
-               err = dev->hard_header(skb, dev, ntohs(skb->protocol), n->ha, NULL, skb->len);
+               err = dev_hard_header(skb, dev, ntohs(skb->protocol),
+                                     n->ha, NULL, skb->len);
                read_unlock(&n->lock);
+
                if (err < 0) {
                        neigh_release(n);
                        return -EINVAL;
@@ -260,10 +249,13 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *
        return (skb_res == NULL) ? -EAGAIN : 1;
 }
 
-static __inline__ int
-teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev)
+static inline int teql_resolve(struct sk_buff *skb,
+                              struct sk_buff *skb_res, struct net_device *dev)
 {
-       if (dev->hard_header == NULL ||
+       if (dev->qdisc == &noop_qdisc)
+               return -ENODEV;
+
+       if (dev->header_ops == NULL ||
            skb->dst == NULL ||
            skb->dst->neighbour == NULL)
                return 0;
@@ -277,7 +269,7 @@ static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
        int busy;
        int nores;
        int len = skb->len;
-       int subq = skb->queue_mapping;
+       int subq = skb_get_queue_mapping(skb);
        struct sk_buff *skb_res = NULL;
 
        start = master->slaves;
@@ -295,7 +287,7 @@ restart:
                if (slave->qdisc_sleeping != q)
                        continue;
                if (netif_queue_stopped(slave) ||
-                   netif_subqueue_stopped(slave, subq) ||
+                   __netif_subqueue_stopped(slave, subq) ||
                    !netif_running(slave)) {
                        busy = 1;
                        continue;
@@ -305,7 +297,7 @@ restart:
                case 0:
                        if (netif_tx_trylock(slave)) {
                                if (!netif_queue_stopped(slave) &&
-                                   !netif_subqueue_stopped(slave, subq) &&
+                                   !__netif_subqueue_stopped(slave, subq) &&
                                    slave->hard_start_xmit(skb, slave) == 0) {
                                        netif_tx_unlock(slave);
                                        master->slaves = NEXT_SLAVE(q);
@@ -446,7 +438,6 @@ static __init void teql_master_setup(struct net_device *dev)
        dev->tx_queue_len       = 100;
        dev->flags              = IFF_NOARP;
        dev->hard_header_len    = LL_MAX_HEADER;
-       SET_MODULE_OWNER(dev);
 }
 
 static LIST_HEAD(master_dev_list);