diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-01-26 19:18:12 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-01-27 17:39:32 -0500 |
commit | 118278f20aa89efe45fa1e2b1829f198d557f8fe (patch) | |
tree | edac7f90f582e3c29f13290a016f12b0068a4ff2 /net/nfc/hci/command.c | |
parent | fda7a49cb991e9da15f5955d1ea292f8ec74f27a (diff) |
NFC: hci: Add pipes table to reference them with a tuple {gate, host}
In order to keep host source information on specific hci event (such as
evt_connectivity or evt_transaction) and because 2 pipes can be connected
to the same gate, it is necessary to add a table referencing every pipe
with a {gate, host} tuple.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/hci/command.c')
-rw-r--r-- | net/nfc/hci/command.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/nfc/hci/command.c b/net/nfc/hci/command.c index 91df487aa0a9..9acf586c98d4 100644 --- a/net/nfc/hci/command.c +++ b/net/nfc/hci/command.c | |||
@@ -331,7 +331,7 @@ int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev) | |||
331 | if (r < 0) | 331 | if (r < 0) |
332 | return r; | 332 | return r; |
333 | 333 | ||
334 | memset(hdev->gate2pipe, NFC_HCI_INVALID_PIPE, sizeof(hdev->gate2pipe)); | 334 | nfc_hci_reset_pipes(hdev); |
335 | 335 | ||
336 | return 0; | 336 | return 0; |
337 | } | 337 | } |
@@ -345,7 +345,7 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, | |||
345 | 345 | ||
346 | pr_debug("\n"); | 346 | pr_debug("\n"); |
347 | 347 | ||
348 | if (hdev->gate2pipe[dest_gate] == NFC_HCI_DO_NOT_CREATE_PIPE) | 348 | if (pipe == NFC_HCI_DO_NOT_CREATE_PIPE) |
349 | return 0; | 349 | return 0; |
350 | 350 | ||
351 | if (hdev->gate2pipe[dest_gate] != NFC_HCI_INVALID_PIPE) | 351 | if (hdev->gate2pipe[dest_gate] != NFC_HCI_INVALID_PIPE) |
@@ -380,6 +380,8 @@ open_pipe: | |||
380 | return r; | 380 | return r; |
381 | } | 381 | } |
382 | 382 | ||
383 | hdev->pipes[pipe].gate = dest_gate; | ||
384 | hdev->pipes[pipe].dest_host = dest_host; | ||
383 | hdev->gate2pipe[dest_gate] = pipe; | 385 | hdev->gate2pipe[dest_gate] = pipe; |
384 | 386 | ||
385 | return 0; | 387 | return 0; |