diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-10-25 17:54:23 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-10-26 01:53:12 -0400 |
commit | fa6fbadea5d3618339fae8f9d5136a470bad4fa7 (patch) | |
tree | 00c9d30f720c9c90cddfbe19c56a3cec24cba215 /net/nfc | |
parent | e65917b6d54f8b47d8293ea96adfa604fd46cf0d (diff) |
NFC: nci: add nci_hci_clear_all_pipes functions
nci_hci_clear_all_pipes might be use full in some cases
for example after a firmware update.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/nci/hci.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index 30b09f04c142..6f477d21adfd 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c | |||
@@ -70,6 +70,7 @@ struct nci_hcp_packet { | |||
70 | #define NCI_HCI_ANY_SET_PARAMETER 0x01 | 70 | #define NCI_HCI_ANY_SET_PARAMETER 0x01 |
71 | #define NCI_HCI_ANY_GET_PARAMETER 0x02 | 71 | #define NCI_HCI_ANY_GET_PARAMETER 0x02 |
72 | #define NCI_HCI_ANY_CLOSE_PIPE 0x04 | 72 | #define NCI_HCI_ANY_CLOSE_PIPE 0x04 |
73 | #define NCI_HCI_ADM_CLEAR_ALL_PIPE 0x14 | ||
73 | 74 | ||
74 | #define NCI_HFP_NO_CHAINING 0x80 | 75 | #define NCI_HFP_NO_CHAINING 0x80 |
75 | 76 | ||
@@ -267,6 +268,20 @@ int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate, u8 cmd, | |||
267 | } | 268 | } |
268 | EXPORT_SYMBOL(nci_hci_send_cmd); | 269 | EXPORT_SYMBOL(nci_hci_send_cmd); |
269 | 270 | ||
271 | int nci_hci_clear_all_pipes(struct nci_dev *ndev) | ||
272 | { | ||
273 | int r; | ||
274 | |||
275 | r = nci_hci_send_cmd(ndev, NCI_HCI_ADMIN_GATE, | ||
276 | NCI_HCI_ADM_CLEAR_ALL_PIPE, NULL, 0, NULL); | ||
277 | if (r < 0) | ||
278 | return r; | ||
279 | |||
280 | nci_hci_reset_pipes(ndev->hci_dev); | ||
281 | return r; | ||
282 | } | ||
283 | EXPORT_SYMBOL(nci_hci_clear_all_pipes); | ||
284 | |||
270 | static void nci_hci_event_received(struct nci_dev *ndev, u8 pipe, | 285 | static void nci_hci_event_received(struct nci_dev *ndev, u8 pipe, |
271 | u8 event, struct sk_buff *skb) | 286 | u8 event, struct sk_buff *skb) |
272 | { | 287 | { |