Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351878
b: refs/heads/master
c: 15461ae
h: refs/heads/master
v: v3
  • Loading branch information
Waldemar Rymarkiewicz authored and Samuel Ortiz committed Jan 9, 2013
1 parent 844c20c commit 7ae54e6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aada17ac70e33b127c8f8dd425fc735cc0d30e25
refs/heads/master: 15461aeb53ae2d3bbde6b374de913e3df81d1ad0
31 changes: 31 additions & 0 deletions trunk/drivers/nfc/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ MODULE_DEVICE_TABLE(usb, pn533_table);
+ 2) /* data[0] TFI, data[1] CC */
#define PN533_FRAME_TAIL_LEN 2 /* data[len] DCS, data[len + 1] postamble*/

/*
* Max extended frame payload len, excluding TFI and CC
* which are already in PN533_FRAME_HEADER_LEN.
*/
#define PN533_FRAME_MAX_PAYLOAD_LEN 263

#define PN533_FRAME_SIZE(f) (sizeof(struct pn533_frame) + f->datalen + \
PN533_FRAME_TAIL_LEN)
#define PN533_FRAME_ACK_SIZE (sizeof(struct pn533_frame) + 1)
Expand Down Expand Up @@ -807,6 +813,31 @@ static int __pn533_send_async(struct pn533 *dev, u8 cmd_code,
return rc;
}

static int pn533_send_data_async(struct pn533 *dev, u8 cmd_code,
struct sk_buff *req,
pn533_send_async_complete_t complete_cb,
void *complete_cb_context)
{
struct sk_buff *resp;
int rc;
int resp_len = PN533_FRAME_HEADER_LEN +
PN533_FRAME_MAX_PAYLOAD_LEN +
PN533_FRAME_TAIL_LEN;

nfc_dev_dbg(&dev->interface->dev, "%s", __func__);

resp = nfc_alloc_recv_skb(resp_len, GFP_KERNEL);
if (!resp)
return -ENOMEM;

rc = __pn533_send_async(dev, cmd_code, req, resp, resp_len, complete_cb,
complete_cb_context);
if (rc)
dev_kfree_skb(resp);

return rc;
}

static int pn533_send_cmd_async(struct pn533 *dev, u8 cmd_code,
struct sk_buff *req,
pn533_send_async_complete_t complete_cb,
Expand Down

0 comments on commit 7ae54e6

Please sign in to comment.