Skip to content

Commit 456411c

Browse files
Eric Lapuyadelinvjw
authored andcommitted
NFC: Driver failure API
This API should be used by drivers, HCI, SHDLC or NCI stacks to report an unrecoverable error. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 6c1c5b9 commit 456411c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎include/net/nfc/nfc.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,6 @@ int nfc_tm_activated(struct nfc_dev *dev, u32 protocol, u8 comm_mode,
204204
int nfc_tm_deactivated(struct nfc_dev *dev);
205205
int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb);
206206

207+
void nfc_driver_failure(struct nfc_dev *dev, int err);
208+
207209
#endif /* __NET_NFC_H */

‎net/nfc/core.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,16 @@ int nfc_target_lost(struct nfc_dev *dev, u32 target_idx)
651651
}
652652
EXPORT_SYMBOL(nfc_target_lost);
653653

654+
void nfc_driver_failure(struct nfc_dev *dev, int err)
655+
{
656+
/*
657+
* TODO: if polling is active, send empty target_found
658+
* or else do whatever makes sense to let user space
659+
* know this device needs to be closed and reinitialized.
660+
*/
661+
}
662+
EXPORT_SYMBOL(nfc_driver_failure);
663+
654664
static void nfc_release(struct device *d)
655665
{
656666
struct nfc_dev *dev = to_nfc_dev(d);

0 commit comments

Comments
 (0)