Loading net/atm/signaling.c +101 −101 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ #include "resources.h" #include "signaling.h" #undef WAIT_FOR_DEMON /* #define this if system calls on SVC sockets should block until the demon runs. Danger: may cause nasty hangs if the demon Loading @@ -29,7 +28,6 @@ struct atm_vcc *sigd = NULL; static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep); #endif static void sigd_put_skb(struct sk_buff *skb) { #ifdef WAIT_FOR_DEMON Loading @@ -55,7 +53,6 @@ static void sigd_put_skb(struct sk_buff *skb) sk_atm(sigd)->sk_data_ready(sk_atm(sigd), skb->len); } static void modify_qos(struct atm_vcc *vcc, struct atmsvc_msg *msg) { struct sk_buff *skb; Loading @@ -64,12 +61,14 @@ static void modify_qos(struct atm_vcc *vcc,struct atmsvc_msg *msg) !test_bit(ATM_VF_READY, &vcc->flags)) return; msg->type = as_error; if (!vcc->dev->ops->change_qos) msg->reply = -EOPNOTSUPP; if (!vcc->dev->ops->change_qos) msg->reply = -EOPNOTSUPP; else { /* should lock VCC */ msg->reply = vcc->dev->ops->change_qos(vcc, &msg->qos, msg->reply); if (!msg->reply) msg->type = as_okay; if (!msg->reply) msg->type = as_okay; } /* * Should probably just turn around the old skb. But the, the buffer Loading @@ -81,7 +80,6 @@ static void modify_qos(struct atm_vcc *vcc,struct atmsvc_msg *msg) sigd_put_skb(skb); } static int sigd_send(struct atm_vcc *vcc, struct sk_buff *skb) { struct atmsvc_msg *msg; Loading @@ -98,8 +96,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) case as_okay: sk->sk_err = -msg->reply; clear_bit(ATM_VF_WAITING, &vcc->flags); if (!*vcc->local.sas_addr.prv && !*vcc->local.sas_addr.pub) { if (!*vcc->local.sas_addr.prv && !*vcc->local.sas_addr.pub) { vcc->local.sas_family = AF_ATMSVC; memcpy(vcc->local.sas_addr.prv, msg->local.sas_addr.prv, ATM_ESA_LEN); Loading @@ -107,7 +104,8 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) msg->local.sas_addr.pub, ATM_E164_LEN + 1); } session_vcc = vcc->session ? vcc->session : vcc; if (session_vcc->vpi || session_vcc->vci) break; if (session_vcc->vpi || session_vcc->vci) break; session_vcc->itf = msg->pvc.sap_addr.itf; session_vcc->vpi = msg->pvc.sap_addr.vpi; session_vcc->vci = msg->pvc.sap_addr.vci; Loading Loading @@ -146,7 +144,8 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) break; case as_addparty: case as_dropparty: sk->sk_err_soft = msg->reply; /* < 0 failure, otherwise ep_ref */ sk->sk_err_soft = msg->reply; /* < 0 failure, otherwise ep_ref */ clear_bit(ATM_VF_WAITING, &vcc->flags); break; default: Loading @@ -159,10 +158,10 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) return 0; } void sigd_enq2(struct atm_vcc *vcc, enum atmsvc_msg_type type, struct atm_vcc *listen_vcc, const struct sockaddr_atmpvc *pvc, const struct sockaddr_atmsvc *svc,const struct atm_qos *qos,int reply) const struct sockaddr_atmsvc *svc, const struct atm_qos *qos, int reply) { struct sk_buff *skb; struct atmsvc_msg *msg; Loading @@ -177,21 +176,26 @@ void sigd_enq2(struct atm_vcc *vcc,enum atmsvc_msg_type type, *(struct atm_vcc **) &msg->vcc = vcc; *(struct atm_vcc **) &msg->listen_vcc = listen_vcc; msg->reply = reply; if (qos) msg->qos = *qos; if (vcc) msg->sap = vcc->sap; if (svc) msg->svc = *svc; if (vcc) msg->local = vcc->local; if (pvc) msg->pvc = *pvc; if (qos) msg->qos = *qos; if (vcc) msg->sap = vcc->sap; if (svc) msg->svc = *svc; if (vcc) msg->local = vcc->local; if (pvc) msg->pvc = *pvc; if (vcc) { if (type == as_connect && test_bit(ATM_VF_SESSION, &vcc->flags)) msg->session = ++session; /* every new pmp connect gets the next session number */ } sigd_put_skb(skb); if (vcc) set_bit(ATM_VF_REGIS,&vcc->flags); if (vcc) set_bit(ATM_VF_REGIS, &vcc->flags); } void sigd_enq(struct atm_vcc *vcc, enum atmsvc_msg_type type, struct atm_vcc *listen_vcc, const struct sockaddr_atmpvc *pvc, const struct sockaddr_atmsvc *svc) Loading @@ -200,7 +204,6 @@ void sigd_enq(struct atm_vcc *vcc,enum atmsvc_msg_type type, /* other ISP applications may use "reply" */ } static void purge_vcc(struct atm_vcc *vcc) { if (sk_atm(vcc)->sk_family == PF_ATMSVC && Loading @@ -211,7 +214,6 @@ static void purge_vcc(struct atm_vcc *vcc) } } static void sigd_close(struct atm_vcc *vcc) { struct hlist_node *node; Loading @@ -237,13 +239,11 @@ static void sigd_close(struct atm_vcc *vcc) read_unlock(&vcc_sklist_lock); } static struct atmdev_ops sigd_dev_ops = { .close = sigd_close, .send = sigd_send }; static struct atm_dev sigd_dev = { .ops = &sigd_dev_ops, .type = "sig", Loading @@ -251,10 +251,10 @@ static struct atm_dev sigd_dev = { .lock = __SPIN_LOCK_UNLOCKED(sigd_dev.lock) }; int sigd_attach(struct atm_vcc *vcc) { if (sigd) return -EADDRINUSE; if (sigd) return -EADDRINUSE; pr_debug("\n"); sigd = vcc; vcc->dev = &sigd_dev; Loading Loading
net/atm/signaling.c +101 −101 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ #include "resources.h" #include "signaling.h" #undef WAIT_FOR_DEMON /* #define this if system calls on SVC sockets should block until the demon runs. Danger: may cause nasty hangs if the demon Loading @@ -29,7 +28,6 @@ struct atm_vcc *sigd = NULL; static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep); #endif static void sigd_put_skb(struct sk_buff *skb) { #ifdef WAIT_FOR_DEMON Loading @@ -55,7 +53,6 @@ static void sigd_put_skb(struct sk_buff *skb) sk_atm(sigd)->sk_data_ready(sk_atm(sigd), skb->len); } static void modify_qos(struct atm_vcc *vcc, struct atmsvc_msg *msg) { struct sk_buff *skb; Loading @@ -64,12 +61,14 @@ static void modify_qos(struct atm_vcc *vcc,struct atmsvc_msg *msg) !test_bit(ATM_VF_READY, &vcc->flags)) return; msg->type = as_error; if (!vcc->dev->ops->change_qos) msg->reply = -EOPNOTSUPP; if (!vcc->dev->ops->change_qos) msg->reply = -EOPNOTSUPP; else { /* should lock VCC */ msg->reply = vcc->dev->ops->change_qos(vcc, &msg->qos, msg->reply); if (!msg->reply) msg->type = as_okay; if (!msg->reply) msg->type = as_okay; } /* * Should probably just turn around the old skb. But the, the buffer Loading @@ -81,7 +80,6 @@ static void modify_qos(struct atm_vcc *vcc,struct atmsvc_msg *msg) sigd_put_skb(skb); } static int sigd_send(struct atm_vcc *vcc, struct sk_buff *skb) { struct atmsvc_msg *msg; Loading @@ -98,8 +96,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) case as_okay: sk->sk_err = -msg->reply; clear_bit(ATM_VF_WAITING, &vcc->flags); if (!*vcc->local.sas_addr.prv && !*vcc->local.sas_addr.pub) { if (!*vcc->local.sas_addr.prv && !*vcc->local.sas_addr.pub) { vcc->local.sas_family = AF_ATMSVC; memcpy(vcc->local.sas_addr.prv, msg->local.sas_addr.prv, ATM_ESA_LEN); Loading @@ -107,7 +104,8 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) msg->local.sas_addr.pub, ATM_E164_LEN + 1); } session_vcc = vcc->session ? vcc->session : vcc; if (session_vcc->vpi || session_vcc->vci) break; if (session_vcc->vpi || session_vcc->vci) break; session_vcc->itf = msg->pvc.sap_addr.itf; session_vcc->vpi = msg->pvc.sap_addr.vpi; session_vcc->vci = msg->pvc.sap_addr.vci; Loading Loading @@ -146,7 +144,8 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) break; case as_addparty: case as_dropparty: sk->sk_err_soft = msg->reply; /* < 0 failure, otherwise ep_ref */ sk->sk_err_soft = msg->reply; /* < 0 failure, otherwise ep_ref */ clear_bit(ATM_VF_WAITING, &vcc->flags); break; default: Loading @@ -159,10 +158,10 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) return 0; } void sigd_enq2(struct atm_vcc *vcc, enum atmsvc_msg_type type, struct atm_vcc *listen_vcc, const struct sockaddr_atmpvc *pvc, const struct sockaddr_atmsvc *svc,const struct atm_qos *qos,int reply) const struct sockaddr_atmsvc *svc, const struct atm_qos *qos, int reply) { struct sk_buff *skb; struct atmsvc_msg *msg; Loading @@ -177,21 +176,26 @@ void sigd_enq2(struct atm_vcc *vcc,enum atmsvc_msg_type type, *(struct atm_vcc **) &msg->vcc = vcc; *(struct atm_vcc **) &msg->listen_vcc = listen_vcc; msg->reply = reply; if (qos) msg->qos = *qos; if (vcc) msg->sap = vcc->sap; if (svc) msg->svc = *svc; if (vcc) msg->local = vcc->local; if (pvc) msg->pvc = *pvc; if (qos) msg->qos = *qos; if (vcc) msg->sap = vcc->sap; if (svc) msg->svc = *svc; if (vcc) msg->local = vcc->local; if (pvc) msg->pvc = *pvc; if (vcc) { if (type == as_connect && test_bit(ATM_VF_SESSION, &vcc->flags)) msg->session = ++session; /* every new pmp connect gets the next session number */ } sigd_put_skb(skb); if (vcc) set_bit(ATM_VF_REGIS,&vcc->flags); if (vcc) set_bit(ATM_VF_REGIS, &vcc->flags); } void sigd_enq(struct atm_vcc *vcc, enum atmsvc_msg_type type, struct atm_vcc *listen_vcc, const struct sockaddr_atmpvc *pvc, const struct sockaddr_atmsvc *svc) Loading @@ -200,7 +204,6 @@ void sigd_enq(struct atm_vcc *vcc,enum atmsvc_msg_type type, /* other ISP applications may use "reply" */ } static void purge_vcc(struct atm_vcc *vcc) { if (sk_atm(vcc)->sk_family == PF_ATMSVC && Loading @@ -211,7 +214,6 @@ static void purge_vcc(struct atm_vcc *vcc) } } static void sigd_close(struct atm_vcc *vcc) { struct hlist_node *node; Loading @@ -237,13 +239,11 @@ static void sigd_close(struct atm_vcc *vcc) read_unlock(&vcc_sklist_lock); } static struct atmdev_ops sigd_dev_ops = { .close = sigd_close, .send = sigd_send }; static struct atm_dev sigd_dev = { .ops = &sigd_dev_ops, .type = "sig", Loading @@ -251,10 +251,10 @@ static struct atm_dev sigd_dev = { .lock = __SPIN_LOCK_UNLOCKED(sigd_dev.lock) }; int sigd_attach(struct atm_vcc *vcc) { if (sigd) return -EADDRINUSE; if (sigd) return -EADDRINUSE; pr_debug("\n"); sigd = vcc; vcc->dev = &sigd_dev; Loading