Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6095b0f0 authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz
Browse files

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: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent a41bb844
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -541,6 +541,13 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
	pr_debug("rf_tech_specific_params_len %d\n",
	pr_debug("rf_tech_specific_params_len %d\n",
		 ntf.rf_tech_specific_params_len);
		 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) {
	if (ntf.rf_tech_specific_params_len > 0) {
		switch (ntf.activation_rf_tech_and_mode) {
		switch (ntf.activation_rf_tech_and_mode) {
		case NCI_NFC_A_PASSIVE_POLL_MODE:
		case NCI_NFC_A_PASSIVE_POLL_MODE:
@@ -653,6 +660,7 @@ exit:
			nci_req_complete(ndev, err);
			nci_req_complete(ndev, err);
		}
		}
	} else {
	} else {
listen:
		/* Listen mode */
		/* Listen mode */
		atomic_set(&ndev->state, NCI_LISTEN_ACTIVE);
		atomic_set(&ndev->state, NCI_LISTEN_ACTIVE);
		if (err == NCI_STATUS_OK &&
		if (err == NCI_STATUS_OK &&