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

Commit a070c859 authored by Eric Lapuyade's avatar Eric Lapuyade Committed by John W. Linville
Browse files

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: default avatarEric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent ccca0d6e
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -736,10 +736,17 @@ EXPORT_SYMBOL(nfc_hci_get_clientdata);


static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err)
static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err)
{
{
	/*
	mutex_lock(&hdev->msg_tx_mutex);
	 * TODO: lower layer has permanent failure.

	 * complete potential HCI command or send an empty tag discovered event
	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)
void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err)