static void send_uframe(struct PStack *st, u_char cmd, u_char cr) { struct sk_buff *skb; u_char tmp[MAX_HEADER_LEN]; int i; i = sethdraddr(&st->l2, tmp, cr); tmp[i++] = cmd; if (!(skb = alloc_skb(i, GFP_ATOMIC))) { printk(KERN_WARNING "isdl2 can't alloc sbbuff for send_uframe\n"); return; } memcpy(skb_put(skb, i), tmp, i); enqueue_super(st, skb); }
static void send_uframe(layer2_t *l2, msg_t *msg, u_char cmd, u_char cr) { u_char tmp[MAX_HEADER_LEN]; int i; i = sethdraddr(l2, tmp, cr); tmp[i++] = cmd; if (msg) msg_trim(msg, 0); else if ((msg = alloc_msg(i + mISDNUSER_HEAD_SIZE))) msg_reserve(msg, mISDNUSER_HEAD_SIZE); else { dprint(DBGM_L2, l2->nst->cardnr,"%s: can't alloc msguff\n", __FUNCTION__); return; } memcpy(msg_put(msg, i), tmp, i); msg_push(msg, mISDNUSER_HEAD_SIZE); enqueue_super(l2, msg); }
static void send_uframe(struct layer2 *l2, struct sk_buff *skb, u_char cmd, u_char cr) { u_char tmp[MAX_L2HEADER_LEN]; int i; i = sethdraddr(l2, tmp, cr); tmp[i++] = cmd; if (skb) skb_trim(skb, 0); else { skb = mI_alloc_skb(i, GFP_ATOMIC); if (!skb) { printk(KERN_WARNING "%s: can't alloc skbuff\n", __func__); return; } } memcpy(skb_put(skb, i), tmp, i); enqueue_super(l2, skb); }
static void enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, u_char pf) { struct sk_buff *skb; u_char tmp[MAX_L2HEADER_LEN]; int i; i = sethdraddr(l2, tmp, cr); if (test_bit(FLG_MOD128, &l2->flag)) { tmp[i++] = typ; tmp[i++] = (l2->vr << 1) | (pf ? 1 : 0); } else tmp[i++] = (l2->vr << 5) | typ | (pf ? 0x10 : 0); skb = mI_alloc_skb(i, GFP_ATOMIC); if (!skb) { printk(KERN_WARNING "isdnl2 can't alloc sbbuff for enquiry_cr\n"); return; } memcpy(skb_put(skb, i), tmp, i); enqueue_super(l2, skb); }
void enquiry_cr(layer2_t *l2, u_char typ, u_char cr, u_char pf) { msg_t *msg; u_char tmp[MAX_HEADER_LEN]; int i; i = sethdraddr(l2, tmp, cr); if (test_bit(FLG_MOD128, &l2->flag)) { tmp[i++] = typ; tmp[i++] = (l2->vr << 1) | (pf ? 1 : 0); } else tmp[i++] = (l2->vr << 5) | typ | (pf ? 0x10 : 0); if (!(msg = alloc_msg(i + mISDNUSER_HEAD_SIZE))) { dprint(DBGM_L2, l2->nst->cardnr, "isdnl2 can't alloc sbbuff for enquiry_cr\n"); return; } else msg_reserve(msg, mISDNUSER_HEAD_SIZE); memcpy(msg_put(msg, i), tmp, i); msg_push(msg, mISDNUSER_HEAD_SIZE); enqueue_super(l2, msg); }
inline void enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) { struct sk_buff *skb; struct Layer2 *l2; u_char tmp[MAX_HEADER_LEN]; int i; l2 = &st->l2; i = sethdraddr(l2, tmp, cr); if (test_bit(FLG_MOD128, &l2->flag)) { tmp[i++] = typ; tmp[i++] = (l2->vr << 1) | (pf ? 1 : 0); } else tmp[i++] = (l2->vr << 5) | typ | (pf ? 0x10 : 0); if (!(skb = alloc_skb(i, GFP_ATOMIC))) { printk(KERN_WARNING "isdl2 can't alloc sbbuff for enquiry_cr\n"); return; } memcpy(skb_put(skb, i), tmp, i); enqueue_super(st, skb); }