NFC: nci: Call nci_hci_clear_all_pipes at HCI initial activation.
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Oct 2015 21:54:24 +0000 (22:54 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Oct 2015 05:53:13 +0000 (06:53 +0100)
When session_id is filled to 0xff, the pipe configuration is
probably incorrect and needs to be cleared.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/nci/hci.c

index 6f477d21adfd5ef2b5d1ea38591905766b06dc59..af401fff72d92726219acbf56af885c00f8d9573 100644 (file)
@@ -706,6 +706,10 @@ int nci_hci_dev_session_init(struct nci_dev *ndev)
                /* Restore gate<->pipe table from some proprietary location. */
                r = ndev->ops->hci_load_session(ndev);
        } else {
+               r = nci_hci_clear_all_pipes(ndev);
+               if (r < 0)
+                       goto exit;
+
                r = nci_hci_dev_connect_gates(ndev,
                                              ndev->hci_dev->init_data.gate_count,
                                              ndev->hci_dev->init_data.gates);