add tinc
[10.03/openwrt.git] / package / linux / kernel-patches / 204-net_sched_sch_api_c-wlfix
1 --- linux-mips-cvs/net/sched/sch_api.c  2004-11-19 01:29:09.000000000 +0100
2 +++ linux-broadcom/net/sched/sch_api.c  2005-01-31 18:07:45.000000000 +0100
3 @@ -194,7 +194,11 @@
4  {
5         struct Qdisc *q;
6  
7 +#ifdef CONFIG_BCM4710
8 +       for (q = dev->qdisc_list; q; q = q->next) {
9 +#else
10         list_for_each_entry(q, &dev->qdisc_list, list) {
11 +#endif
12                 if (q->handle == handle)
13                         return q;
14         }
15 @@ -371,8 +375,10 @@
16                         unsigned long cl = cops->get(parent, classid);
17                         if (cl) {
18                                 err = cops->graft(parent, cl, new, old);
19 +#ifndef CONFIG_BCM4710
20                                 if (new)
21                                         new->parent = classid;
22 +#endif
23                                 cops->put(parent, cl);
24                         }
25                 }
26 @@ -427,7 +433,11 @@
27  
28         memset(sch, 0, size);
29  
30 +#ifdef CONFIG_BCM4710
31 +       sch->next = NULL;
32 +#else
33         INIT_LIST_HEAD(&sch->list);
34 +#endif
35         skb_queue_head_init(&sch->q);
36  
37         if (handle == TC_H_INGRESS)
38 @@ -453,7 +463,12 @@
39  
40         if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) {
41                 write_lock(&qdisc_tree_lock);
42 +#ifdef CONFIG_BCM4710
43 +               sch->next = dev->qdisc_list;
44 +               dev->qdisc_list = sch;
45 +#else
46                 list_add_tail(&sch->list, &dev->qdisc_list);
47 +#endif
48                 write_unlock(&qdisc_tree_lock);
49  #ifdef CONFIG_NET_ESTIMATOR
50                 if (tca[TCA_RATE-1])
51 @@ -809,12 +824,20 @@
52                         s_q_idx = 0;
53                 read_lock(&qdisc_tree_lock);
54                 q_idx = 0;
55 +#ifdef CONFIG_BCM4710  
56 +               for (q = dev->qdisc_list, q_idx = 0; q; q = q->next, q_idx++) {
57 +#else
58                 list_for_each_entry(q, &dev->qdisc_list, list) {
59 +#endif
60                         if (q_idx < s_q_idx) {
61                                 q_idx++;
62                                 continue;
63                         }
64 +#ifdef CONFIG_BCM4710
65 +                       if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid,
66 +#else
67                         if (tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid,
68 +#endif
69                                           cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
70                                 read_unlock(&qdisc_tree_lock);
71                                 goto done;
72 @@ -1033,7 +1056,11 @@
73         t = 0;
74  
75         read_lock(&qdisc_tree_lock);
76 +#ifdef CONFIG_BCM4710
77 +       for (q=dev->qdisc_list, t=0; q; q = q->next, t++) {
78 +#else
79         list_for_each_entry(q, &dev->qdisc_list, list) {
80 +#endif
81                 if (t < s_t || !q->ops->cl_ops ||
82                     (tcm->tcm_parent &&
83                      TC_H_MAJ(tcm->tcm_parent) != q->handle)) {