diff options
author | Julien Lefrique <lefrique@marvell.com> | 2014-10-21 10:52:45 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-11-28 08:07:51 -0500 |
commit | 90d78c13965859d87622b37a221ebf29522585a8 (patch) | |
tree | b5108f476203b2983b923d66c730bae447c38e73 /net/nfc | |
parent | 772dccf4a73bdb51a7628263a42347973a06a295 (diff) |
NFC: NCI: Enable NFC-DEP in Listen A and Listen F
Send LA_SEL_INFO and LF_PROTOCOL_TYPE with NFC-DEP protocol enabled.
Configure 212 Kbit/s and 412 Kbit/s bit rates for Listen F.
Signed-off-by: Julien Lefrique <lefrique@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/nci/core.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index d376e4abe0f2..61f92678a64c 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -474,6 +474,29 @@ static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev) | |||
474 | msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT)); | 474 | msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT)); |
475 | } | 475 | } |
476 | 476 | ||
477 | static int nci_set_listen_parameters(struct nfc_dev *nfc_dev) | ||
478 | { | ||
479 | struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); | ||
480 | int rc; | ||
481 | __u8 val; | ||
482 | |||
483 | val = NCI_LA_SEL_INFO_NFC_DEP_MASK; | ||
484 | |||
485 | rc = nci_set_config(ndev, NCI_LA_SEL_INFO, 1, &val); | ||
486 | if (rc) | ||
487 | return rc; | ||
488 | |||
489 | val = NCI_LF_PROTOCOL_TYPE_NFC_DEP_MASK; | ||
490 | |||
491 | rc = nci_set_config(ndev, NCI_LF_PROTOCOL_TYPE, 1, &val); | ||
492 | if (rc) | ||
493 | return rc; | ||
494 | |||
495 | val = NCI_LF_CON_BITR_F_212 | NCI_LF_CON_BITR_F_424; | ||
496 | |||
497 | return nci_set_config(ndev, NCI_LF_CON_BITR_F, 1, &val); | ||
498 | } | ||
499 | |||
477 | static int nci_start_poll(struct nfc_dev *nfc_dev, | 500 | static int nci_start_poll(struct nfc_dev *nfc_dev, |
478 | __u32 im_protocols, __u32 tm_protocols) | 501 | __u32 im_protocols, __u32 tm_protocols) |
479 | { | 502 | { |
@@ -510,6 +533,12 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, | |||
510 | } | 533 | } |
511 | } | 534 | } |
512 | 535 | ||
536 | if (tm_protocols & NFC_PROTO_NFC_DEP_MASK) { | ||
537 | rc = nci_set_listen_parameters(nfc_dev); | ||
538 | if (rc) | ||
539 | pr_err("failed to set listen parameters\n"); | ||
540 | } | ||
541 | |||
513 | param.im_protocols = im_protocols; | 542 | param.im_protocols = im_protocols; |
514 | param.tm_protocols = tm_protocols; | 543 | param.tm_protocols = tm_protocols; |
515 | rc = nci_request(ndev, nci_rf_discover_req, (unsigned long)¶m, | 544 | rc = nci_request(ndev, nci_rf_discover_req, (unsigned long)¶m, |