NFC: hci: Add specific hci macro to not create a pipe
authorChristophe Ricard <christophe.ricard@gmail.com>
Tue, 2 Dec 2014 20:27:52 +0000 (21:27 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 2 Dec 2014 21:48:13 +0000 (22:48 +0100)
Some pipe are only created by other host (different than the
Terminal Host).
The pipe values will for example be notified by
NFC_HCI_ADM_NOTIFY_PIPE_CREATED.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
include/net/nfc/hci.h
net/nfc/hci/command.c

index 50bc66f0121f3feb838e5293c2611f2736fa426b..14bd0e1c47fae31ba0ae70669dde92741a81cc64 100644 (file)
@@ -64,6 +64,7 @@ struct nfc_hci_ops {
 
 /* Pipes */
 #define NFC_HCI_INVALID_PIPE   0x80
+#define NFC_HCI_DO_NOT_CREATE_PIPE     0x81
 #define NFC_HCI_LINK_MGMT_PIPE 0x00
 #define NFC_HCI_ADMIN_PIPE     0x01
 
index 677d24bb70f8af24569ef574404ba4b1b9e1c9f0..91df487aa0a9cf2a69f368a9211e80efcc06b012 100644 (file)
@@ -345,6 +345,9 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate,
 
        pr_debug("\n");
 
+       if (hdev->gate2pipe[dest_gate] == NFC_HCI_DO_NOT_CREATE_PIPE)
+               return 0;
+
        if (hdev->gate2pipe[dest_gate] != NFC_HCI_INVALID_PIPE)
                return -EADDRINUSE;