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>
14 #ifdef CONFIG_MMU_HACKS
15 #include <linux/mmuio.h>
16 #include <linux/uio.h>
20 #include "protocols.h"
21 #include "tunable.h" /* tunable parameters */
25 #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
27 #define DPRINTK(format,args...)
32 * SKB == NULL indicates that the link is being closed
35 void atm_push_raw(struct atm_vcc
*vcc
,struct sk_buff
*skb
)
38 skb_queue_tail(&vcc
->recvq
,skb
);
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
);
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
);
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
;
66 int atm_init_aal34(struct atm_vcc
*vcc
)
68 vcc
->push
= atm_push_raw
;
69 vcc
->pop
= atm_pop_raw
;
75 int atm_init_aal5(struct atm_vcc
*vcc
)
77 vcc
->push
= atm_push_raw
;
78 vcc
->pop
= atm_pop_raw
;
84 EXPORT_SYMBOL(atm_init_aal5
);