Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278964
b: refs/heads/master
c: 541d920
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Dec 14, 2011
1 parent c47ead7 commit 64e23ab
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ed28f610653e9b18433c6d87e9d333b7e3e886e
refs/heads/master: 541d920b05b538ec0d9ae8ce619ee4fc6fb19e32
7 changes: 6 additions & 1 deletion trunk/drivers/nfc/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ static int pn533_activate_target_nfcdep(struct pn533 *dev)
{
struct pn533_cmd_activate_param param;
struct pn533_cmd_activate_response *resp;
u16 gt_len;
int rc;

nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
Expand All @@ -1146,7 +1147,11 @@ static int pn533_activate_target_nfcdep(struct pn533 *dev)
if (rc != PN533_CMD_RET_SUCCESS)
return -EIO;

return 0;
/* ATR_RES general bytes are located at offset 16 */
gt_len = PN533_FRAME_CMD_PARAMS_LEN(dev->in_frame) - 16;
rc = nfc_set_remote_general_bytes(dev->nfc_dev, resp->gt, gt_len);

return rc;
}

static int pn533_activate_target(struct nfc_dev *nfc_dev, u32 target_idx,
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/net/nfc/nfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk,
unsigned int *err);
struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp);

int nfc_set_remote_general_bytes(struct nfc_dev *dev,
u8 *gt, u8 gt_len);

u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, u8 *gt_len);

int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
int ntargets);

Expand Down
18 changes: 18 additions & 0 deletions trunk/net/nfc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,24 @@ int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx,
return rc;
}

int nfc_set_remote_general_bytes(struct nfc_dev *dev, u8 *gb, u8 gb_len)
{
pr_debug("dev_name=%s gb_len=%d\n",
dev_name(&dev->dev), gb_len);

if (gb_len > NFC_MAX_GT_LEN)
return -EINVAL;

return 0;
}
EXPORT_SYMBOL(nfc_set_remote_general_bytes);

u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, u8 *gt_len)
{
return NULL;
}
EXPORT_SYMBOL(nfc_get_local_general_bytes);

/**
* nfc_alloc_send_skb - allocate a skb for data exchange responses
*
Expand Down

0 comments on commit 64e23ab

Please sign in to comment.