#include <linux/module.h>
#include <linux/atmdev.h>
#include <linux/atm_tcp.h>
#include <linux/bitops.h>
#include <linux/uaccess.h>
#include <linux/atomic.h>
extern int atm_init_aal5(struct atm_vcc *vcc);
#define PRIV(dev) ((struct atmtcp_dev_data *) ((dev)->dev_data))
#define DEV_LABEL "atmtcp"
static int atmtcp_send_control(struct atm_vcc *vcc,int type,
const struct atmtcp_control *msg,int flag)
DECLARE_WAITQUEUE(wait,current);
struct atmtcp_control *new_msg;
out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
if (!out_vcc) return -EUNATCH;
skb = alloc_skb(sizeof(*msg),GFP_KERNEL);
if (!skb) return -ENOMEM;
out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
atm_force_charge(out_vcc,skb->truesize);
new_msg = skb_put(skb, sizeof(*new_msg));
new_msg->hdr.length = ATMTCP_HDR_MAGIC;
memset(&new_msg->vcc,0,sizeof(atm_kptr_t));
*(struct atm_vcc **) &new_msg->vcc = vcc;
old_test = test_bit(flag,&vcc->flags);
out_vcc->push(out_vcc,skb);
add_wait_queue(sk_sleep(sk_atm(vcc)), &wait);
while (test_bit(flag,&vcc->flags) == old_test) {
out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
set_current_state(TASK_UNINTERRUPTIBLE);
set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk_atm(vcc)), &wait);
static int atmtcp_recv_control(const struct atmtcp_control *msg)
struct atm_vcc *vcc = *(struct atm_vcc **) &msg->vcc;
vcc->vpi = msg->addr.sap_addr.vpi;