Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Amitkumar Karwar and committed by
Samuel Ortiz
22c15bf3 86e8586e

+17
+1
include/net/nfc/nci_core.h
··· 155 155 int nci_register_device(struct nci_dev *ndev); 156 156 void nci_unregister_device(struct nci_dev *ndev); 157 157 int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); 158 + int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val); 158 159 159 160 static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 160 161 unsigned int len,
+16
net/nfc/nci/core.c
··· 413 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)&param, 428 + msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT)); 429 + } 430 + EXPORT_SYMBOL(nci_set_config); 431 + 416 432 static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev) 417 433 { 418 434 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);