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) { struct sk_buff *skb; struct atmsvc_msg *msg; static unsigned session = 0; DPRINTK("sigd_enq %d (0x%p)\n",(int) type,vcc); while (!(skb = alloc_skb(sizeof(struct atmsvc_msg),GFP_KERNEL))) schedule(); msg = (struct atmsvc_msg *) skb_put(skb,sizeof(struct atmsvc_msg)); memset(msg,0,sizeof(*msg)); 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 (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); }
static void modify_qos(struct atm_vcc *vcc, struct atmsvc_msg *msg) { struct sk_buff *skb; if (test_bit(ATM_VF_RELEASED, &vcc->flags) || !test_bit(ATM_VF_READY, &vcc->flags)) return; msg->type = as_error; 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; } /* * Should probably just turn around the old skb. But the, the buffer * space accounting needs to follow the change too. Maybe later. */ while (!(skb = alloc_skb(sizeof(struct atmsvc_msg), GFP_KERNEL))) schedule(); *(struct atmsvc_msg *)skb_put(skb, sizeof(struct atmsvc_msg)) = *msg; sigd_put_skb(skb); }
static void modify_qos(struct atm_vcc *vcc,struct atmsvc_msg *msg) { struct sk_buff *skb; if (test_bit(ATM_VF_RELEASED,&vcc->flags) || !test_bit(ATM_VF_READY,&vcc->flags)) return; msg->type = as_error; if (!vcc->dev->ops->change_qos) msg->reply = -EOPNOTSUPP; else { msg->reply = vcc->dev->ops->change_qos(vcc,&msg->qos, msg->reply); if (!msg->reply) msg->type = as_okay; } while (!(skb = alloc_skb(sizeof(struct atmsvc_msg),GFP_KERNEL))) schedule(); *(struct atmsvc_msg *) skb_put(skb,sizeof(struct atmsvc_msg)) = *msg; sigd_put_skb(skb); }