aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_atm.c468
1 files changed, 232 insertions, 236 deletions
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 54b92d22796c..9b458c403fa0 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -2,7 +2,6 @@
2 2
3/* Written 1998-2000 by Werner Almesberger, EPFL ICA */ 3/* Written 1998-2000 by Werner Almesberger, EPFL ICA */
4 4
5
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/init.h> 6#include <linux/init.h>
8#include <linux/string.h> 7#include <linux/string.h>
@@ -11,12 +10,11 @@
11#include <linux/atmdev.h> 10#include <linux/atmdev.h>
12#include <linux/atmclip.h> 11#include <linux/atmclip.h>
13#include <linux/rtnetlink.h> 12#include <linux/rtnetlink.h>
14#include <linux/file.h> /* for fput */ 13#include <linux/file.h> /* for fput */
15#include <net/netlink.h> 14#include <net/netlink.h>
16#include <net/pkt_sched.h> 15#include <net/pkt_sched.h>
17 16
18 17extern struct socket *sockfd_lookup(int fd, int *err); /* @@@ fix this */
19extern struct socket *sockfd_lookup(int fd, int *err); /* @@@ fix this */
20 18
21#if 0 /* control */ 19#if 0 /* control */
22#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args) 20#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
@@ -30,7 +28,6 @@ extern struct socket *sockfd_lookup(int fd, int *err); /* @@@ fix this */
30#define D2PRINTK(format,args...) 28#define D2PRINTK(format,args...)
31#endif 29#endif
32 30
33
34/* 31/*
35 * The ATM queuing discipline provides a framework for invoking classifiers 32 * The ATM queuing discipline provides a framework for invoking classifiers
36 * (aka "filters"), which in turn select classes of this queuing discipline. 33 * (aka "filters"), which in turn select classes of this queuing discipline.
@@ -52,16 +49,15 @@ extern struct socket *sockfd_lookup(int fd, int *err); /* @@@ fix this */
52 * - should lock the flow while there is data in the queue (?) 49 * - should lock the flow while there is data in the queue (?)
53 */ 50 */
54 51
55
56#define PRIV(sch) qdisc_priv(sch) 52#define PRIV(sch) qdisc_priv(sch)
57#define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back)) 53#define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back))
58 54
59
60struct atm_flow_data { 55struct atm_flow_data {
61 struct Qdisc *q; /* FIFO, TBF, etc. */ 56 struct Qdisc *q; /* FIFO, TBF, etc. */
62 struct tcf_proto *filter_list; 57 struct tcf_proto *filter_list;
63 struct atm_vcc *vcc; /* VCC; NULL if VCC is closed */ 58 struct atm_vcc *vcc; /* VCC; NULL if VCC is closed */
64 void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* chaining */ 59 void (*old_pop)(struct atm_vcc *vcc,
60 struct sk_buff * skb); /* chaining */
65 struct atm_qdisc_data *parent; /* parent qdisc */ 61 struct atm_qdisc_data *parent; /* parent qdisc */
66 struct socket *sock; /* for closing */ 62 struct socket *sock; /* for closing */
67 u32 classid; /* x:y type ID */ 63 u32 classid; /* x:y type ID */
@@ -82,76 +78,74 @@ struct atm_qdisc_data {
82 struct tasklet_struct task; /* requeue tasklet */ 78 struct tasklet_struct task; /* requeue tasklet */
83}; 79};
84 80
85
86/* ------------------------- Class/flow operations ------------------------- */ 81/* ------------------------- Class/flow operations ------------------------- */
87 82
88 83static int find_flow(struct atm_qdisc_data *qdisc, struct atm_flow_data *flow)
89static int find_flow(struct atm_qdisc_data *qdisc,struct atm_flow_data *flow)
90{ 84{
91 struct atm_flow_data *walk; 85 struct atm_flow_data *walk;
92 86
93 DPRINTK("find_flow(qdisc %p,flow %p)\n",qdisc,flow); 87 DPRINTK("find_flow(qdisc %p,flow %p)\n", qdisc, flow);
94 for (walk = qdisc->flows; walk; walk = walk->next) 88 for (walk = qdisc->flows; walk; walk = walk->next)
95 if (walk == flow) return 1; 89 if (walk == flow)
90 return 1;
96 DPRINTK("find_flow: not found\n"); 91 DPRINTK("find_flow: not found\n");
97 return 0; 92 return 0;
98} 93}
99 94
100 95static inline struct atm_flow_data *lookup_flow(struct Qdisc *sch, u32 classid)
101static __inline__ struct atm_flow_data *lookup_flow(struct Qdisc *sch,
102 u32 classid)
103{ 96{
104 struct atm_qdisc_data *p = PRIV(sch); 97 struct atm_qdisc_data *p = PRIV(sch);
105 struct atm_flow_data *flow; 98 struct atm_flow_data *flow;
106 99
107 for (flow = p->flows; flow; flow = flow->next) 100 for (flow = p->flows; flow; flow = flow->next)
108 if (flow->classid == classid) break; 101 if (flow->classid == classid)
102 break;
109 return flow; 103 return flow;
110} 104}
111 105
112 106static int atm_tc_graft(struct Qdisc *sch, unsigned long arg,
113static int atm_tc_graft(struct Qdisc *sch,unsigned long arg, 107 struct Qdisc *new, struct Qdisc **old)
114 struct Qdisc *new,struct Qdisc **old)
115{ 108{
116 struct atm_qdisc_data *p = PRIV(sch); 109 struct atm_qdisc_data *p = PRIV(sch);
117 struct atm_flow_data *flow = (struct atm_flow_data *) arg; 110 struct atm_flow_data *flow = (struct atm_flow_data *)arg;
118 111
119 DPRINTK("atm_tc_graft(sch %p,[qdisc %p],flow %p,new %p,old %p)\n",sch, 112 DPRINTK("atm_tc_graft(sch %p,[qdisc %p],flow %p,new %p,old %p)\n",
120 p,flow,new,old); 113 sch, p, flow, new, old);
121 if (!find_flow(p,flow)) return -EINVAL; 114 if (!find_flow(p, flow))
122 if (!new) new = &noop_qdisc; 115 return -EINVAL;
123 *old = xchg(&flow->q,new); 116 if (!new)
124 if (*old) qdisc_reset(*old); 117 new = &noop_qdisc;
118 *old = xchg(&flow->q, new);
119 if (*old)
120 qdisc_reset(*old);
125 return 0; 121 return 0;
126} 122}
127 123
128 124static struct Qdisc *atm_tc_leaf(struct Qdisc *sch, unsigned long cl)
129static struct Qdisc *atm_tc_leaf(struct Qdisc *sch,unsigned long cl)
130{ 125{
131 struct atm_flow_data *flow = (struct atm_flow_data *) cl; 126 struct atm_flow_data *flow = (struct atm_flow_data *)cl;
132 127
133 DPRINTK("atm_tc_leaf(sch %p,flow %p)\n",sch,flow); 128 DPRINTK("atm_tc_leaf(sch %p,flow %p)\n", sch, flow);
134 return flow ? flow->q : NULL; 129 return flow ? flow->q : NULL;
135} 130}
136 131
137 132static unsigned long atm_tc_get(struct Qdisc *sch, u32 classid)
138static unsigned long atm_tc_get(struct Qdisc *sch,u32 classid)
139{ 133{
140 struct atm_qdisc_data *p __attribute__((unused)) = PRIV(sch); 134 struct atm_qdisc_data *p __maybe_unused = PRIV(sch);
141 struct atm_flow_data *flow; 135 struct atm_flow_data *flow;
142 136
143 DPRINTK("atm_tc_get(sch %p,[qdisc %p],classid %x)\n",sch,p,classid); 137 DPRINTK("atm_tc_get(sch %p,[qdisc %p],classid %x)\n", sch, p, classid);
144 flow = lookup_flow(sch,classid); 138 flow = lookup_flow(sch, classid);
145 if (flow) flow->ref++; 139 if (flow)
146 DPRINTK("atm_tc_get: flow %p\n",flow); 140 flow->ref++;
147 return (unsigned long) flow; 141 DPRINTK("atm_tc_get: flow %p\n", flow);
142 return (unsigned long)flow;
148} 143}
149 144
150
151static unsigned long atm_tc_bind_filter(struct Qdisc *sch, 145static unsigned long atm_tc_bind_filter(struct Qdisc *sch,
152 unsigned long parent, u32 classid) 146 unsigned long parent, u32 classid)
153{ 147{
154 return atm_tc_get(sch,classid); 148 return atm_tc_get(sch, classid);
155} 149}
156 150
157/* 151/*
@@ -159,72 +153,75 @@ static unsigned long atm_tc_bind_filter(struct Qdisc *sch,
159 * requested (atm_tc_destroy, etc.). The assumption here is that we never drop 153 * requested (atm_tc_destroy, etc.). The assumption here is that we never drop
160 * anything that still seems to be in use. 154 * anything that still seems to be in use.
161 */ 155 */
162
163static void atm_tc_put(struct Qdisc *sch, unsigned long cl) 156static void atm_tc_put(struct Qdisc *sch, unsigned long cl)
164{ 157{
165 struct atm_qdisc_data *p = PRIV(sch); 158 struct atm_qdisc_data *p = PRIV(sch);
166 struct atm_flow_data *flow = (struct atm_flow_data *) cl; 159 struct atm_flow_data *flow = (struct atm_flow_data *)cl;
167 struct atm_flow_data **prev; 160 struct atm_flow_data **prev;
168 161
169 DPRINTK("atm_tc_put(sch %p,[qdisc %p],flow %p)\n",sch,p,flow); 162 DPRINTK("atm_tc_put(sch %p,[qdisc %p],flow %p)\n", sch, p, flow);
170 if (--flow->ref) return; 163 if (--flow->ref)
164 return;
171 DPRINTK("atm_tc_put: destroying\n"); 165 DPRINTK("atm_tc_put: destroying\n");
172 for (prev = &p->flows; *prev; prev = &(*prev)->next) 166 for (prev = &p->flows; *prev; prev = &(*prev)->next)
173 if (*prev == flow) break; 167 if (*prev == flow)
168 break;
174 if (!*prev) { 169 if (!*prev) {
175 printk(KERN_CRIT "atm_tc_put: class %p not found\n",flow); 170 printk(KERN_CRIT "atm_tc_put: class %p not found\n", flow);
176 return; 171 return;
177 } 172 }
178 *prev = flow->next; 173 *prev = flow->next;
179 DPRINTK("atm_tc_put: qdisc %p\n",flow->q); 174 DPRINTK("atm_tc_put: qdisc %p\n", flow->q);
180 qdisc_destroy(flow->q); 175 qdisc_destroy(flow->q);
181 tcf_destroy_chain(flow->filter_list); 176 tcf_destroy_chain(flow->filter_list);
182 if (flow->sock) { 177 if (flow->sock) {
183 DPRINTK("atm_tc_put: f_count %d\n", 178 DPRINTK("atm_tc_put: f_count %d\n",
184 file_count(flow->sock->file)); 179 file_count(flow->sock->file));
185 flow->vcc->pop = flow->old_pop; 180 flow->vcc->pop = flow->old_pop;
186 sockfd_put(flow->sock); 181 sockfd_put(flow->sock);
187 } 182 }
188 if (flow->excess) atm_tc_put(sch,(unsigned long) flow->excess); 183 if (flow->excess)
189 if (flow != &p->link) kfree(flow); 184 atm_tc_put(sch, (unsigned long)flow->excess);
185 if (flow != &p->link)
186 kfree(flow);
190 /* 187 /*
191 * If flow == &p->link, the qdisc no longer works at this point and 188 * If flow == &p->link, the qdisc no longer works at this point and
192 * needs to be removed. (By the caller of atm_tc_put.) 189 * needs to be removed. (By the caller of atm_tc_put.)
193 */ 190 */
194} 191}
195 192
196 193static void sch_atm_pop(struct atm_vcc *vcc, struct sk_buff *skb)
197static void sch_atm_pop(struct atm_vcc *vcc,struct sk_buff *skb)
198{ 194{
199 struct atm_qdisc_data *p = VCC2FLOW(vcc)->parent; 195 struct atm_qdisc_data *p = VCC2FLOW(vcc)->parent;
200 196
201 D2PRINTK("sch_atm_pop(vcc %p,skb %p,[qdisc %p])\n",vcc,skb,p); 197 D2PRINTK("sch_atm_pop(vcc %p,skb %p,[qdisc %p])\n", vcc, skb, p);
202 VCC2FLOW(vcc)->old_pop(vcc,skb); 198 VCC2FLOW(vcc)->old_pop(vcc, skb);
203 tasklet_schedule(&p->task); 199 tasklet_schedule(&p->task);
204} 200}
205 201
206static const u8 llc_oui_ip[] = { 202static const u8 llc_oui_ip[] = {
207 0xaa, /* DSAP: non-ISO */ 203 0xaa, /* DSAP: non-ISO */
208 0xaa, /* SSAP: non-ISO */ 204 0xaa, /* SSAP: non-ISO */
209 0x03, /* Ctrl: Unnumbered Information Command PDU */ 205 0x03, /* Ctrl: Unnumbered Information Command PDU */
210 0x00, /* OUI: EtherType */ 206 0x00, /* OUI: EtherType */
211 0x00, 0x00, 207 0x00, 0x00,
212 0x08, 0x00 }; /* Ethertype IP (0800) */ 208 0x08, 0x00
209}; /* Ethertype IP (0800) */
213 210
214static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, 211static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
215 struct rtattr **tca, unsigned long *arg) 212 struct rtattr **tca, unsigned long *arg)
216{ 213{
217 struct atm_qdisc_data *p = PRIV(sch); 214 struct atm_qdisc_data *p = PRIV(sch);
218 struct atm_flow_data *flow = (struct atm_flow_data *) *arg; 215 struct atm_flow_data *flow = (struct atm_flow_data *)*arg;
219 struct atm_flow_data *excess = NULL; 216 struct atm_flow_data *excess = NULL;
220 struct rtattr *opt = tca[TCA_OPTIONS-1]; 217 struct rtattr *opt = tca[TCA_OPTIONS - 1];
221 struct rtattr *tb[TCA_ATM_MAX]; 218 struct rtattr *tb[TCA_ATM_MAX];
222 struct socket *sock; 219 struct socket *sock;
223 int fd,error,hdr_len; 220 int fd, error, hdr_len;
224 void *hdr; 221 void *hdr;
225 222
226 DPRINTK("atm_tc_change(sch %p,[qdisc %p],classid %x,parent %x," 223 DPRINTK("atm_tc_change(sch %p,[qdisc %p],classid %x,parent %x,"
227 "flow %p,opt %p)\n",sch,p,classid,parent,flow,opt); 224 "flow %p,opt %p)\n", sch, p, classid, parent, flow, opt);
228 /* 225 /*
229 * The concept of parents doesn't apply for this qdisc. 226 * The concept of parents doesn't apply for this qdisc.
230 */ 227 */
@@ -237,33 +234,36 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
237 * class needs to be removed and a new one added. (This may be changed 234 * class needs to be removed and a new one added. (This may be changed
238 * later.) 235 * later.)
239 */ 236 */
240 if (flow) return -EBUSY; 237 if (flow)
238 return -EBUSY;
241 if (opt == NULL || rtattr_parse_nested(tb, TCA_ATM_MAX, opt)) 239 if (opt == NULL || rtattr_parse_nested(tb, TCA_ATM_MAX, opt))
242 return -EINVAL; 240 return -EINVAL;
243 if (!tb[TCA_ATM_FD-1] || RTA_PAYLOAD(tb[TCA_ATM_FD-1]) < sizeof(fd)) 241 if (!tb[TCA_ATM_FD - 1] || RTA_PAYLOAD(tb[TCA_ATM_FD - 1]) < sizeof(fd))
244 return -EINVAL; 242 return -EINVAL;
245 fd = *(int *) RTA_DATA(tb[TCA_ATM_FD-1]); 243 fd = *(int *)RTA_DATA(tb[TCA_ATM_FD - 1]);
246 DPRINTK("atm_tc_change: fd %d\n",fd); 244 DPRINTK("atm_tc_change: fd %d\n", fd);
247 if (tb[TCA_ATM_HDR-1]) { 245 if (tb[TCA_ATM_HDR - 1]) {
248 hdr_len = RTA_PAYLOAD(tb[TCA_ATM_HDR-1]); 246 hdr_len = RTA_PAYLOAD(tb[TCA_ATM_HDR - 1]);
249 hdr = RTA_DATA(tb[TCA_ATM_HDR-1]); 247 hdr = RTA_DATA(tb[TCA_ATM_HDR - 1]);
250 } 248 } else {
251 else {
252 hdr_len = RFC1483LLC_LEN; 249 hdr_len = RFC1483LLC_LEN;
253 hdr = NULL; /* default LLC/SNAP for IP */ 250 hdr = NULL; /* default LLC/SNAP for IP */
254 } 251 }
255 if (!tb[TCA_ATM_EXCESS-1]) excess = NULL; 252 if (!tb[TCA_ATM_EXCESS - 1])
253 excess = NULL;
256 else { 254 else {
257 if (RTA_PAYLOAD(tb[TCA_ATM_EXCESS-1]) != sizeof(u32)) 255 if (RTA_PAYLOAD(tb[TCA_ATM_EXCESS - 1]) != sizeof(u32))
258 return -EINVAL; 256 return -EINVAL;
259 excess = (struct atm_flow_data *) atm_tc_get(sch, 257 excess = (struct atm_flow_data *)
260 *(u32 *) RTA_DATA(tb[TCA_ATM_EXCESS-1])); 258 atm_tc_get(sch, *(u32 *)RTA_DATA(tb[TCA_ATM_EXCESS - 1]));
261 if (!excess) return -ENOENT; 259 if (!excess)
260 return -ENOENT;
262 } 261 }
263 DPRINTK("atm_tc_change: type %d, payload %d, hdr_len %d\n", 262 DPRINTK("atm_tc_change: type %d, payload %d, hdr_len %d\n",
264 opt->rta_type,RTA_PAYLOAD(opt),hdr_len); 263 opt->rta_type, RTA_PAYLOAD(opt), hdr_len);
265 if (!(sock = sockfd_lookup(fd,&error))) return error; /* f_count++ */ 264 if (!(sock = sockfd_lookup(fd, &error)))
266 DPRINTK("atm_tc_change: f_count %d\n",file_count(sock->file)); 265 return error; /* f_count++ */
266 DPRINTK("atm_tc_change: f_count %d\n", file_count(sock->file));
267 if (sock->ops->family != PF_ATMSVC && sock->ops->family != PF_ATMPVC) { 267 if (sock->ops->family != PF_ATMSVC && sock->ops->family != PF_ATMPVC) {
268 error = -EPROTOTYPE; 268 error = -EPROTOTYPE;
269 goto err_out; 269 goto err_out;
@@ -276,37 +276,37 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
276 error = -EINVAL; 276 error = -EINVAL;
277 goto err_out; 277 goto err_out;
278 } 278 }
279 if (find_flow(p,flow)) { 279 if (find_flow(p, flow)) {
280 error = -EEXIST; 280 error = -EEXIST;
281 goto err_out; 281 goto err_out;
282 } 282 }
283 } 283 } else {
284 else {
285 int i; 284 int i;
286 unsigned long cl; 285 unsigned long cl;
287 286
288 for (i = 1; i < 0x8000; i++) { 287 for (i = 1; i < 0x8000; i++) {
289 classid = TC_H_MAKE(sch->handle,0x8000 | i); 288 classid = TC_H_MAKE(sch->handle, 0x8000 | i);
290 if (!(cl = atm_tc_get(sch,classid))) break; 289 if (!(cl = atm_tc_get(sch, classid)))
291 atm_tc_put(sch,cl); 290 break;
291 atm_tc_put(sch, cl);
292 } 292 }
293 } 293 }
294 DPRINTK("atm_tc_change: new id %x\n",classid); 294 DPRINTK("atm_tc_change: new id %x\n", classid);
295 flow = kmalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL); 295 flow = kmalloc(sizeof(struct atm_flow_data) + hdr_len, GFP_KERNEL);
296 DPRINTK("atm_tc_change: flow %p\n",flow); 296 DPRINTK("atm_tc_change: flow %p\n", flow);
297 if (!flow) { 297 if (!flow) {
298 error = -ENOBUFS; 298 error = -ENOBUFS;
299 goto err_out; 299 goto err_out;
300 } 300 }
301 memset(flow,0,sizeof(*flow)); 301 memset(flow, 0, sizeof(*flow));
302 flow->filter_list = NULL; 302 flow->filter_list = NULL;
303 if (!(flow->q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops,classid))) 303 if (!(flow->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid)))
304 flow->q = &noop_qdisc; 304 flow->q = &noop_qdisc;
305 DPRINTK("atm_tc_change: qdisc %p\n",flow->q); 305 DPRINTK("atm_tc_change: qdisc %p\n", flow->q);
306 flow->sock = sock; 306 flow->sock = sock;
307 flow->vcc = ATM_SD(sock); /* speedup */ 307 flow->vcc = ATM_SD(sock); /* speedup */
308 flow->vcc->user_back = flow; 308 flow->vcc->user_back = flow;
309 DPRINTK("atm_tc_change: vcc %p\n",flow->vcc); 309 DPRINTK("atm_tc_change: vcc %p\n", flow->vcc);
310 flow->old_pop = flow->vcc->pop; 310 flow->old_pop = flow->vcc->pop;
311 flow->parent = p; 311 flow->parent = p;
312 flow->vcc->pop = sch_atm_pop; 312 flow->vcc->pop = sch_atm_pop;
@@ -317,50 +317,53 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
317 p->link.next = flow; 317 p->link.next = flow;
318 flow->hdr_len = hdr_len; 318 flow->hdr_len = hdr_len;
319 if (hdr) 319 if (hdr)
320 memcpy(flow->hdr,hdr,hdr_len); 320 memcpy(flow->hdr, hdr, hdr_len);
321 else 321 else
322 memcpy(flow->hdr,llc_oui_ip,sizeof(llc_oui_ip)); 322 memcpy(flow->hdr, llc_oui_ip, sizeof(llc_oui_ip));
323 *arg = (unsigned long) flow; 323 *arg = (unsigned long)flow;
324 return 0; 324 return 0;
325err_out: 325err_out:
326 if (excess) atm_tc_put(sch,(unsigned long) excess); 326 if (excess)
327 atm_tc_put(sch, (unsigned long)excess);
327 sockfd_put(sock); 328 sockfd_put(sock);
328 return error; 329 return error;
329} 330}
330 331
331 332static int atm_tc_delete(struct Qdisc *sch, unsigned long arg)
332static int atm_tc_delete(struct Qdisc *sch,unsigned long arg)
333{ 333{
334 struct atm_qdisc_data *p = PRIV(sch); 334 struct atm_qdisc_data *p = PRIV(sch);
335 struct atm_flow_data *flow = (struct atm_flow_data *) arg; 335 struct atm_flow_data *flow = (struct atm_flow_data *)arg;
336 336
337 DPRINTK("atm_tc_delete(sch %p,[qdisc %p],flow %p)\n",sch,p,flow); 337 DPRINTK("atm_tc_delete(sch %p,[qdisc %p],flow %p)\n", sch, p, flow);
338 if (!find_flow(PRIV(sch),flow)) return -EINVAL; 338 if (!find_flow(PRIV(sch), flow))
339 if (flow->filter_list || flow == &p->link) return -EBUSY; 339 return -EINVAL;
340 if (flow->filter_list || flow == &p->link)
341 return -EBUSY;
340 /* 342 /*
341 * Reference count must be 2: one for "keepalive" (set at class 343 * Reference count must be 2: one for "keepalive" (set at class
342 * creation), and one for the reference held when calling delete. 344 * creation), and one for the reference held when calling delete.
343 */ 345 */
344 if (flow->ref < 2) { 346 if (flow->ref < 2) {
345 printk(KERN_ERR "atm_tc_delete: flow->ref == %d\n",flow->ref); 347 printk(KERN_ERR "atm_tc_delete: flow->ref == %d\n", flow->ref);
346 return -EINVAL; 348 return -EINVAL;
347 } 349 }
348 if (flow->ref > 2) return -EBUSY; /* catch references via excess, etc.*/ 350 if (flow->ref > 2)
349 atm_tc_put(sch,arg); 351 return -EBUSY; /* catch references via excess, etc. */
352 atm_tc_put(sch, arg);
350 return 0; 353 return 0;
351} 354}
352 355
353 356static void atm_tc_walk(struct Qdisc *sch, struct qdisc_walker *walker)
354static void atm_tc_walk(struct Qdisc *sch,struct qdisc_walker *walker)
355{ 357{
356 struct atm_qdisc_data *p = PRIV(sch); 358 struct atm_qdisc_data *p = PRIV(sch);
357 struct atm_flow_data *flow; 359 struct atm_flow_data *flow;
358 360
359 DPRINTK("atm_tc_walk(sch %p,[qdisc %p],walker %p)\n",sch,p,walker); 361 DPRINTK("atm_tc_walk(sch %p,[qdisc %p],walker %p)\n", sch, p, walker);
360 if (walker->stop) return; 362 if (walker->stop)
363 return;
361 for (flow = p->flows; flow; flow = flow->next) { 364 for (flow = p->flows; flow; flow = flow->next) {
362 if (walker->count >= walker->skip) 365 if (walker->count >= walker->skip)
363 if (walker->fn(sch,(unsigned long) flow,walker) < 0) { 366 if (walker->fn(sch, (unsigned long)flow, walker) < 0) {
364 walker->stop = 1; 367 walker->stop = 1;
365 break; 368 break;
366 } 369 }
@@ -368,73 +371,74 @@ static void atm_tc_walk(struct Qdisc *sch,struct qdisc_walker *walker)
368 } 371 }
369} 372}
370 373
371 374static struct tcf_proto **atm_tc_find_tcf(struct Qdisc *sch, unsigned long cl)
372static struct tcf_proto **atm_tc_find_tcf(struct Qdisc *sch,unsigned long cl)
373{ 375{
374 struct atm_qdisc_data *p = PRIV(sch); 376 struct atm_qdisc_data *p = PRIV(sch);
375 struct atm_flow_data *flow = (struct atm_flow_data *) cl; 377 struct atm_flow_data *flow = (struct atm_flow_data *)cl;
376 378
377 DPRINTK("atm_tc_find_tcf(sch %p,[qdisc %p],flow %p)\n",sch,p,flow); 379 DPRINTK("atm_tc_find_tcf(sch %p,[qdisc %p],flow %p)\n", sch, p, flow);
378 return flow ? &flow->filter_list : &p->link.filter_list; 380 return flow ? &flow->filter_list : &p->link.filter_list;
379} 381}
380 382
381
382/* --------------------------- Qdisc operations ---------------------------- */ 383/* --------------------------- Qdisc operations ---------------------------- */
383 384
384 385static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
385static int atm_tc_enqueue(struct sk_buff *skb,struct Qdisc *sch)
386{ 386{
387 struct atm_qdisc_data *p = PRIV(sch); 387 struct atm_qdisc_data *p = PRIV(sch);
388 struct atm_flow_data *flow = NULL ; /* @@@ */ 388 struct atm_flow_data *flow = NULL; /* @@@ */
389 struct tcf_result res; 389 struct tcf_result res;
390 int result; 390 int result;
391 int ret = NET_XMIT_POLICED; 391 int ret = NET_XMIT_POLICED;
392 392
393 D2PRINTK("atm_tc_enqueue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p); 393 D2PRINTK("atm_tc_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p);
394 result = TC_POLICE_OK; /* be nice to gcc */ 394 result = TC_POLICE_OK; /* be nice to gcc */
395 if (TC_H_MAJ(skb->priority) != sch->handle || 395 if (TC_H_MAJ(skb->priority) != sch->handle ||
396 !(flow = (struct atm_flow_data *) atm_tc_get(sch,skb->priority))) 396 !(flow = (struct atm_flow_data *)atm_tc_get(sch, skb->priority)))
397 for (flow = p->flows; flow; flow = flow->next) 397 for (flow = p->flows; flow; flow = flow->next)
398 if (flow->filter_list) { 398 if (flow->filter_list) {
399 result = tc_classify(skb,flow->filter_list, 399 result = tc_classify(skb, flow->filter_list,
400 &res); 400 &res);
401 if (result < 0) continue; 401 if (result < 0)
402 flow = (struct atm_flow_data *) res.class; 402 continue;
403 if (!flow) flow = lookup_flow(sch,res.classid); 403 flow = (struct atm_flow_data *)res.class;
404 if (!flow)
405 flow = lookup_flow(sch, res.classid);
404 break; 406 break;
405 } 407 }
406 if (!flow) flow = &p->link; 408 if (!flow)
409 flow = &p->link;
407 else { 410 else {
408 if (flow->vcc) 411 if (flow->vcc)
409 ATM_SKB(skb)->atm_options = flow->vcc->atm_options; 412 ATM_SKB(skb)->atm_options = flow->vcc->atm_options;
410 /*@@@ looks good ... but it's not supposed to work :-)*/ 413 /*@@@ looks good ... but it's not supposed to work :-) */
411#ifdef CONFIG_NET_CLS_POLICE 414#ifdef CONFIG_NET_CLS_POLICE
412 switch (result) { 415 switch (result) {
413 case TC_POLICE_SHOT: 416 case TC_POLICE_SHOT:
414 kfree_skb(skb); 417 kfree_skb(skb);
415 break; 418 break;
416 case TC_POLICE_RECLASSIFY: 419 case TC_POLICE_RECLASSIFY:
417 if (flow->excess) flow = flow->excess; 420 if (flow->excess)
418 else { 421 flow = flow->excess;
419 ATM_SKB(skb)->atm_options |= 422 else {
420 ATM_ATMOPT_CLP; 423 ATM_SKB(skb)->atm_options |= ATM_ATMOPT_CLP;
421 break;
422 }
423 /* fall through */
424 case TC_POLICE_OK:
425 /* fall through */
426 default:
427 break; 424 break;
425 }
426 /* fall through */
427 case TC_POLICE_OK:
428 /* fall through */
429 default:
430 break;
428 } 431 }
429#endif 432#endif
430 } 433 }
431 if ( 434 if (
432#ifdef CONFIG_NET_CLS_POLICE 435#ifdef CONFIG_NET_CLS_POLICE
433 result == TC_POLICE_SHOT || 436 result == TC_POLICE_SHOT ||
434#endif 437#endif
435 (ret = flow->q->enqueue(skb,flow->q)) != 0) { 438 (ret = flow->q->enqueue(skb, flow->q)) != 0) {
436 sch->qstats.drops++; 439 sch->qstats.drops++;
437 if (flow) flow->qstats.drops++; 440 if (flow)
441 flow->qstats.drops++;
438 return ret; 442 return ret;
439 } 443 }
440 sch->bstats.bytes += skb->len; 444 sch->bstats.bytes += skb->len;
@@ -458,7 +462,6 @@ static int atm_tc_enqueue(struct sk_buff *skb,struct Qdisc *sch)
458 return NET_XMIT_BYPASS; 462 return NET_XMIT_BYPASS;
459} 463}
460 464
461
462/* 465/*
463 * Dequeue packets and send them over ATM. Note that we quite deliberately 466 * Dequeue packets and send them over ATM. Note that we quite deliberately
464 * avoid checking net_device's flow control here, simply because sch_atm 467 * avoid checking net_device's flow control here, simply because sch_atm
@@ -466,167 +469,163 @@ static int atm_tc_enqueue(struct sk_buff *skb,struct Qdisc *sch)
466 * non-ATM interfaces. 469 * non-ATM interfaces.
467 */ 470 */
468 471
469
470static void sch_atm_dequeue(unsigned long data) 472static void sch_atm_dequeue(unsigned long data)
471{ 473{
472 struct Qdisc *sch = (struct Qdisc *) data; 474 struct Qdisc *sch = (struct Qdisc *)data;
473 struct atm_qdisc_data *p = PRIV(sch); 475 struct atm_qdisc_data *p = PRIV(sch);
474 struct atm_flow_data *flow; 476 struct atm_flow_data *flow;
475 struct sk_buff *skb; 477 struct sk_buff *skb;
476 478
477 D2PRINTK("sch_atm_dequeue(sch %p,[qdisc %p])\n",sch,p); 479 D2PRINTK("sch_atm_dequeue(sch %p,[qdisc %p])\n", sch, p);
478 for (flow = p->link.next; flow; flow = flow->next) 480 for (flow = p->link.next; flow; flow = flow->next)
479 /* 481 /*
480 * If traffic is properly shaped, this won't generate nasty 482 * If traffic is properly shaped, this won't generate nasty
481 * little bursts. Otherwise, it may ... (but that's okay) 483 * little bursts. Otherwise, it may ... (but that's okay)
482 */ 484 */
483 while ((skb = flow->q->dequeue(flow->q))) { 485 while ((skb = flow->q->dequeue(flow->q))) {
484 if (!atm_may_send(flow->vcc,skb->truesize)) { 486 if (!atm_may_send(flow->vcc, skb->truesize)) {
485 (void) flow->q->ops->requeue(skb,flow->q); 487 (void)flow->q->ops->requeue(skb, flow->q);
486 break; 488 break;
487 } 489 }
488 D2PRINTK("atm_tc_dequeue: sending on class %p\n",flow); 490 D2PRINTK("atm_tc_dequeue: sending on class %p\n", flow);
489 /* remove any LL header somebody else has attached */ 491 /* remove any LL header somebody else has attached */
490 skb_pull(skb, skb_network_offset(skb)); 492 skb_pull(skb, skb_network_offset(skb));
491 if (skb_headroom(skb) < flow->hdr_len) { 493 if (skb_headroom(skb) < flow->hdr_len) {
492 struct sk_buff *new; 494 struct sk_buff *new;
493 495
494 new = skb_realloc_headroom(skb,flow->hdr_len); 496 new = skb_realloc_headroom(skb, flow->hdr_len);
495 dev_kfree_skb(skb); 497 dev_kfree_skb(skb);
496 if (!new) continue; 498 if (!new)
499 continue;
497 skb = new; 500 skb = new;
498 } 501 }
499 D2PRINTK("sch_atm_dequeue: ip %p, data %p\n", 502 D2PRINTK("sch_atm_dequeue: ip %p, data %p\n",
500 skb_network_header(skb), skb->data); 503 skb_network_header(skb), skb->data);
501 ATM_SKB(skb)->vcc = flow->vcc; 504 ATM_SKB(skb)->vcc = flow->vcc;
502 memcpy(skb_push(skb,flow->hdr_len),flow->hdr, 505 memcpy(skb_push(skb, flow->hdr_len), flow->hdr,
503 flow->hdr_len); 506 flow->hdr_len);
504 atomic_add(skb->truesize, 507 atomic_add(skb->truesize,
505 &sk_atm(flow->vcc)->sk_wmem_alloc); 508 &sk_atm(flow->vcc)->sk_wmem_alloc);
506 /* atm.atm_options are already set by atm_tc_enqueue */ 509 /* atm.atm_options are already set by atm_tc_enqueue */
507 (void) flow->vcc->send(flow->vcc,skb); 510 flow->vcc->send(flow->vcc, skb);
508 } 511 }
509} 512}
510 513
511
512static struct sk_buff *atm_tc_dequeue(struct Qdisc *sch) 514static struct sk_buff *atm_tc_dequeue(struct Qdisc *sch)
513{ 515{
514 struct atm_qdisc_data *p = PRIV(sch); 516 struct atm_qdisc_data *p = PRIV(sch);
515 struct sk_buff *skb; 517 struct sk_buff *skb;
516 518
517 D2PRINTK("atm_tc_dequeue(sch %p,[qdisc %p])\n",sch,p); 519 D2PRINTK("atm_tc_dequeue(sch %p,[qdisc %p])\n", sch, p);
518 tasklet_schedule(&p->task); 520 tasklet_schedule(&p->task);
519 skb = p->link.q->dequeue(p->link.q); 521 skb = p->link.q->dequeue(p->link.q);
520 if (skb) sch->q.qlen--; 522 if (skb)
523 sch->q.qlen--;
521 return skb; 524 return skb;
522} 525}
523 526
524 527static int atm_tc_requeue(struct sk_buff *skb, struct Qdisc *sch)
525static int atm_tc_requeue(struct sk_buff *skb,struct Qdisc *sch)
526{ 528{
527 struct atm_qdisc_data *p = PRIV(sch); 529 struct atm_qdisc_data *p = PRIV(sch);
528 int ret; 530 int ret;
529 531
530 D2PRINTK("atm_tc_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p); 532 D2PRINTK("atm_tc_requeue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p);
531 ret = p->link.q->ops->requeue(skb,p->link.q); 533 ret = p->link.q->ops->requeue(skb, p->link.q);
532 if (!ret) { 534 if (!ret) {
533 sch->q.qlen++; 535 sch->q.qlen++;
534 sch->qstats.requeues++; 536 sch->qstats.requeues++;
535 } else { 537 } else {
536 sch->qstats.drops++; 538 sch->qstats.drops++;
537 p->link.qstats.drops++; 539 p->link.qstats.drops++;
538 } 540 }
539 return ret; 541 return ret;
540} 542}
541 543
542
543static unsigned int atm_tc_drop(struct Qdisc *sch) 544static unsigned int atm_tc_drop(struct Qdisc *sch)
544{ 545{
545 struct atm_qdisc_data *p = PRIV(sch); 546 struct atm_qdisc_data *p = PRIV(sch);
546 struct atm_flow_data *flow; 547 struct atm_flow_data *flow;
547 unsigned int len; 548 unsigned int len;
548 549
549 DPRINTK("atm_tc_drop(sch %p,[qdisc %p])\n",sch,p); 550 DPRINTK("atm_tc_drop(sch %p,[qdisc %p])\n", sch, p);
550 for (flow = p->flows; flow; flow = flow->next) 551 for (flow = p->flows; flow; flow = flow->next)
551 if (flow->q->ops->drop && (len = flow->q->ops->drop(flow->q))) 552 if (flow->q->ops->drop && (len = flow->q->ops->drop(flow->q)))
552 return len; 553 return len;
553 return 0; 554 return 0;
554} 555}
555 556
556 557static int atm_tc_init(struct Qdisc *sch, struct rtattr *opt)
557static int atm_tc_init(struct Qdisc *sch,struct rtattr *opt)
558{ 558{
559 struct atm_qdisc_data *p = PRIV(sch); 559 struct atm_qdisc_data *p = PRIV(sch);
560 560
561 DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt); 561 DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n", sch, p, opt);
562 p->flows = &p->link; 562 p->flows = &p->link;
563 if(!(p->link.q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops, 563 if (!(p->link.q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
564 sch->handle))) 564 sch->handle)))
565 p->link.q = &noop_qdisc; 565 p->link.q = &noop_qdisc;
566 DPRINTK("atm_tc_init: link (%p) qdisc %p\n",&p->link,p->link.q); 566 DPRINTK("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q);
567 p->link.filter_list = NULL; 567 p->link.filter_list = NULL;
568 p->link.vcc = NULL; 568 p->link.vcc = NULL;
569 p->link.sock = NULL; 569 p->link.sock = NULL;
570 p->link.classid = sch->handle; 570 p->link.classid = sch->handle;
571 p->link.ref = 1; 571 p->link.ref = 1;
572 p->link.next = NULL; 572 p->link.next = NULL;
573 tasklet_init(&p->task,sch_atm_dequeue,(unsigned long) sch); 573 tasklet_init(&p->task, sch_atm_dequeue, (unsigned long)sch);
574 return 0; 574 return 0;
575} 575}
576 576
577
578static void atm_tc_reset(struct Qdisc *sch) 577static void atm_tc_reset(struct Qdisc *sch)
579{ 578{
580 struct atm_qdisc_data *p = PRIV(sch); 579 struct atm_qdisc_data *p = PRIV(sch);
581 struct atm_flow_data *flow; 580 struct atm_flow_data *flow;
582 581
583 DPRINTK("atm_tc_reset(sch %p,[qdisc %p])\n",sch,p); 582 DPRINTK("atm_tc_reset(sch %p,[qdisc %p])\n", sch, p);
584 for (flow = p->flows; flow; flow = flow->next) qdisc_reset(flow->q); 583 for (flow = p->flows; flow; flow = flow->next)
584 qdisc_reset(flow->q);
585 sch->q.qlen = 0; 585 sch->q.qlen = 0;
586} 586}
587 587
588
589static void atm_tc_destroy(struct Qdisc *sch) 588static void atm_tc_destroy(struct Qdisc *sch)
590{ 589{
591 struct atm_qdisc_data *p = PRIV(sch); 590 struct atm_qdisc_data *p = PRIV(sch);
592 struct atm_flow_data *flow; 591 struct atm_flow_data *flow;
593 592
594 DPRINTK("atm_tc_destroy(sch %p,[qdisc %p])\n",sch,p); 593 DPRINTK("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p);
595 /* races ? */ 594 /* races ? */
596 while ((flow = p->flows)) { 595 while ((flow = p->flows)) {
597 tcf_destroy_chain(flow->filter_list); 596 tcf_destroy_chain(flow->filter_list);
598 flow->filter_list = NULL; 597 flow->filter_list = NULL;
599 if (flow->ref > 1) 598 if (flow->ref > 1)
600 printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow, 599 printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow,
601 flow->ref); 600 flow->ref);
602 atm_tc_put(sch,(unsigned long) flow); 601 atm_tc_put(sch, (unsigned long)flow);
603 if (p->flows == flow) { 602 if (p->flows == flow) {
604 printk(KERN_ERR "atm_destroy: putting flow %p didn't " 603 printk(KERN_ERR "atm_destroy: putting flow %p didn't "
605 "kill it\n",flow); 604 "kill it\n", flow);
606 p->flows = flow->next; /* brute force */ 605 p->flows = flow->next; /* brute force */
607 break; 606 break;
608 } 607 }
609 } 608 }
610 tasklet_kill(&p->task); 609 tasklet_kill(&p->task);
611} 610}
612 611
613
614static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl, 612static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
615 struct sk_buff *skb, struct tcmsg *tcm) 613 struct sk_buff *skb, struct tcmsg *tcm)
616{ 614{
617 struct atm_qdisc_data *p = PRIV(sch); 615 struct atm_qdisc_data *p = PRIV(sch);
618 struct atm_flow_data *flow = (struct atm_flow_data *) cl; 616 struct atm_flow_data *flow = (struct atm_flow_data *)cl;
619 unsigned char *b = skb_tail_pointer(skb); 617 unsigned char *b = skb_tail_pointer(skb);
620 struct rtattr *rta; 618 struct rtattr *rta;
621 619
622 DPRINTK("atm_tc_dump_class(sch %p,[qdisc %p],flow %p,skb %p,tcm %p)\n", 620 DPRINTK("atm_tc_dump_class(sch %p,[qdisc %p],flow %p,skb %p,tcm %p)\n",
623 sch,p,flow,skb,tcm); 621 sch, p, flow, skb, tcm);
624 if (!find_flow(p,flow)) return -EINVAL; 622 if (!find_flow(p, flow))
623 return -EINVAL;
625 tcm->tcm_handle = flow->classid; 624 tcm->tcm_handle = flow->classid;
626 tcm->tcm_info = flow->q->handle; 625 tcm->tcm_info = flow->q->handle;
627 rta = (struct rtattr *) b; 626 rta = (struct rtattr *)b;
628 RTA_PUT(skb,TCA_OPTIONS,0,NULL); 627 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
629 RTA_PUT(skb,TCA_ATM_HDR,flow->hdr_len,flow->hdr); 628 RTA_PUT(skb, TCA_ATM_HDR, flow->hdr_len, flow->hdr);
630 if (flow->vcc) { 629 if (flow->vcc) {
631 struct sockaddr_atmpvc pvc; 630 struct sockaddr_atmpvc pvc;
632 int state; 631 int state;
@@ -635,16 +634,16 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
635 pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number : -1; 634 pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number : -1;
636 pvc.sap_addr.vpi = flow->vcc->vpi; 635 pvc.sap_addr.vpi = flow->vcc->vpi;
637 pvc.sap_addr.vci = flow->vcc->vci; 636 pvc.sap_addr.vci = flow->vcc->vci;
638 RTA_PUT(skb,TCA_ATM_ADDR,sizeof(pvc),&pvc); 637 RTA_PUT(skb, TCA_ATM_ADDR, sizeof(pvc), &pvc);
639 state = ATM_VF2VS(flow->vcc->flags); 638 state = ATM_VF2VS(flow->vcc->flags);
640 RTA_PUT(skb,TCA_ATM_STATE,sizeof(state),&state); 639 RTA_PUT(skb, TCA_ATM_STATE, sizeof(state), &state);
641 } 640 }
642 if (flow->excess) 641 if (flow->excess)
643 RTA_PUT(skb,TCA_ATM_EXCESS,sizeof(u32),&flow->classid); 642 RTA_PUT(skb, TCA_ATM_EXCESS, sizeof(u32), &flow->classid);
644 else { 643 else {
645 static u32 zero; 644 static u32 zero;
646 645
647 RTA_PUT(skb,TCA_ATM_EXCESS,sizeof(zero),&zero); 646 RTA_PUT(skb, TCA_ATM_EXCESS, sizeof(zero), &zero);
648 } 647 }
649 rta->rta_len = skb_tail_pointer(skb) - b; 648 rta->rta_len = skb_tail_pointer(skb) - b;
650 return skb->len; 649 return skb->len;
@@ -655,9 +654,9 @@ rtattr_failure:
655} 654}
656static int 655static int
657atm_tc_dump_class_stats(struct Qdisc *sch, unsigned long arg, 656atm_tc_dump_class_stats(struct Qdisc *sch, unsigned long arg,
658 struct gnet_dump *d) 657 struct gnet_dump *d)
659{ 658{
660 struct atm_flow_data *flow = (struct atm_flow_data *) arg; 659 struct atm_flow_data *flow = (struct atm_flow_data *)arg;
661 660
662 flow->qstats.qlen = flow->q->q.qlen; 661 flow->qstats.qlen = flow->q->q.qlen;
663 662
@@ -674,38 +673,35 @@ static int atm_tc_dump(struct Qdisc *sch, struct sk_buff *skb)
674} 673}
675 674
676static struct Qdisc_class_ops atm_class_ops = { 675static struct Qdisc_class_ops atm_class_ops = {
677 .graft = atm_tc_graft, 676 .graft = atm_tc_graft,
678 .leaf = atm_tc_leaf, 677 .leaf = atm_tc_leaf,
679 .get = atm_tc_get, 678 .get = atm_tc_get,
680 .put = atm_tc_put, 679 .put = atm_tc_put,
681 .change = atm_tc_change, 680 .change = atm_tc_change,
682 .delete = atm_tc_delete, 681 .delete = atm_tc_delete,
683 .walk = atm_tc_walk, 682 .walk = atm_tc_walk,
684 .tcf_chain = atm_tc_find_tcf, 683 .tcf_chain = atm_tc_find_tcf,
685 .bind_tcf = atm_tc_bind_filter, 684 .bind_tcf = atm_tc_bind_filter,
686 .unbind_tcf = atm_tc_put, 685 .unbind_tcf = atm_tc_put,
687 .dump = atm_tc_dump_class, 686 .dump = atm_tc_dump_class,
688 .dump_stats = atm_tc_dump_class_stats, 687 .dump_stats = atm_tc_dump_class_stats,
689}; 688};
690 689
691static struct Qdisc_ops atm_qdisc_ops = { 690static struct Qdisc_ops atm_qdisc_ops = {
692 .next = NULL, 691 .cl_ops = &atm_class_ops,
693 .cl_ops = &atm_class_ops, 692 .id = "atm",
694 .id = "atm", 693 .priv_size = sizeof(struct atm_qdisc_data),
695 .priv_size = sizeof(struct atm_qdisc_data), 694 .enqueue = atm_tc_enqueue,
696 .enqueue = atm_tc_enqueue, 695 .dequeue = atm_tc_dequeue,
697 .dequeue = atm_tc_dequeue, 696 .requeue = atm_tc_requeue,
698 .requeue = atm_tc_requeue, 697 .drop = atm_tc_drop,
699 .drop = atm_tc_drop, 698 .init = atm_tc_init,
700 .init = atm_tc_init, 699 .reset = atm_tc_reset,
701 .reset = atm_tc_reset, 700 .destroy = atm_tc_destroy,
702 .destroy = atm_tc_destroy, 701 .dump = atm_tc_dump,
703 .change = NULL, 702 .owner = THIS_MODULE,
704 .dump = atm_tc_dump,
705 .owner = THIS_MODULE,
706}; 703};
707 704
708
709static int __init atm_init(void) 705static int __init atm_init(void)
710{ 706{
711 return register_qdisc(&atm_qdisc_ops); 707 return register_qdisc(&atm_qdisc_ops);