All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Ricard <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	christophe-h.ricard-qxv4g6HH51o@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [RFC v2 12/14] NFC: nci: Change NCI state machine to LISTEN_ACTIVE and ignore parameters in rf_intf_activated_ntf
Date: Wed, 28 Jan 2015 21:17:29 +0100	[thread overview]
Message-ID: <1422476251-25972-13-git-send-email-christophe-h.ricard@st.com> (raw)
In-Reply-To: <1422476251-25972-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>

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.ricard-qxv4g6HH51o@public.gmane.org>
---
 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-01-28 20:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 20:17 [RFC v2 00/14] Secure Element support for NCI based NFC controller, st21nfcb integration and EVT_TRANSACTION Christophe Ricard
     [not found] ` <1422476251-25972-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-28 20:17   ` [RFC v2 01/14] NFC: nci: Add dynamic conn_id NCI concept Christophe Ricard
2015-01-28 20:17   ` [RFC v2 02/14] NFC: nci: Make nci_request available for nfc driver Christophe Ricard
2015-01-28 20:17   ` [RFC v2 03/14] NFC: nci: Add NCI NFCEE constant Christophe Ricard
2015-01-28 20:17   ` [RFC v2 04/14] NFC: nci: Add nci_nfcee_discover handler command/response/notification Christophe Ricard
2015-01-28 20:17   ` [RFC v2 05/14] NFC: nci: Add nci_nfcee_mode_set handler command/response Christophe Ricard
2015-01-28 20:17   ` [RFC v2 06/14] NFC: nci: Add nci_core_conn_create " Christophe Ricard
2015-01-28 20:17   ` [RFC v2 07/14] NFC: nci: Add nci_core_conn_close " Christophe Ricard
2015-01-28 20:17   ` [RFC v2 08/14] NFC: st21nfcb: Add HCI protocol over NCI protocol support Christophe Ricard
2015-01-28 20:17   ` [RFC v2 09/14] NFC: st21nfcb: Adding support for secure element Christophe Ricard
2015-01-28 20:17   ` [RFC v2 10/14] NFC: Forward NFC_EVT_TRANSACTION up to user space Christophe Ricard
2015-01-28 20:17   ` [RFC v2 11/14] NFC: nci: Add support RF_NFCEE_ACTION_NTF Christophe Ricard
2015-01-28 20:17   ` Christophe Ricard [this message]
2015-01-28 20:17   ` [RFC v2 13/14] NFC: st21nfcb: Add support for HCI event transaction Christophe Ricard
2015-01-28 20:17   ` [RFC v2 14/14] NFC: st21nfca: " Christophe Ricard
2015-01-28 21:11   ` [RFC v2 00/14] Secure Element support for NCI based NFC controller, st21nfcb integration and EVT_TRANSACTION christophe.ricard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422476251-25972-13-git-send-email-christophe-h.ricard@st.com \
    --to=christophe.ricard-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=christophe-h.ricard-qxv4g6HH51o@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfc-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.