[PATCH] NFC: Add error mapping for Directed Advertising DISCOVERY_TEAR_DOWN

From: Meng Tang
Date: Thu Apr 28 2022 - 21:57:11 EST


When a DISCOVERY_TEAR_DOWN occurs. Since the operation is analogous
to conventional connection creation map this to the usual ENOLINK
error.

Signed-off-by: Meng Tang <tangmeng@xxxxxxxxxxxxx>
---
net/nfc/nci/lib.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/nfc/nci/lib.c b/net/nfc/nci/lib.c
index 473323f8067b..873854c5d180 100644
--- a/net/nfc/nci/lib.c
+++ b/net/nfc/nci/lib.c
@@ -57,6 +57,9 @@ int nci_to_errno(__u8 code)
case NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED:
return -ECONNREFUSED;

+ case NCI_STATUS_DISCOVERY_TEAR_DOWN:
+ return -ENOLINK;
+
case NCI_STATUS_RF_TRANSMISSION_ERROR:
case NCI_STATUS_NFCEE_TRANSMISSION_ERROR:
return -ECOMM;
--
2.20.1