aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/nci
diff options
context:
space:
mode:
authorJulien Lefrique <lefrique@marvell.com>2014-10-21 10:52:47 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-11-28 08:07:51 -0500
commit529ee06682a5691eec25991c506357caf7341c93 (patch)
tree1025657c5d49a9e6c2060765698774ea395da59d /net/nfc/nci
parenta99903ec4566eeeaaaf611499cae00abbe844938 (diff)
NFC: NCI: Configure ATR_RES general bytes
The Target responds to the ATR_REQ with the ATR_RES. Configure the General Bytes in ATR_RES with the first three octets equal to the NFC Forum LLCP magic number, followed by some LLC Parameters TLVs described in section 4.5 of [LLCP]. Signed-off-by: Julien Lefrique <lefrique@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/nci')
-rw-r--r--net/nfc/nci/core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 61f92678a64c..8f8bfdf145cb 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -460,6 +460,7 @@ static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev)
460{ 460{
461 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); 461 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
462 struct nci_set_config_param param; 462 struct nci_set_config_param param;
463 int rc;
463 464
464 param.val = nfc_get_local_general_bytes(nfc_dev, &param.len); 465 param.val = nfc_get_local_general_bytes(nfc_dev, &param.len);
465 if ((param.val == NULL) || (param.len == 0)) 466 if ((param.val == NULL) || (param.len == 0))
@@ -470,6 +471,13 @@ static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev)
470 471
471 param.id = NCI_PN_ATR_REQ_GEN_BYTES; 472 param.id = NCI_PN_ATR_REQ_GEN_BYTES;
472 473
474 rc = nci_request(ndev, nci_set_config_req, (unsigned long)&param,
475 msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT));
476 if (rc)
477 return rc;
478
479 param.id = NCI_LN_ATR_RES_GEN_BYTES;
480
473 return nci_request(ndev, nci_set_config_req, (unsigned long)&param, 481 return nci_request(ndev, nci_set_config_req, (unsigned long)&param,
474 msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT)); 482 msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT));
475} 483}
@@ -525,7 +533,7 @@ static int nci_start_poll(struct nfc_dev *nfc_dev,
525 return -EBUSY; 533 return -EBUSY;
526 } 534 }
527 535
528 if (im_protocols & NFC_PROTO_NFC_DEP_MASK) { 536 if ((im_protocols | tm_protocols) & NFC_PROTO_NFC_DEP_MASK) {
529 rc = nci_set_local_general_bytes(nfc_dev); 537 rc = nci_set_local_general_bytes(nfc_dev);
530 if (rc) { 538 if (rc) {
531 pr_err("failed to set local general bytes\n"); 539 pr_err("failed to set local general bytes\n");