Import 2.3.18pre1
[davej-history.git] / net / atm / clip.c
blob3e7a6ea1668632ae64bf5136109411e5fc05a00e
1 /* net/atm/clip.c - RFC1577 Classical IP over ATM */
3 /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
6 #include <linux/config.h>
7 #include <linux/string.h>
8 #include <linux/errno.h>
9 #include <linux/kernel.h> /* for UINT_MAX */
10 #include <linux/netdevice.h>
11 #include <linux/skbuff.h>
12 #include <linux/wait.h>
13 #include <linux/timer.h>
14 #include <linux/if_arp.h> /* for some manifest constants */
15 #include <linux/notifier.h>
16 #include <linux/atm.h>
17 #include <linux/atmdev.h>
18 #include <linux/atmclip.h>
19 #include <linux/atmarp.h>
20 #include <linux/ip.h> /* for net/route.h */
21 #include <linux/in.h> /* for struct sockaddr_in */
22 #include <linux/if.h> /* for IFF_UP */
23 #include <linux/inetdevice.h>
24 #include <net/route.h> /* for struct rtable and routing */
25 #include <net/icmp.h> /* icmp_send */
26 #include <asm/param.h> /* for HZ */
27 #include <asm/byteorder.h> /* for htons etc. */
28 #include <asm/system.h> /* save/restore_flags */
29 #include <asm/uaccess.h>
30 #include <asm/atomic.h>
32 #include "common.h"
33 #include "tunable.h"
34 #include "resources.h"
35 #include "ipcommon.h"
36 #include <net/atmclip.h>
39 #if 0
40 #define DPRINTK(format,args...) printk(format,##args)
41 #else
42 #define DPRINTK(format,args...)
43 #endif
46 struct net_device *clip_devs = NULL;
47 struct atm_vcc *atmarpd = NULL;
48 static struct timer_list idle_timer;
49 static int start_timer = 1;
52 static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip)
54 struct atmarp_ctrl *ctrl;
55 struct sk_buff *skb;
57 DPRINTK("to_atmarpd(%d)\n",type);
58 if (!atmarpd) return -EUNATCH;
59 skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC);
60 if (!skb) return -ENOMEM;
61 ctrl = (struct atmarp_ctrl *) skb_put(skb,sizeof(struct atmarp_ctrl));
62 ctrl->type = type;
63 ctrl->itf_num = itf;
64 ctrl->ip = ip;
65 atm_force_charge(atmarpd,skb->truesize);
66 skb_queue_tail(&atmarpd->recvq,skb);
67 wake_up(&atmarpd->sleep);
68 return 0;
72 static void link_vcc(struct clip_vcc *clip_vcc,struct atmarp_entry *entry)
74 DPRINTK("link_vcc %p to entry %p (neigh %p)\n",clip_vcc,entry,
75 entry->neigh);
76 clip_vcc->entry = entry;
77 clip_vcc->next = entry->vccs;
78 entry->vccs = clip_vcc;
79 entry->neigh->used = jiffies;
83 static void unlink_clip_vcc(struct clip_vcc *clip_vcc)
85 struct atmarp_entry *entry = clip_vcc->entry;
86 struct clip_vcc **walk;
88 if (!entry) {
89 printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc);
90 return;
92 entry->neigh->used = jiffies;
93 for (walk = &entry->vccs; *walk; walk = &(*walk)->next)
94 if (*walk == clip_vcc) {
95 int error;
97 *walk = clip_vcc->next; /* atomic */
98 clip_vcc->entry = NULL;
99 if (entry->vccs) return;
100 entry->expires = jiffies-1;
101 /* force resolution or expiration */
102 error = neigh_update(entry->neigh,NULL,NUD_NONE,0,0);
103 if (error)
104 printk(KERN_CRIT "unlink_clip_vcc: "
105 "neigh_update failed with %d\n",error);
106 return;
108 printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc "
109 "0x%p)\n",entry,clip_vcc);
113 static void idle_timer_check(unsigned long dummy)
115 int i;
117 /*DPRINTK("idle_timer_check\n");*/
118 write_lock(&clip_tbl.lock);
119 for (i = 0; i <= NEIGH_HASHMASK; i++) {
120 struct neighbour **np;
122 for (np = &clip_tbl.hash_buckets[i]; *np;) {
123 struct neighbour *n = *np;
124 struct atmarp_entry *entry = NEIGH2ENTRY(n);
125 struct clip_vcc *clip_vcc;
127 for (clip_vcc = entry->vccs; clip_vcc;
128 clip_vcc = clip_vcc->next)
129 if (clip_vcc->idle_timeout &&
130 time_after(jiffies, clip_vcc->last_use+
131 clip_vcc->idle_timeout)) {
132 DPRINTK("releasing vcc %p->%p of "
133 "entry %p\n",clip_vcc,clip_vcc->vcc,
134 entry);
135 atm_async_release_vcc(clip_vcc->vcc,
136 -ETIMEDOUT);
138 if (entry->vccs ||
139 time_before(jiffies, entry->expires)) {
140 np = &n->next;
141 continue;
143 if (atomic_read(&n->refcnt) > 1) {
144 struct sk_buff *skb;
146 DPRINTK("destruction postponed with ref %d\n",
147 atomic_read(&n->refcnt));
148 while ((skb = skb_dequeue(&n->arp_queue)) !=
149 NULL)
150 dev_kfree_skb(skb);
151 np = &n->next;
152 continue;
154 *np = n->next;
155 DPRINTK("expired neigh %p\n",n);
156 n->dead = 1;
157 neigh_release(n);
160 mod_timer(&idle_timer, jiffies+CLIP_CHECK_INTERVAL*HZ);
161 write_unlock(&clip_tbl.lock);
165 static int clip_arp_rcv(struct sk_buff *skb)
167 struct atm_vcc *vcc;
169 DPRINTK("clip_arp_rcv\n");
170 vcc = ATM_SKB(skb)->vcc;
171 if (!vcc || !atm_charge(vcc,skb->truesize)) {
172 kfree_skb(skb);
173 return 0;
175 DPRINTK("pushing to %p\n",vcc);
176 DPRINTK("using %p\n",CLIP_VCC(vcc)->old_push);
177 CLIP_VCC(vcc)->old_push(vcc,skb);
178 return 0;
182 void clip_push(struct atm_vcc *vcc,struct sk_buff *skb)
184 struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
186 DPRINTK("clip push\n");
187 if (!skb) {
188 DPRINTK("removing VCC %p\n",clip_vcc);
189 if (clip_vcc->entry) unlink_clip_vcc(clip_vcc);
190 clip_vcc->old_push(vcc,NULL); /* pass on the bad news */
191 kfree(clip_vcc);
192 return;
194 atm_return(vcc,skb->truesize);
195 skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs;
196 /* clip_vcc->entry == NULL if we don't have an IP address yet */
197 if (!skb->dev) {
198 kfree_skb(skb);
199 return;
201 ATM_SKB(skb)->vcc = vcc;
202 skb->mac.raw = skb->data;
203 if (!clip_vcc->encap || skb->len < RFC1483LLC_LEN || memcmp(skb->data,
204 llc_oui,sizeof(llc_oui))) skb->protocol = htons(ETH_P_IP);
205 else {
206 skb->protocol = ((u16 *) skb->data)[3];
207 skb_pull(skb,RFC1483LLC_LEN);
208 if (skb->protocol == htons(ETH_P_ARP)) {
209 PRIV(skb->dev)->stats.rx_packets++;
210 PRIV(skb->dev)->stats.rx_bytes += skb->len;
211 clip_arp_rcv(skb);
212 return;
215 clip_vcc->last_use = jiffies;
216 PRIV(skb->dev)->stats.rx_packets++;
217 PRIV(skb->dev)->stats.rx_bytes += skb->len;
218 netif_rx(skb);
222 static void clip_neigh_destroy(struct neighbour *neigh)
224 DPRINTK("clip_neigh_destroy (neigh %p)\n",neigh);
225 if (NEIGH2ENTRY(neigh)->vccs)
226 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
227 NEIGH2ENTRY(neigh)->vccs = (void *) 0xdeadbeef;
231 static void clip_neigh_solicit(struct neighbour *neigh,struct sk_buff *skb)
233 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n",neigh,skb);
234 to_atmarpd(act_need,PRIV(neigh->dev)->number,NEIGH2ENTRY(neigh)->ip);
238 static void clip_neigh_error(struct neighbour *neigh,struct sk_buff *skb)
240 #ifndef CONFIG_ATM_CLIP_NO_ICMP
241 icmp_send(skb,ICMP_DEST_UNREACH,ICMP_HOST_UNREACH,0);
242 #endif
243 kfree_skb(skb);
247 static struct neigh_ops clip_neigh_ops = {
248 AF_INET, /* family */
249 clip_neigh_destroy, /* destructor */
250 clip_neigh_solicit, /* solicit */
251 clip_neigh_error, /* error_report */
252 dev_queue_xmit, /* output */
253 dev_queue_xmit, /* connected_output */
254 dev_queue_xmit, /* hh_output */
255 dev_queue_xmit /* queue_xmit */
259 static int clip_constructor(struct neighbour *neigh)
261 struct atmarp_entry *entry = NEIGH2ENTRY(neigh);
262 struct net_device *dev = neigh->dev;
263 struct in_device *in_dev = dev->ip_ptr;
265 DPRINTK("clip_constructor (neigh %p, entry %p)\n",neigh,entry);
266 if (!in_dev) return -EINVAL;
267 neigh->type = inet_addr_type(entry->ip);
268 if (neigh->type != RTN_UNICAST) return -EINVAL;
269 if (in_dev->arp_parms) neigh->parms = in_dev->arp_parms;
270 neigh->ops = &clip_neigh_ops;
271 neigh->output = neigh->nud_state & NUD_VALID ?
272 neigh->ops->connected_output : neigh->ops->output;
273 entry->neigh = neigh;
274 entry->vccs = NULL;
275 entry->expires = jiffies-1;
276 return 0;
279 static u32 clip_hash(const void *pkey, const struct net_device *dev)
281 u32 hash_val;
283 hash_val = *(u32*)pkey;
284 hash_val ^= (hash_val>>16);
285 hash_val ^= hash_val>>8;
286 hash_val ^= hash_val>>3;
287 hash_val = (hash_val^dev->ifindex)&NEIGH_HASHMASK;
289 return hash_val;
293 struct neigh_table clip_tbl = {
294 NULL, /* next */
295 AF_INET, /* family */
296 sizeof(struct neighbour)+sizeof(struct atmarp_entry), /* entry_size */
297 4, /* key_len */
298 clip_hash,
299 clip_constructor, /* constructor */
300 NULL, /* pconstructor */
301 NULL, /* pdestructor */
302 NULL, /* proxy_redo */
303 "clip_arp_cache",
304 { /* neigh_parms */
305 NULL, /* next */
306 NULL, /* neigh_setup */
307 &clip_tbl, /* tbl */
308 0, /* entries */
309 NULL, /* priv */
310 NULL, /* sysctl_table */
311 30*HZ, /* base_reachable_time */
312 1*HZ, /* retrans_time */
313 60*HZ, /* gc_staletime */
314 30*HZ, /* reachable_time */
315 5*HZ, /* delay_probe_time */
316 3, /* queue_len */
317 3, /* ucast_probes */
318 0, /* app_probes */
319 3, /* mcast_probes */
320 1*HZ, /* anycast_delay */
321 (8*HZ)/10, /* proxy_delay */
322 1*HZ, /* proxy_qlen */
323 64 /* locktime */
325 30*HZ,128,512,1024 /* copied from ARP ... */
329 /* @@@ copy bh locking from arp.c -- need to bh-enable atm code before */
332 * We play with the resolve flag: 0 and 1 have the usual meaning, but -1 means
333 * to allocate the neighbour entry but not to ask atmarpd for resolution. Also,
334 * don't increment the usage count. This is used to create entries in
335 * clip_setentry.
339 int clip_encap(struct atm_vcc *vcc,int mode)
341 CLIP_VCC(vcc)->encap = mode;
342 return 0;
346 static int clip_start_xmit(struct sk_buff *skb,struct net_device *dev)
348 struct atmarp_entry *entry;
350 DPRINTK("clip_start_xmit (skb %p)\n",skb);
351 if (!skb->dst) {
352 printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n");
353 dev_kfree_skb(skb);
354 return 0;
356 if (!skb->dst->neighbour) {
357 #if 0
358 skb->dst->neighbour = clip_find_neighbour(skb->dst,1);
359 if (!skb->dst->neighbour) {
360 dev_kfree_skb(skb); /* lost that one */
361 PRIV(dev)->stats.tx_dropped++;
362 return 0;
364 #endif
365 printk("clip_start_xmit: NO NEIGHBOUR !\n");
366 return 0;
368 entry = NEIGH2ENTRY(skb->dst->neighbour);
369 if (!entry->vccs) {
370 if (time_after(jiffies, entry->expires)) {
371 /* should be resolved */
372 entry->expires = jiffies+ATMARP_RETRY_DELAY*HZ;
373 to_atmarpd(act_need,PRIV(dev)->number,entry->ip);
375 if (entry->neigh->arp_queue.qlen < ATMARP_MAX_UNRES_PACKETS)
376 skb_queue_tail(&entry->neigh->arp_queue,skb);
377 else {
378 dev_kfree_skb(skb);
379 PRIV(dev)->stats.tx_dropped++;
381 return 0;
383 DPRINTK("neigh %p, vccs %p\n",entry,entry->vccs);
384 ATM_SKB(skb)->vcc = entry->vccs->vcc;
385 DPRINTK("using neighbour %p, vcc %p\n",skb->dst->neighbour,
386 ATM_SKB(skb)->vcc);
387 if (entry->vccs->encap) {
388 void *here;
390 here = skb_push(skb,RFC1483LLC_LEN);
391 memcpy(here,llc_oui,sizeof(llc_oui));
392 ((u16 *) here)[3] = skb->protocol;
394 atomic_add(skb->truesize,&ATM_SKB(skb)->vcc->tx_inuse);
395 ATM_SKB(skb)->iovcnt = 0;
396 ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options;
397 entry->vccs->last_use = jiffies;
398 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n",skb,ATM_SKB(skb)->vcc,
399 ATM_SKB(skb)->vcc->dev);
400 PRIV(dev)->stats.tx_packets++;
401 PRIV(dev)->stats.tx_bytes += skb->len;
402 (void) ATM_SKB(skb)->vcc->dev->ops->send(ATM_SKB(skb)->vcc,skb);
403 return 0;
407 static struct net_device_stats *clip_get_stats(struct net_device *dev)
409 return &PRIV(dev)->stats;
413 int clip_mkip(struct atm_vcc *vcc,int timeout)
415 struct clip_vcc *clip_vcc;
416 struct sk_buff_head copy;
417 struct sk_buff *skb;
418 unsigned long flags;
420 if (!vcc->push) return -EBADFD;
421 clip_vcc = kmalloc(sizeof(struct clip_vcc),GFP_KERNEL);
422 if (!clip_vcc) return -ENOMEM;
423 DPRINTK("mkip clip_vcc %p vcc %p\n",clip_vcc,vcc);
424 clip_vcc->vcc = vcc;
425 vcc->user_back = clip_vcc;
426 clip_vcc->entry = NULL;
427 clip_vcc->encap = 1;
428 clip_vcc->last_use = jiffies;
429 clip_vcc->idle_timeout = timeout*HZ;
430 clip_vcc->old_push = vcc->push;
431 save_flags(flags);
432 cli();
433 vcc->push = clip_push;
434 skb_migrate(&vcc->recvq,&copy);
435 restore_flags(flags);
436 /* re-process everything received between connection setup and MKIP */
437 while ((skb = skb_dequeue(&copy)))
438 if (!clip_devs) {
439 atm_return(vcc,skb->truesize);
440 kfree_skb(skb);
442 else {
443 unsigned int len = skb->len;
445 clip_push(vcc,skb);
446 PRIV(skb->dev)->stats.rx_packets--;
447 PRIV(skb->dev)->stats.rx_bytes -= len;
449 return 0;
453 int clip_setentry(struct atm_vcc *vcc,u32 ip)
455 struct neighbour *neigh;
456 struct atmarp_entry *entry;
457 int error;
458 struct clip_vcc *clip_vcc;
459 struct rtable *rt;
461 if (vcc->push != clip_push) {
462 printk(KERN_WARNING "clip_setentry: non-CLIP VCC\n");
463 return -EBADF;
465 clip_vcc = CLIP_VCC(vcc);
466 if (!ip) {
467 if (!clip_vcc->entry) {
468 printk(KERN_ERR "hiding hidden ATMARP entry\n");
469 return 0;
471 DPRINTK("setentry: remove\n");
472 unlink_clip_vcc(clip_vcc);
473 return 0;
475 error = ip_route_output(&rt,ip,0,1,0);
476 if (error) return error;
477 neigh = __neigh_lookup(&clip_tbl,&ip,rt->u.dst.dev,1);
478 ip_rt_put(rt);
479 if (!neigh)
480 return -ENOMEM;
481 entry = NEIGH2ENTRY(neigh);
482 if (entry != clip_vcc->entry) {
483 if (!clip_vcc->entry) DPRINTK("setentry: add\n");
484 else {
485 DPRINTK("setentry: update\n");
486 unlink_clip_vcc(clip_vcc);
488 link_vcc(clip_vcc,entry);
490 error = neigh_update(neigh,llc_oui,NUD_PERMANENT,1,0);
491 neigh_release(neigh);
492 return error;
496 static int clip_init(struct net_device *dev)
498 DPRINTK("clip_init %s\n",dev->name);
499 dev->hard_start_xmit = clip_start_xmit;
500 /* sg_xmit ... */
501 dev->hard_header = NULL;
502 dev->rebuild_header = NULL;
503 dev->set_mac_address = NULL;
504 dev->hard_header_parse = NULL;
505 dev->hard_header_cache = NULL;
506 dev->header_cache_update = NULL;
507 dev->change_mtu = NULL;
508 dev->do_ioctl = NULL;
509 dev->get_stats = clip_get_stats;
510 dev->type = ARPHRD_ATM;
511 dev->hard_header_len = RFC1483LLC_LEN;
512 dev->mtu = RFC1626_MTU;
513 dev->addr_len = 0;
514 dev->tx_queue_len = 0;
515 dev->flags = 0;
516 dev_init_buffers(dev); /* is this ever supposed to be used ? */
517 return 0;
521 int clip_create(int number)
523 struct net_device *dev;
524 int error;
526 if (number != -1) {
527 for (dev = clip_devs; dev; dev = PRIV(dev)->next)
528 if (PRIV(dev)->number == number) return -EEXIST;
530 else {
531 number = 0;
532 for (dev = clip_devs; dev; dev = PRIV(dev)->next)
533 if (PRIV(dev)->number >= number)
534 number = PRIV(dev)->number+1;
536 dev = kmalloc(sizeof(struct net_device)+sizeof(struct clip_priv),
537 GFP_KERNEL);
538 if (!dev) return -ENOMEM;
539 memset(dev,0,sizeof(struct net_device)+sizeof(struct clip_priv));
540 dev->name = PRIV(dev)->name;
541 sprintf(dev->name,"atm%d",number);
542 dev->init = clip_init;
543 PRIV(dev)->number = number;
544 error = register_netdev(dev);
545 if (error) {
546 kfree(dev);
547 return error;
549 PRIV(dev)->next = clip_devs;
550 clip_devs = dev;
551 DPRINTK("registered (net:%s)\n",dev->name);
552 return number;
556 static int clip_device_event(struct notifier_block *this,unsigned long event,
557 void *dev)
559 /* ignore non-CLIP devices */
560 if (((struct net_device *) dev)->type != ARPHRD_ATM ||
561 ((struct net_device *) dev)->init != clip_init)
562 return NOTIFY_DONE;
563 switch (event) {
564 case NETDEV_UP:
565 DPRINTK("clip_device_event NETDEV_UP\n");
566 (void) to_atmarpd(act_up,PRIV(dev)->number,0);
567 break;
568 case NETDEV_DOWN:
569 DPRINTK("clip_device_event NETDEV_DOWN\n");
570 (void) to_atmarpd(act_down,PRIV(dev)->number,0);
571 break;
572 case NETDEV_CHANGE:
573 case NETDEV_CHANGEMTU:
574 DPRINTK("clip_device_event NETDEV_CHANGE*\n");
575 (void) to_atmarpd(act_change,PRIV(dev)->number,0);
576 break;
577 case NETDEV_REBOOT:
578 case NETDEV_REGISTER:
579 DPRINTK("clip_device_event %ld\n",event);
580 /* ignore */
581 break;
582 default:
583 printk(KERN_WARNING "clip_device_event: unknown event "
584 "%ld\n",event);
585 break;
587 return NOTIFY_DONE;
591 static int clip_inet_event(struct notifier_block *this,unsigned long event,
592 void *ifa)
594 struct in_device *in_dev;
596 in_dev = ((struct in_ifaddr *) ifa)->ifa_dev;
597 if (!in_dev || !in_dev->dev) {
598 printk(KERN_WARNING "clip_inet_event: no device\n");
599 return NOTIFY_DONE;
602 * Transitions are of the down-change-up type, so it's sufficient to
603 * handle the change on up.
605 if (event != NETDEV_UP) return NOTIFY_DONE;
606 return clip_device_event(this,NETDEV_CHANGE,in_dev->dev);
610 static struct notifier_block clip_dev_notifier = {
611 clip_device_event,
612 NULL,
618 static struct notifier_block clip_inet_notifier = {
619 clip_inet_event,
620 NULL,
626 static void atmarpd_close(struct atm_vcc *vcc)
628 struct sk_buff *skb;
630 DPRINTK("atmarpd_close\n");
631 atmarpd = NULL; /* assumed to be atomic */
632 barrier();
633 unregister_inetaddr_notifier(&clip_inet_notifier);
634 unregister_netdevice_notifier(&clip_dev_notifier);
635 if (skb_peek(&vcc->recvq))
636 printk(KERN_ERR "atmarpd_close: closing with requests "
637 "pending\n");
638 while ((skb = skb_dequeue(&vcc->recvq))) kfree_skb(skb);
639 DPRINTK("(done)\n");
643 static struct atmdev_ops atmarpd_dev_ops = {
644 NULL, /* no dev_close */
645 NULL, /* no open */
646 atmarpd_close, /* close */
647 NULL, /* no ioctl */
648 NULL, /* no getsockopt */
649 NULL, /* no setsockopt */
650 NULL, /* send */
651 NULL, /* no sg_send */
652 NULL, /* no send_oam */
653 NULL, /* no phy_put */
654 NULL, /* no phy_get */
655 NULL, /* no feedback */
656 NULL, /* no change_qos */
657 NULL /* no free_rx_skb */
661 static struct atm_dev atmarpd_dev = {
662 &atmarpd_dev_ops,
663 NULL, /* no PHY */
664 "arpd", /* type */
665 999, /* dummy device number */
666 NULL,NULL, /* pretend not to have any VCCs */
667 NULL,NULL, /* no data */
668 0, /* no flags */
669 NULL, /* no local address */
670 { 0 } /* no ESI, no statistics */
674 int atm_init_atmarp(struct atm_vcc *vcc)
676 struct net_device *dev;
678 if (atmarpd) return -EADDRINUSE;
679 if (start_timer) {
680 start_timer = 0;
681 init_timer(&idle_timer);
682 idle_timer.expires = jiffies+CLIP_CHECK_INTERVAL*HZ;
683 idle_timer.function = idle_timer_check;
684 add_timer(&idle_timer);
686 atmarpd = vcc;
687 vcc->flags |= ATM_VF_READY | ATM_VF_META;
688 /* allow replies and avoid getting closed if signaling dies */
689 bind_vcc(vcc,&atmarpd_dev);
690 vcc->push = NULL;
691 vcc->pop = NULL; /* crash */
692 vcc->push_oam = NULL; /* crash */
693 if (register_netdevice_notifier(&clip_dev_notifier))
694 printk(KERN_ERR "register_netdevice_notifier failed\n");
695 if (register_inetaddr_notifier(&clip_inet_notifier))
696 printk(KERN_ERR "register_inetaddr_notifier failed\n");
697 for (dev = clip_devs; dev; dev = PRIV(dev)->next)
698 if (dev->flags & IFF_UP)
699 (void) to_atmarpd(act_up,PRIV(dev)->number,0);
700 return 0;
704 void atm_clip_init(void)
706 clip_tbl.lock = RW_LOCK_UNLOCKED;
707 clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id,
708 clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL);