aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_teql.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_teql.c')
-rw-r--r--net/sched/sch_teql.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index d84e7329660f..45cd30098e34 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -53,8 +53,7 @@
53 which will not break load balancing, though native slave 53 which will not break load balancing, though native slave
54 traffic will have the highest priority. */ 54 traffic will have the highest priority. */
55 55
56struct teql_master 56struct teql_master {
57{
58 struct Qdisc_ops qops; 57 struct Qdisc_ops qops;
59 struct net_device *dev; 58 struct net_device *dev;
60 struct Qdisc *slaves; 59 struct Qdisc *slaves;
@@ -65,22 +64,21 @@ struct teql_master
65 unsigned long tx_dropped; 64 unsigned long tx_dropped;
66}; 65};
67 66
68struct teql_sched_data 67struct teql_sched_data {
69{
70 struct Qdisc *next; 68 struct Qdisc *next;
71 struct teql_master *m; 69 struct teql_master *m;
72 struct neighbour *ncache; 70 struct neighbour *ncache;
73 struct sk_buff_head q; 71 struct sk_buff_head q;
74}; 72};
75 73
76#define NEXT_SLAVE(q) (((struct teql_sched_data*)qdisc_priv(q))->next) 74#define NEXT_SLAVE(q) (((struct teql_sched_data *)qdisc_priv(q))->next)
77 75
78#define FMASK (IFF_BROADCAST|IFF_POINTOPOINT) 76#define FMASK (IFF_BROADCAST | IFF_POINTOPOINT)
79 77
80/* "teql*" qdisc routines */ 78/* "teql*" qdisc routines */
81 79
82static int 80static int
83teql_enqueue(struct sk_buff *skb, struct Qdisc* sch) 81teql_enqueue(struct sk_buff *skb, struct Qdisc *sch)
84{ 82{
85 struct net_device *dev = qdisc_dev(sch); 83 struct net_device *dev = qdisc_dev(sch);
86 struct teql_sched_data *q = qdisc_priv(sch); 84 struct teql_sched_data *q = qdisc_priv(sch);
@@ -96,7 +94,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch)
96} 94}
97 95
98static struct sk_buff * 96static struct sk_buff *
99teql_dequeue(struct Qdisc* sch) 97teql_dequeue(struct Qdisc *sch)
100{ 98{
101 struct teql_sched_data *dat = qdisc_priv(sch); 99 struct teql_sched_data *dat = qdisc_priv(sch);
102 struct netdev_queue *dat_queue; 100 struct netdev_queue *dat_queue;
@@ -118,13 +116,13 @@ teql_dequeue(struct Qdisc* sch)
118} 116}
119 117
120static struct sk_buff * 118static struct sk_buff *
121teql_peek(struct Qdisc* sch) 119teql_peek(struct Qdisc *sch)
122{ 120{
123 /* teql is meant to be used as root qdisc */ 121 /* teql is meant to be used as root qdisc */
124 return NULL; 122 return NULL;
125} 123}
126 124
127static __inline__ void 125static inline void
128teql_neigh_release(struct neighbour *n) 126teql_neigh_release(struct neighbour *n)
129{ 127{
130 if (n) 128 if (n)
@@ -132,7 +130,7 @@ teql_neigh_release(struct neighbour *n)
132} 130}
133 131
134static void 132static void
135teql_reset(struct Qdisc* sch) 133teql_reset(struct Qdisc *sch)
136{ 134{
137 struct teql_sched_data *dat = qdisc_priv(sch); 135 struct teql_sched_data *dat = qdisc_priv(sch);
138 136
@@ -142,13 +140,14 @@ teql_reset(struct Qdisc* sch)
142} 140}
143 141
144static void 142static void
145teql_destroy(struct Qdisc* sch) 143teql_destroy(struct Qdisc *sch)
146{ 144{
147 struct Qdisc *q, *prev; 145 struct Qdisc *q, *prev;
148 struct teql_sched_data *dat = qdisc_priv(sch); 146 struct teql_sched_data *dat = qdisc_priv(sch);
149 struct teql_master *master = dat->m; 147 struct teql_master *master = dat->m;
150 148
151 if ((prev = master->slaves) != NULL) { 149 prev = master->slaves;
150 if (prev) {
152 do { 151 do {
153 q = NEXT_SLAVE(prev); 152 q = NEXT_SLAVE(prev);
154 if (q == sch) { 153 if (q == sch) {
@@ -180,7 +179,7 @@ teql_destroy(struct Qdisc* sch)
180static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt) 179static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt)
181{ 180{
182 struct net_device *dev = qdisc_dev(sch); 181 struct net_device *dev = qdisc_dev(sch);
183 struct teql_master *m = (struct teql_master*)sch->ops; 182 struct teql_master *m = (struct teql_master *)sch->ops;
184 struct teql_sched_data *q = qdisc_priv(sch); 183 struct teql_sched_data *q = qdisc_priv(sch);
185 184
186 if (dev->hard_header_len > m->dev->hard_header_len) 185 if (dev->hard_header_len > m->dev->hard_header_len)
@@ -291,7 +290,8 @@ restart:
291 nores = 0; 290 nores = 0;
292 busy = 0; 291 busy = 0;
293 292
294 if ((q = start) == NULL) 293 q = start;
294 if (!q)
295 goto drop; 295 goto drop;
296 296
297 do { 297 do {
@@ -356,10 +356,10 @@ drop:
356 356
357static int teql_master_open(struct net_device *dev) 357static int teql_master_open(struct net_device *dev)
358{ 358{
359 struct Qdisc * q; 359 struct Qdisc *q;
360 struct teql_master *m = netdev_priv(dev); 360 struct teql_master *m = netdev_priv(dev);
361 int mtu = 0xFFFE; 361 int mtu = 0xFFFE;
362 unsigned flags = IFF_NOARP|IFF_MULTICAST; 362 unsigned int flags = IFF_NOARP | IFF_MULTICAST;
363 363
364 if (m->slaves == NULL) 364 if (m->slaves == NULL)
365 return -EUNATCH; 365 return -EUNATCH;
@@ -427,7 +427,7 @@ static int teql_master_mtu(struct net_device *dev, int new_mtu)
427 do { 427 do {
428 if (new_mtu > qdisc_dev(q)->mtu) 428 if (new_mtu > qdisc_dev(q)->mtu)
429 return -EINVAL; 429 return -EINVAL;
430 } while ((q=NEXT_SLAVE(q)) != m->slaves); 430 } while ((q = NEXT_SLAVE(q)) != m->slaves);
431 } 431 }
432 432
433 dev->mtu = new_mtu; 433 dev->mtu = new_mtu;