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