59289a1b3086257e40a135fe852b09fcf7c0a524
[openwrt.git] / target / linux / generic-2.4 / patches / 226-atm_br2684.patch
1 Index: linux-2.4.35.4/net/atm/br2684.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/net/atm/br2684.c        2007-12-15 05:19:38.818633185 +0100
4 +++ linux-2.4.35.4/net/atm/br2684.c     2007-12-15 05:20:03.656048591 +0100
5 @@ -55,36 +55,55 @@
6  #define skb_debug(skb) do {} while (0)
7  #endif
8  
9 +#define        BR2684_LLC_LEN          3
10 +#define        BR2684_SNAP_LEN         3
11 +#define        BR2684_ETHERTYPE_LEN    2
12 +#define        BR2684_PID_LEN          2
13 +#define        BR2684_PAD_LEN          2
14 +
15 +static unsigned char llc_common[] = { 0xaa, 0xaa, 0x03 };
16 +static unsigned char snap_bridged[] = { 0x00, 0x80, 0xc2 };
17 +static unsigned char snap_routed[] = { 0x00, 0x00, 0x00 };
18 +static unsigned char pid_ipv4[] = { 0x00, 0x07 };
19 +static unsigned char ethertype_ipv4[] = { 0x08, 0x00 };
20 +static unsigned char ethertype_ipv6[] = { 0x86, 0xdd };
21 +static unsigned char pad_bridged[] = { 0x00, 0x00 };
22 +
23  static unsigned char llc_oui_pid_pad[] =
24      { 0xAA, 0xAA, 0x03, 0x00, 0x80, 0xC2, 0x00, 0x07, 0x00, 0x00 };
25 +static unsigned char llc_oui_ipv6[] =
26 +    { 0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x86, 0xdd };
27 +static unsigned char llc_oui_ipv4[] =
28 +    { 0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00 };
29  #define PADLEN (2)
30  
31  enum br2684_encaps {
32 -       e_vc  = BR2684_ENCAPS_VC,
33 +       e_vc = BR2684_ENCAPS_VC,
34         e_llc = BR2684_ENCAPS_LLC,
35  };
36  
37  struct br2684_vcc {
38 -       struct atm_vcc  *atmvcc;
39 +       struct atm_vcc *atmvcc;
40         struct br2684_dev *brdev;
41         /* keep old push,pop functions for chaining */
42 -       void (*old_push)(struct atm_vcc *vcc,struct sk_buff *skb);
43 +       void (*old_push) (struct atm_vcc * vcc, struct sk_buff * skb);
44         /* void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); */
45         enum br2684_encaps encaps;
46 +       enum br2684_payload payload;
47         struct list_head brvccs;
48  #ifdef CONFIG_ATM_BR2684_IPFILTER
49         struct br2684_filter filter;
50 -#endif /* CONFIG_ATM_BR2684_IPFILTER */
51 +#endif                         /* CONFIG_ATM_BR2684_IPFILTER */
52  #ifndef FASTER_VERSION
53         unsigned copies_needed, copies_failed;
54 -#endif /* FASTER_VERSION */
55 +#endif                         /* FASTER_VERSION */
56  };
57  
58  struct br2684_dev {
59         struct net_device net_dev;
60         struct list_head br2684_devs;
61         int number;
62 -       struct list_head brvccs; /* one device <=> one vcc (before xmas) */
63 +       struct list_head brvccs;        /* one device <=> one vcc (before xmas) */
64         struct net_device_stats stats;
65         int mac_was_set;
66  };
67 @@ -173,24 +192,84 @@
68                 }
69                 skb = skb2;
70         }
71 -       skb_push(skb, minheadroom);
72 -       if (brvcc->encaps == e_llc)
73 -               memcpy(skb->data, llc_oui_pid_pad, 10);
74 -       else
75 -               memset(skb->data, 0, 2);
76 -#endif /* FASTER_VERSION */
77 +
78 +       /* This skb_push is a problem: routed packets need less headroom than
79 +        * bridged packets.
80 +        */
81 +
82 +/*     skb_push(skb, minheadroom); */
83 +       if (brvcc->encaps == e_llc) {
84 +               int offset = 0;
85 +               int actual_headroom;
86 +
87 +               actual_headroom =
88 +                   BR2684_LLC_LEN +
89 +                   BR2684_SNAP_LEN +
90 +                   ((brvcc->payload == p_bridged) ?
91 +                    (BR2684_PID_LEN + BR2684_PAD_LEN) :
92 +                    BR2684_ETHERTYPE_LEN);
93 +
94 +               skb_push(skb, actual_headroom);
95 +               memcpy(skb->data, llc_common, BR2684_LLC_LEN);
96 +               offset += BR2684_LLC_LEN;
97 +
98 +               if (brvcc->payload == p_bridged) {
99 +                       memcpy(skb->data + offset, snap_bridged,
100 +                              BR2684_SNAP_LEN);
101 +                       offset += BR2684_SNAP_LEN;
102 +                       /* pid_ipv4 is poorly named.  should probably be
103 +                        * pid_ethernet
104 +                        */
105 +                       memcpy(skb->data + offset, pid_ipv4,
106 +                              BR2684_PID_LEN);
107 +                       offset += BR2684_PID_LEN;
108 +                       memcpy(skb->data + offset, pad_bridged,
109 +                              BR2684_PAD_LEN);
110 +                       offset += BR2684_PAD_LEN;
111 +               } else if (brvcc->payload == p_routed) {
112 +                       unsigned short prot =
113 +                           __constant_ntohs(skb->protocol);
114 +                       memcpy(skb->data + offset, snap_routed,
115 +                              BR2684_SNAP_LEN);
116 +                       offset += BR2684_SNAP_LEN;
117 +
118 +                       switch (prot) {
119 +                       case ETH_P_IP:
120 +                               memcpy(skb->data + offset,
121 +                                      ethertype_ipv4,
122 +                                      BR2684_ETHERTYPE_LEN);
123 +                               break;
124 +                       case ETH_P_IPV6:
125 +                               memcpy(skb->data + offset,
126 +                                      ethertype_ipv6,
127 +                                      BR2684_ETHERTYPE_LEN);
128 +                               break;
129 +                       default:
130 +                               dev_kfree_skb(skb);
131 +                               return 0;
132 +                       }
133 +                       offset += BR2684_ETHERTYPE_LEN;
134 +
135 +               }
136 +       } else {
137 +               skb_push(skb, 2);
138 +               if (brvcc->payload == p_bridged)
139 +                       memset(skb->data, 0, 2);
140 +       }
141 +#endif                         /* FASTER_VERSION */
142         skb_debug(skb);
143  
144         ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
145 -       DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
146 +       DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc,
147 +               atmvcc->dev);
148         if (!atm_may_send(atmvcc, skb->truesize)) {
149                 /* we free this here for now, because we cannot know in a higher 
150 -                       layer whether the skb point it supplied wasn't freed yet.
151 -                       now, it always is.
152 -               */
153 +                  layer whether the skb point it supplied wasn't freed yet.
154 +                  now, it always is.
155 +                */
156                 dev_kfree_skb(skb);
157                 return 0;
158 -               }
159 +       }
160         atomic_add(skb->truesize, &atmvcc->sk->wmem_alloc);
161         ATM_SKB(skb)->atm_options = atmvcc->atm_options;
162         brdev->stats.tx_packets++;
163 @@ -428,18 +507,39 @@
164         atm_return(atmvcc, skb->truesize);
165         DPRINTK("skb from brdev %p\n", brdev);
166         if (brvcc->encaps == e_llc) {
167 +               /* accept packets that have "ipv[46]" in the snap header */
168 +               /* 8 - 2 == sizeof(llc_oui_ipv6) - BR2684_ETHERTYPE_LEN */
169 +               if (memcmp(skb->data, llc_oui_ipv6, 8 - 2) == 0) {
170 +                       plen = sizeof(llc_oui_ipv6);
171 +
172 +                       if (memcmp(skb->data + 6, ethertype_ipv6, 2) == 0)
173 +                               skb->protocol =
174 +                                   __constant_htons(ETH_P_IPV6);
175 +                       else if (memcmp(skb->data + 6, ethertype_ipv4, 2)
176 +                                == 0)
177 +                               skb->protocol = __constant_htons(ETH_P_IP);
178 +                       else {
179 +                               brdev->stats.rx_errors++;
180 +                               dev_kfree_skb(skb);
181 +                               return;
182 +                       }
183 +                       skb_pull(skb, plen);
184 +                       skb->nh.raw = skb->data;
185 +                       skb->pkt_type = PACKET_HOST;
186 +               }
187 +
188                 /* let us waste some time for checking the encapsulation.
189                    Note, that only 7 char is checked so frames with a valid FCS
190                    are also accepted (but FCS is not checked of course) */
191 -               if (memcmp(skb->data, llc_oui_pid_pad, 7)) {
192 +               else if (memcmp(skb->data, llc_oui_pid_pad, 7) == 0) {
193 +                       skb_pull(skb, plen - ETH_HLEN);
194 +                       skb->protocol =
195 +                           eth_type_trans(skb, &brdev->net_dev);
196 +               } else {
197                         brdev->stats.rx_errors++;
198                         dev_kfree_skb(skb);
199                         return;
200                 }
201 -
202 -               /* Strip FCS if present */
203 -               if (skb->len > 7 && skb->data[7] == 0x01)
204 -                       __skb_trim(skb, skb->len - 4);
205         } else {
206                 plen = PADLEN + ETH_HLEN;       /* pad, dstmac,srcmac, ethtype */
207                 /* first 2 chars should be 0 */
208 @@ -448,13 +548,14 @@
209                         dev_kfree_skb(skb);
210                         return;
211                 }
212 +               skb_pull(skb, plen - ETH_HLEN);
213 +               skb->protocol = eth_type_trans(skb, &brdev->net_dev);
214         }
215         if (skb->len < plen) {
216                 brdev->stats.rx_errors++;
217                 dev_kfree_skb(skb);     /* dev_ not needed? */
218                 return;
219         }
220 -
221  #ifdef FASTER_VERSION
222         /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
223            than should be. What else should I set? */
224 @@ -465,30 +566,29 @@
225         skb->protocol = ((u16 *) skb->data)[-1];
226  #else                          /* some protocols might require this: */
227         skb->protocol = br_type_trans(skb, &brdev->net_dev);
228 -#endif /* CONFIG_BR2684_FAST_TRANS */
229 +#endif                         /* CONFIG_BR2684_FAST_TRANS */
230  #else
231 -       skb_pull(skb, plen - ETH_HLEN);
232 -       skb->protocol = eth_type_trans(skb, &brdev->net_dev);
233 -#endif /* FASTER_VERSION */
234 +       /* skb_pull(skb, plen - ETH_HLEN); */
235 +       /* skb->protocol = eth_type_trans(skb, &brdev->net_dev); */
236 +#endif                         /* FASTER_VERSION */
237  #ifdef CONFIG_ATM_BR2684_IPFILTER
238         if (packet_fails_filter(skb->protocol, brvcc, skb)) {
239                 brdev->stats.rx_dropped++;
240                 dev_kfree_skb(skb);
241                 return;
242         }
243 -#endif /* CONFIG_ATM_BR2684_IPFILTER */
244 +#endif                         /* CONFIG_ATM_BR2684_IPFILTER */
245         skb->dev = &brdev->net_dev;
246 -       ATM_SKB(skb)->vcc = atmvcc;     /* needed ? */
247 +       /* ATM_SKB(skb)->vcc = atmvcc;  *//* needed ? */
248         DPRINTK("received packet's protocol: %x\n", ntohs(skb->protocol));
249         skb_debug(skb);
250 -       if (!(brdev->net_dev.flags & IFF_UP)) { /* sigh, interface is down */
251 +       if (!(brdev->net_dev.flags & IFF_UP)) { /* sigh, interface is down */
252                 brdev->stats.rx_dropped++;
253                 dev_kfree_skb(skb);
254                 return;
255         }
256         brdev->stats.rx_packets++;
257         brdev->stats.rx_bytes += skb->len;
258 -       memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data));
259         netif_rx(skb);
260  }
261  
262 @@ -525,10 +625,10 @@
263                 err = -EEXIST;
264                 goto error;
265         }
266 -       if (be.fcs_in != BR2684_FCSIN_NO || be.fcs_out != BR2684_FCSOUT_NO ||
267 -           be.fcs_auto || be.has_vpiid || be.send_padding || (be.encaps !=
268 -           BR2684_ENCAPS_VC && be.encaps != BR2684_ENCAPS_LLC) ||
269 -           be.min_size != 0) {
270 +       if (be.fcs_in != BR2684_FCSIN_NO || be.fcs_out != BR2684_FCSOUT_NO
271 +           || be.fcs_auto || be.has_vpiid || be.send_padding
272 +           || (be.encaps != BR2684_ENCAPS_VC
273 +               && be.encaps != BR2684_ENCAPS_LLC) || be.min_size != 0) {
274                 err = -EINVAL;
275                 goto error;
276         }
277 @@ -554,18 +654,21 @@
278         brvcc->atmvcc = atmvcc;
279         atmvcc->user_back = brvcc;
280         brvcc->encaps = (enum br2684_encaps) be.encaps;
281 +       brvcc->payload = (enum br2684_payload) be.payload;
282         brvcc->old_push = atmvcc->push;
283         barrier();
284         atmvcc->push = br2684_push;
285         skb_queue_head_init(&copy);
286         skb_migrate(&atmvcc->sk->receive_queue, &copy);
287         while ((skb = skb_dequeue(&copy))) {
288 +#ifdef notdef
289                 BRPRIV(skb->dev)->stats.rx_bytes -= skb->len;
290                 BRPRIV(skb->dev)->stats.rx_packets--;
291 +#endif
292                 br2684_push(atmvcc, skb);
293         }
294         return 0;
295 -    error:
296 +      error:
297         write_unlock_irq(&devs_lock);
298         MOD_DEC_USE_COUNT;
299         return err;
300 @@ -608,12 +711,25 @@
301  
302         if (ni.ifname[0] != '\0') {
303                 memcpy(brdev->net_dev.name, ni.ifname,
304 -                   sizeof(brdev->net_dev.name));
305 -               brdev->net_dev.name[sizeof(brdev->net_dev.name) - 1] = '\0';
306 +                      sizeof(brdev->net_dev.name));
307 +               brdev->net_dev.name[sizeof(brdev->net_dev.name) - 1] =
308 +                   '\0';
309         } else
310                 sprintf(brdev->net_dev.name, "nas%d", brdev->number);
311         DPRINTK("registered netdev %s\n", brdev->net_dev.name);
312 -       ether_setup(&brdev->net_dev);
313 +       if (ni.payload == p_routed) {
314 +               brdev->net_dev.hard_header_len = 0;
315 +               brdev->net_dev.addr_len = 0;
316 +               brdev->net_dev.mtu = 1500;
317 +
318 +               /* Type PPP seems most suitable */
319 +               brdev->net_dev.type = ARPHRD_PPP;
320 +               brdev->net_dev.flags =
321 +                   IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
322 +               brdev->net_dev.tx_queue_len = 100;
323 +       } else {
324 +               ether_setup(&brdev->net_dev);
325 +       }
326         brdev->mac_was_set = 0;
327  #ifdef FASTER_VERSION
328         my_eth_header = brdev->net_dev.hard_header;
329 @@ -677,12 +793,11 @@
330                 err = br2684_setfilt(atmvcc, arg);
331                 MOD_DEC_USE_COUNT;
332                 return err;
333 -#endif /* CONFIG_ATM_BR2684_IPFILTER */
334 +#endif                         /* CONFIG_ATM_BR2684_IPFILTER */
335         }
336         return -ENOIOCTLCMD;
337  }
338  
339 -#ifdef CONFIG_PROC_FS
340  /* Never put more than 256 bytes in at once */
341  static int br2684_proc_engine(loff_t pos, char *buf)
342  {
343 @@ -692,52 +807,62 @@
344         list_for_each(lhd, &br2684_devs) {
345                 brdev = list_entry_brdev(lhd);
346                 if (pos-- == 0)
347 -                       return sprintf(buf, "dev %.16s: num=%d, mac=%02X:%02X:"
348 -                           "%02X:%02X:%02X:%02X (%s)\n", brdev->net_dev.name,
349 -                           brdev->number,
350 -                           brdev->net_dev.dev_addr[0],
351 -                           brdev->net_dev.dev_addr[1],
352 -                           brdev->net_dev.dev_addr[2],
353 -                           brdev->net_dev.dev_addr[3],
354 -                           brdev->net_dev.dev_addr[4],
355 -                           brdev->net_dev.dev_addr[5],
356 -                           brdev->mac_was_set ? "set" : "auto");
357 +                       return sprintf(buf,
358 +                                      "dev %.16s: num=%d, mac=%02X:%02X:"
359 +                                      "%02X:%02X:%02X:%02X (%s)\n",
360 +                                      brdev->net_dev.name, brdev->number,
361 +                                      brdev->net_dev.dev_addr[0],
362 +                                      brdev->net_dev.dev_addr[1],
363 +                                      brdev->net_dev.dev_addr[2],
364 +                                      brdev->net_dev.dev_addr[3],
365 +                                      brdev->net_dev.dev_addr[4],
366 +                                      brdev->net_dev.dev_addr[5],
367 +                                      brdev->
368 +                                      mac_was_set ? "set" : "auto");
369                 list_for_each(lhc, &brdev->brvccs) {
370                         brvcc = list_entry_brvcc(lhc);
371                         if (pos-- == 0)
372 -                               return sprintf(buf, "  vcc %d.%d.%d: encaps=%s"
373 +                               return sprintf(buf,
374 +                                              "  vcc %d.%d.%d: encaps=%s"
375 +                                              ", payload=%s"
376  #ifndef FASTER_VERSION
377 -                                   ", failed copies %u/%u"
378 -#endif /* FASTER_VERSION */
379 -                                   "\n", brvcc->atmvcc->dev->number,
380 -                                   brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
381 -                                   (brvcc->encaps == e_llc) ? "LLC" : "VC"
382 +                                              ", failed copies %u/%u"
383 +#endif                         /* FASTER_VERSION */
384 +                                              "\n",
385 +                                              brvcc->atmvcc->dev->number,
386 +                                              brvcc->atmvcc->vpi,
387 +                                              brvcc->atmvcc->vci,
388 +                                              (brvcc->encaps ==
389 +                                               e_llc) ? "LLC" : "VC",
390 +                                              (brvcc->payload ==
391 +                                               p_bridged) ? "bridged" :
392 +                                              "routed"
393  #ifndef FASTER_VERSION
394 -                                   , brvcc->copies_failed
395 -                                   , brvcc->copies_needed
396 -#endif /* FASTER_VERSION */
397 +                                              , brvcc->copies_failed,
398 +                                              brvcc->copies_needed
399 +#endif                         /* FASTER_VERSION */
400                                     );
401  #ifdef CONFIG_ATM_BR2684_IPFILTER
402  #define b1(var, byte)  ((u8 *) &brvcc->filter.var)[byte]
403  #define bs(var)                b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
404                         if (brvcc->filter.netmask != 0 && pos-- == 0)
405 -                               return sprintf(buf, "    filter=%d.%d.%d.%d/"
406 -                                   "%d.%d.%d.%d\n", bs(prefix), bs(netmask));
407 +                               return sprintf(buf,
408 +                                              "    filter=%d.%d.%d.%d/"
409 +                                              "%d.%d.%d.%d\n", bs(prefix),
410 +                                              bs(netmask));
411  #undef bs
412  #undef b1
413 -#endif /* CONFIG_ATM_BR2684_IPFILTER */
414 +#endif                         /* CONFIG_ATM_BR2684_IPFILTER */
415                 }
416         }
417         return 0;
418  }
419  
420  static ssize_t br2684_proc_read(struct file *file, char *buf, size_t count,
421 -       loff_t *pos)
422 +                               loff_t * pos)
423  {
424         unsigned long page;
425         int len = 0, x, left;
426 -       loff_t n = *pos;
427 -
428         page = get_free_page(GFP_KERNEL);
429         if (!page)
430                 return -ENOMEM;
431 @@ -746,7 +871,7 @@
432                 left = count;
433         read_lock(&devs_lock);
434         for (;;) {
435 -               x = br2684_proc_engine(n, &((char *) page)[len]);
436 +               x = br2684_proc_engine(*pos, &((char *) page)[len]);
437                 if (x == 0)
438                         break;
439                 if (x > left)
440 @@ -761,12 +886,11 @@
441                 }
442                 len += x;
443                 left -= x;
444 -               n++;
445 +               (*pos)++;
446                 if (left < 256)
447                         break;
448         }
449         read_unlock(&devs_lock);
450 -       *pos = n;
451         if (len > 0 && copy_to_user(buf, (char *) page, len))
452                 len = -EFAULT;
453         free_page(page);
454 @@ -774,23 +898,20 @@
455  }
456  
457  static struct file_operations br2684_proc_operations = {
458 -       read: br2684_proc_read,
459 +      read:br2684_proc_read,
460  };
461  
462  extern struct proc_dir_entry *atm_proc_root;   /* from proc.c */
463 -#endif /* CONFIG_PROC_FS */
464  
465  /* the following avoids some spurious warnings from the compiler */
466  #define UNUSED __attribute__((unused))
467  
468  static int __init UNUSED br2684_init(void)
469  {
470 -#ifdef CONFIG_PROC_FS
471         struct proc_dir_entry *p;
472         if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL)
473                 return -ENOMEM;
474         p->proc_fops = &br2684_proc_operations;
475 -#endif /* CONFIG_PROC_FS */
476         br2684_ioctl_set(br2684_ioctl);
477         return 0;
478  }
479 @@ -799,9 +920,7 @@
480  {
481         struct br2684_dev *brdev;
482         br2684_ioctl_set(NULL);
483 -#ifdef CONFIG_PROC_FS
484         remove_proc_entry("br2684", atm_proc_root);
485 -#endif /* CONFIG_PROC_FS */
486         while (!list_empty(&br2684_devs)) {
487                 brdev = list_entry_brdev(br2684_devs.next);
488                 unregister_netdev(&brdev->net_dev);
489 Index: linux-2.4.35.4/net/atm/common.c
490 ===================================================================
491 --- linux-2.4.35.4.orig/net/atm/common.c        2007-12-15 05:19:38.826633641 +0100
492 +++ linux-2.4.35.4/net/atm/common.c     2007-12-15 05:20:03.656048591 +0100
493 @@ -158,6 +158,7 @@
494  }
495  #ifdef CONFIG_ATM_BR2684_MODULE
496  EXPORT_SYMBOL(br2684_ioctl_set);
497 +EXPORT_SYMBOL(br2684_ioctl_hook);
498  #endif
499  #endif
500  
501 Index: linux-2.4.35.4/include/linux/atmbr2684.h
502 ===================================================================
503 --- linux-2.4.35.4.orig/include/linux/atmbr2684.h       2007-12-15 05:19:38.838634325 +0100
504 +++ linux-2.4.35.4/include/linux/atmbr2684.h    2007-12-15 05:20:03.668049273 +0100
505 @@ -3,6 +3,7 @@
506  
507  #include <linux/atm.h>
508  #include <linux/if.h>          /* For IFNAMSIZ */
509 +#include <linux/if_ether.h>    /* ETH_P_* */
510  
511  /*
512   * Type of media we're bridging (ethernet, token ring, etc)  Currently only
513 @@ -36,15 +37,24 @@
514  #define BR2684_ENCAPS_AUTODETECT (2)   /* Unsuported */
515  
516  /*
517 + * Is this VC bridged or routed?
518 + */
519 +
520 +#define        BR2684_PAYLOAD_ROUTED   (0)
521 +#define        BR2684_PAYLOAD_BRIDGED  (1)
522 +
523 +
524 +/*
525   * This is for the ATM_NEWBACKENDIF call - these are like socket families:
526   * the first element of the structure is the backend number and the rest
527   * is per-backend specific
528   */
529  struct atm_newif_br2684 {
530 -       atm_backend_t   backend_num;    /* ATM_BACKEND_BR2684 */
531 -       int             media;          /* BR2684_MEDIA_* */
532 -       char            ifname[IFNAMSIZ];
533 -       int             mtu;
534 +       atm_backend_t backend_num;      /* ATM_BACKEND_BR2684 */
535 +       int media;              /* BR2684_MEDIA_* */
536 +       char ifname[IFNAMSIZ];
537 +       int mtu;
538 +       int payload;            /* bridged or routed */
539  };
540  
541  /*
542 @@ -68,16 +78,17 @@
543   * is per-backend specific
544   */
545  struct atm_backend_br2684 {
546 -       atm_backend_t   backend_num;    /* ATM_BACKEND_BR2684 */
547 +       atm_backend_t backend_num;      /* ATM_BACKEND_BR2684 */
548         struct br2684_if_spec ifspec;
549 -       int     fcs_in;         /* BR2684_FCSIN_* */
550 -       int     fcs_out;        /* BR2684_FCSOUT_* */
551 -       int     fcs_auto;       /* 1: fcs_{in,out} disabled if no FCS rx'ed */
552 -       int     encaps;         /* BR2684_ENCAPS_* */
553 -       int     has_vpiid;      /* 1: use vpn_id - Unsupported */
554 -       __u8    vpn_id[7];
555 -       int     send_padding;   /* unsupported */
556 -       int     min_size;       /* we will pad smaller packets than this */
557 +       int fcs_in;             /* BR2684_FCSIN_* */
558 +       int fcs_out;            /* BR2684_FCSOUT_* */
559 +       int fcs_auto;           /* 1: fcs_{in,out} disabled if no FCS rx'ed */
560 +       int encaps;             /* BR2684_ENCAPS_* */
561 +       int payload;            /* BR2684_PAYLOAD_* */
562 +       int has_vpiid;          /* 1: use vpn_id - Unsupported */
563 +       __u8 vpn_id[7];
564 +       int send_padding;       /* unsupported */
565 +       int min_size;           /* we will pad smaller packets than this */
566  };
567  
568  /*
569 @@ -95,7 +106,12 @@
570         struct br2684_filter filter;
571  };
572  
573 +enum br2684_payload {
574 +       p_routed = BR2684_PAYLOAD_ROUTED,
575 +       p_bridged = BR2684_PAYLOAD_BRIDGED,
576 +};
577 +
578  #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
579                                 struct br2684_filter_set)
580  
581 -#endif /* _LINUX_ATMBR2684_H */
582 +#endif                         /* _LINUX_ATMBR2684_H */