diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2011-08-19 15:47:11 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 14:41:44 -0400 |
commit | e8753043f9fbabffbf087c7f4b514c50ef89541e (patch) | |
tree | 2c4b382a21500c228005a43e48134d39fdcccbe8 /drivers/nfc | |
parent | 4e0d8cc1006b889909a87f824943bad9a56358e8 (diff) | |
download | op-kernel-dev-e8753043f9fbabffbf087c7f4b514c50ef89541e.zip op-kernel-dev-e8753043f9fbabffbf087c7f4b514c50ef89541e.tar.gz |
NFC: Reserve tx head and tail room
We can have the NFC core layer allocating the tx head and tail
room for the drivers and avoid 1 or more SKBs copy on write on
the Tx path.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r-- | drivers/nfc/pn533.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index c77e054..f81a93e 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c @@ -1246,7 +1246,6 @@ static int pn533_data_exchange_tx_frame(struct pn533 *dev, struct sk_buff *skb) { int payload_len = skb->len; struct pn533_frame *out_frame; - struct sk_buff *discarded; u8 tg; nfc_dev_dbg(&dev->interface->dev, "%s - Sending %d bytes", __func__, @@ -1260,18 +1259,6 @@ static int pn533_data_exchange_tx_frame(struct pn533 *dev, struct sk_buff *skb) return -ENOSYS; } - /* Reserving header space */ - if (skb_cow_head(skb, PN533_CMD_DATAEXCH_HEAD_LEN)) { - nfc_dev_err(&dev->interface->dev, "Error to add header data"); - return -ENOMEM; - } - - /* Reserving tail space, see pn533_tx_frame_finish */ - if (skb_cow_data(skb, PN533_FRAME_TAIL_SIZE, &discarded) < 0) { - nfc_dev_err(&dev->interface->dev, "Error to add tail data"); - return -ENOMEM; - } - skb_push(skb, PN533_CMD_DATAEXCH_HEAD_LEN); out_frame = (struct pn533_frame *) skb->data; @@ -1536,7 +1523,9 @@ static int pn533_probe(struct usb_interface *interface, | NFC_PROTO_ISO14443_MASK | NFC_PROTO_NFC_DEP_MASK; - dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols); + dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols, + PN533_CMD_DATAEXCH_HEAD_LEN, + PN533_FRAME_TAIL_SIZE); if (!dev->nfc_dev) goto kill_tasklet; |