diff options
author | Eric Lapuyade <eric.lapuyade@linux.intel.com> | 2012-09-11 04:43:50 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-09-24 18:17:25 -0400 |
commit | f3e8fb552789f4845e60b11c47b676d14b9488e5 (patch) | |
tree | 8fde55db141d361952cbb190d9e59231e143157b /include/net/nfc | |
parent | e4c4789e55327e5f2bd6cafcccd46f9b6251bbc3 (diff) |
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/nfc')
-rw-r--r-- | include/net/nfc/hci.h | 8 | ||||
-rw-r--r-- | include/net/nfc/shdlc.h | 4 |
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 { | |||
38 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 38 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
39 | struct nfc_target *target); | 39 | struct nfc_target *target); |
40 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 40 | int (*data_exchange) (struct nfc_hci_dev *hdev, |
41 | struct nfc_target *target, | 41 | struct nfc_target *target, struct sk_buff *skb, |
42 | struct sk_buff *skb, struct sk_buff **res_skb); | 42 | data_exchange_cb_t cb, void *cb_context); |
43 | int (*check_presence)(struct nfc_hci_dev *hdev, | 43 | int (*check_presence)(struct nfc_hci_dev *hdev, |
44 | struct nfc_target *target); | 44 | struct nfc_target *target); |
45 | }; | 45 | }; |
@@ -103,6 +103,10 @@ struct nfc_hci_dev { | |||
103 | u8 hw_mpw; | 103 | u8 hw_mpw; |
104 | u8 hw_software; | 104 | u8 hw_software; |
105 | u8 hw_bsid; | 105 | u8 hw_bsid; |
106 | |||
107 | int async_cb_type; | ||
108 | data_exchange_cb_t async_cb; | ||
109 | void *async_cb_context; | ||
106 | }; | 110 | }; |
107 | 111 | ||
108 | /* hci device allocation */ | 112 | /* 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 { | |||
34 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, | 34 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, |
35 | struct nfc_target *target); | 35 | struct nfc_target *target); |
36 | int (*data_exchange) (struct nfc_shdlc *shdlc, | 36 | int (*data_exchange) (struct nfc_shdlc *shdlc, |
37 | struct nfc_target *target, | 37 | struct nfc_target *target, struct sk_buff *skb, |
38 | struct sk_buff *skb, struct sk_buff **res_skb); | 38 | data_exchange_cb_t cb, void *cb_context); |
39 | int (*check_presence)(struct nfc_shdlc *shdlc, | 39 | int (*check_presence)(struct nfc_shdlc *shdlc, |
40 | struct nfc_target *target); | 40 | struct nfc_target *target); |
41 | }; | 41 | }; |