diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-02-01 16:26:18 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-02-02 15:50:41 -0500 |
commit | 6095b0f07d9b1abd98484bc33b329e06a684115b (patch) | |
tree | 240844d301f05ff5e2a77a0fdddeb585f26ad2a1 | |
parent | a41bb8448ebaebe1d0d9a268d340fad73c247e09 (diff) |
NFC: nci: Change NCI state machine to LISTEN_ACTIVE
When receiving an interface activation notification, if
the RF interface is NCI_RF_INTERFACE_NFCEE_DIRECT, we
need to ignore the following parameters and change the NCI
state machine to NCI_LISTEN_ACTIVE. According to the NCI
specification, the parameters should be 0 and shall be
ignored.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | net/nfc/nci/ntf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index 5924b812fb6a..33f5f00ecf4c 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c | |||
@@ -541,6 +541,13 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, | |||
541 | pr_debug("rf_tech_specific_params_len %d\n", | 541 | pr_debug("rf_tech_specific_params_len %d\n", |
542 | ntf.rf_tech_specific_params_len); | 542 | ntf.rf_tech_specific_params_len); |
543 | 543 | ||
544 | /* If this contains a value of 0x00 (NFCEE Direct RF | ||
545 | * Interface) then all following parameters SHALL contain a | ||
546 | * value of 0 and SHALL be ignored. | ||
547 | */ | ||
548 | if (ntf.rf_interface == NCI_RF_INTERFACE_NFCEE_DIRECT) | ||
549 | goto listen; | ||
550 | |||
544 | if (ntf.rf_tech_specific_params_len > 0) { | 551 | if (ntf.rf_tech_specific_params_len > 0) { |
545 | switch (ntf.activation_rf_tech_and_mode) { | 552 | switch (ntf.activation_rf_tech_and_mode) { |
546 | case NCI_NFC_A_PASSIVE_POLL_MODE: | 553 | case NCI_NFC_A_PASSIVE_POLL_MODE: |
@@ -653,6 +660,7 @@ exit: | |||
653 | nci_req_complete(ndev, err); | 660 | nci_req_complete(ndev, err); |
654 | } | 661 | } |
655 | } else { | 662 | } else { |
663 | listen: | ||
656 | /* Listen mode */ | 664 | /* Listen mode */ |
657 | atomic_set(&ndev->state, NCI_LISTEN_ACTIVE); | 665 | atomic_set(&ndev->state, NCI_LISTEN_ACTIVE); |
658 | if (err == NCI_STATUS_OK && | 666 | if (err == NCI_STATUS_OK && |