add oleg's fix for ethtool
[openwrt.git] / package / linux / kernel-patches / 205-net_sched_sched_generic_c.patch
1 --- linux-2.4.30/net/sched/sch_generic.c 2004-11-17 12:54:22.000000000 +0100
2 +++ linux-2.4.30-wl/net/sched/sch_generic.c 2005-04-24 18:09:38.000000000 +0200
3 @@ -392,7 +392,6 @@
4 return NULL;
5 memset(sch, 0, size);
6
7 - INIT_LIST_HEAD(&sch->list);
8 skb_queue_head_init(&sch->q);
9 sch->ops = ops;
10 sch->enqueue = ops->enqueue;
11 @@ -422,11 +421,22 @@
12 void qdisc_destroy(struct Qdisc *qdisc)
13 {
14 struct Qdisc_ops *ops = qdisc->ops;
15 + struct net_device *dev;
16
17 if (qdisc->flags&TCQ_F_BUILTIN ||
18 !atomic_dec_and_test(&qdisc->refcnt))
19 return;
20 - list_del(&qdisc->list);
21 +
22 + dev = qdisc->dev;
23 + if (dev) {
24 + struct Qdisc *q, **qp;
25 + for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) {
26 + if (q == qdisc) {
27 + *qp = q->next;
28 + break;
29 + }
30 + }
31 + }
32 #ifdef CONFIG_NET_ESTIMATOR
33 qdisc_kill_estimator(&qdisc->stats);
34 #endif
35 @@ -455,9 +465,9 @@
36 return;
37 }
38 write_lock(&qdisc_tree_lock);
39 - list_add_tail(&qdisc->list, &dev->qdisc_list);
40 + qdisc->next = dev->qdisc_list;
41 + dev->qdisc_list = qdisc;
42 write_unlock(&qdisc_tree_lock);
43 -
44 } else {
45 qdisc = &noqueue_qdisc;
46 }
47 @@ -501,7 +511,7 @@
48 dev->qdisc = &noop_qdisc;
49 spin_unlock_bh(&dev->queue_lock);
50 dev->qdisc_sleeping = &noop_qdisc;
51 - INIT_LIST_HEAD(&dev->qdisc_list);
52 + dev->qdisc_list = NULL;
53 write_unlock(&qdisc_tree_lock);
54
55 dev_watchdog_init(dev);
56 @@ -523,7 +533,7 @@
57 qdisc_destroy(qdisc);
58 }
59 #endif
60 - BUG_TRAP(list_empty(&dev->qdisc_list));
61 + BUG_TRAP(dev->qdisc_list == NULL);
62 BUG_TRAP(!timer_pending(&dev->watchdog_timer));
63 spin_unlock_bh(&dev->queue_lock);
64 write_unlock(&qdisc_tree_lock);
This page took 0.043349 seconds and 5 git commands to generate.