Import 2.3.18pre1
[davej-history.git] / net / atm / raw.c
blobd93baa0eca8ed9b3ddee47acbc944e98979ae34c
1 /* net/atm/raw.c - Raw AAL0 and AAL5 transports */
3 /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
6 #include <linux/config.h>
7 #include <linux/module.h>
8 #include <linux/sched.h>
9 #include <linux/atmdev.h>
10 #include <linux/kernel.h>
11 #include <linux/skbuff.h>
12 #include <linux/mm.h>
14 #ifdef CONFIG_MMU_HACKS
15 #include <linux/mmuio.h>
16 #include <linux/uio.h>
17 #endif
19 #include "common.h"
20 #include "protocols.h"
21 #include "tunable.h" /* tunable parameters */
24 #if 0
25 #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
26 #else
27 #define DPRINTK(format,args...)
28 #endif
32 * SKB == NULL indicates that the link is being closed
35 void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb)
37 if (skb) {
38 skb_queue_tail(&vcc->recvq,skb);
39 wake_up(&vcc->sleep);
44 static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb)
46 #ifdef CONFIG_MMU_HACKS
47 if (ATM_SKB(skb)->iovcnt)
48 unlock_user(ATM_SKB(skb)->iovcnt,(struct iovec *) skb->data);
49 #endif
50 DPRINTK("APopR (%d) %d -= %d\n",vcc->vci,vcc->tx_inuse,skb->truesize);
51 atomic_sub(skb->truesize+ATM_PDU_OVHD,&vcc->tx_inuse);
52 dev_kfree_skb(skb);
53 wake_up(&vcc->wsleep);
57 int atm_init_aal0(struct atm_vcc *vcc)
59 vcc->push = atm_push_raw;
60 vcc->pop = atm_pop_raw;
61 vcc->push_oam = NULL;
62 return 0;
66 int atm_init_aal34(struct atm_vcc *vcc)
68 vcc->push = atm_push_raw;
69 vcc->pop = atm_pop_raw;
70 vcc->push_oam = NULL;
71 return 0;
75 int atm_init_aal5(struct atm_vcc *vcc)
77 vcc->push = atm_push_raw;
78 vcc->pop = atm_pop_raw;
79 vcc->push_oam = NULL;
80 return 0;
84 EXPORT_SYMBOL(atm_init_aal5);