mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
networking: introduce and use skb_put_data()
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.
An spatch similar to the one for skb_put_zero() converts many
of the places using it:
@@
identifier p, p2;
expression len, skb, data;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_data(skb, data, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_data(skb, data, len);
)
(
p2 = (t2)p;
-memcpy(p2, data, len);
|
-memcpy(p, data, len);
)
@@
type t, t2;
identifier p, p2;
expression skb, data;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
)
(
p2 = (t2)p;
-memcpy(p2, data, sizeof(*p));
|
-memcpy(p, data, sizeof(*p));
)
@@
expression skb, len, data;
@@
-memcpy(skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);
(again, manually post-processed to retain some comments)
Reviewed-by: Stephen Hemminger <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
b080db5853
commit
59ae1d127a
252 changed files with 622 additions and 741 deletions
|
|
@ -1058,7 +1058,7 @@ static int capinc_tty_write(struct tty_struct *tty,
|
|||
}
|
||||
|
||||
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
|
||||
memcpy(skb_put(skb, count), buf, count);
|
||||
skb_put_data(skb, buf, count);
|
||||
|
||||
__skb_queue_tail(&mp->outqueue, skb);
|
||||
mp->outbytes += skb->len;
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ static void send_message(capidrv_contr *card, _cmsg *cmsg)
|
|||
printk(KERN_ERR "capidrv::send_message: can't allocate mem\n");
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, len), cmsg->buf, len);
|
||||
skb_put_data(skb, cmsg->buf, len);
|
||||
if (capi20_put_message(&global.ap, skb) != CAPI_NOERROR)
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -529,8 +529,8 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->databuf, DataB3Len);
|
||||
capi_ctr_handle_message(ctrl, ApplId, skb);
|
||||
}
|
||||
break;
|
||||
|
|
@ -544,7 +544,7 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
|
|||
card->name);
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
|
||||
capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
|
||||
CAPIMSG_NCCI(skb->data),
|
||||
|
|
|
|||
|
|
@ -474,8 +474,8 @@ static void b1dma_handle_rx(avmcard *card)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->databuf, DataB3Len);
|
||||
capi_ctr_handle_message(ctrl, ApplId, skb);
|
||||
}
|
||||
break;
|
||||
|
|
@ -488,7 +488,7 @@ static void b1dma_handle_rx(avmcard *card)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) {
|
||||
spin_lock(&card->lock);
|
||||
capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
|
||||
|
|
|
|||
|
|
@ -536,8 +536,8 @@ static void c4_handle_rx(avmcard *card)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->databuf, DataB3Len);
|
||||
capi_ctr_handle_message(ctrl, ApplId, skb);
|
||||
}
|
||||
break;
|
||||
|
|
@ -555,7 +555,7 @@ static void c4_handle_rx(avmcard *card)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
|
||||
capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
|
||||
CAPIMSG_NCCI(skb->data),
|
||||
|
|
|
|||
|
|
@ -171,8 +171,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->databuf, DataB3Len);
|
||||
capi_ctr_handle_message(ctrl, ApplId, skb);
|
||||
}
|
||||
break;
|
||||
|
|
@ -186,7 +186,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
|
|||
printk(KERN_ERR "%s: incoming packet dropped\n",
|
||||
card->name);
|
||||
} else {
|
||||
memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
|
||||
skb_put_data(skb, card->msgbuf, MsgLen);
|
||||
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3)
|
||||
capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
|
||||
CAPIMSG_NCCI(skb->data),
|
||||
|
|
|
|||
|
|
@ -1926,7 +1926,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
|
|||
hh = mISDN_HEAD_P(skb);
|
||||
hh->prim = PH_CONTROL_IND;
|
||||
hh->id = DTMF_HFC_COEF;
|
||||
memcpy(skb_put(skb, 512), hc->chan[ch].coeff, 512);
|
||||
skb_put_data(skb, hc->chan[ch].coeff, 512);
|
||||
recv_Bchannel_skb(bch, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -2332,8 +2332,7 @@ next_frame:
|
|||
skb = *sp;
|
||||
*sp = mI_alloc_skb(skb->len, GFP_ATOMIC);
|
||||
if (*sp) {
|
||||
memcpy(skb_put(*sp, skb->len),
|
||||
skb->data, skb->len);
|
||||
skb_put_data(*sp, skb->data, skb->len);
|
||||
skb_trim(skb, 0);
|
||||
} else {
|
||||
printk(KERN_DEBUG "%s: No mem\n",
|
||||
|
|
|
|||
|
|
@ -893,7 +893,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
|
|||
}
|
||||
}
|
||||
|
||||
memcpy(skb_put(rx_skb, len), data, len);
|
||||
skb_put_data(rx_skb, data, len);
|
||||
|
||||
if (hdlc) {
|
||||
/* we have a complete hdlc packet */
|
||||
|
|
|
|||
|
|
@ -317,7 +317,8 @@ Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag)
|
|||
debugl1(cs, "%s", cs->dlog);
|
||||
}
|
||||
/* moves received data in sk-buffer */
|
||||
memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx);
|
||||
skb_put_data(skb, cs->rcvbuf,
|
||||
cs->rcvidx);
|
||||
skb_queue_tail(&cs->rq, skb);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,8 +378,9 @@ HDLC_irq(struct BCState *bcs, u_int stat) {
|
|||
if (!(skb = dev_alloc_skb(bcs->hw.hdlc.rcvidx)))
|
||||
printk(KERN_WARNING "HDLC: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, bcs->hw.hdlc.rcvidx),
|
||||
bcs->hw.hdlc.rcvbuf, bcs->hw.hdlc.rcvidx);
|
||||
skb_put_data(skb,
|
||||
bcs->hw.hdlc.rcvbuf,
|
||||
bcs->hw.hdlc.rcvidx);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
bcs->hw.hdlc.rcvidx = 0;
|
||||
|
|
|
|||
|
|
@ -511,7 +511,8 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "HSCX: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
count);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -526,7 +527,8 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
|
|||
if (!(skb = dev_alloc_skb(fifo_size)))
|
||||
printk(KERN_WARNING "HiSax: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
fifo_size);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
bcs->hw.hscx.rcvidx = 0;
|
||||
|
|
|
|||
|
|
@ -333,8 +333,8 @@ static inline void receive_chars(struct IsdnCardState *cs,
|
|||
if (!(skb = dev_alloc_skb(cs->hw.elsa.rcvcnt)))
|
||||
printk(KERN_WARNING "ElsaSER: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, cs->hw.elsa.rcvcnt), cs->hw.elsa.rcvbuf,
|
||||
cs->hw.elsa.rcvcnt);
|
||||
skb_put_data(skb, cs->hw.elsa.rcvbuf,
|
||||
cs->hw.elsa.rcvcnt);
|
||||
skb_queue_tail(&cs->hw.elsa.bcs->rqueue, skb);
|
||||
}
|
||||
schedule_event(cs->hw.elsa.bcs, B_RCVBUFREADY);
|
||||
|
|
|
|||
|
|
@ -799,7 +799,7 @@ collect_rx_frame(usb_fifo *fifo, __u8 *data, int len, int finish)
|
|||
}
|
||||
if (len) {
|
||||
if (fifo->skbuff->len + len < fifo->max_size) {
|
||||
memcpy(skb_put(fifo->skbuff, len), data, len);
|
||||
skb_put_data(fifo->skbuff, data, len);
|
||||
} else {
|
||||
DBG(HFCUSB_DBG_FIFO_ERR,
|
||||
"HCF-USB: got frame exceeded fifo->max_size(%d) fifo(%d)",
|
||||
|
|
|
|||
|
|
@ -495,8 +495,7 @@ static inline void hdlc_rpr_irq(struct fritz_bcs *bcs, u32 stat)
|
|||
if (!skb) {
|
||||
printk(KERN_WARNING "HDLC: receive out of memory\n");
|
||||
} else {
|
||||
memcpy(skb_put(skb, bcs->rcvidx), bcs->rcvbuf,
|
||||
bcs->rcvidx);
|
||||
skb_put_data(skb, bcs->rcvbuf, bcs->rcvidx);
|
||||
DBG_SKB(1, skb);
|
||||
B_L1L2(bcs, PH_DATA | INDICATION, skb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ static inline void isac_rme_interrupt(struct isac *isac)
|
|||
DBG(DBG_WARN, "no memory, dropping\n");
|
||||
goto out;
|
||||
}
|
||||
memcpy(skb_put(skb, count), isac->rcvbuf, count);
|
||||
skb_put_data(skb, isac->rcvbuf, count);
|
||||
DBG_SKB(DBG_RPACKET, skb);
|
||||
D_L1L2(isac, PH_DATA | INDICATION, skb);
|
||||
out:
|
||||
|
|
@ -687,7 +687,7 @@ static inline void isacsx_rme_interrupt(struct isac *isac)
|
|||
DBG(DBG_WARN, "no memory, dropping");
|
||||
goto out;
|
||||
}
|
||||
memcpy(skb_put(skb, count), isac->rcvbuf, count);
|
||||
skb_put_data(skb, isac->rcvbuf, count);
|
||||
DBG_SKB(DBG_RPACKET, skb);
|
||||
D_L1L2(isac, PH_DATA | INDICATION, skb);
|
||||
out:
|
||||
|
|
|
|||
|
|
@ -169,7 +169,8 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "HSCX: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
count);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -184,7 +185,8 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
|
|||
if (!(skb = dev_alloc_skb(fifo_size)))
|
||||
printk(KERN_WARNING "HiSax: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
fifo_size);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
bcs->hw.hscx.rcvidx = 0;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
|
|||
if (!(skb = alloc_skb(count, GFP_ATOMIC)))
|
||||
printk(KERN_WARNING "HiSax: D receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), cs->rcvbuf, count);
|
||||
skb_put_data(skb, cs->rcvbuf, count);
|
||||
skb_queue_tail(&cs->rq, skb);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ dch_int(struct IsdnCardState *cs)
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "HiSax dch_int(): receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), cs->rcvbuf, count);
|
||||
skb_put_data(skb, cs->rcvbuf, count);
|
||||
skb_queue_tail(&cs->rq, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -627,7 +627,8 @@ bch_int(struct IsdnCardState *cs, u_char hscx)
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "HiSax bch_int(): receive frame out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
count);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -644,7 +645,8 @@ bch_int(struct IsdnCardState *cs, u_char hscx)
|
|||
if (!(skb = dev_alloc_skb(B_FIFO_SIZE)))
|
||||
printk(KERN_WARNING "HiSax bch_int(): receive transparent out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, B_FIFO_SIZE), bcs->hw.hscx.rcvbuf, B_FIFO_SIZE);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
B_FIFO_SIZE);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
bcs->hw.hscx.rcvidx = 0;
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
|
|||
if (!skb)
|
||||
printk(KERN_WARNING "HiSax: D receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), cs->rcvbuf, count);
|
||||
skb_put_data(skb, cs->rcvbuf, count);
|
||||
skb_queue_tail(&cs->rq, skb);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ send_DLE_ETX(struct BCState *bcs)
|
|||
struct sk_buff *skb;
|
||||
|
||||
if ((skb = dev_alloc_skb(2))) {
|
||||
memcpy(skb_put(skb, 2), dleetx, 2);
|
||||
skb_put_data(skb, dleetx, 2);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
schedule_event(bcs, B_RCVBUFREADY);
|
||||
} else {
|
||||
|
|
@ -550,8 +550,8 @@ isar_rcv_frame(struct IsdnCardState *cs, struct BCState *bcs)
|
|||
} else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx - 2))) {
|
||||
printk(KERN_WARNING "ISAR: receive out of memory\n");
|
||||
} else {
|
||||
memcpy(skb_put(skb, bcs->hw.isar.rcvidx - 2),
|
||||
bcs->hw.isar.rcvbuf, bcs->hw.isar.rcvidx - 2);
|
||||
skb_put_data(skb, bcs->hw.isar.rcvbuf,
|
||||
bcs->hw.isar.rcvidx - 2);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
schedule_event(bcs, B_RCVBUFREADY);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ send_uframe(struct PStack *st, u_char cmd, u_char cr)
|
|||
printk(KERN_WARNING "isdl2 can't alloc sbbuff for send_uframe\n");
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, i), tmp, i);
|
||||
skb_put_data(skb, tmp, i);
|
||||
enqueue_super(st, skb);
|
||||
}
|
||||
|
||||
|
|
@ -894,7 +894,7 @@ enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf)
|
|||
printk(KERN_WARNING "isdl2 can't alloc sbbuff for enquiry_cr\n");
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, i), tmp, i);
|
||||
skb_put_data(skb, tmp, i);
|
||||
enqueue_super(st, skb);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,8 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade)
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "JADE %s receive out of memory\n", (jade ? "B" : "A"));
|
||||
else {
|
||||
memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
count);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -162,7 +163,8 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade)
|
|||
if (!(skb = dev_alloc_skb(fifo_size)))
|
||||
printk(KERN_WARNING "HiSax: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size);
|
||||
skb_put_data(skb, bcs->hw.hscx.rcvbuf,
|
||||
fifo_size);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
bcs->hw.hscx.rcvidx = 0;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ l3_1tr6_setup_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
L3DelTimer(&pc->timer);
|
||||
L3AddTimer(&pc->timer, T303, CC_T303);
|
||||
newl3state(pc, 1);
|
||||
|
|
@ -497,7 +497,7 @@ l3_1tr6_setup_rsp(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3DelTimer(&pc->timer);
|
||||
L3AddTimer(&pc->timer, T313, CC_T313);
|
||||
|
|
@ -543,7 +543,7 @@ l3_1tr6_disconnect_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3AddTimer(&pc->timer, T305, CC_T305);
|
||||
}
|
||||
|
|
@ -602,7 +602,7 @@ l3_1tr6_t305(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3AddTimer(&pc->timer, T308, CC_T308_1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ l3dss1_message_cause(struct l3_process *pc, u_char mt, u_char cause)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ l3dss1_status_send(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
||||
|
|
@ -587,7 +587,7 @@ l3dss1_msg_without_setup(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
dss1_release_l3_process(pc);
|
||||
}
|
||||
|
|
@ -944,7 +944,7 @@ l3dss1_msg_with_uus(struct l3_process *pc, u_char cmd)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
} /* l3dss1_msg_with_uus */
|
||||
|
||||
|
|
@ -1420,7 +1420,7 @@ l3dss1_setup_req(struct l3_process *pc, u_char pr,
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
L3DelTimer(&pc->timer);
|
||||
L3AddTimer(&pc->timer, T303, CC_T303);
|
||||
newl3state(pc, 1);
|
||||
|
|
@ -1786,7 +1786,7 @@ l3dss1_disconnect_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
newl3state(pc, 11);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3AddTimer(&pc->timer, T305, CC_T305);
|
||||
|
|
@ -1848,7 +1848,7 @@ l3dss1_reject_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc);
|
||||
newl3state(pc, 0);
|
||||
|
|
@ -2145,7 +2145,7 @@ static void l3dss1_redir_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
|
||||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l))) return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
} /* l3dss1_redir_req */
|
||||
|
|
@ -2216,7 +2216,7 @@ static int l3dss1_cmd_global(struct PStack *st, isdn_ctrl *ic)
|
|||
if (pc) dss1_release_l3_process(pc);
|
||||
return (-2);
|
||||
}
|
||||
memcpy(skb_put(skb, l), temp, l);
|
||||
skb_put_data(skb, temp, l);
|
||||
|
||||
if (pc)
|
||||
{ pc->prot.dss1.invoke_id = id; /* remember id */
|
||||
|
|
@ -2359,7 +2359,7 @@ l3dss1_t305(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
newl3state(pc, 19);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3AddTimer(&pc->timer, T308, CC_T308_1);
|
||||
|
|
@ -2528,7 +2528,7 @@ l3dss1_suspend_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
newl3state(pc, 15);
|
||||
L3AddTimer(&pc->timer, T319, CC_T319);
|
||||
|
|
@ -2603,7 +2603,7 @@ l3dss1_resume_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
newl3state(pc, 17);
|
||||
L3AddTimer(&pc->timer, T318, CC_T318);
|
||||
|
|
@ -2721,7 +2721,7 @@ l3dss1_global_restart(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
newl3state(pc, 0);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
|
@ -2929,7 +2929,7 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(proc->st, DL_DATA | REQUEST, skb);
|
||||
} else {
|
||||
if (st->l3.debug & L3_DEB_STATE) {
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ l3ni1_message_plus_chid(struct l3_process *pc, u_char mt)
|
|||
|
||||
if (!(skb = l3_alloc_skb(7)))
|
||||
return;
|
||||
memcpy(skb_put(skb, 7), tmp, 7);
|
||||
skb_put_data(skb, tmp, 7);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
||||
|
|
@ -475,7 +475,7 @@ l3ni1_message_cause(struct l3_process *pc, u_char mt, u_char cause)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
||||
|
|
@ -501,7 +501,7 @@ l3ni1_status_send(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
||||
|
|
@ -537,7 +537,7 @@ l3ni1_msg_without_setup(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
ni1_release_l3_process(pc);
|
||||
}
|
||||
|
|
@ -894,7 +894,7 @@ l3ni1_msg_with_uus(struct l3_process *pc, u_char cmd)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
} /* l3ni1_msg_with_uus */
|
||||
|
||||
|
|
@ -1274,7 +1274,7 @@ l3ni1_setup_req(struct l3_process *pc, u_char pr,
|
|||
{
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
L3DelTimer(&pc->timer);
|
||||
L3AddTimer(&pc->timer, T303, CC_T303);
|
||||
newl3state(pc, 1);
|
||||
|
|
@ -1640,7 +1640,7 @@ l3ni1_disconnect_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
newl3state(pc, 11);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3AddTimer(&pc->timer, T305, CC_T305);
|
||||
|
|
@ -1704,7 +1704,7 @@ l3ni1_reject_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc);
|
||||
newl3state(pc, 0);
|
||||
|
|
@ -2001,7 +2001,7 @@ static void l3ni1_redir_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
|
||||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l))) return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
} /* l3ni1_redir_req */
|
||||
|
|
@ -2076,7 +2076,7 @@ static int l3ni1_cmd_global(struct PStack *st, isdn_ctrl *ic)
|
|||
if (pc) ni1_release_l3_process(pc);
|
||||
return (-2);
|
||||
}
|
||||
memcpy(skb_put(skb, l), temp, l);
|
||||
skb_put_data(skb, temp, l);
|
||||
|
||||
if (pc)
|
||||
{ pc->prot.ni1.invoke_id = id; /* remember id */
|
||||
|
|
@ -2219,7 +2219,7 @@ l3ni1_t305(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
newl3state(pc, 19);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
L3AddTimer(&pc->timer, T308, CC_T308_1);
|
||||
|
|
@ -2388,7 +2388,7 @@ l3ni1_suspend_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
newl3state(pc, 15);
|
||||
L3AddTimer(&pc->timer, T319, CC_T319);
|
||||
|
|
@ -2463,7 +2463,7 @@ l3ni1_resume_req(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
newl3state(pc, 17);
|
||||
L3AddTimer(&pc->timer, T318, CC_T318);
|
||||
|
|
@ -2582,7 +2582,7 @@ l3ni1_global_restart(struct l3_process *pc, u_char pr, void *arg)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
newl3state(pc, 0);
|
||||
l3_msg(pc->st, DL_DATA | REQUEST, skb);
|
||||
}
|
||||
|
|
@ -2655,7 +2655,7 @@ static void l3ni1_SendSpid(struct l3_process *pc, u_char pr, struct sk_buff *skb
|
|||
*p++ = IE_SPID;
|
||||
*p++ = l;
|
||||
|
||||
memcpy(skb_put(skb, l), pSPID, l);
|
||||
skb_put_data(skb, pSPID, l);
|
||||
|
||||
newl3state(pc, iNewState);
|
||||
|
||||
|
|
@ -2873,7 +2873,7 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb)
|
|||
l = p - tmp;
|
||||
if (!(skb = l3_alloc_skb(l)))
|
||||
return;
|
||||
memcpy(skb_put(skb, l), tmp, l);
|
||||
skb_put_data(skb, tmp, l);
|
||||
l3_msg(proc->st, DL_DATA | REQUEST, skb);
|
||||
} else {
|
||||
if (st->l3.debug & L3_DEB_STATE) {
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ static void got_frame(struct BCState *bcs, int count) {
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "TIGER: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), bcs->hw.tiger.rcvbuf, count);
|
||||
skb_put_data(skb, bcs->hw.tiger.rcvbuf, count);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
test_and_set_bit(B_RCVBUFREADY, &bcs->event);
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ static void usb_in_complete(struct urb *urb)
|
|||
WARNING("receive out of memory\n");
|
||||
break;
|
||||
}
|
||||
memcpy(skb_put(skb, status), in->rcvbuf, status);
|
||||
skb_put_data(skb, in->rcvbuf, status);
|
||||
in->hisax_if->l1l2(in->hisax_if, PH_DATA | INDICATION, skb);
|
||||
} else if (status == -HDLC_CRC_ERROR) {
|
||||
INFO("CRC error");
|
||||
|
|
|
|||
|
|
@ -309,7 +309,9 @@ W6692B_interrupt(struct IsdnCardState *cs, u_char bchan)
|
|||
if (!(skb = dev_alloc_skb(count)))
|
||||
printk(KERN_WARNING "W6692: Bchan receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), bcs->hw.w6692.rcvbuf, count);
|
||||
skb_put_data(skb,
|
||||
bcs->hw.w6692.rcvbuf,
|
||||
count);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
}
|
||||
|
|
@ -332,7 +334,8 @@ W6692B_interrupt(struct IsdnCardState *cs, u_char bchan)
|
|||
if (!(skb = dev_alloc_skb(W_B_FIFO_THRESH)))
|
||||
printk(KERN_WARNING "HiSax: receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, W_B_FIFO_THRESH), bcs->hw.w6692.rcvbuf, W_B_FIFO_THRESH);
|
||||
skb_put_data(skb, bcs->hw.w6692.rcvbuf,
|
||||
W_B_FIFO_THRESH);
|
||||
skb_queue_tail(&bcs->rqueue, skb);
|
||||
}
|
||||
bcs->hw.w6692.rcvidx = 0;
|
||||
|
|
@ -441,7 +444,7 @@ StartW6692:
|
|||
if (!(skb = alloc_skb(count, GFP_ATOMIC)))
|
||||
printk(KERN_WARNING "HiSax: D receive out of memory\n");
|
||||
else {
|
||||
memcpy(skb_put(skb, count), cs->rcvbuf, count);
|
||||
skb_put_data(skb, cs->rcvbuf, count);
|
||||
skb_queue_tail(&cs->rq, skb);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,16 +171,16 @@ hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl,
|
|||
card->myid);
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16));
|
||||
skb_put_data(skb, &len, sizeof(__u16));
|
||||
skb_put_data(skb, &appl, sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
|
||||
memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &MessageBufferSize, sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &(rp->level3cnt), sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &(rp->datablkcnt), sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &(rp->datablklen), sizeof(__u16));
|
||||
memcpy(skb_put(skb, slen), ExtFeatureDefaults, slen);
|
||||
skb_put_data(skb, &MessageNumber, sizeof(__u16));
|
||||
skb_put_data(skb, &MessageBufferSize, sizeof(__u16));
|
||||
skb_put_data(skb, &(rp->level3cnt), sizeof(__u16));
|
||||
skb_put_data(skb, &(rp->datablkcnt), sizeof(__u16));
|
||||
skb_put_data(skb, &(rp->datablklen), sizeof(__u16));
|
||||
skb_put_data(skb, ExtFeatureDefaults, slen);
|
||||
hycapi_applications[appl - 1].ctrl_mask |= (1 << (ctrl->cnr - 1));
|
||||
hycapi_send_message(ctrl, skb);
|
||||
}
|
||||
|
|
@ -279,11 +279,11 @@ static void hycapi_release_internal(struct capi_ctr *ctrl, __u16 appl)
|
|||
card->myid);
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16));
|
||||
skb_put_data(skb, &len, sizeof(__u16));
|
||||
skb_put_data(skb, &appl, sizeof(__u16));
|
||||
memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
|
||||
memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
|
||||
memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16));
|
||||
skb_put_data(skb, &MessageNumber, sizeof(__u16));
|
||||
hycapi_send_message(ctrl, skb);
|
||||
hycapi_applications[appl - 1].ctrl_mask &= ~(1 << (ctrl->cnr - 1));
|
||||
}
|
||||
|
|
@ -557,10 +557,9 @@ hycapi_rx_capipkt(hysdn_card *card, unsigned char *buf, unsigned short len)
|
|||
card->myid);
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, MsgLen), buf, MsgLen);
|
||||
memcpy(skb_put(skb, 2 * sizeof(__u32)), CP64, 2 * sizeof(__u32));
|
||||
memcpy(skb_put(skb, len - MsgLen), buf + MsgLen,
|
||||
len - MsgLen);
|
||||
skb_put_data(skb, buf, MsgLen);
|
||||
skb_put_data(skb, CP64, 2 * sizeof(__u32));
|
||||
skb_put_data(skb, buf + MsgLen, len - MsgLen);
|
||||
CAPIMSG_SETLEN(skb->data, 30);
|
||||
} else {
|
||||
if (!(skb = alloc_skb(len, GFP_ATOMIC))) {
|
||||
|
|
@ -568,7 +567,7 @@ hycapi_rx_capipkt(hysdn_card *card, unsigned char *buf, unsigned short len)
|
|||
card->myid);
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, len), buf, len);
|
||||
skb_put_data(skb, buf, len);
|
||||
}
|
||||
switch (CAPIMSG_CMD(skb->data))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ hysdn_rx_netpkt(hysdn_card *card, unsigned char *buf, unsigned short len)
|
|||
return;
|
||||
}
|
||||
/* copy the data */
|
||||
memcpy(skb_put(skb, len), buf, len);
|
||||
skb_put_data(skb, buf, len);
|
||||
|
||||
/* determine the used protocol */
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
|
|
|
|||
|
|
@ -2258,8 +2258,7 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto,
|
|||
|
||||
/* Now stuff remaining bytes */
|
||||
if (len) {
|
||||
p = skb_put(skb, len);
|
||||
memcpy(p, data, len);
|
||||
p = skb_put_data(skb, data, len);
|
||||
}
|
||||
|
||||
/* skb is now ready for xmit */
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ isdn_tty_senddown(modem_info *info)
|
|||
return;
|
||||
}
|
||||
skb_reserve(skb, skb_res);
|
||||
memcpy(skb_put(skb, buflen), info->port.xmit_buf, buflen);
|
||||
skb_put_data(skb, info->port.xmit_buf, buflen);
|
||||
info->xmit_count = 0;
|
||||
#ifdef CONFIG_ISDN_AUDIO
|
||||
if (info->vonline & 2) {
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ isdn_v110_sync(isdn_v110_stream *v)
|
|||
}
|
||||
if ((skb = dev_alloc_skb(v->framelen + v->skbres))) {
|
||||
skb_reserve(skb, v->skbres);
|
||||
memcpy(skb_put(skb, v->framelen), v->OfflineFrame, v->framelen);
|
||||
skb_put_data(skb, v->OfflineFrame, v->framelen);
|
||||
}
|
||||
return skb;
|
||||
}
|
||||
|
|
@ -441,7 +441,7 @@ isdn_v110_idle(isdn_v110_stream *v)
|
|||
}
|
||||
if ((skb = dev_alloc_skb(v->framelen + v->skbres))) {
|
||||
skb_reserve(skb, v->skbres);
|
||||
memcpy(skb_put(skb, v->framelen), v->OnlineFrame, v->framelen);
|
||||
skb_put_data(skb, v->OnlineFrame, v->framelen);
|
||||
}
|
||||
return skb;
|
||||
}
|
||||
|
|
@ -486,7 +486,7 @@ isdn_v110_encode(isdn_v110_stream *v, struct sk_buff *skb)
|
|||
}
|
||||
skb_reserve(nskb, v->skbres + sizeof(int));
|
||||
if (skb->len == 0) {
|
||||
memcpy(skb_put(nskb, v->framelen), v->OnlineFrame, v->framelen);
|
||||
skb_put_data(nskb, v->OnlineFrame, v->framelen);
|
||||
*((int *)skb_push(nskb, sizeof(int))) = 0;
|
||||
return nskb;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)
|
|||
}
|
||||
if (ch >= 0)
|
||||
sprintf(skb_put(skb, 3), "%02d;", ch);
|
||||
memcpy(skb_put(skb, strlen(s)), s, strlen(s));
|
||||
skb_put_data(skb, s, strlen(s));
|
||||
skb_queue_tail(&card->dqueue, skb);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1595,8 +1595,7 @@ send_packet:
|
|||
thh = mISDN_HEAD_P(txskb);
|
||||
thh->prim = DL_DATA_REQ;
|
||||
thh->id = 0;
|
||||
memcpy(skb_put(txskb, len), nskb->data + preload,
|
||||
len);
|
||||
skb_put_data(txskb, nskb->data + preload, len);
|
||||
/* queue (trigger later) */
|
||||
skb_queue_tail(&dsp->sendq, txskb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ l2up_create(struct layer2 *l2, u_int prim, int len, void *arg)
|
|||
hh->prim = prim;
|
||||
hh->id = (l2->ch.nr << 16) | l2->ch.addr;
|
||||
if (len)
|
||||
memcpy(skb_put(skb, len), arg, len);
|
||||
skb_put_data(skb, arg, len);
|
||||
err = l2->up->send(l2->up, skb);
|
||||
if (err) {
|
||||
printk(KERN_WARNING "%s: dev %s err=%d\n", __func__,
|
||||
|
|
@ -235,7 +235,7 @@ l2down_create(struct layer2 *l2, u_int prim, u_int id, int len, void *arg)
|
|||
hh->prim = prim;
|
||||
hh->id = id;
|
||||
if (len)
|
||||
memcpy(skb_put(skb, len), arg, len);
|
||||
skb_put_data(skb, arg, len);
|
||||
err = l2down_raw(l2, skb);
|
||||
if (err)
|
||||
dev_kfree_skb(skb);
|
||||
|
|
@ -640,7 +640,7 @@ send_uframe(struct layer2 *l2, struct sk_buff *skb, u_char cmd, u_char cr)
|
|||
return;
|
||||
}
|
||||
}
|
||||
memcpy(skb_put(skb, i), tmp, i);
|
||||
skb_put_data(skb, tmp, i);
|
||||
enqueue_super(l2, skb);
|
||||
}
|
||||
|
||||
|
|
@ -1125,7 +1125,7 @@ enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, u_char pf)
|
|||
mISDNDevName4ch(&l2->ch), __func__);
|
||||
return;
|
||||
}
|
||||
memcpy(skb_put(skb, i), tmp, i);
|
||||
skb_put_data(skb, tmp, i);
|
||||
enqueue_super(l2, skb);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ teiup_create(struct manager *mgr, u_int prim, int len, void *arg)
|
|||
hh->prim = prim;
|
||||
hh->id = (mgr->ch.nr << 16) | mgr->ch.addr;
|
||||
if (len)
|
||||
memcpy(skb_put(skb, len), arg, len);
|
||||
skb_put_data(skb, arg, len);
|
||||
err = mgr->up->send(mgr->up, skb);
|
||||
if (err) {
|
||||
printk(KERN_WARNING "%s: err=%d\n", __func__, err);
|
||||
|
|
|
|||
Loading…
Reference in a new issue