/* Make device DMA transfer visible to CPU. */
fore200e->bus->dma_sync_for_cpu(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, DMA_FROM_DEVICE);
- memcpy(skb_put(skb, rpd->rsd[ i ].length), buffer->data.align_addr, rpd->rsd[ i ].length);
+ skb_put_data(skb, buffer->data.align_addr, rpd->rsd[i].length);
/* Now let the device get at it again. */
fore200e->bus->dma_sync_for_device(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, DMA_FROM_DEVICE);
__net_timestamp(skb);
list_for_each_entry(heb, &he_vcc->buffers, entry)
- memcpy(skb_put(skb, heb->len), &heb->data, heb->len);
+ skb_put_data(skb, &heb->data, heb->len);
switch (vcc->qos.aal) {
case ATM_AAL0:
*((u32 *) sb->data) = aal0;
skb_put(sb, sizeof(u32));
- memcpy(skb_put(sb, ATM_CELL_PAYLOAD),
- cell, ATM_CELL_PAYLOAD);
+ skb_put_data(sb, cell, ATM_CELL_PAYLOAD);
ATM_SKB(sb)->vcc = vcc;
__net_timestamp(sb);
return;
}
skb_queue_walk(&rpp->queue, sb)
- memcpy(skb_put(skb, sb->len),
- sb->data, sb->len);
+ skb_put_data(skb, sb->data, sb->len);
recycle_rx_pool_skb(card, rpp);
*((u32 *) sb->data) = header;
skb_put(sb, sizeof(u32));
- memcpy(skb_put(sb, ATM_CELL_PAYLOAD), &(queue->data[16]),
- ATM_CELL_PAYLOAD);
+ skb_put_data(sb, &(queue->data[16]), ATM_CELL_PAYLOAD);
ATM_SKB(sb)->vcc = vcc;
__net_timestamp(sb);
}
atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
- memcpy(skb_put(skb, 52), cell, 52);
+ skb_put_data(skb, cell, 52);
return idt77252_send_skb(vcc, skb, 1);
}
header->vci = cpu_to_le16(0);
header->type = cpu_to_le16(PKT_COMMAND);
- memcpy(skb_put(skb, size), buf, size);
+ skb_put_data(skb, buf, size);
fpga_queue(card, dev, skb, NULL);
}
if (len > 0)
- memcpy(skb_put(data->reassembly, len), buf, len);
+ skb_put_data(data->reassembly, buf, len);
if (hdr & 0x08) {
hci_recv_frame(data->hdev, data->reassembly);
buf[1] = 0x00;
buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size;
- memcpy(skb_put(nskb, 3), buf, 3);
+ skb_put_data(nskb, buf, 3);
skb_copy_from_linear_data_offset(skb, sent, skb_put(nskb, size), size);
sent += size;
if ((nskb->len % data->bulk_pkt_size) == 0) {
buf[0] = 0xdd;
buf[1] = 0x00;
- memcpy(skb_put(nskb, 2), buf, 2);
+ skb_put_data(nskb, buf, 2);
}
read_lock(&data->lock);
break;
}
- memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+ skb_put_data(skb, cmd, sizeof(cmd));
skb_queue_tail(&(info->txq), skb);
hdr->plen = len;
if (len)
- memcpy(skb_put(skb, len), param, len);
+ skb_put_data(skb, param, len);
hci_skb_pkt_type(skb) = MRVL_VENDOR_PKT;
}
hci_skb_pkt_type(skb) = type;
- memcpy(skb_put(skb, count), data, count);
+ skb_put_data(skb, data, count);
return hci_recv_frame(hdev, skb);
}
}
len = min_t(uint, hci_skb_expect(skb), count);
- memcpy(skb_put(skb, len), buffer, len);
+ skb_put_data(skb, buffer, len);
count -= len;
buffer += len;
}
len = min_t(uint, hci_skb_expect(skb), count);
- memcpy(skb_put(skb, len), buffer, len);
+ skb_put_data(skb, buffer, len);
count -= len;
buffer += len;
}
len = min_t(uint, hci_skb_expect(skb), count);
- memcpy(skb_put(skb, len), buffer, len);
+ skb_put_data(skb, buffer, len);
count -= len;
buffer += len;
skb = bt_skb_alloc(urb->actual_length, GFP_ATOMIC);
if (skb) {
- memcpy(skb_put(skb, urb->actual_length),
- urb->transfer_buffer, urb->actual_length);
+ skb_put_data(skb, urb->transfer_buffer,
+ urb->actual_length);
hci_recv_diag(hdev, skb);
}
} else if (urb->status == -ENOENT) {
return -ENOMEM;
}
- memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+ skb_put_data(skb, cmd, sizeof(cmd));
hci_skb_pkt_type(skb) = HCI_COMMAND_PKT;
ret = btusb_send_frame(hdev, skb);
{
const char pkt_delim = 0xc0;
- memcpy(skb_put(skb, 1), &pkt_delim, 1);
+ skb_put_data(skb, &pkt_delim, 1);
}
static void bcsp_slip_one_byte(struct sk_buff *skb, u8 c)
switch (c) {
case 0xc0:
- memcpy(skb_put(skb, 2), &esc_c0, 2);
+ skb_put_data(skb, &esc_c0, 2);
break;
case 0xdb:
- memcpy(skb_put(skb, 2), &esc_db, 2);
+ skb_put_data(skb, &esc_db, 2);
break;
default:
- memcpy(skb_put(skb, 1), &c, 1);
+ skb_put_data(skb, &c, 1);
}
}
BT_DBG("Found a LE conf pkt");
if (!nskb)
return;
- memcpy(skb_put(nskb, 4), conf_rsp_pkt, 4);
+ skb_put_data(nskb, conf_rsp_pkt, 4);
hci_skb_pkt_type(nskb) = BCSP_LE_PKT;
skb_queue_head(&bcsp->unrel, nskb);
bcsp->rx_esc_state = BCSP_ESCSTATE_ESC;
break;
default:
- memcpy(skb_put(bcsp->rx_skb, 1), &byte, 1);
+ skb_put_data(bcsp->rx_skb, &byte, 1);
if ((bcsp->rx_skb->data[0] & 0x40) != 0 &&
bcsp->rx_state != BCSP_W4_CRC)
bcsp_crc_update(&bcsp->message_crc, byte);
case BCSP_ESCSTATE_ESC:
switch (byte) {
case 0xdc:
- memcpy(skb_put(bcsp->rx_skb, 1), &c0, 1);
+ skb_put_data(bcsp->rx_skb, &c0, 1);
if ((bcsp->rx_skb->data[0] & 0x40) != 0 &&
bcsp->rx_state != BCSP_W4_CRC)
bcsp_crc_update(&bcsp->message_crc, 0xc0);
break;
case 0xdd:
- memcpy(skb_put(bcsp->rx_skb, 1), &db, 1);
+ skb_put_data(bcsp->rx_skb, &db, 1);
if ((bcsp->rx_skb->data[0] & 0x40) != 0 &&
bcsp->rx_state != BCSP_W4_CRC)
bcsp_crc_update(&bcsp->message_crc, 0xdb);
}
len = min_t(uint, hci_skb_expect(skb) - skb->len, count);
- memcpy(skb_put(skb, len), buffer, len);
+ skb_put_data(skb, buffer, len);
count -= len;
buffer += len;
hci_skb_pkt_type(nskb) = HCI_3WIRE_LINK_PKT;
- memcpy(skb_put(nskb, len), data, len);
+ skb_put_data(nskb, data, len);
skb_queue_tail(&h5->unrel, nskb);
}
}
}
- memcpy(skb_put(h5->rx_skb, 1), byte, 1);
+ skb_put_data(h5->rx_skb, byte, 1);
h5->rx_pending--;
BT_DBG("unsliped 0x%02hhx, rx_pending %zu", *byte, h5->rx_pending);
{
const char delim = SLIP_DELIMITER;
- memcpy(skb_put(skb, 1), &delim, 1);
+ skb_put_data(skb, &delim, 1);
}
static void h5_slip_one_byte(struct sk_buff *skb, u8 c)
switch (c) {
case SLIP_DELIMITER:
- memcpy(skb_put(skb, 2), &esc_delim, 2);
+ skb_put_data(skb, &esc_delim, 2);
break;
case SLIP_ESC:
- memcpy(skb_put(skb, 2), &esc_esc, 2);
+ skb_put_data(skb, &esc_esc, 2);
break;
default:
- memcpy(skb_put(skb, 1), &c, 1);
+ skb_put_data(skb, &c, 1);
}
}
return -ENOMEM;
}
- memcpy(skb_put(skb, sizeof(suspend)), suspend, sizeof(suspend));
+ skb_put_data(skb, suspend, sizeof(suspend));
hci_skb_pkt_type(skb) = HCI_LPM_PKT;
set_bit(STATE_LPM_TRANSACTION, &intel->flags);
return -ENOMEM;
}
- memcpy(skb_put(skb, sizeof(lpm_resume_ack)), lpm_resume_ack,
- sizeof(lpm_resume_ack));
+ skb_put_data(skb, lpm_resume_ack, sizeof(lpm_resume_ack));
hci_skb_pkt_type(skb) = HCI_LPM_PKT;
/* LPM flow is a priority, enqueue packet at list head */
return -ENOMEM;
}
- memcpy(skb_put(skb, sizeof(speed_cmd)), speed_cmd, sizeof(speed_cmd));
+ skb_put_data(skb, speed_cmd, sizeof(speed_cmd));
hci_skb_pkt_type(skb) = HCI_COMMAND_PKT;
hci_uart_set_flow_control(hu, true);
while (count) {
if (ll->rx_count) {
len = min_t(unsigned int, ll->rx_count, count);
- memcpy(skb_put(ll->rx_skb, len), ptr, len);
+ skb_put_data(ll->rx_skb, ptr, len);
ll->rx_count -= len; count -= len; ptr += len;
if (ll->rx_count)
}
bt_cb(skb)->pkt_type = MRVL_RAW_DATA;
- memcpy(skb_put(skb, mrvl->tx_len), fw_ptr, mrvl->tx_len);
+ skb_put_data(skb, fw_ptr, mrvl->tx_len);
fw_ptr += mrvl->tx_len;
set_bit(STATE_FW_REQ_PENDING, &mrvl->flags);
}
/* Assign commands to change baudrate and packet type. */
- memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+ skb_put_data(skb, cmd, sizeof(cmd));
hci_skb_pkt_type(skb) = HCI_COMMAND_PKT;
skb_queue_tail(&qca->txq, skb);
return;
}
- memcpy(skb_put(skb, size), buf, size);
+ skb_put_data(skb, buf, size);
skb->protocol = hdlc_type_trans(skb, dev);
return -ENOMEM;
}
skb_reserve(skb, LL_RESERVED_SPACE(net));
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
return fwnet_finish_incoming_packet(net, skb, source_node_id,
is_broadcast, ether_type);
}
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;
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);
}
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;
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),
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;
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,
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;
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),
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;
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),
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);
}
}
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",
}
}
- memcpy(skb_put(rx_skb, len), data, len);
+ skb_put_data(rx_skb, data, len);
if (hdlc) {
/* we have a complete hdlc packet */
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);
}
}
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;
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);
}
}
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;
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);
}
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)",
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);
}
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:
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:
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);
}
}
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;
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);
}
}
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);
}
}
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);
}
}
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;
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);
}
}
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 {
} 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);
}
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);
}
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);
}
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);
}
}
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;
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);
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);
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);
}
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);
}
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);
}
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);
}
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);
}
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 */
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);
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);
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);
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 */
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 */
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);
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);
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);
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);
}
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) {
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);
}
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);
}
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);
}
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);
}
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 */
{
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);
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);
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);
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 */
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 */
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);
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);
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);
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);
}
*p++ = IE_SPID;
*p++ = l;
- memcpy(skb_put(skb, l), pSPID, l);
+ skb_put_data(skb, pSPID, l);
newl3state(pc, iNewState);
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) {
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);
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");
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);
}
}
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;
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);
}
}
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);
}
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));
}
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))) {
card->myid);
return;
}
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
}
switch (CAPIMSG_CMD(skb->data))
{
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);
/* 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 */
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) {
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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);
}
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__,
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);
return;
}
}
- memcpy(skb_put(skb, i), tmp, i);
+ skb_put_data(skb, tmp, i);
enqueue_super(l2, skb);
}
mISDNDevName4ch(&l2->ch), __func__);
return;
}
- memcpy(skb_put(skb, i), tmp, i);
+ skb_put_data(skb, tmp, i);
enqueue_super(l2, skb);
}
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);
/* Copy data into our current skb. */
h.how_much = min(h.priv->ule_sndu_remain, (int)h.ts_remain);
- memcpy(skb_put(h.priv->ule_skb, h.how_much),
- h.from_where, h.how_much);
+ skb_put_data(h.priv->ule_skb, h.from_where, h.how_much);
h.priv->ule_sndu_remain -= h.how_much;
h.ts_remain -= h.how_much;
h.from_where += h.how_much;
fm_cb(skb)->fm_op = *((u8 *)payload + 2);
}
if (payload != NULL)
- memcpy(skb_put(skb, payload_len), payload, payload_len);
+ skb_put_data(skb, payload, payload_len);
fm_cb(skb)->completion = wait_completion;
skb_queue_tail(&fmdev->tx_q, skb);
while (count) {
if (st_gdata->rx_count) {
len = min_t(unsigned int, st_gdata->rx_count, count);
- memcpy(skb_put(st_gdata->rx_skb, len), ptr, len);
+ skb_put_data(st_gdata->rx_skb, ptr, len);
st_gdata->rx_count -= len;
count -= len;
ptr += len;
while (count) {
if (kim_gdata->rx_count) {
len = min_t(unsigned int, kim_gdata->rx_count, count);
- memcpy(skb_put(kim_gdata->rx_skb, len), ptr, len);
+ skb_put_data(kim_gdata->rx_skb, ptr, len);
kim_gdata->rx_count -= len;
count -= len;
ptr += len;
if (!skb)
return;
- data = skb_put(skb, size);
- memcpy(data, &pkt, size);
+ data = skb_put_data(skb, &pkt, size);
skb_reset_mac_header(skb);
skb->network_header = skb->mac_header + ETH_HLEN;
}
caif_assert(skb != NULL);
- dst = skb_put(skb, len);
- memcpy(dst, pfrm, len);
+ dst = skb_put_data(skb, pfrm, len);
skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb);
}
caif_assert(skb != NULL);
- dst = skb_put(skb, len);
- memcpy(dst, pcffrm, len);
+ dst = skb_put_data(skb, pcffrm, len);
skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb);
skb = netdev_alloc_skb(ser->dev, count+1);
if (skb == NULL)
return;
- p = skb_put(skb, count);
- memcpy(p, data, count);
+ p = skb_put_data(skb, data, count);
skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb);
skb = netdev_alloc_skb(cfspi->ndev, pkt_len + 1);
caif_assert(skb != NULL);
- dst = skb_put(skb, pkt_len);
- memcpy(dst, src, pkt_len);
+ dst = skb_put_data(skb, src, pkt_len);
src += pkt_len;
skb->protocol = htons(ETH_P_CAIF);
skb_reserve(skb, cfv->rx_hr + pad_len);
- memcpy(skb_put(skb, cfpkt_len), frm + cfv->rx_hr, cfpkt_len);
+ skb_put_data(skb, frm + cfv->rx_hr, cfpkt_len);
return skb;
}
can_skb_prv(skb)->ifindex = sl->dev->ifindex;
can_skb_prv(skb)->skbcnt = 0;
- memcpy(skb_put(skb, sizeof(struct can_frame)),
- &cf, sizeof(struct can_frame));
+ skb_put_data(skb, &cf, sizeof(struct can_frame));
sl->dev->stats.rx_packets++;
sl->dev->stats.rx_bytes += cf.can_dlc;
(skb = netdev_alloc_skb(dev, pkt_len + 4)) != NULL) {
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
/* 'skb_put()' points to the start of sk_buff data area. */
- memcpy(skb_put(skb, pkt_len),
- isa_bus_to_virt(vp->rx_ring[entry].
- addr), pkt_len);
+ skb_put_data(skb,
+ isa_bus_to_virt(vp->rx_ring[entry].addr),
+ pkt_len);
rx_copy++;
} else {
void *temp;
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
/* 'skb_put()' points to the start of sk_buff data area. */
- memcpy(skb_put(skb, pkt_len),
- vp->rx_skbuff[entry]->data,
- pkt_len);
+ skb_put_data(skb, vp->rx_skbuff[entry]->data,
+ pkt_len);
pci_dma_sync_single_for_device(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
vp->rx_copy++;
} else {
if (netif_msg_pktdata(greth))
greth_print_rx_packet(phys_to_virt(dma_addr), pkt_len);
- memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len);
+ skb_put_data(skb, phys_to_virt(dma_addr),
+ pkt_len);
skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_bytes += pkt_len;
adapter->netdev->stats.rx_bytes += rfd->len;
- memcpy(skb_put(skb, rfd->len), fbr->virt[buff_index], rfd->len);
+ skb_put_data(skb, fbr->virt[buff_index], rfd->len);
skb->protocol = eth_type_trans(skb, adapter->netdev);
skb->ip_summed = CHECKSUM_NONE;
return;
}
skb_reserve(skb, 2);
- memcpy(skb_put(skb, frame_length), mf->data, frame_length);
+ skb_put_data(skb, mf->data, frame_length);
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
if (len <= RX_COPYBREAK) {
dma_sync_single_for_cpu(&dev->dev, dma, len, DMA_FROM_DEVICE);
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
dma_sync_single_for_device(&dev->dev, dma, len,
DMA_FROM_DEVICE);
} else {
}
dma_unmap_page(&dev->dev, dma, RX_BUF_SIZE, DMA_FROM_DEVICE);
- memcpy(skb_put(skb, RX_COPYHDR), data, RX_COPYHDR);
+ skb_put_data(skb, data, RX_COPYHDR);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
offset + RX_COPYHDR, len - RX_COPYHDR,
RX_BUF_SIZE);
skb = netdev_alloc_skb(dev, pktlen + 2);
if (skb) {
skb_reserve(skb, 2);
- memcpy(skb_put(skb, pktlen), p_recv, pktlen);
+ skb_put_data(skb, p_recv, pktlen);
skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_packets++;
int copy_len,
int idx)
{
- memcpy(skb_put(nicbuf, copy_len),
- get_rbd(droq->recv_buf_list[idx].buffer), copy_len);
+ skb_put_data(nicbuf, get_rbd(droq->recv_buf_list[idx].buffer),
+ copy_len);
}
/**
if (bp + length > lp->end_dma_buff) {
int semi_cnt = lp->end_dma_buff - bp;
- memcpy(skb_put(skb, semi_cnt), bp, semi_cnt);
- memcpy(skb_put(skb, length - semi_cnt), lp->dma_buff,
- length - semi_cnt);
+ skb_put_data(skb, bp, semi_cnt);
+ skb_put_data(skb, lp->dma_buff, length - semi_cnt);
} else {
- memcpy(skb_put(skb, length), bp, length);
+ skb_put_data(skb, bp, length);
}
bp += (length + 3) & ~3;
if (bp >= lp->end_dma_buff)
skb_reserve(p, 2); /* Align */
if (index < lp->rx_old) { /* Wrapped buffer */
short tlen = (lp->rxRingSize - lp->rx_old) * RX_BUFF_SZ;
- memcpy(skb_put(p,tlen),lp->rx_bufs + lp->rx_old * RX_BUFF_SZ,tlen);
- memcpy(skb_put(p,len-tlen),lp->rx_bufs,len-tlen);
+ skb_put_data(p, lp->rx_bufs + lp->rx_old * RX_BUFF_SZ, tlen);
+ skb_put_data(p, lp->rx_bufs, len - tlen);
} else { /* Linear buffer */
- memcpy(skb_put(p,len),lp->rx_bufs + lp->rx_old * RX_BUFF_SZ,len);
+ skb_put_data(p, lp->rx_bufs + lp->rx_old * RX_BUFF_SZ, len);
}
return p;
pkt_len);
skb_put(skb, pkt_len);
#else
- memcpy(skb_put(skb, pkt_len),
- tp->rx_buffers[entry].skb->data,
- pkt_len);
+ skb_put_data(skb,
+ tp->rx_buffers[entry].skb->data,
+ pkt_len);
#endif
pci_dma_sync_single_for_device(tp->pdev,
tp->rx_buffers[entry].mapping,
pkt_len);
skb_put(skb, pkt_len);
#else
- memcpy(skb_put(skb, pkt_len),
- tp->rx_buffers[entry].skb->data,
- pkt_len);
+ skb_put_data(skb,
+ tp->rx_buffers[entry].skb->data,
+ pkt_len);
#endif
pci_dma_sync_single_for_device(tp->pdev,
tp->rx_buffers[entry].mapping,
skb = new_skb;
/* size less than COPY_SIZE, allocate a rxlen SKB */
skb_reserve(skb, 2); /* 16byte align */
- memcpy(skb_put(skb, rxlen),
- skb_tail_pointer(rxptr->rx_skb_ptr),
- rxlen);
+ skb_put_data(skb,
+ skb_tail_pointer(rxptr->rx_skb_ptr),
+ rxlen);
uli526x_reuse_skb(db, rxptr->rx_skb_ptr);
} else
skb_put(skb, rxlen);
skb = netdev_alloc_skb_ip_align(priv->net_dev, pkt_size);
if (skb) {
- memcpy(skb_put(skb, pkt_size), data, pkt_size);
+ skb_put_data(skb, data, pkt_size);
skb->protocol = eth_type_trans(skb, priv->net_dev);
priv->stat_rx_bytes += pkt_size;
np->cur_rx->skbuff->data, pkt_len);
skb_put(skb, pkt_len);
#else
- memcpy(skb_put(skb, pkt_len),
- np->cur_rx->skbuff->data, pkt_len);
+ skb_put_data(skb, np->cur_rx->skbuff->data,
+ pkt_len);
#endif
pci_dma_sync_single_for_device(np->pci_dev,
np->cur_rx->buffer,
if (!rx_in_place) {
/* 16 byte align the data fields */
skb_reserve(skb, 2);
- memcpy(skb_put(skb,pkt_len), rbd->v_data, pkt_len);
+ skb_put_data(skb, rbd->v_data,
+ pkt_len);
}
skb->protocol=eth_type_trans(skb,dev);
skb->len = pkt_len;
dma_sync_single_for_cpu(dev->dev.parent,
(dma_addr_t)SWAP32(rbd->b_data),
PKT_BUF_SZ, DMA_FROM_DEVICE);
- memcpy(skb_put(skb, pkt_len), rbd->v_data, pkt_len);
+ skb_put_data(skb, rbd->v_data,
+ pkt_len);
dma_sync_single_for_device(dev->dev.parent,
(dma_addr_t)SWAP32(rbd->b_data),
PKT_BUF_SZ, DMA_FROM_DEVICE);
dma_sync_single_for_cpu(&adapter->pdev->dev, buffer_info->dma,
length, DMA_FROM_DEVICE);
- memcpy(skb_put(skb, length), data, length);
+ skb_put_data(skb, data, length);
return skb;
}
MVNETA_MH_SIZE + NET_SKB_PAD,
rx_bytes,
DMA_FROM_DEVICE);
- memcpy(skb_put(skb, rx_bytes),
- data + MVNETA_MH_SIZE + NET_SKB_PAD,
- rx_bytes);
+ skb_put_data(skb, data + MVNETA_MH_SIZE + NET_SKB_PAD,
+ rx_bytes);
skb->protocol = eth_type_trans(skb, dev);
mvneta_rx_csum(pp, rx_status, skb);
MVNETA_MH_SIZE + NET_SKB_PAD,
rx_bytes,
DMA_FROM_DEVICE);
- memcpy(skb_put(skb, rx_bytes),
- data + MVNETA_MH_SIZE + NET_SKB_PAD,
- rx_bytes);
+ skb_put_data(skb, data + MVNETA_MH_SIZE + NET_SKB_PAD,
+ rx_bytes);
skb->protocol = eth_type_trans(skb, dev);
mvneta_rx_csum(pp, rx_status, skb);
*/
skb_reserve(skb, 2);
- memcpy(skb_put(skb, packet_len),
- dma_buf->skb->data, packet_len);
+ skb_put_data(skb, dma_buf->skb->data, packet_len);
} while (0);
skb->protocol = eth_type_trans(skb, dev);
if (!skb) {
ndev->stats.rx_dropped++;
} else {
- prdbuf = skb_put(skb, len);
-
/* Copy packet from buffer */
- memcpy(prdbuf, pldat->rx_buff_v +
- rxconsidx * ENET_MAXF_SIZE, len);
+ prdbuf = skb_put_data(skb,
+ pldat->rx_buff_v + rxconsidx * ENET_MAXF_SIZE,
+ len);
/* Pass to upper layer */
skb->protocol = eth_type_trans(skb, ndev);
* re-use the already allcoated & mapped memory.
*/
if (len + pad <= edev->rx_copybreak) {
- memcpy(skb_put(skb, len),
- page_address(page) + offset, len);
+ skb_put_data(skb, page_address(page) + offset, len);
qede_reuse_page(rxq, bd);
goto out;
}
rx_ring->rx_dropped++;
goto err_out;
}
- memcpy(skb_put(skb, hlen), addr, hlen);
+ skb_put_data(skb, addr, hlen);
netif_printk(qdev, rx_status, KERN_DEBUG, qdev->ndev,
"%d bytes of headers and data in large. Chain page to new skb and pull tail.\n",
length);
dma_unmap_len(sbq_desc, maplen),
PCI_DMA_FROMDEVICE);
- memcpy(skb_put(new_skb, length), skb->data, length);
+ skb_put_data(new_skb, skb->data, length);
pci_dma_sync_single_for_device(qdev->pdev,
dma_unmap_addr(sbq_desc, mapaddr),
dma_unmap_len
(sbq_desc, maplen),
PCI_DMA_FROMDEVICE);
- memcpy(skb_put(skb, length),
- sbq_desc->p.skb->data, length);
+ skb_put_data(skb, sbq_desc->p.skb->data, length);
pci_dma_sync_single_for_device(qdev->pdev,
dma_unmap_addr
(sbq_desc,
}
if ((rx_ring_offset + pkt_size) > RX_BUF_LEN) {
- memcpy(skb_put(skb, RX_BUF_LEN - rx_ring_offset),
- rx_ring + rx_ring_offset, RX_BUF_LEN - rx_ring_offset);
- memcpy(skb_put(skb, pkt_size - (RX_BUF_LEN - rx_ring_offset)),
- rx_ring, pkt_size - (RX_BUF_LEN - rx_ring_offset));
+ skb_put_data(skb, rx_ring + rx_ring_offset,
+ RX_BUF_LEN - rx_ring_offset);
+ skb_put_data(skb, rx_ring,
+ pkt_size - (RX_BUF_LEN - rx_ring_offset));
} else {
- memcpy(skb_put(skb, pkt_size), rx_ring + rx_ring_offset, pkt_size);
+ skb_put_data(skb, rx_ring + rx_ring_offset, pkt_size);
}
skb->protocol = eth_type_trans(skb, dev);
hw->ep_shm_info[cur_epid].net_stats
.rx_errors += 1;
} else {
- memcpy(skb_put(skb, frame_len),
- frame, frame_len);
+ skb_put_data(skb, frame, frame_len);
skb->protocol = eth_type_trans(skb, netdev);
skb->ip_summed = CHECKSUM_UNNECESSARY;
return;
}
- memcpy(skb_put(skb,count), ax->rbuff, count);
+ skb_put_data(skb, ax->rbuff, count);
skb->protocol = ax25_type_trans(skb, ax->dev);
netif_rx(skb);
ax->dev->stats.rx_packets++;
pkt_len,
PCI_DMA_FROMDEVICE);
- memcpy(skb_put(skb, pkt_len),
- rx_skb->data, pkt_len);
+ skb_put_data(skb, rx_skb->data,
+ pkt_len);
pci_dma_sync_single_for_device(rrpriv->pci_dev,
desc->addr.addrlo,
* Copy to skb. This copy is needed here since the memory pointed by
* hv_netvsc_packet cannot be deallocated
*/
- memcpy(skb_put(skb, buflen), data, buflen);
+ skb_put_data(skb, data, buflen);
skb->protocol = eth_type_trans(skb, net);
return;
}
- memcpy(skb_put(skb, len), buf + 2, len);
+ skb_put_data(skb, buf + 2, len);
ieee802154_rx_irqsafe(lp->hw, skb, lqi);
kfree(ctx);
}
copy_payload:
/* Add <msdulen> bytes of space to the back of the buffer */
/* Copy msdu to skb */
- memcpy(skb_put(skb, msdulen), &data_ind[29], msdulen);
+ skb_put_data(skb, &data_ind[29], msdulen);
ieee802154_rx_irqsafe(hw, skb, mpdulinkquality);
return 0;
return;
}
- memcpy(skb_put(skb, len), rx_local_buf, len);
+ skb_put_data(skb, rx_local_buf, len);
ieee802154_rx_irqsafe(devrec->hw, skb, 0);
#ifdef DEBUG
/* Make sure IP header gets aligned */
skb_reserve(skb, 1);
- memcpy(skb_put(skb, len), self->rx_buff.data, len);
+ skb_put_data(skb, self->rx_buff.data, len);
self->netdev->stats.rx_packets++;
self->netdev->stats.rx_bytes += len;
skb = rd->skb;
rd->skb = NULL;
skb->dev = ndev;
- memcpy(skb_put(skb,len), rd->buf, len);
+ skb_put_data(skb, rd->buf, len);
skb_reset_mac_header(skb);
if (in_interrupt())
netif_rx(skb);
/* packet overflowed MRU */
ap->state |= SC_TOSS;
} else {
- sp = skb_put(skb, n);
- memcpy(sp, buf, n);
+ sp = skb_put_data(skb, buf, n);
if (ap->state & SC_ESCAPE) {
sp[0] ^= PPP_TRANS;
ap->state &= ~SC_ESCAPE;
goto err;
}
- p = skb_put(skb, count);
- memcpy(p, buf, count);
+ p = skb_put_data(skb, buf, count);
/* strip address/control field if present */
p = skb->data;
return;
}
skb->dev = dev;
- memcpy(skb_put(skb, count), sl->rbuff, count);
+ skb_put_data(skb, sl->rbuff, count);
skb_reset_mac_header(skb);
skb->protocol = htons(ETH_P_IP);
netif_rx_ni(skb);
}
if (rx->ax_skb) {
- data = skb_put(rx->ax_skb, copy_length);
- memcpy(data, skb->data + offset, copy_length);
+ data = skb_put_data(rx->ax_skb, skb->data + offset,
+ copy_length);
if (!rx->remaining)
usbnet_skb_return(dev, rx->ax_skb);
}
skb = pnd->rx_skb = netdev_alloc_skb(dev, 12);
if (likely(skb)) {
/* Can't use pskb_pull() on page in IRQ */
- memcpy(skb_put(skb, 1), page_address(page), 1);
+ skb_put_data(skb, page_address(page), 1);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
page, 1, req->actual_length,
PAGE_SIZE);
memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
/* add datagram */
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
/* map MBIM session to VLAN */
if (tci)
ndp16->dpe16[index].wDatagramLength = cpu_to_le16(skb->len);
ndp16->dpe16[index].wDatagramIndex = cpu_to_le16(skb_out->len);
ndp16->wLength = cpu_to_le16(ndplen + sizeof(struct usb_cdc_ncm_dpe16));
- memcpy(skb_put(skb_out, skb->len), skb->data, skb->len);
+ skb_put_data(skb_out, skb->data, skb->len);
ctx->tx_curr_frame_payload += skb->len; /* count real tx payload data */
dev_kfree_skb_any(skb);
skb = NULL;
nth16 = (struct usb_cdc_ncm_nth16 *)skb_out->data;
cdc_ncm_align_tail(skb_out, ctx->tx_ndp_modulus, 0, ctx->tx_max);
nth16->wNdpIndex = cpu_to_le16(skb_out->len);
- memcpy(skb_put(skb_out, ctx->max_ndp_size), ctx->delayed_ndp16, ctx->max_ndp_size);
+ skb_put_data(skb_out, ctx->delayed_ndp16, ctx->max_ndp_size);
/* Zero out delayed NDP - signature checking will naturally fail. */
ndp16 = memset(ctx->delayed_ndp16, 0, ctx->max_ndp_size);
skb = netdev_alloc_skb_ip_align(dev->net, len);
if (!skb)
goto error;
- memcpy(skb_put(skb, len), skb_in->data + offset, len);
+ skb_put_data(skb, skb_in->data + offset, len);
usbnet_skb_return(dev, skb);
payload += len; /* count payload bytes in this NTB */
}
if (gl_skb) {
// copy the packet data to the new skb
- memcpy(skb_put(gl_skb, size),
- packet->packet_data, size);
+ skb_put_data(gl_skb, packet->packet_data, size);
usbnet_skb_return(dev, gl_skb);
}
/* Copy what we got so far. make room for iphdr
* after tail. */
- tmp_rx_buf =
- skb_put(odev->skb_rx_buf,
- sizeof(struct iphdr));
- memcpy(tmp_rx_buf, (char *)&(odev->rx_ip_hdr),
- sizeof(struct iphdr));
+ tmp_rx_buf = skb_put_data(odev->skb_rx_buf,
+ (char *)&(odev->rx_ip_hdr),
+ sizeof(struct iphdr));
/* ETH_HLEN */
odev->rx_buf_size = sizeof(struct iphdr);
/* Copy the rest of the bytes that are left in the
* buffer into the waiting sk_buf. */
/* Make room for temp_bytes after tail. */
- tmp_rx_buf = skb_put(odev->skb_rx_buf, temp_bytes);
- memcpy(tmp_rx_buf, ip_pkt + buffer_offset, temp_bytes);
+ tmp_rx_buf = skb_put_data(odev->skb_rx_buf,
+ ip_pkt + buffer_offset,
+ temp_bytes);
odev->rx_buf_missing -= temp_bytes;
count -= temp_bytes;
return;
}
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
skb->dev = dev->net;
skb->protocol = eth_type_trans(skb, dev->net);
}
buf = s->current_rx_buf;
- memcpy(skb_put(buf, skb->len), skb->data, skb->len);
+ skb_put_data(buf, skb->data, skb->len);
} else if (skb->len < 4) {
netif_err(dev, ifup, dev->net, "Frame too short\n");
dev->net->stats.rx_length_errors++;
goto skip;
}
- memcpy(skb_put(skbn, len), skb->data + offset, len);
+ skb_put_data(skbn, skb->data + offset, len);
if (netif_rx(skbn) != NET_RX_SUCCESS)
return 0;
copy = len;
if (copy > skb_tailroom(skb))
copy = skb_tailroom(skb);
- memcpy(skb_put(skb, copy), p, copy);
+ skb_put_data(skb, p, copy);
len -= copy;
offset += copy;
dbg(DBG_TX, "fst_rx_dma_complete\n");
pi = port->index;
- memcpy(skb_put(skb, len), card->rx_dma_handle_host, len);
+ skb_put_data(skb, card->rx_dma_handle_host, len);
/* Reset buffer descriptor */
FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
cp->len = htons(sizeof(struct cp_header) + magic_len + len);
if (magic_len)
- memcpy(skb_put(skb, magic_len), &magic, magic_len);
+ skb_put_data(skb, &magic, magic_len);
if (len)
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
#if DEBUG_CP
BUG_ON(code >= CP_CODES);
return;
}
skb_push(skb, 1); /* LAPB internal control */
- memcpy(skb_put(skb, count), sl->rbuff, count);
+ skb_put_data(skb, sl->rbuff, count);
skb->protocol = x25_type_trans(skb, sl->dev);
err = lapb_data_received(skb->dev, skb);
if (err != LAPB_OK) {
net_dev->stats.rx_dropped++;
goto error_skb_realloc;
}
- memcpy(skb_put(skb, buf_len), buf, buf_len);
+ skb_put_data(skb, buf, buf_len);
}
i2400m_rx_fake_eth_header(i2400m->wimax_dev.net_dev,
skb->data - ETH_HLEN,
priv->pdev,
priv->rx_buffers[entry].mapping,
pktlen, PCI_DMA_FROMDEVICE);
- memcpy(skb_put(skb, pktlen),
- skb_tail_pointer(priv->rx_buffers[entry].skb),
- pktlen);
+ skb_put_data(skb,
+ skb_tail_pointer(priv->rx_buffers[entry].skb),
+ pktlen);
pci_dma_sync_single_for_device(
priv->pdev,
priv->rx_buffers[entry].mapping,
if (arvif->u.ap.noa_data)
if (!pskb_expand_head(skb, 0, arvif->u.ap.noa_len,
GFP_ATOMIC))
- memcpy(skb_put(skb, arvif->u.ap.noa_len),
- arvif->u.ap.noa_data,
- arvif->u.ap.noa_len);
+ skb_put_data(skb, arvif->u.ap.noa_data,
+ arvif->u.ap.noa_len);
spin_unlock_bh(&ar->data_lock);
}
}
if (arvif->u.ap.noa_data)
if (!pskb_expand_head(bcn, 0, arvif->u.ap.noa_len, GFP_ATOMIC))
- memcpy(skb_put(bcn, arvif->u.ap.noa_len),
- arvif->u.ap.noa_data,
- arvif->u.ap.noa_len);
+ skb_put_data(bcn, arvif->u.ap.noa_data,
+ arvif->u.ap.noa_len);
}
static int ath10k_wmi_op_pull_swba_ev(struct ath10k *ar, struct sk_buff *skb,
info->flags |= IEEE80211_TX_CTL_NO_CCK_RATE;
if (req->ie_len)
- memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len);
+ skb_put_data(skb, req->ie, req->ie_len);
skb_set_queue_mapping(skb, IEEE80211_AC_VO);
noa_desc = !!avp->offchannel_duration + !!avp->noa_duration;
noa_len = 2 + sizeof(struct ieee80211_p2p_noa_desc) * noa_desc;
- hdr = skb_put(skb, sizeof(noa_ie_hdr));
- memcpy(hdr, noa_ie_hdr, sizeof(noa_ie_hdr));
+ hdr = skb_put_data(skb, noa_ie_hdr, sizeof(noa_ie_hdr));
hdr[1] = sizeof(noa_ie_hdr) + noa_len - 2;
hdr[7] = noa_len;
skb_reserve(skb, headroom);
if (cmd_len != 0 && cmd_buf != NULL) {
- data = (u8 *) skb_put(skb, cmd_len);
- memcpy(data, cmd_buf, cmd_len);
+ data = skb_put_data(skb, cmd_buf, cmd_len);
}
mutex_lock(&wmi->op_mutex);
skb = dev_alloc_skb(len + reserved);
if (likely(skb)) {
skb_reserve(skb, reserved);
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
}
return skb;
}
}
- memcpy(skb_put(ar->rx_failover, tlen), tbuf, tlen);
+ skb_put_data(ar->rx_failover, tbuf, tlen);
ar->rx_failover_missing -= tlen;
if (ar->rx_failover_missing <= 0) {
* the rx - descriptor comes round again.
*/
- memcpy(skb_put(ar->rx_failover, tlen), tbuf, tlen);
+ skb_put_data(ar->rx_failover, tbuf, tlen);
ar->rx_failover_missing = clen - tlen;
return;
}
ether_addr_copy(eth->h_dest, ndev->dev_addr);
ether_addr_copy(eth->h_source, evt->src_mac);
eth->h_proto = cpu_to_be16(ETH_P_PAE);
- memcpy(skb_put(skb, eapol_len), evt->eapol, eapol_len);
+ skb_put_data(skb, evt->eapol, eapol_len);
skb->protocol = eth_type_trans(skb, ndev);
if (likely(netif_rx_ni(skb) == NET_RX_SUCCESS)) {
ndev->stats.rx_packets++;
priv->dev->stats.rx_dropped++;
} else {
skb_reserve(skb, 2);
- memcpy(skb_put(skb, priv->frag_len + 12),
- priv->rx_buf,
- priv->frag_len + 12);
+ skb_put_data(skb, priv->rx_buf,
+ priv->frag_len + 12);
skb->protocol = eth_type_trans(skb, priv->dev);
skb->ip_summed = CHECKSUM_NONE;
netif_rx(skb);
goto out_unmap_hdr;
}
- memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
+ skb_put_data(bounce_skb, skb->data, skb->len);
memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
bounce_skb->dev = skb->dev;
skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
printk(KERN_INFO "Adding frag %d %d...\n",
j, size);
- memcpy(skb_put(skb, size),
- txb->fragments[j]->data + hdr_len, size);
+ skb_put_data(skb,
+ txb->fragments[j]->data + hdr_len,
+ size);
}
dev_kfree_skb_any(txb->fragments[i]);
txb->fragments[i] = skb;
goto failed;
skb_reserve(skb_new, crypt->ops->extra_msdu_prefix_len);
- memcpy(skb_put(skb_new, hdr_len), &header, hdr_len);
+ skb_put_data(skb_new, &header, hdr_len);
snapped = 1;
libipw_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)),
ether_type);
skb_reserve(skb_frag,
crypt->ops->extra_mpdu_prefix_len);
- frag_hdr =
- (struct libipw_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
- memcpy(frag_hdr, &header, hdr_len);
+ frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
/* If this is not the last fragment, then add the MOREFRAGS
* bit to the frame control */
* and do not consume a full page
*/
if (len <= SMALL_PACKET_SIZE) {
- memcpy(skb_put(skb, len), rx_hdr->payload, len);
+ skb_put_data(skb, rx_hdr->payload, len);
} else {
skb_add_rx_frag(skb, 0, rxb->page,
(void *)rx_hdr->payload - (void *)pkt, len,
}
if (len <= SMALL_PACKET_SIZE) {
- memcpy(skb_put(skb, len), hdr, len);
+ skb_put_data(skb, hdr, len);
} else {
skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb),
len, PAGE_SIZE << il->hw_params.rx_page_order);
*/
hdrlen = (len <= skb_tailroom(skb)) ? len : sizeof(*hdr);
- memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
+ skb_put_data(skb, hdr, hdrlen);
fraglen = len - hdrlen;
if (fraglen) {
if (noa_data &&
pskb_expand_head(skb, 0, noa_data->length,
GFP_ATOMIC) == 0) {
- memcpy(skb_put(skb, noa_data->length),
- noa_data->data, noa_data->length);
+ skb_put_data(skb, noa_data->data, noa_data->length);
hdr = (struct ieee80211_hdr *)skb->data;
}
}
if (!pkt)
goto report;
- memcpy(skb_put(pkt, hdrlen), pktdata, hdrlen);
+ skb_put_data(pkt, pktdata, hdrlen);
pktdata += hdrlen;
pktsize -= hdrlen;
pktsize -= ivlen + icvlen;
pktdata += ivlen;
- memcpy(skb_put(pkt, pktsize), pktdata, pktsize);
+ skb_put_data(pkt, pktdata, pktsize);
if (ieee80211_data_to_8023(pkt, vif->addr, vif->type))
goto report;
rx_status.band);
/* copy the data */
- memcpy(skb_put(skb, size), sb->data, size);
+ skb_put_data(skb, sb->data, size);
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
/* pass it as regular rx to mac80211 */
*/
hdrlen = (len <= skb_tailroom(skb)) ? len : hdrlen + crypt_len + 8;
- memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
+ skb_put_data(skb, hdr, hdrlen);
fraglen = len - hdrlen;
if (fraglen) {
* present before copying packet data.
*/
hdrlen += crypt_len;
- memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
- memcpy(skb_put(skb, headlen - hdrlen), (u8 *)hdr + hdrlen + pad_len,
- headlen - hdrlen);
+ skb_put_data(skb, hdr, hdrlen);
+ skb_put_data(skb, (u8 *)hdr + hdrlen + pad_len, headlen - hdrlen);
fraglen = len - headlen;
htons(ETH_P_IPV6),
data_left);
- memcpy(skb_put(csum_skb, tcp_hdrlen(skb)),
- tcph, tcp_hdrlen(skb));
+ skb_put_data(csum_skb, tcph, tcp_hdrlen(skb));
skb_reset_transport_header(csum_skb);
csum_skb->csum_start =
(unsigned char *)tcp_hdr(csum_skb) -
dma_addr_t tb_phys;
if (trans_pcie->sw_csum_tx)
- memcpy(skb_put(csum_skb, size), tso.data, size);
+ skb_put_data(csum_skb, tso.data, size);
tb_phys = dma_map_single(trans->dev, tso.data,
size, DMA_TO_DEVICE);
memcpy(skb_push(skb, encaps_len), encaps_data, encaps_len);
memcpy(skb_push(skb, hdr_len), &hdr, hdr_len);
if (use_wds == WDS_OWN_FRAME) {
- memcpy(skb_put(skb, ETH_ALEN), &hdr.addr4, ETH_ALEN);
+ skb_put_data(skb, &hdr.addr4, ETH_ALEN);
}
iface->stats.tx_packets++;
hdrlen = hostap_80211_get_hdrlen(cpu_to_le16(type_subtype));
hdr = skb_put_zero(skb, hdrlen);
if (body)
- memcpy(skb_put(skb, body_len), body, body_len);
+ skb_put_data(skb, body, body_len);
/* FIX: ctrl::ack sending used special HFA384X_TX_CTRL_802_11
* tx_control instead of using local->tx_control */
goto rx_dropped;
}
skb->dev = dev;
- memcpy(skb_put(skb, hdr_len), &rxdesc, hdr_len);
+ skb_put_data(skb, &rxdesc, hdr_len);
if (len > 0)
res = hfa384x_from_bap(dev, BAP0, skb_put(skb, len), len);
return;
}
- memcpy(skb_put(skb, hdrlen), (void *) &txdesc->frame_control, hdrlen);
+ skb_put_data(skb, (void *)&txdesc->frame_control, hdrlen);
if (payload)
- memcpy(skb_put(skb, len), payload, len);
+ skb_put_data(skb, payload, len);
skb->dev = local->dev;
skb_reset_mac_header(skb);
struct sk_buff *skb;
skb = dev_alloc_skb(sizeof(txdesc));
if (skb) {
- memcpy(skb_put(skb, sizeof(txdesc)), &txdesc,
- sizeof(txdesc));
+ skb_put_data(skb, &txdesc, sizeof(txdesc));
skb_queue_tail(&local->sta_tx_exc_list, skb);
tasklet_schedule(&local->sta_tx_exc_tasklet);
}
goto out;
}
- memcpy(skb_put(skb, sizeof(info)), &info, sizeof(info));
+ skb_put_data(skb, &info, sizeof(info));
if (left > 0 && hfa384x_from_bap(dev, BAP0, skb_put(skb, left), left))
{
spin_unlock(&local->baplock);
memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
memcpy(mgmt->bssid, dst, ETH_ALEN);
if (body)
- memcpy(skb_put(skb, bodylen), body, bodylen);
+ skb_put_data(skb, body, bodylen);
meta = (struct hostap_skb_tx_data *) skb->cb;
memset(meta, 0, sizeof(*meta));
}
/* Copy the 802.11 header to the skb */
- memcpy(skb_put(skb, hdrlen), &(desc->frame_ctl), hdrlen);
+ skb_put_data(skb, &(desc->frame_ctl), hdrlen);
skb_reset_mac_header(skb);
/* If any, copy the data from the card to the skb */
}
if (len <= READAHEAD_SZ) {
- memcpy(skb_put(skb, len), rx_head + 1, len);
+ skb_put_data(skb, rx_head + 1, len);
} else {
- memcpy(skb_put(skb, READAHEAD_SZ), rx_head + 1, READAHEAD_SZ);
+ skb_put_data(skb, rx_head + 1, READAHEAD_SZ);
p54spi_spi_read(priv, SPI_ADRS_DMA_DATA,
skb_put(skb, len - READAHEAD_SZ),
len - READAHEAD_SZ);
if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
/* reserve space for the MIC key */
len += 8;
- memcpy(skb_put(skb, 8), &(info->control.hw_key->key
- [NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY]), 8);
+ skb_put_data(skb,
+ &(info->control.hw_key->key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY]),
+ 8);
}
/* reserve some space for ICV */
len += info->control.hw_key->icv_len;
memcpy(mgmt->bssid, req->bssid, ETH_ALEN);
if (req->ie_len)
- memcpy(skb_put(probe, req->ie_len), req->ie,
- req->ie_len);
+ skb_put_data(probe, req->ie, req->ie_len);
local_bh_disable();
mac80211_hwsim_tx_frame(hwsim->hw, probe,
goto err;
/* Copy the data */
- memcpy(skb_put(skb, frame_data_len), frame_data, frame_data_len);
+ skb_put_data(skb, frame_data, frame_data_len);
data2 = get_hwsim_data_ref_from_addr(dst);
if (!data2)
skb_reserve(skb, NET_IP_ALIGN);
- data = skb_put(skb, size);
-
- memcpy(data, buffer, size);
+ data = skb_put_data(skb, buffer, size);
lbs_process_rxed_packet(card->priv, skb);
tx_header->eth803_hdr.h_proto = htons(skb_src->len + LLC_SNAP_LEN);
/* Add payload */
- memcpy(skb_put(skb_aggr, skb_src->len), skb_src->data, skb_src->len);
+ skb_put_data(skb_aggr, skb_src->data, skb_src->len);
/* Add padding for new MSDU to start from 4 byte boundary */
*pad = (4 - ((unsigned long)skb_aggr->tail & 0x3)) % 4;
memcpy(skb_push(skb, sizeof(pkt_type)), &pkt_type, sizeof(pkt_type));
/* Add packet data and address4 */
- memcpy(skb_put(skb, sizeof(struct ieee80211_hdr_3addr)), buf,
- sizeof(struct ieee80211_hdr_3addr));
- memcpy(skb_put(skb, ETH_ALEN), addr, ETH_ALEN);
- memcpy(skb_put(skb, len - sizeof(struct ieee80211_hdr_3addr)),
- buf + sizeof(struct ieee80211_hdr_3addr),
- len - sizeof(struct ieee80211_hdr_3addr));
+ skb_put_data(skb, buf, sizeof(struct ieee80211_hdr_3addr));
+ skb_put_data(skb, addr, ETH_ALEN);
+ skb_put_data(skb, buf + sizeof(struct ieee80211_hdr_3addr),
+ len - sizeof(struct ieee80211_hdr_3addr));
skb->priority = LOW_PRIO_TID;
__net_timestamp(skb);
return ret;
}
if (extra_ies_len)
- memcpy(skb_put(skb, extra_ies_len), extra_ies,
- extra_ies_len);
+ skb_put_data(skb, extra_ies, extra_ies_len);
mwifiex_tdls_add_link_ie(skb, priv->curr_addr, peer,
priv->cfg_bssid);
break;
return ret;
}
if (extra_ies_len)
- memcpy(skb_put(skb, extra_ies_len), extra_ies,
- extra_ies_len);
+ skb_put_data(skb, extra_ies, extra_ies_len);
mwifiex_tdls_add_link_ie(skb, peer, priv->curr_addr,
priv->cfg_bssid);
break;
}
if (extra_ies_len)
- memcpy(skb_put(skb, extra_ies_len), extra_ies, extra_ies_len);
+ skb_put_data(skb, extra_ies, extra_ies_len);
/* the TDLS link IE is always added last we are the responder */
goto bad_frame;
if (rxwi->rxinfo & cpu_to_le32(MT_RXINFO_L2PAD)) {
- memcpy(skb_put(skb, hdr_len), data, hdr_len);
+ skb_put_data(skb, data, hdr_len);
data += hdr_len + 2;
true_len -= hdr_len;
copy = (true_len <= skb_tailroom(skb)) ? true_len : hdr_len + 8;
frag = true_len - copy;
- memcpy(skb_put(skb, copy), data, copy);
+ skb_put_data(skb, data, copy);
data += copy;
if (frag) {
skb = alloc_skb(len + MT_DMA_HDR_LEN + 4, GFP_KERNEL);
if (skb) {
skb_reserve(skb, MT_DMA_HDR_LEN);
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
}
return skb;
return;
}
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
qtnf_trans_handle_rx_ctl_packet(bus, skb);
}
{
u8 *buf_dst;
- buf_dst = skb_put(skb, len);
- memcpy(buf_dst, buf_src, len);
+ buf_dst = skb_put_data(skb, buf_src, len);
}
static inline void qtnf_cmd_skb_put_tlv_arr(struct sk_buff *skb,
dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);
if (!(skbdesc->flags & SKBDESC_DESC_IN_SKB))
- memcpy(skb_put(skbcopy, skbdesc->desc_len), skbdesc->desc,
- skbdesc->desc_len);
- memcpy(skb_put(skbcopy, skb->len), skb->data, skb->len);
+ skb_put_data(skbcopy, skbdesc->desc, skbdesc->desc_len);
+ skb_put_data(skbcopy, skb->data, skb->len);
skb_queue_tail(&intf->frame_dump_skbqueue, skbcopy);
wake_up_interruptible(&intf->frame_dump_waitqueue);
if (likely(uskb)) {
memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status,
sizeof(rx_status));
- pdata = (u8 *)skb_put(uskb, skb->len);
- memcpy(pdata, skb->data, skb->len);
+ pdata = skb_put_data(uskb, skb->data, skb->len);
dev_kfree_skb_any(skb);
ieee80211_rx_irqsafe(hw, uskb);
} else {
u1rsvdpageloc, 3);
skb = dev_alloc_skb(totalpacketlen);
- memcpy(skb_put(skb, totalpacketlen),
- &reserved_page_packet, totalpacketlen);
+ skb_put_data(skb, &reserved_page_packet, totalpacketlen);
rtstatus = rtl_cmd_send_packet(hw, skb);
if (!skb)
return false;
skb_reserve(skb, extra_descoffset);
- seg_ptr = (u8 *)skb_put(skb, (u32)(frag_length -
- extra_descoffset));
- memcpy(seg_ptr, code_virtual_address + frag_offset,
- (u32)(frag_length - extra_descoffset));
+ seg_ptr = skb_put_data(skb,
+ code_virtual_address + frag_offset,
+ (u32)(frag_length - extra_descoffset));
tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
tcb_desc->queue_index = TXCMD_QUEUE;
/* reserve some space for mac80211's radiotap */
skb_reserve(skb, __RADIO_TAP_SIZE_RSV);
- memcpy(skb_put(skb, size), _urb->transfer_buffer, size);
+ skb_put_data(skb, _urb->transfer_buffer, size);
skb_queue_tail(&rtlusb->rx_queue, skb);
tasklet_schedule(&rtlusb->rx_work_tasklet);
return -ENOMEM;
}
- buffer = skb_put(skb, msg_len);
-
- memcpy(buffer,
- (u8 *)(msg + FRAME_DESC_SZ + pad_bytes),
- msg_len);
+ buffer = skb_put_data(skb,
+ (u8 *)(msg + FRAME_DESC_SZ + pad_bytes),
+ msg_len);
pkt_recv = buffer[0];
return -ENOMEM;
if (req->ie_len)
- memcpy(skb_put(frame.skb, req->ie_len), req->ie, req->ie_len);
+ skb_put_data(frame.skb, req->ie, req->ie_len);
/* will be unlocked in cw1200_scan_work() */
down(&priv->scan.lock);
goto out_idle;
}
if (req->ie_len)
- memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len);
+ skb_put_data(skb, req->ie, req->ie_len);
ret = wl1251_cmd_template_set(wl, CMD_PROBE_REQ, skb->data,
skb->len);
goto out;
}
if (ie0_len)
- memcpy(skb_put(skb, ie0_len), ie0, ie0_len);
+ skb_put_data(skb, ie0, ie0_len);
if (ie1_len)
- memcpy(skb_put(skb, ie1_len), ie1, ie1_len);
+ skb_put_data(skb, ie1, ie1_len);
if (sched_scan &&
(wl->quirks & WLCORE_QUIRK_DUAL_PROBE_TMPL)) {
/* reserve the unaligned payload(if any) */
skb_reserve(skb, reserved);
- buf = skb_put(skb, pkt_data_len);
-
/*
* Copy packets from aggregation buffer to the skbs without rx
* descriptor and with packet payload aligned care. In case of unaligned
* packets copy the packets in offset of 2 bytes guarantee IP header
* payload aligned to 4 bytes.
*/
- memcpy(buf, data + sizeof(*desc), pkt_data_len);
+ buf = skb_put_data(skb, data + sizeof(*desc), pkt_data_len);
if (rx_align == WLCORE_RX_BUF_PADDED)
skb_pull(skb, RX_BUF_ALIGN);
if (!(skb = dev_alloc_skb(datalen+24)))
goto resubmit;
- memcpy(skb_put(skb, 2), &data[datalen-16], 2);
- memcpy(skb_put(skb, 2), &data[datalen-2], 2);
- memcpy(skb_put(skb, 6), &data[datalen-14], 6);
- memcpy(skb_put(skb, 6), &data[datalen-22], 6);
- memcpy(skb_put(skb, 6), &data[datalen-8], 6);
- memcpy(skb_put(skb, 2), &data[datalen-24], 2);
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, &data[datalen - 16], 2);
+ skb_put_data(skb, &data[datalen - 2], 2);
+ skb_put_data(skb, &data[datalen - 14], 6);
+ skb_put_data(skb, &data[datalen - 22], 6);
+ skb_put_data(skb, &data[datalen - 8], 6);
+ skb_put_data(skb, &data[datalen - 24], 2);
+ skb_put_data(skb, data, len);
skb->protocol = eth_type_trans(skb, zd->dev);
zd->dev->stats.rx_packets++;
zd->dev->stats.rx_bytes += skb->len;
frag->skb = skb;
frag->seq = seq & IEEE80211_SCTL_SEQ;
skb_reserve(skb, 2);
- memcpy(skb_put(skb, 12), &data[datalen-14], 12);
- memcpy(skb_put(skb, 2), &data[6], 2);
- memcpy(skb_put(skb, len), data+8, len);
+ skb_put_data(skb, &data[datalen - 14], 12);
+ skb_put_data(skb, &data[6], 2);
+ skb_put_data(skb, data + 8, len);
hlist_add_head(&frag->fnode, &zd->fraglist);
goto resubmit;
}
if (!skb)
goto resubmit;
skb_reserve(skb, 2);
- memcpy(skb_put(skb, 12), &data[datalen-14], 12);
- memcpy(skb_put(skb, 2), &data[6], 2);
- memcpy(skb_put(skb, len), data+8, len);
+ skb_put_data(skb, &data[datalen - 14], 12);
+ skb_put_data(skb, &data[6], 2);
+ skb_put_data(skb, data + 8, len);
}
skb->protocol = eth_type_trans(skb, zd->dev);
zd->dev->stats.rx_packets++;
}
/* FIXME : could we avoid this big memcpy ? */
- memcpy(skb_put(skb, length), buffer, length);
+ skb_put_data(skb, buffer, length);
memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
ieee80211_rx_irqsafe(hw, skb);
skb_reserve(skb, NCI_CTRL_HDR_SIZE);
- memcpy(skb_put(skb, payload_size), fw->data + (fw->size - len),
- payload_size);
+ skb_put_data(skb, fw->data + (fw->size - len), payload_size);
rc = nci_send_data(ndev, conn_id, skb);
goto flush;
}
- memcpy(skb_put(*skb, len), tmp, len);
+ skb_put_data(*skb, tmp, len);
fdp_nci_i2c_dump_skb(&client->dev, "fdp_rd", *skb);
fdp_nci_i2c_remove_len_lrc(*skb);
out_skb = alloc_lc_skb(priv, priv->fw_dnld.chunk_len);
if (!out_skb)
return -ENOMEM;
- memcpy(skb_put(out_skb, priv->fw_dnld.chunk_len),
- ((uint8_t *)priv->fw_dnld.fw->data) +
- priv->fw_dnld.offset,
- priv->fw_dnld.chunk_len);
+ skb_put_data(out_skb,
+ ((uint8_t *)priv->fw_dnld.fw->data) + priv->fw_dnld.offset,
+ priv->fw_dnld.chunk_len);
nci_send_frame(priv->ndev, out_skb);
priv->fw_dnld.substate = SUBSTATE_WAIT_DATA_CREDIT;
}
return -ENOMEM;
/* Copy NCI header into the SKB */
- memcpy(skb_put(*skb, NCI_CTRL_HDR_SIZE), &nci_hdr, NCI_CTRL_HDR_SIZE);
+ skb_put_data(*skb, &nci_hdr, NCI_CTRL_HDR_SIZE);
if (nci_hdr.plen) {
/* Read the NCI payload */
if (!skb) {
nfc_err(&drv_data->udev->dev, "failed to alloc mem\n");
} else {
- memcpy(skb_put(skb, urb->actual_length),
- urb->transfer_buffer, urb->actual_length);
+ skb_put_data(skb, urb->transfer_buffer,
+ urb->actual_length);
if (nfcmrvl_nci_recv_frame(drv_data->priv, skb) < 0)
nfc_err(&drv_data->udev->dev,
"corrupted Rx packet\n");
header |= chunk_len & NXP_NCI_FW_FRAME_LEN_MASK;
put_unaligned_be16(header, skb_put(skb, NXP_NCI_FW_HDR_LEN));
- memcpy(skb_put(skb, chunk_len), fw_info->data + fw_info->written,
- chunk_len);
+ skb_put_data(skb, fw_info->data + fw_info->written, chunk_len);
crc = nxp_nci_fw_crc(skb->data, chunk_len + NXP_NCI_FW_HDR_LEN);
put_unaligned_be16(crc, skb_put(skb, NXP_NCI_FW_CRC_LEN));
goto fw_read_exit;
}
- memcpy(skb_put(*skb, NXP_NCI_FW_HDR_LEN), &header, NXP_NCI_FW_HDR_LEN);
+ skb_put_data(*skb, &header, NXP_NCI_FW_HDR_LEN);
r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len);
if (r != frame_len) {
goto nci_read_exit;
}
- memcpy(skb_put(*skb, NCI_CTRL_HDR_SIZE), (void *) &header,
- NCI_CTRL_HDR_SIZE);
+ skb_put_data(*skb, (void *)&header, NCI_CTRL_HDR_SIZE);
r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen);
if (r != header.plen) {
*skb_put(skb, 1) = PN533_INIT_TARGET_DEP;
/* MIFARE params */
- memcpy(skb_put(skb, 6), mifare_params, 6);
+ skb_put_data(skb, mifare_params, 6);
/* Felica params */
- felica = skb_put(skb, 18);
- memcpy(felica, felica_params, 18);
+ felica = skb_put_data(skb, felica_params, 18);
get_random_bytes(felica + 2, 6);
/* NFCID3 */
/* General bytes */
*skb_put(skb, 1) = gbytes_len;
- gb = skb_put(skb, gbytes_len);
- memcpy(gb, gbytes, gbytes_len);
+ gb = skb_put_data(skb, gbytes, gbytes_len);
/* Len Tk */
*skb_put(skb, 1) = 0;
*next = 0;
/* Copy passive data */
- memcpy(skb_put(skb, PASSIVE_DATA_LEN), passive_data, PASSIVE_DATA_LEN);
+ skb_put_data(skb, passive_data, PASSIVE_DATA_LEN);
*next |= 1;
/* Copy NFCID3 (which is NFCID2 from SENSF_RES) */
- memcpy(skb_put(skb, NFC_NFCID3_MAXSIZE), nfcid3,
- NFC_NFCID3_MAXSIZE);
+ skb_put_data(skb, nfcid3, NFC_NFCID3_MAXSIZE);
*next |= 2;
- memcpy(skb_put(skb, dev->gb_len), dev->gb, dev->gb_len);
+ skb_put_data(skb, dev->gb, dev->gb_len);
*next |= 4; /* We have some Gi */
rc = pn533_send_cmd_async(dev, PN533_CMD_IN_JUMP_FOR_DEP, skb,
if (!skb)
return NULL;
- memcpy(skb_put(skb, mod->len), &mod->data, mod->len);
+ skb_put_data(skb, &mod->data, mod->len);
return skb;
}
*next = 0;
/* Copy passive data */
- memcpy(skb_put(skb, PASSIVE_DATA_LEN), passive_data, PASSIVE_DATA_LEN);
+ skb_put_data(skb, passive_data, PASSIVE_DATA_LEN);
*next |= 1;
/* Copy NFCID3 (which is NFCID2 from SENSF_RES) */
memcpy(skb_put(skb, NFC_NFCID3_MAXSIZE), target->nfcid2,
target->nfcid2_len);
else
- memcpy(skb_put(skb, NFC_NFCID3_MAXSIZE), nfcid3,
- NFC_NFCID3_MAXSIZE);
+ skb_put_data(skb, nfcid3, NFC_NFCID3_MAXSIZE);
*next |= 2;
if (gb != NULL && gb_len > 0) {
- memcpy(skb_put(skb, gb_len), gb, gb_len);
+ skb_put_data(skb, gb, gb_len);
*next |= 4; /* We have some Gi */
} else {
*next = 0;
*skb_push(frag, sizeof(u8)) = 1; /* TG */
}
- memcpy(skb_put(frag, frag_size), skb->data, frag_size);
+ skb_put_data(frag, skb->data, frag_size);
/* Reduce the size of incoming buffer */
skb_pull(skb, frag_size);
return -ENOMEM;
*skb_put(skb, sizeof(cfgitem)) = cfgitem;
- memcpy(skb_put(skb, cfgdata_len), cfgdata, cfgdata_len);
+ skb_put_data(skb, cfgdata, cfgdata_len);
resp = pn533_send_cmd_sync(dev, PN533_CMD_RF_CONFIGURATION, skb);
if (IS_ERR(resp))
if (!skb) {
nfc_err(&phy->udev->dev, "failed to alloc memory\n");
} else {
- memcpy(skb_put(skb, urb->actual_length),
- urb->transfer_buffer, urb->actual_length);
+ skb_put_data(skb, urb->transfer_buffer,
+ urb->actual_length);
}
}
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, sizeof(struct port100_in_rf_setting)),
- &in_rf_settings[rf],
- sizeof(struct port100_in_rf_setting));
+ skb_put_data(skb, &in_rf_settings[rf],
+ sizeof(struct port100_in_rf_setting));
resp = port100_send_cmd_sync(dev, PORT100_CMD_IN_SET_RF, skb);
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, size), protocols, size);
+ skb_put_data(skb, protocols, size);
resp = port100_send_cmd_sync(dev, PORT100_CMD_IN_SET_PROTOCOL, skb);
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, sizeof(struct port100_tg_rf_setting)),
- &tg_rf_settings[rf],
- sizeof(struct port100_tg_rf_setting));
+ skb_put_data(skb, &tg_rf_settings[rf],
+ sizeof(struct port100_tg_rf_setting));
resp = port100_send_cmd_sync(dev, PORT100_CMD_TG_SET_RF, skb);
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, size), protocols, size);
+ skb_put_data(skb, protocols, size);
resp = port100_send_cmd_sync(dev, PORT100_CMD_TG_SET_PROTOCOL, skb);
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, S3FWRN5_FW_HDR_SIZE), &hdr, S3FWRN5_FW_HDR_SIZE);
+ skb_put_data(skb, &hdr, S3FWRN5_FW_HDR_SIZE);
if (len)
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
*msg = skb;
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, hdr_size), hdr, hdr_size);
+ skb_put_data(skb, hdr, hdr_size);
if (data_len == 0)
goto out;
atr_req->ppi = ST21NFCA_LR_BITS_PAYLOAD_SIZE_254B;
if (gb_len) {
atr_req->ppi |= ST21NFCA_GB_BIT;
- memcpy(skb_put(skb, gb_len), gb, gb_len);
+ skb_put_data(skb, gb, gb_len);
}
atr_req->length = sizeof(struct st21nfca_atr_req) + hdev->gb_len;
phy->current_read_len = 0;
}
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
if (skb->data[skb->len - 1] == ST21NFCA_SOF_EOF) {
phy->current_read_len = 0;
if (!skb)
return -ENOMEM;
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
spin_lock(&eptdev->queue_lock);
skb_queue_tail(&eptdev->queue, skb);
__func__, data_space);
while ((skb = skb_dequeue(&ch->collect_queue))) {
- memcpy(skb_put(ch->trans_skb, skb->len), skb->data, skb->len);
+ skb_put_data(ch->trans_skb, skb->data, skb->len);
p_header = (struct pdu *)
(skb_tail_pointer(ch->trans_skb) - skb->len);
p_header->pdu_flag = 0x00;
break;
case MPCG_STATE_FLOWC:
case MPCG_STATE_READY:
- memcpy(skb_put(new_skb, block_len),
- skb->data, block_len);
+ skb_put_data(new_skb, skb->data, block_len);
skb_queue_tail(&ch->io_queue, new_skb);
tasklet_schedule(&ch->ch_tasklet);
break;
default:
- memcpy(skb_put(new_skb, len), skb->data, len);
+ skb_put_data(new_skb, skb->data, len);
skb_queue_tail(&ch->io_queue, new_skb);
tasklet_hi_schedule(&ch->ch_tasklet);
break;
ctcm_clear_busy(ch->netdev);
return -ENOMEM;
} else {
- memcpy(skb_put(nskb, skb->len), skb->data, skb->len);
+ skb_put_data(nskb, skb->data, skb->len);
atomic_inc(&nskb->users);
atomic_dec(&skb->users);
dev_kfree_skb_irq(skb);
header->th.th_seq_num = 0x00;
header->sw.th_last_seq = ch->th_seq_num;
- memcpy(skb_put(sweep_skb, TH_SWEEP_LENGTH), header, TH_SWEEP_LENGTH);
+ skb_put_data(sweep_skb, header, TH_SWEEP_LENGTH);
kfree(header);
if (!nskb) {
goto nomem_exit;
} else {
- memcpy(skb_put(nskb, skb->len), skb->data, skb->len);
+ skb_put_data(nskb, skb->data, skb->len);
atomic_inc(&nskb->users);
atomic_dec(&skb->users);
dev_kfree_skb_irq(skb);
skb_reset_tail_pointer(ch->trans_skb);
ch->trans_skb->len = 0;
ch->ccw[1].count = skb->len;
- memcpy(skb_put(ch->trans_skb, skb->len), skb->data, skb->len);
+ skb_put_data(ch->trans_skb, skb->data, skb->len);
atomic_dec(&skb->users);
dev_kfree_skb_irq(skb);
ccw_idx = 0;
}
newskb->protocol = skb->protocol;
skb_reserve(newskb, TH_HEADER_LENGTH + PDU_HEADER_LENGTH);
- memcpy(skb_put(newskb, skb->len), skb->data, skb->len);
+ skb_put_data(newskb, skb->data, skb->len);
dev_kfree_skb_any(skb);
skb = newskb;
}
header->th.th_seq_num = 0x00;
header->sw.th_last_seq = ch->th_seq_num;
- memcpy(skb_put(sweep_skb, TH_SWEEP_LENGTH), header, TH_SWEEP_LENGTH);
+ skb_put_data(sweep_skb, header, TH_SWEEP_LENGTH);
kfree(header);
skb_reset_tail_pointer(ch->xid_skb);
ch->xid_skb->len = 0;
- memcpy(skb_put(ch->xid_skb, grp->xid_skb->len),
- grp->xid_skb->data,
- grp->xid_skb->len);
+ skb_put_data(ch->xid_skb, grp->xid_skb->data,
+ grp->xid_skb->len);
ch->xid->xid2_dlc_type =
((CHANNEL_DIRECTION(ch->flags) == CTCM_READ)
fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);
goto done;
}
- memcpy(skb_put(skb, new_len), pskb->data, new_len);
+ skb_put_data(skb, pskb->data, new_len);
skb_reset_mac_header(skb);
skb->dev = pskb->dev;
/* base xid for all channels in group */
grp->xid_skb_data = grp->xid_skb->data;
grp->xid_th = (struct th_header *)grp->xid_skb->data;
- memcpy(skb_put(grp->xid_skb, TH_HEADER_LENGTH),
- &thnorm, TH_HEADER_LENGTH);
+ skb_put_data(grp->xid_skb, &thnorm, TH_HEADER_LENGTH);
grp->xid = (struct xid2 *)skb_tail_pointer(grp->xid_skb);
- memcpy(skb_put(grp->xid_skb, XID2_LENGTH), &init_xid, XID2_LENGTH);
+ skb_put_data(grp->xid_skb, &init_xid, XID2_LENGTH);
grp->xid->xid2_adj_id = jiffies | 0xfff00000;
grp->xid->xid2_sender_id = jiffies;
grp->xid_id = skb_tail_pointer(grp->xid_skb);
- memcpy(skb_put(grp->xid_skb, 4), "VTAM", 4);
+ skb_put_data(grp->xid_skb, "VTAM", 4);
grp->rcvd_xid_skb =
__dev_alloc_skb(MPC_BUFSIZE_DEFAULT, GFP_ATOMIC|GFP_DMA);
}
grp->rcvd_xid_data = grp->rcvd_xid_skb->data;
grp->rcvd_xid_th = (struct th_header *)grp->rcvd_xid_skb->data;
- memcpy(skb_put(grp->rcvd_xid_skb, TH_HEADER_LENGTH),
- &thnorm, TH_HEADER_LENGTH);
+ skb_put_data(grp->rcvd_xid_skb, &thnorm, TH_HEADER_LENGTH);
grp->saved_xid2 = NULL;
priv->xid = grp->xid;
priv->mpcg = grp;
skb_reset_tail_pointer(grp->rcvd_xid_skb);
grp->rcvd_xid_skb->len = 0;
grp->rcvd_xid_th = (struct th_header *)grp->rcvd_xid_skb->data;
- memcpy(skb_put(grp->rcvd_xid_skb, TH_HEADER_LENGTH), &thnorm,
- TH_HEADER_LENGTH);
+ skb_put_data(grp->rcvd_xid_skb, &thnorm, TH_HEADER_LENGTH);
if (grp->send_qllc_disc == 1) {
grp->send_qllc_disc = 0;
grp->saved_xid2 =
(struct xid2 *)skb_tail_pointer(grp->rcvd_xid_skb);
- memcpy(skb_put(grp->rcvd_xid_skb,
- XID2_LENGTH), xid, XID2_LENGTH);
+ skb_put_data(grp->rcvd_xid_skb, xid, XID2_LENGTH);
grp->rcvd_xid_skb->data = grp->rcvd_xid_data;
skb_reset_tail_pointer(grp->rcvd_xid_skb);
if (fsm_getstate(ch->fsm) == CH_XID7_PENDING1) {
fsm_newstate(ch->fsm, CH_XID7_PENDING2);
ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD;
- memcpy(skb_put(ch->xid_skb,
- TH_HEADER_LENGTH),
- &thdummy, TH_HEADER_LENGTH);
+ skb_put_data(ch->xid_skb, &thdummy,
+ TH_HEADER_LENGTH);
send = 1;
}
} else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING2) {
fsm_newstate(ch->fsm, CH_XID7_PENDING2);
ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL;
- memcpy(skb_put(ch->xid_skb,
- TH_HEADER_LENGTH),
- &thnorm, TH_HEADER_LENGTH);
+ skb_put_data(ch->xid_skb, &thnorm,
+ TH_HEADER_LENGTH);
send = 1;
}
} else {
if (grp->roll == YSIDE) {
if (fsm_getstate(ch->fsm) < CH_XID7_PENDING4) {
fsm_newstate(ch->fsm, CH_XID7_PENDING4);
- memcpy(skb_put(ch->xid_skb,
- TH_HEADER_LENGTH),
- &thnorm, TH_HEADER_LENGTH);
+ skb_put_data(ch->xid_skb, &thnorm,
+ TH_HEADER_LENGTH);
ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL;
send = 1;
}
} else if (fsm_getstate(ch->fsm) == CH_XID7_PENDING3) {
fsm_newstate(ch->fsm, CH_XID7_PENDING4);
ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD;
- memcpy(skb_put(ch->xid_skb, TH_HEADER_LENGTH),
- &thdummy, TH_HEADER_LENGTH);
+ skb_put_data(ch->xid_skb, &thdummy,
+ TH_HEADER_LENGTH);
send = 1;
}
}
return -ENOMEM;
}
- memcpy(skb_put(skb, new_len), qllcptr, new_len);
+ skb_put_data(skb, qllcptr, new_len);
kfree(qllcptr);
if (skb_headroom(skb) < 4) {
card->stats.rx_dropped++;
return;
}
- memcpy(skb_put(skb, skb_len), skb_data, skb_len);
+ skb_put_data(skb, skb_data, skb_len);
skb->protocol = card->lan_type_trans(skb, card->dev);
card->stats.rx_bytes += skb_len;
card->stats.rx_packets++;
spin_lock_irqsave(&conn->collect_lock, saveflags);
while ((skb = skb_dequeue(&conn->collect_queue))) {
header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN;
- memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header,
- NETIUCV_HDRLEN);
+ skb_put_data(conn->tx_buff, &header, NETIUCV_HDRLEN);
skb_copy_from_linear_data(skb,
skb_put(conn->tx_buff, skb->len),
skb->len);
}
header.next = 0;
- memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
+ skb_put_data(conn->tx_buff, &header, NETIUCV_HDRLEN);
conn->prof.send_stamp = jiffies;
txmsg.class = 0;
txmsg.tag = 0;
return rc;
} else {
skb_reserve(nskb, NETIUCV_HDRLEN);
- memcpy(skb_put(nskb, skb->len),
- skb->data, skb->len);
+ skb_put_data(nskb, skb->data, skb->len);
}
copied = 1;
}
header.next = nskb->len + NETIUCV_HDRLEN;
memcpy(skb_push(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
header.next = 0;
- memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
+ skb_put_data(nskb, &header, NETIUCV_HDRLEN);
fsm_newstate(conn->fsm, CONN_STATE_TX);
conn->prof.send_stamp = jiffies;
skb_reserve(*pskb, ETH_HLEN);
if (data_len <= QETH_RX_PULL_LEN) {
- memcpy(skb_put(*pskb, data_len), element->addr + offset,
- data_len);
+ skb_put_data(*pskb, element->addr + offset, data_len);
} else {
get_page(page);
- memcpy(skb_put(*pskb, QETH_RX_PULL_LEN),
- element->addr + offset, QETH_RX_PULL_LEN);
+ skb_put_data(*pskb, element->addr + offset,
+ QETH_RX_PULL_LEN);
skb_fill_page_desc(*pskb, *pfrag, page,
offset + QETH_RX_PULL_LEN,
data_len - QETH_RX_PULL_LEN);
&skb, offset, &frag, data_len))
goto no_mem;
} else {
- memcpy(skb_put(skb, data_len), data_ptr,
- data_len);
+ skb_put_data(skb, data_ptr, data_len);
}
}
skb_len -= data_len;
return -ENOMEM;
skb_reserve(skb_out, NET_IP_ALIGN);
- memcpy(skb_put(skb_out, mac_header_len), mac_header_data,
- mac_header_len);
- memcpy(skb_put(skb_out, sizeof(struct arphdr)), arp_out,
- sizeof(struct arphdr));
- memcpy(skb_put(skb_out, sizeof(struct arpdata)), arp_data_out,
- sizeof(struct arpdata));
+ skb_put_data(skb_out, mac_header_data, mac_header_len);
+ skb_put_data(skb_out, arp_out, sizeof(struct arphdr));
+ skb_put_data(skb_out, arp_data_out, sizeof(struct arpdata));
skb_out->protocol = ((struct ethhdr *)mac_header_data)->h_proto;
skb_out->dev = skb_in->dev;
return -ENOMEM;
skb_reserve(skb_out, NET_IP_ALIGN);
- memcpy(skb_put(skb_out, mac_header_len), mac_header_data,
- mac_header_len);
- memcpy(skb_put(skb_out, sizeof(struct ipv6hdr)), &ipv6_out,
- sizeof(struct ipv6hdr));
- memcpy(skb_put(skb_out, sizeof(struct icmp6hdr)), &icmp6_out,
- sizeof(struct icmp6hdr));
- memcpy(skb_put(skb_out, sizeof(struct neighbour_advertisement)), &na,
- sizeof(struct neighbour_advertisement));
+ skb_put_data(skb_out, mac_header_data, mac_header_len);
+ skb_put_data(skb_out, &ipv6_out, sizeof(struct ipv6hdr));
+ skb_put_data(skb_out, &icmp6_out, sizeof(struct icmp6hdr));
+ skb_put_data(skb_out, &na, sizeof(struct neighbour_advertisement));
skb_out->protocol = ((struct ethhdr *)mac_header_data)->h_proto;
skb_out->dev = skb_in->dev;
return;
skb_reserve(skb, NET_IP_ALIGN);
- memcpy(skb_put(skb, mac_header_len), mac_header_data, mac_header_len);
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, mac_header_data, mac_header_len);
+ skb_put_data(skb, buf, len);
skb->protocol = ((struct ethhdr *)mac_header_data)->h_proto;
skb->dev = dev;
DPRINTK(4, "SNAP, rx_ind_size = %d\n", rx_ind_size);
size = ETH_ALEN * 2;
- memcpy(skb_put(skb, size), priv->rxp, size);
+ skb_put_data(skb, priv->rxp, size);
/* (SNAP+UI..) skip */
size = rx_ind_size - (ETH_ALEN * 2);
- memcpy(skb_put(skb, size), ð_hdr->h_proto, size);
+ skb_put_data(skb, ð_hdr->h_proto, size);
aa1x_hdr = (struct ieee802_1x_hdr *)(priv->rxp + ETHER_HDR_SIZE);
break;
}
DPRINTK(3, "NETBEUI/NetBIOS rx_ind_size=%d\n", rx_ind_size);
- memcpy(skb_put(skb, 12), priv->rxp, 12); /* 8802/FDDI MAC copy */
+ skb_put_data(skb, priv->rxp, 12); /* 8802/FDDI MAC copy */
temp[0] = (((rx_ind_size - 12) >> 8) & 0xff); /* NETBEUI size add */
temp[1] = ((rx_ind_size - 12) & 0xff);
- memcpy(skb_put(skb, 2), temp, 2);
+ skb_put_data(skb, temp, 2);
- memcpy(skb_put(skb, rx_ind_size - 14), priv->rxp + 12,
- rx_ind_size - 14); /* copy after Type */
+ skb_put_data(skb, priv->rxp + 12, rx_ind_size - 14); /* copy after Type */
aa1x_hdr = (struct ieee802_1x_hdr *)(priv->rxp + 14);
break;
ether_addr_copy(skb_put(skb, ETH_ALEN), dev->dev_addr);
/* src */
- memcpy(skb_put(skb, 4), &zero, 4);
- memcpy(skb_put(skb, 2), buf + 5, 2);
+ skb_put_data(skb, &zero, 4);
+ skb_put_data(skb, buf + 5, 2);
/* eth type */
- memcpy(skb_put(skb, 2), buf + 10, 2);
+ skb_put_data(skb, buf + 10, 2);
buf += MDP_HDR_LEN;
len -= MDP_HDR_LEN;
len -= MEP_HDR_LEN;
}
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
skb->protocol = eth_type_trans(skb, dev);
skb_len = skb->len;
if (netif_rx(skb) == NET_RX_SUCCESS) {
else
ptr += 6;
}
- memcpy(skb_put(skb, work->word1.len), ptr,
- work->word1.len);
+ skb_put_data(skb, ptr, work->word1.len);
/* No packet buffers to free */
} else {
int segments = work->word2.s.bufs;
if (segment_size > len)
segment_size = len;
/* Copy the data into the packet */
- memcpy(skb_put(skb, segment_size),
- cvmx_phys_to_ptr(
- segment_ptr.s.addr),
- segment_size);
+ skb_put_data(skb,
+ cvmx_phys_to_ptr(segment_ptr.s.addr),
+ segment_size);
len -= segment_size;
segment_ptr = next_ptr;
}
sub_skb = dev_alloc_skb(nSubframe_Length + 12);
if (sub_skb) {
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
- memcpy(data_ptr, pdata, nSubframe_Length);
+ data_ptr = skb_put_data(sub_skb, pdata,
+ nSubframe_Length);
} else {
sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
if (sub_skb) {
skb = netdev_alloc_skb(dev, data_len);
if (!skb)
return;
- memcpy(skb_put(skb, data_len), data, data_len);
+ skb_put_data(skb, data, data_len);
/*
* Frame data is not encrypted. Strip off protection so
if (!sub_skb)
return 0;
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, skb->len);
- memcpy(data_ptr, skb->data, skb->len);
+ data_ptr = skb_put_data(sub_skb, skb->data, skb->len);
sub_skb->dev = ieee->dev;
rxb->subframes[0] = sub_skb;
if (!sub_skb)
return 0;
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
- memcpy(data_ptr, skb->data, nSubframe_Length);
+ data_ptr = skb_put_data(sub_skb, skb->data, nSubframe_Length);
sub_skb->dev = ieee->dev;
rxb->subframes[rxb->nr_subframes++] = sub_skb;
/* copy first fragment (including full headers) into
* beginning of the fragment cache skb
*/
- memcpy(skb_put(frag_skb, flen), skb->data, flen);
+ skb_put_data(frag_skb, skb->data, flen);
} else {
/* append frame payload to the end of the fragment
* cache skb
*/
- memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
- flen);
+ skb_put_data(frag_skb, skb->data + hdrlen, flen);
}
dev_kfree_skb_any(skb);
skb = NULL;
hdr->info_element[0].id = MFIE_TYPE_SSID;
hdr->info_element[0].len = beacon->ssid_len;
- tag = skb_put(skb, beacon->ssid_len);
- memcpy(tag, beacon->ssid, beacon->ssid_len);
+ tag = skb_put_data(skb, beacon->ssid, beacon->ssid_len);
tag = skb_put(skb, rate_len);
}
if (wpa_ie_len) {
- tag = skb_put(skb, ieee->wpa_ie_len);
- memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
+ tag = skb_put_data(skb, ieee->wpa_ie, ieee->wpa_ie_len);
if (PMKCacheIdx >= 0) {
tag = skb_put(skb, 18);
}
if (wps_ie_len && ieee->wps_ie) {
- tag = skb_put(skb, wps_ie_len);
- memcpy(tag, ieee->wps_ie, wps_ie_len);
+ tag = skb_put_data(skb, ieee->wps_ie, wps_ie_len);
}
tag = skb_put(skb, turbo_info_len);
txb->encrypted = 0;
txb->payload_size = cpu_to_le16(skb->len);
- memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
- skb->len);
+ skb_put_data(txb->fragments[0], skb->data, skb->len);
goto success;
}
} else {
tcb_desc->bHwSec = 0;
}
- frag_hdr = (struct rtllib_hdr_3addrqos *)
- skb_put(skb_frag, hdr_len);
- memcpy(frag_hdr, &header, hdr_len);
+ frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
/* If this is not the last fragment, then add the
* MOREFRAGS bit to the frame control
bytes -= SNAP_SIZE + sizeof(u16);
}
- memcpy(skb_put(skb_frag, bytes), skb->data, bytes);
+ skb_put_data(skb_frag, skb->data, bytes);
/* Advance the SKB... */
skb_pull(skb, bytes);
txb->encrypted = 0;
txb->payload_size = cpu_to_le16(skb->len);
- memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
- skb->len);
+ skb_put_data(txb->fragments[0], skb->data, skb->len);
}
success:
if (!sub_skb)
return 0;
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
- memcpy(data_ptr, skb->data, nSubframe_Length);
+ data_ptr = skb_put_data(sub_skb, skb->data,
+ nSubframe_Length);
#endif
rxb->subframes[rxb->nr_subframes++] = sub_skb;
if (rxb->nr_subframes >= MAX_SUBFRAME_COUNT) {
if (frag == 0) {
/* copy first fragment (including full headers) into
* beginning of the fragment cache skb */
- memcpy(skb_put(frag_skb, flen), skb->data, flen);
+ skb_put_data(frag_skb, skb->data, flen);
} else {
/* append frame payload to the end of the fragment
* cache skb */
- memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
- flen);
+ skb_put_data(frag_skb, skb->data + hdrlen, flen);
}
dev_kfree_skb_any(skb);
skb = NULL;
hdr->info_element[0].id = MFIE_TYPE_SSID;
hdr->info_element[0].len = beacon->ssid_len;
- tag = skb_put(skb, beacon->ssid_len);
- memcpy(tag, beacon->ssid, beacon->ssid_len);
+ tag = skb_put_data(skb, beacon->ssid, beacon->ssid_len);
tag = skb_put(skb, rate_len);
{
tcb_desc->bHwSec = 0;
}
- frag_hdr = (struct rtl_80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
- memcpy(frag_hdr, &header, hdr_len);
+ frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
/* If this is not the last fragment, then add the MOREFRAGS
* bit to the frame control
bytes -= SNAP_SIZE + sizeof(u16);
}
- memcpy(skb_put(skb_frag, bytes), skb->data, bytes);
+ skb_put_data(skb_frag, skb->data, bytes);
/* Advance the SKB... */
skb_pull(skb, bytes);
txb->encrypted = 0;
txb->payload_size = __cpu_to_le16(skb->len);
- memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len);
+ skb_put_data(txb->fragments[0], skb->data, skb->len);
}
success:
tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_NORMAL;
tcb_desc->bLastIniPkt = 0;
skb_reserve(skb, USB_HWDESC_HEADER_LEN);
- ptr_buf = skb_put(skb, DataLen);
- memcpy(ptr_buf, pData, DataLen);
+ ptr_buf = skb_put_data(skb, pData, DataLen);
tcb_desc->txbuf_size = (u16)DataLen;
if (!priv->ieee80211->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
if (!sub_skb)
break;
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
- memcpy(data_ptr, pdata, nSubframe_Length);
+ data_ptr = skb_put_data(sub_skb, pdata, nSubframe_Length);
subframes[nr_subframes++] = sub_skb;
if (nr_subframes >= MAX_SUBFRAME_COUNT) {
netdev_warn(padapter->pnetdev, "r8712u: ParseSubframe(): Too many Subframes! Packets dropped!\n");
if (sub_skb)
{
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
- memcpy(data_ptr, (pdata + ETH_HLEN), nSubframe_Length);
+ data_ptr = skb_put_data(sub_skb, (pdata + ETH_HLEN),
+ nSubframe_Length);
}
else
{
if (!skb)
return;
- memcpy(skb_put(skb, size), buff, size);
+ skb_put_data(skb, buff, size);
cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb, sizeof(*cb_hdr));
memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
if (!skb)
return;
- memcpy(skb_put(skb, size), buff, size);
+ skb_put_data(skb, buff, size);
hdr = (struct wilc_wfi_radiotap_hdr *)skb_push(skb, sizeof(*hdr));
memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr));
hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
if (!skb2)
return -ENOMEM;
- memcpy(skb_put(skb2, skb->len), skb->data, skb->len);
+ skb_put_data(skb2, skb->data, skb->len);
cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb2, sizeof(*cb_hdr));
memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
skb->dev = wilc_netdev;
- memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);
+ skb_put_data(skb, buff_to_send, frame_len);
skb->protocol = eth_type_trans(skb, wilc_netdev);
vif->netstats.rx_packets++;
/* Copy the 802.11 header to the skb
* (ctl frames may be less than a full header)
*/
- datap = skb_put(skb, hdrlen);
- memcpy(datap, &rxdesc->frame_control, hdrlen);
+ datap = skb_put_data(skb, &rxdesc->frame_control, hdrlen);
/* If any, copy the data from the card to the skb */
if (datalen > 0) {
- datap = skb_put(skb, datalen);
- memcpy(datap, rxfrm->data, datalen);
+ datap = skb_put_data(skb, rxfrm->data, datalen);
/* check for unencrypted stuff if WEP bit set. */
if (*(datap - hdrlen + 1) & 0x40) /* wep set */
if (skb == NULL)
return NULL;
skb_reserve(skb, 2);
- memcpy(skb_put(skb, length), data, length);
+ skb_put_data(skb, data, length);
return skb;
}
return;
}
skb_reserve(skb, NET_IP_ALIGN);
- memcpy(skb_put(skb, size), in_buf, size);
+ skb_put_data(skb, in_buf, size);
skb->dev = net;
skb->protocol = htons(ETH_P_IP);
return;
}
- memcpy(skb_put(skb, size), buf, size);
+ skb_put_data(skb, buf, size);
skb->protocol = hdlc_type_trans(skb, dev);
return;
}
- memcpy(skb_put(skb, size), buf, size);
+ skb_put_data(skb, buf, size);
skb->protocol = hdlc_type_trans(skb, dev);
return;
}
- memcpy(skb_put(skb, size), buf, size);
+ skb_put_data(skb, buf, size);
skb->protocol = hdlc_type_trans(skb, dev);
ntb_iter = skb_put_zero(skb2, ndp_pad);
/* Copy NTB across. */
- ntb_iter = (void *) skb_put(skb2, ncm->skb_tx_ndp->len);
- memcpy(ntb_iter, ncm->skb_tx_ndp->data, ncm->skb_tx_ndp->len);
+ ntb_iter = skb_put_data(skb2, ncm->skb_tx_ndp->data,
+ ncm->skb_tx_ndp->len);
dev_consume_skb_any(ncm->skb_tx_ndp);
ncm->skb_tx_ndp = NULL;
/* Add the new data to the skb */
ntb_data = skb_put_zero(ncm->skb_tx_data, dgram_pad);
- ntb_data = (void *) skb_put(ncm->skb_tx_data, skb->len);
- memcpy(ntb_data, skb->data, skb->len);
+ ntb_data = skb_put_data(ncm->skb_tx_data, skb->data, skb->len);
dev_consume_skb_any(skb);
skb = NULL;
dg_len - crc_len);
if (skb2 == NULL)
goto err;
- memcpy(skb_put(skb2, dg_len - crc_len),
- skb->data + index, dg_len - crc_len);
+ skb_put_data(skb2, skb->data + index,
+ dg_len - crc_len);
skb_queue_tail(list, skb2);
skb->protocol = htons(ETH_P_PHONET);
skb_reset_mac_header(skb);
/* Can't use pskb_pull() on page in IRQ */
- memcpy(skb_put(skb, 1), page_address(page), 1);
+ skb_put_data(skb, page_address(page), 1);
}
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
if (!skb)
return NULL;
if (len)
- memcpy(skb_put(skb, len), dp, len);
+ skb_put_data(skb, dp, len);
hh = mISDN_HEAD_P(skb);
hh->prim = prim;
hh->id = id;
return tmp;
}
+static inline void *skb_put_data(struct sk_buff *skb, const void *data,
+ unsigned int len)
+{
+ void *tmp = skb_put(skb, len);
+
+ memcpy(tmp, data, len);
+
+ return tmp;
+}
+
unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
{
if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen)))
return -EMSGSIZE;
- memcpy(skb_put(skb, attrlen), data, attrlen);
+ skb_put_data(skb, data, attrlen);
return 0;
}
EXPORT_SYMBOL(nla_append);
unsigned char *skb_buff;
unsigned long new_direct_link_flag;
- skb_buff = skb_put(forw_packet_aggr->skb, packet_len);
- memcpy(skb_buff, packet_buff, packet_len);
+ skb_buff = skb_put_data(forw_packet_aggr->skb, packet_buff,
+ packet_len);
forw_packet_aggr->packet_len += packet_len;
forw_packet_aggr->num_packets++;
goto reschedule;
skb_reserve(skb, ETH_HLEN);
- pkt_buff = skb_put(skb, ogm_buff_len);
- memcpy(pkt_buff, ogm_buff, ogm_buff_len);
+ pkt_buff = skb_put_data(skb, ogm_buff, ogm_buff_len);
ogm_packet = (struct batadv_ogm2_packet *)skb->data;
ogm_packet->seqno = htonl(atomic_read(&bat_priv->bat_v.ogm_seqno));
goto out;
skb_reserve(skb, ETH_HLEN);
- skb_buff = skb_put(skb, packet_len);
- memcpy(skb_buff, ogm_received, packet_len);
+ skb_buff = skb_put_data(skb, ogm_received, packet_len);
/* apply forward penalty */
ogm_forward = (struct batadv_ogm2_packet *)skb_buff;
/* Copy the payload of the each fragment into the last skb */
hlist_for_each_entry(entry, chain, list) {
size = entry->skb->len - hdr_size;
- memcpy(skb_put(skb_out, size), entry->skb->data + hdr_size,
- size);
+ skb_put_data(skb_out, entry->skb->data + hdr_size, size);
}
free:
if (skb && (skb->len > 0))
skb_copy_from_linear_data(skb, skb_put(nskb, skb->len), skb->len);
- memcpy(skb_put(nskb, count), buf, count);
+ skb_put_data(nskb, buf, count);
session->reassembly[id] = nskb;
return -ENOMEM;
hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
- memcpy(skb_put(skb, 3), hw_err, 3);
+ skb_put_data(skb, hw_err, 3);
/* Send Hardware Error to upper stack */
return hci_recv_frame(hdev, skb);
hdr->plen = plen;
if (plen)
- memcpy(skb_put(skb, plen), param, plen);
+ skb_put_data(skb, param, plen);
BT_DBG("skb len %d", skb->len);
put_unaligned_le16(event, skb_put(skb, 2));
if (data)
- memcpy(skb_put(skb, data_len), data, data_len);
+ skb_put_data(skb, data, data_len);
skb->tstamp = tstamp;
put_unaligned_le32(hci_pi(sk)->cookie, skb_put(skb, 4));
put_unaligned_le16(format, skb_put(skb, 2));
- memcpy(skb_put(skb, sizeof(ver)), ver, sizeof(ver));
+ skb_put_data(skb, ver, sizeof(ver));
put_unaligned_le32(flags, skb_put(skb, 4));
*skb_put(skb, 1) = TASK_COMM_LEN;
- memcpy(skb_put(skb, TASK_COMM_LEN), hci_pi(sk)->comm, TASK_COMM_LEN);
+ skb_put_data(skb, hci_pi(sk)->comm, TASK_COMM_LEN);
__net_timestamp(skb);
put_unaligned_le16(opcode, skb_put(skb, 2));
if (buf)
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
__net_timestamp(skb);
*skb_put(skb, 1) = hdr;
if (data && size > 0)
- memcpy(skb_put(skb, size), data, size);
+ skb_put_data(skb, data, size);
skb_queue_tail(transmit, skb);
wake_up_interruptible(sk_sleep(sk));
if (dlen) {
count -= L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE;
- memcpy(skb_put(skb, count), data, count);
+ skb_put_data(skb, data, count);
data += count;
}
if (!*frag)
goto fail;
- memcpy(skb_put(*frag, count), data, count);
+ skb_put_data(*frag, data, count);
len -= count;
data += count;
put_unaligned_le16(opcode, skb_put(skb, 2));
if (buf)
- memcpy(skb_put(skb, len), buf, len);
+ skb_put_data(skb, buf, len);
__net_timestamp(skb);
hdr->len = cpu_to_le16(data_len);
if (data)
- memcpy(skb_put(skb, data_len), data, data_len);
+ skb_put_data(skb, data, data_len);
/* Time stamp */
__net_timestamp(skb);
skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);
- memcpy(skb_put(skb, size), buf + sent, size);
+ skb_put_data(skb, buf + sent, size);
rfcomm_dlc_send_noerror(dlc, skb);
icmph->type = ICMP_DEST_UNREACH;
icmph->code = code;
- payload = skb_put(nskb, len);
- memcpy(payload, skb_network_header(oldskb), len);
+ payload = skb_put_data(nskb, skb_network_header(oldskb), len);
csum = csum_partial((void *)icmph, len + sizeof(struct icmphdr), 0);
icmph->checksum = csum_fold(csum);
icmp6h->icmp6_type = ICMPV6_DEST_UNREACH;
icmp6h->icmp6_code = code;
- payload = skb_put(nskb, len);
- memcpy(payload, skb_network_header(oldskb), len);
+ payload = skb_put_data(nskb, skb_network_header(oldskb), len);
nip6h->payload_len = htons(nskb->len - sizeof(struct ipv6hdr));
icmp6h->icmp6_cksum =
can_skb_prv(skb)->ifindex = dev->ifindex;
can_skb_prv(skb)->skbcnt = 0;
- memcpy(skb_put(skb, op->cfsiz), cf, op->cfsiz);
+ skb_put_data(skb, cf, op->cfsiz);
/* send with loopback */
skb->dev = dev;
if (!skb)
return;
- memcpy(skb_put(skb, sizeof(*head)), head, sizeof(*head));
+ skb_put_data(skb, head, sizeof(*head));
if (head->nframes) {
/* CAN frames starting here */
firstframe = (struct canfd_frame *)skb_tail_pointer(skb);
- memcpy(skb_put(skb, datalen), frames, datalen);
+ skb_put_data(skb, frames, datalen);
/*
* the BCM uses the flags-element of the canfd_frame
*skb_put(skb,1) = len;
if (len > 0)
- memcpy(skb_put(skb, len), scp->conndata_out.opt_data, len);
+ skb_put_data(skb, scp->conndata_out.opt_data, len);
dn_nsp_send(skb);
aux = scp->accessdata.acc_userl;
*skb_put(skb, 1) = aux;
if (aux > 0)
- memcpy(skb_put(skb, aux), scp->accessdata.acc_user, aux);
+ skb_put_data(skb, scp->accessdata.acc_user, aux);
aux = scp->accessdata.acc_passl;
*skb_put(skb, 1) = aux;
if (aux > 0)
- memcpy(skb_put(skb, aux), scp->accessdata.acc_pass, aux);
+ skb_put_data(skb, scp->accessdata.acc_pass, aux);
aux = scp->accessdata.acc_accl;
*skb_put(skb, 1) = aux;
if (aux > 0)
- memcpy(skb_put(skb, aux), scp->accessdata.acc_acc, aux);
+ skb_put_data(skb, scp->accessdata.acc_acc, aux);
aux = (__u8)le16_to_cpu(scp->conndata_out.opt_optl);
*skb_put(skb, 1) = aux;
if (aux > 0)
- memcpy(skb_put(skb, aux), scp->conndata_out.opt_data, aux);
+ skb_put_data(skb, scp->conndata_out.opt_data, aux);
scp->persist = dn_nsp_persist(sk);
scp->persist_fxn = dn_nsp_retrans_conninit;
*mac_cb(frag) = *mac_cb(skb);
if (frag1) {
- memcpy(skb_put(frag, skb->mac_len),
- skb_mac_header(skb), skb->mac_len);
+ skb_put_data(frag, skb_mac_header(skb), skb->mac_len);
} else {
rc = wpan_dev_hard_header(frag, wdev,
&master_hdr->dest,
if (IS_ERR(frag))
return PTR_ERR(frag);
- memcpy(skb_put(frag, frag_hdrlen), frag_hdr, frag_hdrlen);
- memcpy(skb_put(frag, len), skb_network_header(skb) + offset, len);
+ skb_put_data(frag, frag_hdr, frag_hdrlen);
+ skb_put_data(frag, skb_network_header(skb) + offset, len);
raw_dump_table(__func__, " fragment dump", frag->data, frag->len);
ip6_mc_hdr(sk, skb, dev, saddr, &mld2_all_mcr, NEXTHDR_HOP, 0);
- memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra));
+ skb_put_data(skb, ra, sizeof(ra));
skb_set_transport_header(skb, skb_tail_pointer(skb) - skb->data);
skb_put(skb, sizeof(*pmr));
ip6_mc_hdr(sk, skb, dev, saddr, snd_addr, NEXTHDR_HOP, payload_len);
- memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra));
+ skb_put_data(skb, ra, sizeof(ra));
hdr = skb_put_zero(skb, sizeof(struct mld_msg));
hdr->mld_type = type;
}
/* Copy data */
- memcpy(skb_put(skb,size), buf + len, size);
+ skb_put_data(skb, buf + len, size);
count -= size;
len += size;
info[0] = discovery->data.charset;
len = IRDA_MIN(discovery->name_len, skb_tailroom(tx_skb));
- info = skb_put(tx_skb, len);
- memcpy(info, discovery->data.info, len);
+ info = skb_put_data(tx_skb, discovery->data.info, len);
}
irlap_queue_xmit(self, tx_skb);
}
frame->control = TEST_RSP | PF_BIT;
/* Copy info */
- info = skb_put(tx_skb, cmd->len);
- memcpy(info, cmd->data, cmd->len);
+ info = skb_put_data(tx_skb, cmd->data, cmd->len);
/* Return to sender */
irlap_wait_min_turn_around(self, &self->qos_tx);
if (!skb)
return -ENOBUFS;
- hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg));
- memcpy(hdr, ihdr, sizeof(struct sadb_msg));
+ hdr = skb_put_data(skb, ihdr, sizeof(struct sadb_msg));
hdr->sadb_msg_errno = (uint8_t) 0;
hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
return;
skb_reserve(skb, local->tx_headroom);
- memcpy(skb_put(skb, presp->head_len), presp->head, presp->head_len);
+ skb_put_data(skb, presp->head, presp->head_len);
memcpy(((struct ieee80211_mgmt *) skb->data)->da, mgmt->sa, ETH_ALEN);
ibss_dbg(sdata, "Sending ProbeResp to %pM\n", mgmt->sa);
data = ifmsh->ie + offset;
if (skb_tailroom(skb) < len)
return -ENOMEM;
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
}
return 0;
if (skb_tailroom(skb) < len)
return -ENOMEM;
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
return 0;
}
goto out;
skb_reserve(presp, local->tx_headroom);
- memcpy(skb_put(presp, bcn->head_len), bcn->head, bcn->head_len);
- memcpy(skb_put(presp, bcn->tail_len), bcn->tail, bcn->tail_len);
+ skb_put_data(presp, bcn->head, bcn->head_len);
+ skb_put_data(presp, bcn->tail, bcn->tail_len);
hdr = (struct ieee80211_mgmt *) presp->data;
hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_PROBE_RESP);
after_ric,
ARRAY_SIZE(after_ric),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, assoc_data->ie + offset, noffset - offset);
+ pos = skb_put_data(skb, assoc_data->ie + offset,
+ noffset - offset);
offset = noffset;
}
noffset = ieee80211_ie_split(assoc_data->ie, assoc_data->ie_len,
before_vht, ARRAY_SIZE(before_vht),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, assoc_data->ie + offset, noffset - offset);
+ pos = skb_put_data(skb, assoc_data->ie + offset,
+ noffset - offset);
offset = noffset;
}
noffset = ieee80211_ie_split_vendor(assoc_data->ie,
assoc_data->ie_len,
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, assoc_data->ie + offset, noffset - offset);
+ pos = skb_put_data(skb, assoc_data->ie + offset,
+ noffset - offset);
offset = noffset;
}
/* add any remaining custom (i.e. vendor specific here) IEs */
if (assoc_data->ie_len) {
noffset = assoc_data->ie_len;
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, assoc_data->ie + offset, noffset - offset);
+ pos = skb_put_data(skb, assoc_data->ie + offset,
+ noffset - offset);
}
if (assoc_data->fils_kek_len &&
}
skb_reserve(skb, local->hw.extra_tx_headroom);
- data = skb_put(skb, params->len);
- memcpy(data, params->buf, params->len);
+ data = skb_put_data(skb, params->buf, params->len);
/* Update CSA counters */
if (sdata->vif.csa_active &&
}
}
while ((skb = __skb_dequeue(&entry->skb_list))) {
- memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len);
+ skb_put_data(rx->skb, skb->data, skb->len);
dev_kfree_skb(skb);
}
before_ext_cap,
ARRAY_SIZE(before_ext_cap),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
offset = noffset;
}
before_ht_cap,
ARRAY_SIZE(before_ht_cap),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
offset = noffset;
}
before_vht_cap,
ARRAY_SIZE(before_vht_cap),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
offset = noffset;
}
/* add any remaining IEs */
if (extra_ies_len) {
noffset = extra_ies_len;
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
}
}
before_qos,
ARRAY_SIZE(before_qos),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
offset = noffset;
}
before_ht_op,
ARRAY_SIZE(before_ht_op),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
offset = noffset;
}
/* add any remaining IEs */
if (extra_ies_len) {
noffset = extra_ies_len;
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
}
}
before_lnkie,
ARRAY_SIZE(before_lnkie),
offset);
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
offset = noffset;
}
/* add any remaining IEs */
if (extra_ies_len) {
noffset = extra_ies_len;
- pos = skb_put(skb, noffset - offset);
- memcpy(pos, extra_ies + offset, noffset - offset);
+ pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
}
}
ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator);
if (extra_ies_len)
- memcpy(skb_put(skb, extra_ies_len), extra_ies, extra_ies_len);
+ skb_put_data(skb, extra_ies, extra_ies_len);
}
static void ieee80211_tdls_add_ies(struct ieee80211_sub_if_data *sdata,
case WLAN_TDLS_TEARDOWN:
case WLAN_TDLS_DISCOVERY_REQUEST:
if (extra_ies_len)
- memcpy(skb_put(skb, extra_ies_len), extra_ies,
- extra_ies_len);
+ skb_put_data(skb, extra_ies, extra_ies_len);
if (status_code == 0 || action_code == WLAN_TDLS_TEARDOWN)
ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator);
break;
tmp->dev = skb->dev;
/* copy header and data */
- memcpy(skb_put(tmp, hdrlen), skb->data, hdrlen);
- memcpy(skb_put(tmp, fraglen), skb->data + pos, fraglen);
+ skb_put_data(tmp, skb->data, hdrlen);
+ skb_put_data(tmp, skb->data + pos, fraglen);
pos += fraglen;
}
goto out;
skb_reserve(skb, local->tx_headroom);
- memcpy(skb_put(skb, beacon->head_len), beacon->head,
- beacon->head_len);
+ skb_put_data(skb, beacon->head, beacon->head_len);
ieee80211_beacon_add_tim(sdata, &ap->ps, skb,
is_template);
}
if (beacon->tail)
- memcpy(skb_put(skb, beacon->tail_len),
- beacon->tail, beacon->tail_len);
+ skb_put_data(skb, beacon->tail,
+ beacon->tail_len);
} else
goto out;
} else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
if (!skb)
goto out;
skb_reserve(skb, local->tx_headroom);
- memcpy(skb_put(skb, beacon->head_len), beacon->head,
- beacon->head_len);
+ skb_put_data(skb, beacon->head, beacon->head_len);
hdr = (struct ieee80211_hdr *) skb->data;
hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
if (!skb)
goto out;
skb_reserve(skb, local->tx_headroom);
- memcpy(skb_put(skb, beacon->head_len), beacon->head,
- beacon->head_len);
+ skb_put_data(skb, beacon->head, beacon->head_len);
ieee80211_beacon_add_tim(sdata, &ifmsh->ps, skb, is_template);
if (offs) {
offs->tim_length = skb->len - beacon->head_len;
}
- memcpy(skb_put(skb, beacon->tail_len), beacon->tail,
- beacon->tail_len);
+ skb_put_data(skb, beacon->tail, beacon->tail_len);
} else {
WARN_ON(1);
goto out;
if (!skb)
goto out;
- memcpy(skb_put(skb, presp->len), presp->data, presp->len);
+ skb_put_data(skb, presp->data, presp->len);
hdr = (struct ieee80211_hdr *) skb->data;
memset(hdr->addr1, 0, sizeof(hdr->addr1));
mgmt->u.auth.auth_transaction = cpu_to_le16(transaction);
mgmt->u.auth.status_code = cpu_to_le16(status);
if (extra)
- memcpy(skb_put(skb, extra_len), extra, extra_len);
+ skb_put_data(skb, extra, extra_len);
if (auth_alg == WLAN_AUTH_SHARED_KEY && transaction == 3) {
mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
skb_reserve(skb, local->hw.extra_tx_headroom);
/* copy in frame */
- memcpy(skb_put(skb, IEEE80211_DEAUTH_FRAME_LEN),
- mgmt, IEEE80211_DEAUTH_FRAME_LEN);
+ skb_put_data(skb, mgmt, IEEE80211_DEAUTH_FRAME_LEN);
if (sdata->vif.type != NL80211_IFTYPE_STATION ||
!(sdata->u.mgd.flags & IEEE80211_STA_MFP_ENABLED))
NETLINK_CB(new).dst_group = NETLINK_CB(skb).dst_group;
NETLINK_CB(new).creds = NETLINK_CB(skb).creds;
- memcpy(skb_put(new, len), skb->data, len);
+ skb_put_data(new, skb->data, len);
return new;
}
return ERR_PTR(-ENOMEM);
}
- memcpy(skb_put(new_skb, ddev->remote_payload_max), skb->data,
- ddev->remote_payload_max);
+ skb_put_data(new_skb, skb->data, ddev->remote_payload_max);
skb_pull(skb, ddev->remote_payload_max);
ddev->chaining_skb = skb;
ddev->chaining_skb = new_skb;
}
- memcpy(skb_put(ddev->chaining_skb, resp->len), resp->data,
- resp->len);
+ skb_put_data(ddev->chaining_skb, resp->data, resp->len);
kfree_skb(resp);
resp = NULL;
if (gb_len) {
atr_req->pp |= DIGITAL_GB_BIT;
- memcpy(skb_put(skb, gb_len), gb, gb_len);
+ skb_put_data(skb, gb, gb_len);
}
digital_skb_push_dep_sod(ddev, skb);
if (ddev->did) {
dep_res->pfb |= DIGITAL_NFC_DEP_PFB_DID_BIT;
- memcpy(skb_put(skb, sizeof(ddev->did)), &ddev->did,
- sizeof(ddev->did));
+ skb_put_data(skb, &ddev->did, sizeof(ddev->did));
}
ddev->curr_nfc_dep_pni =
if (ddev->did) {
dep_res->pfb |= DIGITAL_NFC_DEP_PFB_DID_BIT;
- memcpy(skb_put(skb, sizeof(ddev->did)), &ddev->did,
- sizeof(ddev->did));
+ skb_put_data(skb, &ddev->did, sizeof(ddev->did));
}
digital_skb_push_dep_sod(ddev, skb);
if (ddev->did) {
dep_res->pfb |= DIGITAL_NFC_DEP_PFB_DID_BIT;
- memcpy(skb_put(skb, sizeof(ddev->did)), &ddev->did,
- sizeof(ddev->did));
+ skb_put_data(skb, &ddev->did, sizeof(ddev->did));
}
ddev->curr_nfc_dep_pni =
skb_queue_walk(&hdev->rx_hcp_frags, frag_skb) {
msg_len = frag_skb->len - NFC_HCI_HCP_PACKET_HEADER_LEN;
- memcpy(skb_put(hcp_skb, msg_len),
- frag_skb->data + NFC_HCI_HCP_PACKET_HEADER_LEN,
- msg_len);
+ skb_put_data(hcp_skb,
+ frag_skb->data + NFC_HCI_HCP_PACKET_HEADER_LEN,
+ msg_len);
}
skb_queue_purge(&hdev->rx_hcp_frags);
pr_debug("header 0x%x 0x%x\n", header[0], header[1]);
- memcpy(skb_put(pdu, LLCP_HEADER_SIZE), header, LLCP_HEADER_SIZE);
+ skb_put_data(pdu, header, LLCP_HEADER_SIZE);
return pdu;
}
if (tlv == NULL)
return NULL;
- memcpy(skb_put(pdu, tlv_length), tlv, tlv_length);
+ skb_put_data(pdu, tlv, tlv_length);
return pdu;
}
return PTR_ERR(skb);
hlist_for_each_entry_safe(sdp, n, tlv_list, node) {
- memcpy(skb_put(skb, sdp->tlv_len), sdp->tlv, sdp->tlv_len);
+ skb_put_data(skb, sdp->tlv, sdp->tlv_len);
hlist_del(&sdp->node);
hlist_for_each_entry_safe(sdreq, n, tlv_list, node) {
pr_debug("tid %d for %s\n", sdreq->tid, sdreq->uri);
- memcpy(skb_put(skb, sdreq->tlv_len), sdreq->tlv,
- sdreq->tlv_len);
+ skb_put_data(skb, sdreq->tlv, sdreq->tlv_len);
hlist_del(&sdreq->node);
skb = llcp_add_header(skb, dsap, ssap, LLCP_PDU_DM);
- memcpy(skb_put(skb, 1), &reason, 1);
+ skb_put_data(skb, &reason, 1);
skb_queue_head(&local->tx_queue, skb);
skb_put(pdu, LLCP_SEQUENCE_SIZE);
if (likely(frag_len > 0))
- memcpy(skb_put(pdu, frag_len), msg_ptr, frag_len);
+ skb_put_data(pdu, msg_ptr, frag_len);
skb_queue_tail(&sock->tx_queue, pdu);
pdu = llcp_add_header(pdu, dsap, ssap, LLCP_PDU_UI);
if (likely(frag_len > 0))
- memcpy(skb_put(pdu, frag_len), msg_ptr, frag_len);
+ skb_put_data(pdu, msg_ptr, frag_len);
/* No need to check for the peer RW for UI frames */
skb_queue_tail(&local->tx_queue, pdu);
return;
}
- memcpy(skb_put(new_skb, pdu_len), skb->data, pdu_len);
+ skb_put_data(new_skb, skb->data, pdu_len);
nfc_llcp_rx_skb(local, new_skb);
return -ENOMEM;
skb_reserve(skb, NCI_DATA_HDR_SIZE);
- memcpy(skb_put(skb, data_len), data, data_len);
+ skb_put_data(skb, data, data_len);
loopback_data.conn_id = conn_id;
loopback_data.data = skb;
nci_pbf_set((__u8 *)hdr, NCI_PBF_LAST);
if (plen)
- memcpy(skb_put(skb, plen), payload, plen);
+ skb_put_data(skb, payload, plen);
skb_queue_tail(&ndev->cmd_q, skb);
queue_work(ndev->cmd_wq, &ndev->cmd_work);
skb_reserve(skb_frag, NCI_DATA_HDR_SIZE);
/* first, copy the data */
- memcpy(skb_put(skb_frag, frag_len), data, frag_len);
+ skb_put_data(skb_frag, data, frag_len);
/* second, set the header */
nci_push_data_hdr(ndev, conn_id, skb_frag,
*skb_push(skb, 1) = cb;
if (len > 0)
- memcpy(skb_put(skb, len), data + i, len);
+ skb_put_data(skb, data + i, len);
r = nci_send_data(ndev, conn_info->conn_id, skb);
if (r < 0)
skb_queue_walk(&ndev->hci_dev->rx_hcp_frags, frag_skb) {
msg_len = frag_skb->len - NCI_HCI_HCP_PACKET_HEADER_LEN;
- memcpy(skb_put(hcp_skb, msg_len), frag_skb->data +
- NCI_HCI_HCP_PACKET_HEADER_LEN, msg_len);
+ skb_put_data(hcp_skb,
+ frag_skb->data + NCI_HCI_HCP_PACKET_HEADER_LEN,
+ msg_len);
}
skb_queue_purge(&ndev->hci_dev->rx_hcp_frags);
chunk_len = nu->rx_packet_len - nu->rx_skb->len;
if (count < chunk_len)
chunk_len = count;
- memcpy(skb_put(nu->rx_skb, chunk_len), data, chunk_len);
+ skb_put_data(nu->rx_skb, data, chunk_len);
data += chunk_len;
count -= chunk_len;
return -ENOMEM;
skb_reset_transport_header(skb);
- memcpy(skb_put(skb, len), data, len);
+ skb_put_data(skb, data, len);
skb_queue_tail(&node->rx_queue, skb);
schedule_work(&node->work);
auth = (struct sctp_auth_chunk *)
skb_tail_pointer(nskb);
- memcpy(skb_put(nskb, chunk->skb->len), chunk->skb->data,
- chunk->skb->len);
+ skb_put_data(nskb, chunk->skb->data, chunk->skb->len);
pr_debug("*** Chunk:%p[%s] %s 0x%x, length:%d, chunk->skb->len:%d, rtt_in_progress:%d\n",
chunk,
int padlen = SCTP_PAD4(chunklen) - chunklen;
padding = skb_put_zero(chunk->skb, padlen);
- target = skb_put(chunk->skb, len);
-
- memcpy(target, data, len);
+ target = skb_put_data(chunk->skb, data, len);
/* Adjust the chunk length field. */
chunk->chunk_hdr->length = htons(chunklen + padlen + len);
break;
}
- t_hdr = skb_put(skb, sizeof(pkt->hdr));
- memcpy(t_hdr, &pkt->hdr, sizeof(pkt->hdr));
+ t_hdr = skb_put_data(skb, &pkt->hdr, sizeof(pkt->hdr));
if (pkt->len) {
- payload = skb_put(skb, pkt->len);
- memcpy(payload, pkt->buf, pkt->len);
+ payload = skb_put_data(skb, pkt->buf, pkt->len);
}
return skb;
*dptr++ = X25_CALL_REQUEST;
len = x25_addr_aton(addresses, &x25->dest_addr,
&x25->source_addr);
- dptr = skb_put(skb, len);
- memcpy(dptr, addresses, len);
+ dptr = skb_put_data(skb, addresses, len);
len = x25_create_facilities(facilities,
&x25->facilities,
&x25->dte_facilities,
x25->neighbour->global_facil_mask);
- dptr = skb_put(skb, len);
- memcpy(dptr, facilities, len);
- dptr = skb_put(skb, x25->calluserdata.cudlength);
- memcpy(dptr, x25->calluserdata.cuddata,
- x25->calluserdata.cudlength);
+ dptr = skb_put_data(skb, facilities, len);
+ dptr = skb_put_data(skb, x25->calluserdata.cuddata,
+ x25->calluserdata.cudlength);
x25->calluserdata.cudlength = 0;
break;
&x25->facilities,
&x25->dte_facilities,
x25->vc_facil_mask);
- dptr = skb_put(skb, len);
- memcpy(dptr, facilities, len);
+ dptr = skb_put_data(skb, facilities, len);
/* fast select with no restriction on response
allows call user data. Userland must
ensure it is ours and not theirs */
if(x25->facilities.reverse & 0x80) {
- dptr = skb_put(skb,
- x25->calluserdata.cudlength);
- memcpy(dptr, x25->calluserdata.cuddata,
- x25->calluserdata.cudlength);
+ dptr = skb_put_data(skb,
+ x25->calluserdata.cuddata,
+ x25->calluserdata.cudlength);
}
x25->calluserdata.cudlength = 0;
break;