aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-08-19 09:47:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 14:41:44 -0400
commite8753043f9fbabffbf087c7f4b514c50ef89541e (patch)
tree2c4b382a21500c228005a43e48134d39fdcccbe8 /drivers/nfc
parent4e0d8cc1006b889909a87f824943bad9a56358e8 (diff)
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.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index c77e0543e502..f81a93e5b59d 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)
1246{ 1246{
1247 int payload_len = skb->len; 1247 int payload_len = skb->len;
1248 struct pn533_frame *out_frame; 1248 struct pn533_frame *out_frame;
1249 struct sk_buff *discarded;
1250 u8 tg; 1249 u8 tg;
1251 1250
1252 nfc_dev_dbg(&dev->interface->dev, "%s - Sending %d bytes", __func__, 1251 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)
1260 return -ENOSYS; 1259 return -ENOSYS;
1261 } 1260 }
1262 1261
1263 /* Reserving header space */
1264 if (skb_cow_head(skb, PN533_CMD_DATAEXCH_HEAD_LEN)) {
1265 nfc_dev_err(&dev->interface->dev, "Error to add header data");
1266 return -ENOMEM;
1267 }
1268
1269 /* Reserving tail space, see pn533_tx_frame_finish */
1270 if (skb_cow_data(skb, PN533_FRAME_TAIL_SIZE, &discarded) < 0) {
1271 nfc_dev_err(&dev->interface->dev, "Error to add tail data");
1272 return -ENOMEM;
1273 }
1274
1275 skb_push(skb, PN533_CMD_DATAEXCH_HEAD_LEN); 1262 skb_push(skb, PN533_CMD_DATAEXCH_HEAD_LEN);
1276 out_frame = (struct pn533_frame *) skb->data; 1263 out_frame = (struct pn533_frame *) skb->data;
1277 1264
@@ -1536,7 +1523,9 @@ static int pn533_probe(struct usb_interface *interface,
1536 | NFC_PROTO_ISO14443_MASK 1523 | NFC_PROTO_ISO14443_MASK
1537 | NFC_PROTO_NFC_DEP_MASK; 1524 | NFC_PROTO_NFC_DEP_MASK;
1538 1525
1539 dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols); 1526 dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols,
1527 PN533_CMD_DATAEXCH_HEAD_LEN,
1528 PN533_FRAME_TAIL_SIZE);
1540 if (!dev->nfc_dev) 1529 if (!dev->nfc_dev)
1541 goto kill_tasklet; 1530 goto kill_tasklet;
1542 1531