Lines Matching defs:pipe
19 static int nfc_hci_execute_cmd_async(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd,
23 pr_debug("exec cmd async through pipe=%d, cmd=%d, plen=%zd\n", pipe,
29 return nfc_hci_hcp_message_tx(hdev, pipe, NFC_HCI_HCP_COMMAND, cmd,
55 static int nfc_hci_execute_cmd(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd,
65 pr_debug("exec cmd sync through pipe=%d, cmd=%d, plen=%zd\n", pipe,
71 hcp_ew.exec_result = nfc_hci_hcp_message_tx(hdev, pipe,
94 u8 pipe;
98 pipe = hdev->gate2pipe[gate];
99 if (pipe == NFC_HCI_INVALID_PIPE)
102 return nfc_hci_hcp_message_tx(hdev, pipe, NFC_HCI_HCP_EVENT, event,
115 u8 pipe;
119 pipe = hdev->gate2pipe[gate];
120 if (pipe == NFC_HCI_INVALID_PIPE)
123 return nfc_hci_execute_cmd(hdev, pipe, cmd, param, param_len, skb);
131 u8 pipe;
135 pipe = hdev->gate2pipe[gate];
136 if (pipe == NFC_HCI_INVALID_PIPE)
139 return nfc_hci_execute_cmd_async(hdev, pipe, cmd, param, param_len,
186 static int nfc_hci_open_pipe(struct nfc_hci_dev *hdev, u8 pipe)
191 pr_debug("pipe=%d\n", pipe);
193 r = nfc_hci_execute_cmd(hdev, pipe, NFC_HCI_ANY_OPEN_PIPE,
206 static int nfc_hci_close_pipe(struct nfc_hci_dev *hdev, u8 pipe)
210 return nfc_hci_execute_cmd(hdev, pipe, NFC_HCI_ANY_CLOSE_PIPE,
220 u8 pipe;
235 pipe = resp->pipe;
238 pr_debug("pipe created=%d\n", pipe);
240 return pipe;
243 static int nfc_hci_delete_pipe(struct nfc_hci_dev *hdev, u8 pipe)
248 NFC_HCI_ADM_DELETE_PIPE, &pipe, 1, NULL);
272 u8 pipe = hdev->gate2pipe[gate];
276 if (pipe == NFC_HCI_INVALID_PIPE)
279 r = nfc_hci_close_pipe(hdev, pipe);
283 if (pipe != NFC_HCI_LINK_MGMT_PIPE && pipe != NFC_HCI_ADMIN_PIPE) {
284 r = nfc_hci_delete_pipe(hdev, pipe);
312 u8 pipe)
319 if (pipe == NFC_HCI_DO_NOT_CREATE_PIPE)
325 if (pipe != NFC_HCI_INVALID_PIPE)
330 pipe = NFC_HCI_LINK_MGMT_PIPE;
333 pipe = NFC_HCI_ADMIN_PIPE;
336 pipe = nfc_hci_create_pipe(hdev, dest_host, dest_gate, &r);
337 if (pipe == NFC_HCI_INVALID_PIPE)
344 r = nfc_hci_open_pipe(hdev, pipe);
347 if (nfc_hci_delete_pipe(hdev, pipe) < 0) {
348 /* TODO: Cannot clean by deleting pipe...
354 hdev->pipes[pipe].gate = dest_gate;
355 hdev->pipes[pipe].dest_host = dest_host;
356 hdev->gate2pipe[dest_gate] = pipe;