diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-01-06 15:58:18 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-01-06 19:32:40 -0500 |
commit | 22c15bf30b70ab2eae300f093ffc64e182620aba (patch) | |
tree | e191a88c1cd70dd0281cad5b69e3ca79671451d0 /net/nfc/nci | |
parent | 86e8586ed5beea15ce7c359f02a1084c2da93bc7 (diff) |
NFC: NCI: Add set_config API
This API can be used by drivers to send their custom
configuration using SET_CONFIG NCI command to the device.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/nci')
-rw-r--r-- | net/nfc/nci/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 29c1caf3e975..46bda010bf11 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -413,6 +413,22 @@ static int nci_dev_down(struct nfc_dev *nfc_dev) | |||
413 | return nci_close_device(ndev); | 413 | return nci_close_device(ndev); |
414 | } | 414 | } |
415 | 415 | ||
416 | int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val) | ||
417 | { | ||
418 | struct nci_set_config_param param; | ||
419 | |||
420 | if (!val || !len) | ||
421 | return 0; | ||
422 | |||
423 | param.id = id; | ||
424 | param.len = len; | ||
425 | param.val = val; | ||
426 | |||
427 | return __nci_request(ndev, nci_set_config_req, (unsigned long)¶m, | ||
428 | msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT)); | ||
429 | } | ||
430 | EXPORT_SYMBOL(nci_set_config); | ||
431 | |||
416 | static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev) | 432 | static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev) |
417 | { | 433 | { |
418 | struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); | 434 | struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); |