NFC: Add HCI quirks to support driver (non)standard implementations
Some chips diverge from the HCI spec in their implementation of standard features. This adds a new quirks parameter to nfc_hci_allocate_device() to let the driver indicate its divergence. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:

committed by
Samuel Ortiz

parent
924d4a023e
commit
bf71ab8ba5
@@ -280,14 +280,19 @@ static int nfc_hci_delete_pipe(struct nfc_hci_dev *hdev, u8 pipe)
|
||||
static int nfc_hci_clear_all_pipes(struct nfc_hci_dev *hdev)
|
||||
{
|
||||
u8 param[2];
|
||||
size_t param_len = 2;
|
||||
|
||||
/* TODO: Find out what the identity reference data is
|
||||
* and fill param with it. HCI spec 6.1.3.5 */
|
||||
|
||||
pr_debug("\n");
|
||||
|
||||
if (test_bit(NFC_HCI_QUIRK_SHORT_CLEAR, &hdev->quirks))
|
||||
param_len = 0;
|
||||
|
||||
return nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE,
|
||||
NFC_HCI_ADM_CLEAR_ALL_PIPE, param, 2, NULL);
|
||||
NFC_HCI_ADM_CLEAR_ALL_PIPE, param, param_len,
|
||||
NULL);
|
||||
}
|
||||
|
||||
int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate)
|
||||
|
@@ -795,6 +795,7 @@ static struct nfc_ops hci_nfc_ops = {
|
||||
|
||||
struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
|
||||
struct nfc_hci_init_data *init_data,
|
||||
unsigned long quirks,
|
||||
u32 protocols,
|
||||
const char *llc_name,
|
||||
int tx_headroom,
|
||||
@@ -838,6 +839,8 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
|
||||
|
||||
memset(hdev->gate2pipe, NFC_HCI_INVALID_PIPE, sizeof(hdev->gate2pipe));
|
||||
|
||||
hdev->quirks = quirks;
|
||||
|
||||
return hdev;
|
||||
}
|
||||
EXPORT_SYMBOL(nfc_hci_allocate_device);
|
||||
|
Reference in New Issue
Block a user