2 Experimental ethernet netdevice using ATM AAL5 as underlying carrier
3 (RFC1483 obsoleted by RFC2684) for Linux 2.4
4 Author: Marcell GAL, 2000, XDSL Ltd, Hungary
7 #include <linux/module.h>
8 #include <linux/config.h>
9 #include <linux/init.h>
10 #include <linux/kernel.h>
11 #include <linux/list.h>
12 #include <linux/netdevice.h>
13 #include <linux/skbuff.h>
14 #include <linux/etherdevice.h>
15 #include <linux/rtnetlink.h>
17 #include <asm/uaccess.h>
20 #include <linux/atmbr2684.h>
25 * Define this to use a version of the code which interacts with the higher
26 * layers in a more intellegent way, by always reserving enough space for
27 * our header at the begining of the packet. However, there may still be
28 * some problems with programs like tcpdump. In 2.5 we'll sort out what
29 * we need to do to get this perfect. For now we just will copy the packet
30 * if we need space for the header
32 /* #define FASTER_VERSION */
35 #define DPRINTK(format, args...) printk(KERN_DEBUG "br2684: " format, ##args)
37 #define DPRINTK(format, args...)
41 static void skb_debug(const struct sk_buff *skb)
44 char buf[NUM2PRINT * 3 + 1]; /* 3 chars per byte */
46 for (i = 0; i < skb->len && i < NUM2PRINT; i++) {
47 sprintf(buf + i * 3, "%2.2x ", 0xff & skb->data[i]);
49 printk(KERN_DEBUG "br2684: skb: %s\n", buf);
52 #define skb_debug(skb) do {} while (0)
55 static unsigned char llc_oui_pid_pad[] =
56 { 0xAA, 0xAA, 0x03, 0x00, 0x80, 0xC2, 0x00, 0x07, 0x00, 0x00 };
60 e_vc = BR2684_ENCAPS_VC,
61 e_llc = BR2684_ENCAPS_LLC,
65 struct atm_vcc *atmvcc;
66 struct br2684_dev *brdev;
67 /* keep old push,pop functions for chaining */
68 void (*old_push)(struct atm_vcc *vcc,struct sk_buff *skb);
69 /* void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); */
70 enum br2684_encaps encaps;
71 struct list_head brvccs;
72 #ifdef CONFIG_ATM_BR2684_IPFILTER
73 struct br2684_filter filter;
74 #endif /* CONFIG_ATM_BR2684_IPFILTER */
75 #ifndef FASTER_VERSION
76 unsigned copies_needed, copies_failed;
77 #endif /* FASTER_VERSION */
81 struct net_device net_dev;
82 struct list_head br2684_devs;
84 struct list_head brvccs; /* one device <=> one vcc (before xmas) */
85 struct net_device_stats stats;
90 * This lock should be held for writing any time the list of devices or
91 * their attached vcc's could be altered. It should be held for reading
92 * any time these are being queried. Note that we sometimes need to
93 * do read-locking under interrupt context, so write locking must block
94 * the current CPU's interrupts
96 static rwlock_t devs_lock = RW_LOCK_UNLOCKED;
98 static LIST_HEAD(br2684_devs);
100 static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
102 return (struct br2684_dev *) ((char *) (net_dev) -
103 (unsigned long) (&((struct br2684_dev *) 0)->net_dev));
106 static inline struct br2684_dev *list_entry_brdev(const struct list_head *le)
108 return list_entry(le, struct br2684_dev, br2684_devs);
111 static inline struct br2684_vcc *BR2684_VCC(const struct atm_vcc *atmvcc)
113 return (struct br2684_vcc *) (atmvcc->user_back);
116 static inline struct br2684_vcc *list_entry_brvcc(const struct list_head *le)
118 return list_entry(le, struct br2684_vcc, brvccs);
121 /* Caller should hold read_lock(&devs_lock) */
122 static struct br2684_dev *br2684_find_dev(const struct br2684_if_spec *s)
124 struct list_head *lh;
125 struct br2684_dev *brdev;
127 case BR2684_FIND_BYNUM:
128 list_for_each(lh, &br2684_devs) {
129 brdev = list_entry_brdev(lh);
130 if (brdev->number == s->spec.devnum)
134 case BR2684_FIND_BYIFNAME:
135 list_for_each(lh, &br2684_devs) {
136 brdev = list_entry_brdev(lh);
137 if (!strncmp(brdev->net_dev.name, s->spec.ifname,
138 sizeof brdev->net_dev.name))
147 * Send a packet out a particular vcc. Not to useful right now, but paves
148 * the way for multiple vcc's per itf. Returns true if we can send,
151 static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
152 struct br2684_vcc *brvcc)
154 struct atm_vcc *atmvcc;
155 #ifdef FASTER_VERSION
156 if (brvcc->encaps == e_llc)
157 memcpy(skb_push(skb, 8), llc_oui_pid_pad, 8);
158 /* last 2 bytes of llc_oui_pid_pad are managed by header routines;
159 yes, you got it: 8 + 2 = sizeof(llc_oui_pid_pad)
162 int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
163 if (skb_headroom(skb) < minheadroom) {
164 struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
165 brvcc->copies_needed++;
168 brvcc->copies_failed++;
173 skb_push(skb, minheadroom);
174 if (brvcc->encaps == e_llc)
175 memcpy(skb->data, llc_oui_pid_pad, 10);
177 memset(skb->data, 0, 2);
178 #endif /* FASTER_VERSION */
181 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
182 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
183 if (!atm_may_send(atmvcc, skb->truesize)) {
184 /* we free this here for now, because we cannot know in a higher
185 layer whether the skb point it supplied wasn't freed yet.
191 atomic_add(skb->truesize, &atmvcc->tx_inuse);
192 ATM_SKB(skb)->iovcnt = 0;
193 ATM_SKB(skb)->atm_options = atmvcc->atm_options;
194 brdev->stats.tx_packets++;
195 brdev->stats.tx_bytes += skb->len;
196 atmvcc->send(atmvcc, skb);
200 static inline struct br2684_vcc *pick_outgoing_vcc(struct sk_buff *skb,
201 struct br2684_dev *brdev)
203 return list_empty(&brdev->brvccs) ? NULL :
204 list_entry_brvcc(brdev->brvccs.next); /* 1 vcc/dev right now */
207 static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
209 struct br2684_dev *brdev = BRPRIV(dev);
210 struct br2684_vcc *brvcc;
212 DPRINTK("br2684_start_xmit, skb->dst=%p\n", skb->dst);
213 read_lock(&devs_lock);
214 brvcc = pick_outgoing_vcc(skb, brdev);
216 DPRINTK("no vcc attached to dev %s\n", dev->name);
217 brdev->stats.tx_errors++;
218 brdev->stats.tx_carrier_errors++;
219 /* netif_stop_queue(dev); */
221 read_unlock(&devs_lock);
224 if (!br2684_xmit_vcc(skb, brdev, brvcc)) {
226 * We should probably use netif_*_queue() here, but that
227 * involves added complication. We need to walk before
230 /* don't free here! this pointer might be no longer valid!
233 brdev->stats.tx_errors++;
234 brdev->stats.tx_fifo_errors++;
236 read_unlock(&devs_lock);
240 static struct net_device_stats *br2684_get_stats(struct net_device *dev)
242 DPRINTK("br2684_get_stats\n");
243 return &BRPRIV(dev)->stats;
246 #ifdef FASTER_VERSION
248 * These mirror eth_header and eth_header_cache. They are not usually
249 * exported for use in modules, so we grab them from net_device
250 * after ether_setup() is done with it. Bit of a hack.
252 static int (*my_eth_header)(struct sk_buff *, struct net_device *,
253 unsigned short, void *, void *, unsigned);
254 static int (*my_eth_header_cache)(struct neighbour *, struct hh_cache *);
257 br2684_header(struct sk_buff *skb, struct net_device *dev,
258 unsigned short type, void *daddr, void *saddr, unsigned len)
261 int t = my_eth_header(skb, dev, type, daddr, saddr, len);
263 pad_before_eth = (u16 *) skb_push(skb, 2);
265 return dev->hard_header_len; /* or return 16; ? */
271 br2684_header_cache(struct neighbour *neigh, struct hh_cache *hh)
273 /* hh_data is 16 bytes long. if encaps is ether-llc we need 24, so
274 xmit will add the additional header part in that case */
275 u16 *pad_before_eth = (u16 *)(hh->hh_data);
276 int t = my_eth_header_cache(neigh, hh);
277 DPRINTK("br2684_header_cache, neigh=%p, hh_cache=%p\n", neigh, hh);
282 hh->hh_len = PADLEN + ETH_HLEN;
288 * This is similar to eth_type_trans, which cannot be used because of
289 * our dev->hard_header_len
291 static inline unsigned short br_type_trans(struct sk_buff *skb,
292 struct net_device *dev)
296 eth = skb->mac.ethernet;
298 if (*eth->h_dest & 1) {
299 if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
300 skb->pkt_type = PACKET_BROADCAST;
302 skb->pkt_type = PACKET_MULTICAST;
305 else if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
306 skb->pkt_type = PACKET_OTHERHOST;
308 if (ntohs(eth->h_proto) >= 1536)
314 * This is a magic hack to spot IPX packets. Older Novell breaks
315 * the protocol design and runs IPX over 802.3 without an 802.2 LLC
316 * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
317 * won't work for fault tolerant netware but does for the rest.
319 if (*(unsigned short *) rawp == 0xFFFF)
320 return htons(ETH_P_802_3);
325 return htons(ETH_P_802_2);
327 #endif /* FASTER_VERSION */
330 * We remember when the MAC gets set, so we don't override it later with
331 * the ESI of the ATM card of the first VC
333 static int (*my_eth_mac_addr)(struct net_device *, void *);
334 static int br2684_mac_addr(struct net_device *dev, void *p)
336 int err = my_eth_mac_addr(dev, p);
338 BRPRIV(dev)->mac_was_set = 1;
342 #ifdef CONFIG_ATM_BR2684_IPFILTER
343 /* this IOCTL is experimental. */
344 static int br2684_setfilt(struct atm_vcc *atmvcc, unsigned long arg)
346 struct br2684_vcc *brvcc;
347 struct br2684_filter_set fs;
349 if (copy_from_user(&fs, (void *) arg, sizeof fs))
351 if (fs.ifspec.method != BR2684_FIND_BYNOTHING) {
353 * This is really a per-vcc thing, but we can also search
356 struct br2684_dev *brdev;
357 read_lock(&devs_lock);
358 brdev = br2684_find_dev(&fs.ifspec);
359 if (brdev == NULL || list_empty(&brdev->brvccs) ||
360 brdev->brvccs.next != brdev->brvccs.prev) /* >1 VCC */
363 brvcc = list_entry_brvcc(brdev->brvccs.next);
364 read_unlock(&devs_lock);
368 brvcc = BR2684_VCC(atmvcc);
369 memcpy(&brvcc->filter, &fs.filter, sizeof(brvcc->filter));
373 /* Returns 1 if packet should be dropped */
375 packet_fails_filter(u16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
377 if (brvcc->filter.netmask == 0)
378 return 0; /* no filter in place */
379 if (type == __constant_htons(ETH_P_IP) &&
380 (((struct iphdr *) (skb->data))->daddr & brvcc->filter.
381 netmask) == brvcc->filter.prefix)
383 if (type == __constant_htons(ETH_P_ARP))
385 /* TODO: we should probably filter ARPs too.. don't want to have
386 * them returning values that don't make sense, or is that ok?
390 #endif /* CONFIG_ATM_BR2684_IPFILTER */
392 static void br2684_close_vcc(struct br2684_vcc *brvcc)
394 DPRINTK("removing VCC %p from dev %p\n", brvcc, brvcc->brdev);
395 write_lock_irq(&devs_lock);
396 list_del(&brvcc->brvccs);
397 write_unlock_irq(&devs_lock);
398 brvcc->atmvcc->user_back = NULL; /* what about vcc->recvq ??? */
399 brvcc->old_push(brvcc->atmvcc, NULL); /* pass on the bad news */
404 /* when AAL5 PDU comes in: */
405 static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
407 struct br2684_vcc *brvcc = BR2684_VCC(atmvcc);
408 struct br2684_dev *brdev = brvcc->brdev;
409 int plen = sizeof(llc_oui_pid_pad) + ETH_HLEN;
411 DPRINTK("br2684_push\n");
413 if (skb == NULL) { /* skb==NULL means VCC is being destroyed */
414 br2684_close_vcc(brvcc);
415 if (list_empty(&brdev->brvccs)) {
416 read_lock(&devs_lock);
417 list_del(&brdev->br2684_devs);
418 read_unlock(&devs_lock);
419 unregister_netdev(&brdev->net_dev);
426 atm_return(atmvcc, skb->truesize);
427 DPRINTK("skb from brdev %p\n", brdev);
428 if (brvcc->encaps == e_llc) {
429 /* let us waste some time for checking the encapsulation.
430 Note, that only 7 char is checked so frames with a valid FCS
431 are also accepted (but FCS is not checked of course) */
432 if (memcmp(skb->data, llc_oui_pid_pad, 7)) {
433 brdev->stats.rx_errors++;
438 plen = PADLEN + ETH_HLEN; /* pad, dstmac,srcmac, ethtype */
439 /* first 2 chars should be 0 */
440 if (*((u16 *) (skb->data)) != 0) {
441 brdev->stats.rx_errors++;
446 if (skb->len < plen) {
447 brdev->stats.rx_errors++;
448 dev_kfree_skb(skb); /* dev_ not needed? */
452 #ifdef FASTER_VERSION
453 /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
454 than should be. What else should I set? */
456 skb->mac.raw = ((char *) (skb->data)) - ETH_HLEN;
457 skb->pkt_type = PACKET_HOST;
458 #ifdef CONFIG_BR2684_FAST_TRANS
459 skb->protocol = ((u16 *) skb->data)[-1];
460 #else /* some protocols might require this: */
461 skb->protocol = br_type_trans(skb, &brdev->net_dev);
462 #endif /* CONFIG_BR2684_FAST_TRANS */
464 skb_pull(skb, plen - ETH_HLEN);
465 skb->protocol = eth_type_trans(skb, &brdev->net_dev);
466 #endif /* FASTER_VERSION */
467 #ifdef CONFIG_ATM_BR2684_IPFILTER
468 if (packet_fails_filter(skb->protocol, brvcc, skb)) {
469 brdev->stats.rx_dropped++;
473 #endif /* CONFIG_ATM_BR2684_IPFILTER */
474 skb->dev = &brdev->net_dev;
475 ATM_SKB(skb)->vcc = atmvcc; /* needed ? */
476 DPRINTK("received packet's protocol: %x\n", ntohs(skb->protocol));
478 if (!(brdev->net_dev.flags & IFF_UP)) { /* sigh, interface is down */
479 brdev->stats.rx_dropped++;
483 brdev->stats.rx_packets++;
484 brdev->stats.rx_bytes += skb->len;
488 static int br2684_regvcc(struct atm_vcc *atmvcc, unsigned long arg)
490 /* assign a vcc to a dev
491 Note: we do not have explicit unassign, but look at _push()
494 struct br2684_vcc *brvcc;
495 struct sk_buff_head copy;
497 struct br2684_dev *brdev;
498 struct atm_backend_br2684 be;
501 if (copy_from_user(&be, (void *) arg, sizeof be)) {
505 write_lock_irq(&devs_lock);
506 brdev = br2684_find_dev(&be.ifspec);
509 "br2684: tried to attach to non-existant device\n");
513 if (atmvcc->push == NULL) {
517 if (!list_empty(&brdev->brvccs)) { /* Only 1 VCC/dev right now */
521 if (be.fcs_in != BR2684_FCSIN_NO || be.fcs_out != BR2684_FCSOUT_NO ||
522 be.fcs_auto || be.has_vpiid || be.send_padding || (be.encaps !=
523 BR2684_ENCAPS_VC && be.encaps != BR2684_ENCAPS_LLC) ||
528 brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
533 memset(brvcc, 0, sizeof(struct br2684_vcc));
534 DPRINTK("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
536 if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
537 unsigned char *esi = atmvcc->dev->esi;
538 if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
539 memcpy(brdev->net_dev.dev_addr, esi,
540 brdev->net_dev.addr_len);
542 brdev->net_dev.dev_addr[2] = 1;
544 list_add(&brvcc->brvccs, &brdev->brvccs);
545 write_unlock_irq(&devs_lock);
546 brvcc->brdev = brdev;
547 brvcc->atmvcc = atmvcc;
548 atmvcc->user_back = brvcc;
549 brvcc->encaps = (enum br2684_encaps) be.encaps;
550 brvcc->old_push = atmvcc->push;
552 atmvcc->push = br2684_push;
553 skb_queue_head_init(©);
554 skb_migrate(&atmvcc->recvq, ©);
555 while ((skb = skb_dequeue(©))) {
556 BRPRIV(skb->dev)->stats.rx_bytes -= skb->len;
557 BRPRIV(skb->dev)->stats.rx_packets--;
558 br2684_push(atmvcc, skb);
562 write_unlock_irq(&devs_lock);
567 static int br2684_create(unsigned long arg)
570 struct br2684_dev *brdev;
571 struct atm_newif_br2684 ni;
573 DPRINTK("br2684_create\n");
575 * We track module use by vcc's NOT the devices they're on. We're
576 * protected here against module death by the kernel_lock, but if
577 * we need to sleep we should make sure that the module doesn't
578 * disappear under us.
581 if (copy_from_user(&ni, (void *) arg, sizeof ni)) {
585 if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
589 if ((brdev = kmalloc(sizeof(struct br2684_dev), GFP_KERNEL)) == NULL) {
593 memset(brdev, 0, sizeof(struct br2684_dev));
594 INIT_LIST_HEAD(&brdev->brvccs);
596 write_lock_irq(&devs_lock);
597 brdev->number = list_empty(&br2684_devs) ? 1 :
598 list_entry_brdev(br2684_devs.prev)->number + 1;
599 list_add_tail(&brdev->br2684_devs, &br2684_devs);
600 write_unlock_irq(&devs_lock);
602 if (ni.ifname[0] != '\0') {
603 memcpy(brdev->net_dev.name, ni.ifname,
604 sizeof(brdev->net_dev.name));
605 brdev->net_dev.name[sizeof(brdev->net_dev.name) - 1] = '\0';
607 sprintf(brdev->net_dev.name, "nas%d", brdev->number);
608 DPRINTK("registered netdev %s\n", brdev->net_dev.name);
609 ether_setup(&brdev->net_dev);
610 brdev->mac_was_set = 0;
611 #ifdef FASTER_VERSION
612 my_eth_header = brdev->net_dev.hard_header;
613 brdev->net_dev.hard_header = br2684_header;
614 my_eth_header_cache = brdev->net_dev.hard_header_cache;
615 brdev->net_dev.hard_header_cache = br2684_header_cache;
616 brdev->net_dev.hard_header_len = sizeof(llc_oui_pid_pad) + ETH_HLEN; /* 10 + 14 */
618 my_eth_mac_addr = brdev->net_dev.set_mac_address;
619 brdev->net_dev.set_mac_address = br2684_mac_addr;
620 brdev->net_dev.hard_start_xmit = br2684_start_xmit;
621 brdev->net_dev.get_stats = br2684_get_stats;
623 /* open, stop, do_ioctl ? */
624 err = register_netdev(&brdev->net_dev);
627 printk(KERN_ERR "br2684_create: register_netdev failed\n");
628 write_lock_irq(&devs_lock);
629 list_del(&brdev->br2684_devs);
630 write_unlock_irq(&devs_lock);
638 * This handles ioctls actually performed on our vcc - we must return
639 * -ENOIOCTLCMD for any unrecognized ioctl
641 static int br2684_ioctl(struct atm_vcc *atmvcc, unsigned int cmd,
647 case ATM_NEWBACKENDIF: {
650 err = get_user(b, (atm_backend_t *) arg);
654 if (b != ATM_BACKEND_BR2684)
656 if (!capable(CAP_NET_ADMIN))
658 if (cmd == ATM_SETBACKEND)
659 return br2684_regvcc(atmvcc, arg);
661 return br2684_create(arg);
663 #ifdef CONFIG_ATM_BR2684_IPFILTER
665 if (atmvcc->push != br2684_push)
667 if (!capable(CAP_NET_ADMIN))
670 err = br2684_setfilt(atmvcc, arg);
673 #endif /* CONFIG_ATM_BR2684_IPFILTER */
678 /* Never put more than 256 bytes in at once */
679 static int br2684_proc_engine(loff_t pos, char *buf)
681 struct list_head *lhd, *lhc;
682 struct br2684_dev *brdev;
683 struct br2684_vcc *brvcc;
684 list_for_each(lhd, &br2684_devs) {
685 brdev = list_entry_brdev(lhd);
687 return sprintf(buf, "dev %.16s: num=%d, mac=%02X:%02X:"
688 "%02X:%02X:%02X:%02X (%s)\n", brdev->net_dev.name,
690 brdev->net_dev.dev_addr[0],
691 brdev->net_dev.dev_addr[1],
692 brdev->net_dev.dev_addr[2],
693 brdev->net_dev.dev_addr[3],
694 brdev->net_dev.dev_addr[4],
695 brdev->net_dev.dev_addr[5],
696 brdev->mac_was_set ? "set" : "auto");
697 list_for_each(lhc, &brdev->brvccs) {
698 brvcc = list_entry_brvcc(lhc);
700 return sprintf(buf, " vcc %d.%d.%d: encaps=%s"
701 #ifndef FASTER_VERSION
702 ", failed copies %u/%u"
703 #endif /* FASTER_VERSION */
704 "\n", brvcc->atmvcc->dev->number,
705 brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
706 (brvcc->encaps == e_llc) ? "LLC" : "VC"
707 #ifndef FASTER_VERSION
708 , brvcc->copies_failed
709 , brvcc->copies_needed
710 #endif /* FASTER_VERSION */
712 #ifdef CONFIG_ATM_BR2684_IPFILTER
713 #define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte]
714 #define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
715 if (brvcc->filter.netmask != 0 && pos-- == 0)
716 return sprintf(buf, " filter=%d.%d.%d.%d/"
717 "%d.%d.%d.%d\n", bs(prefix), bs(netmask));
720 #endif /* CONFIG_ATM_BR2684_IPFILTER */
726 static ssize_t br2684_proc_read(struct file *file, char *buf, size_t count,
730 int len = 0, x, left;
731 page = get_free_page(GFP_KERNEL);
734 left = PAGE_SIZE - 256;
737 read_lock(&devs_lock);
739 x = br2684_proc_engine(*pos, &((char *) page)[len]);
744 * This should only happen if the user passed in
745 * a "count" too small for even one line
758 read_unlock(&devs_lock);
759 if (len > 0 && copy_to_user(buf, (char *) page, len))
765 static struct file_operations br2684_proc_operations = {
766 read: br2684_proc_read,
769 extern struct proc_dir_entry *atm_proc_root; /* from proc.c */
771 extern int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long);
773 /* the following avoids some spurious warnings from the compiler */
774 #define UNUSED __attribute__((unused))
776 static int __init UNUSED br2684_init(void)
778 struct proc_dir_entry *p;
779 if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL)
781 p->proc_fops = &br2684_proc_operations;
782 br2684_ioctl_hook = br2684_ioctl;
786 static void __exit UNUSED br2684_exit(void)
788 struct br2684_dev *brdev;
789 br2684_ioctl_hook = NULL;
790 remove_proc_entry("br2684", atm_proc_root);
791 while (!list_empty(&br2684_devs)) {
792 brdev = list_entry_brdev(br2684_devs.next);
793 unregister_netdev(&brdev->net_dev);
794 list_del(&brdev->br2684_devs);
799 module_init(br2684_init);
800 module_exit(br2684_exit);
802 MODULE_AUTHOR("Marcell GAL");
803 MODULE_DESCRIPTION("RFC2684 bridged protocols over ATM/AAL5");
804 MODULE_LICENSE("GPL");