Skip to contentSkip to conversation

NFC: Add error mapping for Directed Advertising DISCOVERY_TEAR_DOWN

PATCH In review Meng Tang 2 participants 2 messages Apr 29, 2022

Subsystems (3)
lore
Share & tools
lore

Meng Tang

author
#0 lore raw

PATCH 1/1 NFC: Add error mapping for Directed Advertising DISCOVERY_TEAR_DOWN

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

---
 net/nfc/nci/lib.c | 3 +++
 1 file changed, 3 insertions(+)
net/nfc/nci/lib.c +3 -0
index 473323f8067b..873854c5d180 100644
@@ -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;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 14 lines · Meng Tang

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

---
 net/nfc/nci/lib.c | 3 +++
 1 file changed, 3 insertions(+)
net/nfc/nci/lib.c +0 -0
index 473323f8067b..873854c5d180 100644

net/nfc/nci/lib.c int nci_to_errno(__u8 code) · line 60

Quoted 4 lines
net/nfc/nci/lib.c +1 -0
@@ -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:

This define is not used. At least I could not find it, so maybe instead it should be entirely dropped.

Best regards,
Krzysztof