aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@linux.intel.com>2012-09-11 10:43:50 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-25 00:17:25 +0200
commitf3e8fb552789f4845e60b11c47b676d14b9488e5 (patch)
tree8fde55db141d361952cbb190d9e59231e143157b /include/net
parentNFC: Add a public nfc_hci_send_cmd_async method (diff)
downloadlinux-dev-f3e8fb552789f4845e60b11c47b676d14b9488e5.tar.xz
linux-dev-f3e8fb552789f4845e60b11c47b676d14b9488e5.zip
NFC: Modified hci_transceive to become an asynchronous operation
This enables the completion callback to be called from a different context, preventing a possible deadlock if the callback resulted in the invocation of a nested call to the currently locked nfc_dev. This is also more in line with the im_transceive nfc_ops for NFC Core or NCI drivers which already behave asynchronously. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/nfc/hci.h8
-rw-r--r--include/net/nfc/shdlc.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 54ba2caab4a6..6cee6e21fc46 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -38,8 +38,8 @@ struct nfc_hci_ops {
int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate,
struct nfc_target *target);
int (*data_exchange) (struct nfc_hci_dev *hdev,
- struct nfc_target *target,
- struct sk_buff *skb, struct sk_buff **res_skb);
+ struct nfc_target *target, struct sk_buff *skb,
+ data_exchange_cb_t cb, void *cb_context);
int (*check_presence)(struct nfc_hci_dev *hdev,
struct nfc_target *target);
};
@@ -103,6 +103,10 @@ struct nfc_hci_dev {
u8 hw_mpw;
u8 hw_software;
u8 hw_bsid;
+
+ int async_cb_type;
+ data_exchange_cb_t async_cb;
+ void *async_cb_context;
};
/* hci device allocation */
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h
index 342427362989..fe5e19829352 100644
--- a/include/net/nfc/shdlc.h
+++ b/include/net/nfc/shdlc.h
@@ -34,8 +34,8 @@ struct nfc_shdlc_ops {
int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate,
struct nfc_target *target);
int (*data_exchange) (struct nfc_shdlc *shdlc,
- struct nfc_target *target,
- struct sk_buff *skb, struct sk_buff **res_skb);
+ struct nfc_target *target, struct sk_buff *skb,
+ data_exchange_cb_t cb, void *cb_context);
int (*check_presence)(struct nfc_shdlc *shdlc,
struct nfc_target *target);
};