When receiving a intf_activated notification, if the rf interface is
NCI_RF_INTERFACE_NFCEE_DIRECT, we need to ignore the next parameters and
change the NCI state machine to NCI_LISTEN_ACTIVE.

Signed-off-by: Christophe Ricard <christophe-h.ric...@st.com>
---
 net/nfc/nci/ntf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 4cdb95d..19eaf52 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -545,6 +545,13 @@ static void nci_rf_intf_activated_ntf_packet(struct 
nci_dev *ndev,
        pr_debug("rf_tech_specific_params_len %d\n",
                 ntf.rf_tech_specific_params_len);
 
+       /* If this contains a value of 0x00 (NFCEE Direct RF
+        * Interface) then all following parameters SHALL contain a
+        * value of 0 and SHALL be ignored.
+        */
+       if (ntf.rf_interface == NCI_RF_INTERFACE_NFCEE_DIRECT)
+               goto listen;
+
        if (ntf.rf_tech_specific_params_len > 0) {
                switch (ntf.activation_rf_tech_and_mode) {
                case NCI_NFC_A_PASSIVE_POLL_MODE:
@@ -660,6 +667,7 @@ exit:
                        nci_req_complete(ndev, err);
                }
        } else {
+listen:
                /* Listen mode */
                atomic_set(&ndev->state, NCI_LISTEN_ACTIVE);
                if (err == NCI_STATUS_OK &&
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to