NFC: Allow HCI driver to pre-open pipes to some gates

Some NFC chips will statically create and open pipes for both standard
and proprietary gates. The driver can now pass this information to HCI
such that HCI will not attempt to create and open them, but will instead
directly use the passed pipe ids.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Eric Lapuyade 2012-06-05 14:42:11 +02:00 committed by John W. Linville
parent eae202aa20
commit a10d595b10
5 changed files with 47 additions and 37 deletions

View file

@ -44,10 +44,20 @@ struct nfc_hci_ops {
struct nfc_target *target);
};
#define NFC_HCI_MAX_CUSTOM_GATES 15
/* Pipes */
#define NFC_HCI_INVALID_PIPE 0x80
#define NFC_HCI_LINK_MGMT_PIPE 0x00
#define NFC_HCI_ADMIN_PIPE 0x01
struct nfc_hci_gate {
u8 gate;
u8 pipe;
};
#define NFC_HCI_MAX_CUSTOM_GATES 50
struct nfc_hci_init_data {
u8 gate_count;
u8 gates[NFC_HCI_MAX_CUSTOM_GATES];
struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES];
char session_id[9];
};
@ -182,7 +192,8 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event,
void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb);
/* connecting to gates and sending hci instructions */
int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate);
int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate,
u8 pipe);
int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate);
int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev);
int nfc_hci_get_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx,