Skip to content

Commit

Permalink
NFC: Implement HCI driver or internal error management
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Lapuyade authored and John W. Linville committed Jul 9, 2012
1 parent ccca0d6 commit a070c85
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions net/nfc/hci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,17 @@ EXPORT_SYMBOL(nfc_hci_get_clientdata);

static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err)
{
/*
* TODO: lower layer has permanent failure.
* complete potential HCI command or send an empty tag discovered event
*/
mutex_lock(&hdev->msg_tx_mutex);

if (hdev->cmd_pending_msg == NULL) {
nfc_driver_failure(hdev->ndev, err);
goto exit;
}

__nfc_hci_cmd_completion(hdev, err, NULL);

exit:
mutex_unlock(&hdev->msg_tx_mutex);
}

void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err)
Expand Down

0 comments on commit a070c85

Please sign in to comment.