diff options
author | Eric Lapuyade <eric.lapuyade@linux.intel.com> | 2012-12-18 08:15:49 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-01-09 18:51:51 -0500 |
commit | bf71ab8ba53081c28b960d48e0c4cd1c17588aa6 (patch) | |
tree | fb6444f45ac21850fa5b7bed05fb19a93b4ee313 /net | |
parent | 924d4a023ee6da2e40c78578829e68bcbabee2dd (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfc/hci/command.c | 7 | ||||
-rw-r--r-- | net/nfc/hci/core.c | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/net/nfc/hci/command.c b/net/nfc/hci/command.c index 7d99410e6c1a..64f922be9281 100644 --- a/net/nfc/hci/command.c +++ b/net/nfc/hci/command.c | |||
@@ -280,14 +280,19 @@ static int nfc_hci_delete_pipe(struct nfc_hci_dev *hdev, u8 pipe) | |||
280 | static int nfc_hci_clear_all_pipes(struct nfc_hci_dev *hdev) | 280 | static int nfc_hci_clear_all_pipes(struct nfc_hci_dev *hdev) |
281 | { | 281 | { |
282 | u8 param[2]; | 282 | u8 param[2]; |
283 | size_t param_len = 2; | ||
283 | 284 | ||
284 | /* TODO: Find out what the identity reference data is | 285 | /* TODO: Find out what the identity reference data is |
285 | * and fill param with it. HCI spec 6.1.3.5 */ | 286 | * and fill param with it. HCI spec 6.1.3.5 */ |
286 | 287 | ||
287 | pr_debug("\n"); | 288 | pr_debug("\n"); |
288 | 289 | ||
290 | if (test_bit(NFC_HCI_QUIRK_SHORT_CLEAR, &hdev->quirks)) | ||
291 | param_len = 0; | ||
292 | |||
289 | return nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE, | 293 | return nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE, |
290 | NFC_HCI_ADM_CLEAR_ALL_PIPE, param, 2, NULL); | 294 | NFC_HCI_ADM_CLEAR_ALL_PIPE, param, param_len, |
295 | NULL); | ||
291 | } | 296 | } |
292 | 297 | ||
293 | int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate) | 298 | int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate) |
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index d9190da4a403..755a6b9774ab 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -795,6 +795,7 @@ static struct nfc_ops hci_nfc_ops = { | |||
795 | 795 | ||
796 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, | 796 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, |
797 | struct nfc_hci_init_data *init_data, | 797 | struct nfc_hci_init_data *init_data, |
798 | unsigned long quirks, | ||
798 | u32 protocols, | 799 | u32 protocols, |
799 | const char *llc_name, | 800 | const char *llc_name, |
800 | int tx_headroom, | 801 | int tx_headroom, |
@@ -838,6 +839,8 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, | |||
838 | 839 | ||
839 | memset(hdev->gate2pipe, NFC_HCI_INVALID_PIPE, sizeof(hdev->gate2pipe)); | 840 | memset(hdev->gate2pipe, NFC_HCI_INVALID_PIPE, sizeof(hdev->gate2pipe)); |
840 | 841 | ||
842 | hdev->quirks = quirks; | ||
843 | |||
841 | return hdev; | 844 | return hdev; |
842 | } | 845 | } |
843 | EXPORT_SYMBOL(nfc_hci_allocate_device); | 846 | EXPORT_SYMBOL(nfc_hci_allocate_device); |