20 #define pr_fmt(fmt) "hci: %s: " fmt, __func__
23 #include <linux/kernel.h>
24 #include <linux/sched.h>
25 #include <linux/module.h>
32 const u8 *
param,
size_t param_len,
35 pr_debug(
"exec cmd async through pipe=%d, cmd=%d, plen=%zd\n", pipe,
42 param, param_len, cb, cb_context, 3000);
55 pr_debug(
"HCI Cmd completed with result=%d\n", err);
68 const u8 *
param,
size_t param_len,
77 pr_debug(
"exec cmd sync through pipe=%d, cmd=%d, plen=%zd\n", pipe,
86 nfc_hci_execute_cb, &hcp_ew,
104 const u8 *param,
size_t param_len)
108 pr_debug(
"%d to gate %d\n", event, gate);
120 const u8 *param,
size_t param_len)
131 response, param, param_len,
NULL,
NULL,
142 const u8 *param,
size_t param_len,
struct sk_buff **skb)
152 return nfc_hci_execute_cmd(hdev, pipe, cmd, param, param_len, skb);
157 const u8 *param,
size_t param_len,
168 return nfc_hci_execute_cmd_async(hdev, pipe, cmd, param, param_len,
174 const u8 *param,
size_t param_len)
187 pr_debug(
"idx=%d to gate %d\n", idx, gate);
194 memcpy(tmp + 1, param, param_len);
197 tmp, param_len + 1,
NULL);
208 pr_debug(
"gate=%d regidx=%d\n", gate, idx);
215 static int nfc_hci_open_pipe(
struct nfc_hci_dev *hdev,
u8 pipe)
235 static int nfc_hci_close_pipe(
struct nfc_hci_dev *hdev,
u8 pipe)
265 pr_debug(
"pipe created=%d\n", pipe);
272 static int nfc_hci_delete_pipe(
struct nfc_hci_dev *hdev,
u8 pipe)
280 static int nfc_hci_clear_all_pipes(
struct nfc_hci_dev *hdev)
307 r = nfc_hci_close_pipe(hdev, pipe);
312 r = nfc_hci_delete_pipe(hdev, pipe);
329 r = nfc_hci_clear_all_pipes(hdev);
342 bool pipe_created =
false;
361 pipe = nfc_hci_create_pipe(hdev, dest_host, dest_gate, &r);
368 r = nfc_hci_open_pipe(hdev, pipe);
371 if (nfc_hci_delete_pipe(hdev, pipe) < 0) {