1 Index: linux-2.6.24.7/include/linux/atmbr2684.h
2 ===================================================================
3 --- linux-2.6.24.7.orig/include/linux/atmbr2684.h
4 +++ linux-2.6.24.7/include/linux/atmbr2684.h
6 #define BR2684_MEDIA_FDDI (3)
7 #define BR2684_MEDIA_802_6 (4) /* 802.6 */
9 + /* used only at device creation: */
10 +#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
13 * Is there FCS inbound on this VC? This currently isn't supported.
16 #define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
19 + * Is this VC bridged or routed?
22 +#define BR2684_PAYLOAD_ROUTED (0)
23 +#define BR2684_PAYLOAD_BRIDGED (1)
26 * This is for the ATM_NEWBACKENDIF call - these are like socket families:
27 * the first element of the structure is the backend number and the rest
28 * is per-backend specific
30 struct atm_newif_br2684 {
31 - atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
32 - int media; /* BR2684_MEDIA_* */
33 - char ifname[IFNAMSIZ];
35 + atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
36 + int media; /* BR2684_MEDIA_*, flags in upper bits */
37 + char ifname[IFNAMSIZ];
42 @@ -55,10 +65,10 @@ struct atm_newif_br2684 {
43 #define BR2684_FIND_BYNUM (1)
44 #define BR2684_FIND_BYIFNAME (2)
45 struct br2684_if_spec {
46 - int method; /* BR2684_FIND_* */
47 + int method; /* BR2684_FIND_* */
49 - char ifname[IFNAMSIZ];
51 + char ifname[IFNAMSIZ];
56 @@ -68,16 +78,16 @@ struct br2684_if_spec {
57 * is per-backend specific
59 struct atm_backend_br2684 {
60 - atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
61 + atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
62 struct br2684_if_spec ifspec;
63 - int fcs_in; /* BR2684_FCSIN_* */
64 - int fcs_out; /* BR2684_FCSOUT_* */
65 - int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
66 - int encaps; /* BR2684_ENCAPS_* */
67 - int has_vpiid; /* 1: use vpn_id - Unsupported */
69 - int send_padding; /* unsupported */
70 - int min_size; /* we will pad smaller packets than this */
71 + int fcs_in; /* BR2684_FCSIN_* */
72 + int fcs_out; /* BR2684_FCSOUT_* */
73 + int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
74 + int encaps; /* BR2684_ENCAPS_* */
75 + int has_vpiid; /* 1: use vpn_id - Unsupported */
77 + int send_padding; /* unsupported */
78 + int min_size; /* we will pad smaller packets than this */
82 @@ -86,8 +96,8 @@ struct atm_backend_br2684 {
83 * efficient per-if in/out filters, this support will be removed
85 struct br2684_filter {
86 - __be32 prefix; /* network byte order */
87 - __be32 netmask; /* 0 = disable filter */
88 + __be32 prefix; /* network byte order */
89 + __be32 netmask; /* 0 = disable filter */
92 struct br2684_filter_set {
93 @@ -95,7 +105,13 @@ struct br2684_filter_set {
94 struct br2684_filter filter;
97 +enum br2684_payload {
98 + p_routed = BR2684_PAYLOAD_ROUTED,
99 + p_bridged = BR2684_PAYLOAD_BRIDGED,
102 #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
103 struct br2684_filter_set)
105 #endif /* _LINUX_ATMBR2684_H */
107 Index: linux-2.6.24.7/net/atm/br2684.c
108 ===================================================================
109 --- linux-2.6.24.7.orig/net/atm/br2684.c
110 +++ linux-2.6.24.7/net/atm/br2684.c
113 -Experimental ethernet netdevice using ATM AAL5 as underlying carrier
114 -(RFC1483 obsoleted by RFC2684) for Linux 2.4
115 -Author: Marcell GAL, 2000, XDSL Ltd, Hungary
117 + * Ethernet netdevice using ATM AAL5 as underlying carrier
118 + * (RFC1483 obsoleted by RFC2684) for Linux
120 + * Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
121 + * Eric Kinzie, 2006-2007, US Naval Research Laboratory
124 #include <linux/module.h>
125 #include <linux/init.h>
126 @@ -39,21 +41,35 @@ static void skb_debug(const struct sk_bu
127 #define skb_debug(skb) do {} while (0)
130 +#define BR2684_ETHERTYPE_LEN 2
131 +#define BR2684_PAD_LEN 2
133 +#define LLC 0xaa, 0xaa, 0x03
134 +#define SNAP_BRIDGED 0x00, 0x80, 0xc2
135 +#define SNAP_ROUTED 0x00, 0x00, 0x00
136 +#define PID_ETHERNET 0x00, 0x07
137 +#define ETHERTYPE_IPV4 0x08, 0x00
138 +#define ETHERTYPE_IPV6 0x86, 0xdd
139 +#define PAD_BRIDGED 0x00, 0x00
141 +static unsigned char ethertype_ipv4[] = { ETHERTYPE_IPV4 };
142 +static unsigned char ethertype_ipv6[] = { ETHERTYPE_IPV6 };
143 static unsigned char llc_oui_pid_pad[] =
144 - { 0xAA, 0xAA, 0x03, 0x00, 0x80, 0xC2, 0x00, 0x07, 0x00, 0x00 };
146 + { LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
147 +static unsigned char llc_oui_ipv4[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
148 +static unsigned char llc_oui_ipv6[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
151 - e_vc = BR2684_ENCAPS_VC,
152 + e_vc = BR2684_ENCAPS_VC,
153 e_llc = BR2684_ENCAPS_LLC,
157 - struct atm_vcc *atmvcc;
158 + struct atm_vcc *atmvcc;
159 struct net_device *device;
160 - /* keep old push,pop functions for chaining */
161 - void (*old_push)(struct atm_vcc *vcc,struct sk_buff *skb);
162 - /* void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); */
163 + /* keep old push, pop functions for chaining */
164 + void (*old_push) (struct atm_vcc * vcc, struct sk_buff * skb);
165 + /* void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); */
166 enum br2684_encaps encaps;
167 struct list_head brvccs;
168 #ifdef CONFIG_ATM_BR2684_IPFILTER
169 @@ -66,9 +82,10 @@ struct br2684_dev {
170 struct net_device *net_dev;
171 struct list_head br2684_devs;
173 - struct list_head brvccs; /* one device <=> one vcc (before xmas) */
174 + struct list_head brvccs; /* one device <=> one vcc (before xmas) */
175 struct net_device_stats stats;
177 + enum br2684_payload payload;
181 @@ -84,7 +101,7 @@ static LIST_HEAD(br2684_devs);
183 static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
185 - return (struct br2684_dev *) net_dev->priv;
186 + return (struct br2684_dev *)net_dev->priv;
189 static inline struct net_device *list_entry_brdev(const struct list_head *le)
190 @@ -94,7 +111,7 @@ static inline struct net_device *list_en
192 static inline struct br2684_vcc *BR2684_VCC(const struct atm_vcc *atmvcc)
194 - return (struct br2684_vcc *) (atmvcc->user_back);
195 + return (struct br2684_vcc *)(atmvcc->user_back);
198 static inline struct br2684_vcc *list_entry_brvcc(const struct list_head *le)
199 @@ -132,10 +149,11 @@ static struct net_device *br2684_find_de
202 static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
203 - struct br2684_vcc *brvcc)
204 + struct br2684_vcc *brvcc)
206 struct atm_vcc *atmvcc;
207 int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
209 if (skb_headroom(skb) < minheadroom) {
210 struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
211 brvcc->copies_needed++;
212 @@ -146,23 +164,48 @@ static int br2684_xmit_vcc(struct sk_buf
216 - skb_push(skb, minheadroom);
217 - if (brvcc->encaps == e_llc)
218 - skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
220 - memset(skb->data, 0, 2);
222 + if (brvcc->encaps == e_llc) {
223 + if (brdev->payload == p_bridged) {
224 + skb_push(skb, sizeof(llc_oui_pid_pad));
225 + skb_copy_to_linear_data(skb, llc_oui_pid_pad,
226 + sizeof(llc_oui_pid_pad));
227 + } else if (brdev->payload == p_routed) {
228 + unsigned short prot = ntohs(skb->protocol);
230 + skb_push(skb, sizeof(llc_oui_ipv4));
233 + skb_copy_to_linear_data(skb, llc_oui_ipv4,
234 + sizeof(llc_oui_ipv4));
237 + skb_copy_to_linear_data(skb, llc_oui_ipv6,
238 + sizeof(llc_oui_ipv6));
241 + dev_kfree_skb(skb);
247 + if (brdev->payload == p_bridged)
248 + memset(skb->data, 0, 2);
252 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
253 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
254 if (!atm_may_send(atmvcc, skb->truesize)) {
255 - /* we free this here for now, because we cannot know in a higher
256 - layer whether the skb point it supplied wasn't freed yet.
260 + * We free this here for now, because we cannot know in a higher
261 + * layer whether the skb pointer it supplied wasn't freed yet.
262 + * Now, it always is.
268 atomic_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc);
269 ATM_SKB(skb)->atm_options = atmvcc->atm_options;
270 brdev->stats.tx_packets++;
271 @@ -172,10 +215,9 @@ static int br2684_xmit_vcc(struct sk_buf
274 static inline struct br2684_vcc *pick_outgoing_vcc(struct sk_buff *skb,
275 - struct br2684_dev *brdev)
276 + struct br2684_dev *brdev)
278 - return list_empty(&brdev->brvccs) ? NULL :
279 - list_entry_brvcc(brdev->brvccs.next); /* 1 vcc/dev right now */
280 + return list_empty(&brdev->brvccs) ? NULL : list_entry_brvcc(brdev->brvccs.next); /* 1 vcc/dev right now */
283 static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
284 @@ -199,11 +241,10 @@ static int br2684_start_xmit(struct sk_b
286 * We should probably use netif_*_queue() here, but that
287 * involves added complication. We need to walk before
291 + * Don't free here! this pointer might be no longer valid!
293 - /* don't free here! this pointer might be no longer valid!
294 - dev_kfree_skb(skb);
296 brdev->stats.tx_errors++;
297 brdev->stats.tx_fifo_errors++;
299 @@ -217,12 +258,11 @@ static struct net_device_stats *br2684_g
300 return &BRPRIV(dev)->stats;
305 * We remember when the MAC gets set, so we don't override it later with
306 * the ESI of the ATM card of the first VC
308 -static int (*my_eth_mac_addr)(struct net_device *, void *);
309 +static int (*my_eth_mac_addr) (struct net_device *, void *);
310 static int br2684_mac_addr(struct net_device *dev, void *p)
312 int err = my_eth_mac_addr(dev, p);
313 @@ -233,7 +273,7 @@ static int br2684_mac_addr(struct net_de
315 #ifdef CONFIG_ATM_BR2684_IPFILTER
316 /* this IOCTL is experimental. */
317 -static int br2684_setfilt(struct atm_vcc *atmvcc, void __user *arg)
318 +static int br2684_setfilt(struct atm_vcc *atmvcc, void __user * arg)
320 struct br2684_vcc *brvcc;
321 struct br2684_filter_set fs;
322 @@ -243,13 +283,12 @@ static int br2684_setfilt(struct atm_vcc
323 if (fs.ifspec.method != BR2684_FIND_BYNOTHING) {
325 * This is really a per-vcc thing, but we can also search
329 struct br2684_dev *brdev;
330 read_lock(&devs_lock);
331 brdev = BRPRIV(br2684_find_dev(&fs.ifspec));
332 - if (brdev == NULL || list_empty(&brdev->brvccs) ||
333 - brdev->brvccs.next != brdev->brvccs.prev) /* >1 VCC */
334 + if (brdev == NULL || list_empty(&brdev->brvccs) || brdev->brvccs.next != brdev->brvccs.prev) /* >1 VCC */
337 brvcc = list_entry_brvcc(brdev->brvccs.next);
338 @@ -267,15 +306,16 @@ static inline int
339 packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
341 if (brvcc->filter.netmask == 0)
342 - return 0; /* no filter in place */
343 + return 0; /* no filter in place */
344 if (type == htons(ETH_P_IP) &&
345 - (((struct iphdr *) (skb->data))->daddr & brvcc->filter.
346 + (((struct iphdr *)(skb->data))->daddr & brvcc->filter.
347 netmask) == brvcc->filter.prefix)
349 if (type == htons(ETH_P_ARP))
351 - /* TODO: we should probably filter ARPs too.. don't want to have
352 - * them returning values that don't make sense, or is that ok?
354 + * TODO: we should probably filter ARPs too.. don't want to have
355 + * them returning values that don't make sense, or is that ok?
359 @@ -299,7 +339,6 @@ static void br2684_push(struct atm_vcc *
360 struct br2684_vcc *brvcc = BR2684_VCC(atmvcc);
361 struct net_device *net_dev = brvcc->device;
362 struct br2684_dev *brdev = BRPRIV(net_dev);
363 - int plen = sizeof(llc_oui_pid_pad) + ETH_HLEN;
365 pr_debug("br2684_push\n");
367 @@ -320,35 +359,58 @@ static void br2684_push(struct atm_vcc *
368 atm_return(atmvcc, skb->truesize);
369 pr_debug("skb from brdev %p\n", brdev);
370 if (brvcc->encaps == e_llc) {
371 - /* let us waste some time for checking the encapsulation.
372 - Note, that only 7 char is checked so frames with a valid FCS
373 - are also accepted (but FCS is not checked of course) */
374 - if (memcmp(skb->data, llc_oui_pid_pad, 7)) {
376 + if (skb->len > 7 && skb->data[7] == 0x01)
377 + __skb_trim(skb, skb->len - 4);
379 + /* accept packets that have "ipv[46]" in the snap header */
380 + if ((skb->len >= (sizeof(llc_oui_ipv4)))
383 + (skb->data, llc_oui_ipv4,
384 + sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
386 + (skb->data + 6, ethertype_ipv6,
387 + sizeof(ethertype_ipv6)) == 0)
388 + skb->protocol = __constant_htons(ETH_P_IPV6);
390 + (skb->data + 6, ethertype_ipv4,
391 + sizeof(ethertype_ipv4)) == 0)
392 + skb->protocol = __constant_htons(ETH_P_IP);
394 + brdev->stats.rx_errors++;
395 + dev_kfree_skb(skb);
398 + skb_pull(skb, sizeof(llc_oui_ipv4));
399 + skb_reset_network_header(skb);
400 + skb->pkt_type = PACKET_HOST;
402 + * Let us waste some time for checking the encapsulation.
403 + * Note, that only 7 char is checked so frames with a valid FCS
404 + * are also accepted (but FCS is not checked of course).
406 + } else if ((skb->len >= sizeof(llc_oui_pid_pad)) &&
407 + (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
408 + skb_pull(skb, sizeof(llc_oui_pid_pad));
409 + skb->protocol = eth_type_trans(skb, net_dev);
411 brdev->stats.rx_errors++;
416 - /* Strip FCS if present */
417 - if (skb->len > 7 && skb->data[7] == 0x01)
418 - __skb_trim(skb, skb->len - 4);
420 - plen = PADLEN + ETH_HLEN; /* pad, dstmac,srcmac, ethtype */
421 /* first 2 chars should be 0 */
422 if (*((u16 *) (skb->data)) != 0) {
423 brdev->stats.rx_errors++;
428 - if (skb->len < plen) {
429 - brdev->stats.rx_errors++;
430 - dev_kfree_skb(skb); /* dev_ not needed? */
432 + skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
433 + skb->protocol = eth_type_trans(skb, net_dev);
436 - skb_pull(skb, plen - ETH_HLEN);
437 - skb->protocol = eth_type_trans(skb, net_dev);
438 #ifdef CONFIG_ATM_BR2684_IPFILTER
439 if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) {
440 brdev->stats.rx_dropped++;
441 @@ -372,11 +434,12 @@ static void br2684_push(struct atm_vcc *
445 -static int br2684_regvcc(struct atm_vcc *atmvcc, void __user *arg)
447 + * Assign a vcc to a dev
448 + * Note: we do not have explicit unassign, but look at _push()
450 +static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
452 -/* assign a vcc to a dev
453 -Note: we do not have explicit unassign, but look at _push()
456 struct br2684_vcc *brvcc;
458 @@ -395,7 +458,7 @@ Note: we do not have explicit unassign,
459 net_dev = br2684_find_dev(&be.ifspec);
460 if (net_dev == NULL) {
462 - "br2684: tried to attach to non-existant device\n");
463 + "br2684: tried to attach to non-existant device\n");
467 @@ -411,13 +474,15 @@ Note: we do not have explicit unassign,
469 if (be.fcs_in != BR2684_FCSIN_NO || be.fcs_out != BR2684_FCSOUT_NO ||
470 be.fcs_auto || be.has_vpiid || be.send_padding || (be.encaps !=
471 - BR2684_ENCAPS_VC && be.encaps != BR2684_ENCAPS_LLC) ||
472 - be.min_size != 0) {
476 + || be.min_size != 0) {
480 - pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
482 + pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc,
484 if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
485 unsigned char *esi = atmvcc->dev->esi;
486 if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
487 @@ -430,7 +495,7 @@ Note: we do not have explicit unassign,
488 brvcc->device = net_dev;
489 brvcc->atmvcc = atmvcc;
490 atmvcc->user_back = brvcc;
491 - brvcc->encaps = (enum br2684_encaps) be.encaps;
492 + brvcc->encaps = (enum br2684_encaps)be.encaps;
493 brvcc->old_push = atmvcc->push;
495 atmvcc->push = br2684_push;
496 @@ -461,7 +526,7 @@ Note: we do not have explicit unassign,
498 __module_get(THIS_MODULE);
502 write_unlock_irq(&devs_lock);
505 @@ -482,25 +547,52 @@ static void br2684_setup(struct net_devi
506 INIT_LIST_HEAD(&brdev->brvccs);
509 -static int br2684_create(void __user *arg)
510 +static void br2684_setup_routed(struct net_device *netdev)
512 + struct br2684_dev *brdev = BRPRIV(netdev);
513 + brdev->net_dev = netdev;
515 + netdev->hard_header_len = 0;
516 + my_eth_mac_addr = netdev->set_mac_address;
517 + netdev->set_mac_address = br2684_mac_addr;
518 + netdev->hard_start_xmit = br2684_start_xmit;
519 + netdev->get_stats = br2684_get_stats;
520 + netdev->addr_len = 0;
521 + netdev->mtu = 1500;
522 + netdev->type = ARPHRD_PPP;
523 + netdev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
524 + netdev->tx_queue_len = 100;
525 + INIT_LIST_HEAD(&brdev->brvccs);
528 +static int br2684_create(void __user * arg)
531 struct net_device *netdev;
532 struct br2684_dev *brdev;
533 struct atm_newif_br2684 ni;
534 + enum br2684_payload payload;
536 pr_debug("br2684_create\n");
538 if (copy_from_user(&ni, arg, sizeof ni)) {
542 + if (ni.media & BR2684_FLAG_ROUTED)
543 + payload = p_routed;
545 + payload = p_bridged;
546 + ni.media &= 0xffff; /* strip flags */
548 if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
552 netdev = alloc_netdev(sizeof(struct br2684_dev),
553 ni.ifname[0] ? ni.ifname : "nas%d",
555 + (payload == p_routed) ?
556 + br2684_setup_routed : br2684_setup);
560 @@ -516,6 +608,7 @@ static int br2684_create(void __user *ar
563 write_lock_irq(&devs_lock);
564 + brdev->payload = payload;
565 brdev->number = list_empty(&br2684_devs) ? 1 :
566 BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;
567 list_add_tail(&brdev->br2684_devs, &br2684_devs);
568 @@ -528,16 +621,16 @@ static int br2684_create(void __user *ar
569 * -ENOIOCTLCMD for any unrecognized ioctl
571 static int br2684_ioctl(struct socket *sock, unsigned int cmd,
575 struct atm_vcc *atmvcc = ATM_SD(sock);
576 void __user *argp = (void __user *)arg;
583 - case ATM_NEWBACKENDIF: {
585 + case ATM_NEWBACKENDIF:
586 err = get_user(b, (atm_backend_t __user *) argp);
589 @@ -549,7 +642,6 @@ static int br2684_ioctl(struct socket *s
590 return br2684_regvcc(atmvcc, argp);
592 return br2684_create(argp);
594 #ifdef CONFIG_ATM_BR2684_IPFILTER
596 if (atmvcc->push != br2684_push)
597 @@ -557,6 +649,7 @@ static int br2684_ioctl(struct socket *s
598 if (!capable(CAP_NET_ADMIN))
600 err = br2684_setfilt(atmvcc, argp);
603 #endif /* CONFIG_ATM_BR2684_IPFILTER */
605 @@ -564,24 +657,25 @@ static int br2684_ioctl(struct socket *s
608 static struct atm_ioctl br2684_ioctl_ops = {
609 - .owner = THIS_MODULE,
610 - .ioctl = br2684_ioctl,
611 + .owner = THIS_MODULE,
612 + .ioctl = br2684_ioctl,
616 #ifdef CONFIG_PROC_FS
617 -static void *br2684_seq_start(struct seq_file *seq, loff_t *pos)
618 +static void *br2684_seq_start(struct seq_file *seq, loff_t * pos)
619 + __acquires(devs_lock)
621 read_lock(&devs_lock);
622 return seq_list_start(&br2684_devs, *pos);
625 -static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos)
626 +static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t * pos)
628 return seq_list_next(v, &br2684_devs, pos);
631 static void br2684_seq_stop(struct seq_file *seq, void *v)
632 + __releases(devs_lock)
634 read_unlock(&devs_lock);
636 @@ -589,7 +683,7 @@ static void br2684_seq_stop(struct seq_f
637 static int br2684_seq_show(struct seq_file *seq, void *v)
639 const struct br2684_dev *brdev = list_entry(v, struct br2684_dev,
642 const struct net_device *net_dev = brdev->net_dev;
643 const struct br2684_vcc *brvcc;
644 DECLARE_MAC_BUF(mac);
645 @@ -601,21 +695,19 @@ static int br2684_seq_show(struct seq_fi
646 brdev->mac_was_set ? "set" : "auto");
648 list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
649 - seq_printf(seq, " vcc %d.%d.%d: encaps=%s"
650 - ", failed copies %u/%u"
651 - "\n", brvcc->atmvcc->dev->number,
652 - brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
653 - (brvcc->encaps == e_llc) ? "LLC" : "VC"
654 - , brvcc->copies_failed
655 - , brvcc->copies_needed
657 + seq_printf(seq, " vcc %d.%d.%d: encaps=%s payload=%s"
658 + ", failed copies %u/%u"
659 + "\n", brvcc->atmvcc->dev->number,
660 + brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
661 + (brvcc->encaps == e_llc) ? "LLC" : "VC",
662 + (brdev->payload == p_bridged) ? "bridged" : "routed",
663 + brvcc->copies_failed, brvcc->copies_needed);
664 #ifdef CONFIG_ATM_BR2684_IPFILTER
665 #define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte]
666 #define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
667 - if (brvcc->filter.netmask != 0)
668 - seq_printf(seq, " filter=%d.%d.%d.%d/"
670 - bs(prefix), bs(netmask));
671 + if (brvcc->filter.netmask != 0)
672 + seq_printf(seq, " filter=%d.%d.%d.%d/"
673 + "%d.%d.%d.%d\n", bs(prefix), bs(netmask));
676 #endif /* CONFIG_ATM_BR2684_IPFILTER */
677 @@ -625,9 +717,9 @@ static int br2684_seq_show(struct seq_fi
679 static const struct seq_operations br2684_seq_ops = {
680 .start = br2684_seq_start,
681 - .next = br2684_seq_next,
682 - .stop = br2684_seq_stop,
683 - .show = br2684_seq_show,
684 + .next = br2684_seq_next,
685 + .stop = br2684_seq_stop,
686 + .show = br2684_seq_show,
689 static int br2684_proc_open(struct inode *inode, struct file *file)
690 @@ -636,26 +728,28 @@ static int br2684_proc_open(struct inode
693 static const struct file_operations br2684_proc_ops = {
694 - .owner = THIS_MODULE,
695 - .open = br2684_proc_open,
697 - .llseek = seq_lseek,
698 + .owner = THIS_MODULE,
699 + .open = br2684_proc_open,
701 + .llseek = seq_lseek,
702 .release = seq_release,
705 extern struct proc_dir_entry *atm_proc_root; /* from proc.c */
707 +#endif /* CONFIG_PROC_FS */
709 static int __init br2684_init(void)
711 #ifdef CONFIG_PROC_FS
712 struct proc_dir_entry *p;
714 if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL)
716 - p->proc_fops = &br2684_proc_ops;
718 + p->proc_fops = &br2684_proc_ops;
720 - register_atm_ioctl(&br2684_ioctl_ops);
722 + register_atm_ioctl(&br2684_ioctl_ops);
727 static void __exit br2684_exit(void)
728 @@ -689,3 +783,4 @@ module_exit(br2684_exit);
729 MODULE_AUTHOR("Marcell GAL");
730 MODULE_DESCRIPTION("RFC2684 bridged protocols over ATM/AAL5");
731 MODULE_LICENSE("GPL");