aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/hci/core.c
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@intel.com>2012-06-11 09:06:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:09 -0400
commita070c8591a503ec65e2c84ebaf3454e5cd76e3fe (patch)
treebe16371429ff295074de0b88e8285c9fa27ff59a /net/nfc/hci/core.c
parentccca0d6e8805f12fcda2e740c44afa7191923559 (diff)
NFC: Implement HCI driver or internal error management
If there is an ongoing HCI command executing, it will be completed, thereby pushing the error up to the core. Otherwise, HCI will directly notify the core with the error. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/hci/core.c')
-rw-r--r--net/nfc/hci/core.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 9a1a12f8687..e6b2df3981b 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -736,10 +736,17 @@ EXPORT_SYMBOL(nfc_hci_get_clientdata);
736 736
737static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err) 737static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err)
738{ 738{
739 /* 739 mutex_lock(&hdev->msg_tx_mutex);
740 * TODO: lower layer has permanent failure. 740
741 * complete potential HCI command or send an empty tag discovered event 741 if (hdev->cmd_pending_msg == NULL) {
742 */ 742 nfc_driver_failure(hdev->ndev, err);
743 goto exit;
744 }
745
746 __nfc_hci_cmd_completion(hdev, err, NULL);
747
748exit:
749 mutex_unlock(&hdev->msg_tx_mutex);
743} 750}
744 751
745void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err) 752void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err)