diff options
Diffstat (limited to 'include/net/nfc/hci.h')
-rw-r--r-- | include/net/nfc/hci.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 14bd0e1c47fa..ab672b537dd4 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -51,8 +51,10 @@ struct nfc_hci_ops { | |||
51 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | 51 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); |
52 | int (*check_presence)(struct nfc_hci_dev *hdev, | 52 | int (*check_presence)(struct nfc_hci_dev *hdev, |
53 | struct nfc_target *target); | 53 | struct nfc_target *target); |
54 | int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 54 | int (*event_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 event, |
55 | struct sk_buff *skb); | 55 | struct sk_buff *skb); |
56 | void (*cmd_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, | ||
57 | struct sk_buff *skb); | ||
56 | int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name); | 58 | int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name); |
57 | int (*discover_se)(struct nfc_hci_dev *dev); | 59 | int (*discover_se)(struct nfc_hci_dev *dev); |
58 | int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); | 60 | int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); |
@@ -63,8 +65,10 @@ struct nfc_hci_ops { | |||
63 | }; | 65 | }; |
64 | 66 | ||
65 | /* Pipes */ | 67 | /* Pipes */ |
66 | #define NFC_HCI_INVALID_PIPE 0x80 | ||
67 | #define NFC_HCI_DO_NOT_CREATE_PIPE 0x81 | 68 | #define NFC_HCI_DO_NOT_CREATE_PIPE 0x81 |
69 | #define NFC_HCI_INVALID_PIPE 0x80 | ||
70 | #define NFC_HCI_INVALID_GATE 0xFF | ||
71 | #define NFC_HCI_INVALID_HOST 0x80 | ||
68 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 | 72 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 |
69 | #define NFC_HCI_ADMIN_PIPE 0x01 | 73 | #define NFC_HCI_ADMIN_PIPE 0x01 |
70 | 74 | ||
@@ -73,7 +77,13 @@ struct nfc_hci_gate { | |||
73 | u8 pipe; | 77 | u8 pipe; |
74 | }; | 78 | }; |
75 | 79 | ||
80 | struct nfc_hci_pipe { | ||
81 | u8 gate; | ||
82 | u8 dest_host; | ||
83 | }; | ||
84 | |||
76 | #define NFC_HCI_MAX_CUSTOM_GATES 50 | 85 | #define NFC_HCI_MAX_CUSTOM_GATES 50 |
86 | #define NFC_HCI_MAX_PIPES 127 | ||
77 | struct nfc_hci_init_data { | 87 | struct nfc_hci_init_data { |
78 | u8 gate_count; | 88 | u8 gate_count; |
79 | struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES]; | 89 | struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES]; |
@@ -125,6 +135,7 @@ struct nfc_hci_dev { | |||
125 | void *clientdata; | 135 | void *clientdata; |
126 | 136 | ||
127 | u8 gate2pipe[NFC_HCI_MAX_GATES]; | 137 | u8 gate2pipe[NFC_HCI_MAX_GATES]; |
138 | struct nfc_hci_pipe pipes[NFC_HCI_MAX_PIPES]; | ||
128 | 139 | ||
129 | u8 sw_romlib; | 140 | u8 sw_romlib; |
130 | u8 sw_patch; | 141 | u8 sw_patch; |
@@ -167,6 +178,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
167 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | 178 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); |
168 | 179 | ||
169 | int nfc_hci_result_to_errno(u8 result); | 180 | int nfc_hci_result_to_errno(u8 result); |
181 | void nfc_hci_reset_pipes(struct nfc_hci_dev *dev); | ||
182 | void nfc_hci_reset_pipes_per_host(struct nfc_hci_dev *hdev, u8 host); | ||
170 | 183 | ||
171 | /* Host IDs */ | 184 | /* Host IDs */ |
172 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 185 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
@@ -219,6 +232,12 @@ int nfc_hci_result_to_errno(u8 result); | |||
219 | #define NFC_HCI_EVT_POST_DATA 0x02 | 232 | #define NFC_HCI_EVT_POST_DATA 0x02 |
220 | #define NFC_HCI_EVT_HOT_PLUG 0x03 | 233 | #define NFC_HCI_EVT_HOT_PLUG 0x03 |
221 | 234 | ||
235 | /* Generic commands */ | ||
236 | #define NFC_HCI_ANY_SET_PARAMETER 0x01 | ||
237 | #define NFC_HCI_ANY_GET_PARAMETER 0x02 | ||
238 | #define NFC_HCI_ANY_OPEN_PIPE 0x03 | ||
239 | #define NFC_HCI_ANY_CLOSE_PIPE 0x04 | ||
240 | |||
222 | /* Reader RF gates events */ | 241 | /* Reader RF gates events */ |
223 | #define NFC_HCI_EVT_READER_REQUESTED 0x10 | 242 | #define NFC_HCI_EVT_READER_REQUESTED 0x10 |
224 | #define NFC_HCI_EVT_END_OPERATION 0x11 | 243 | #define NFC_HCI_EVT_END_OPERATION 0x11 |
@@ -249,8 +268,6 @@ int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | |||
249 | int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | 268 | int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, |
250 | const u8 *param, size_t param_len, | 269 | const u8 *param, size_t param_len, |
251 | data_exchange_cb_t cb, void *cb_context); | 270 | data_exchange_cb_t cb, void *cb_context); |
252 | int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | ||
253 | const u8 *param, size_t param_len); | ||
254 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 271 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
255 | const u8 *param, size_t param_len); | 272 | const u8 *param, size_t param_len); |
256 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | 273 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); |