Skip to content

Commit

Permalink
NFC: NCI: Add set_config API
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Bing Zhao <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
Amitkumar Karwar authored and Samuel Ortiz committed Jan 7, 2014
1 parent 86e8586 commit 22c15bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/net/nfc/nci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ void nci_free_device(struct nci_dev *ndev);
int nci_register_device(struct nci_dev *ndev);
void nci_unregister_device(struct nci_dev *ndev);
int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val);

static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
unsigned int len,
Expand Down
16 changes: 16 additions & 0 deletions net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,22 @@ static int nci_dev_down(struct nfc_dev *nfc_dev)
return nci_close_device(ndev);
}

int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val)
{
struct nci_set_config_param param;

if (!val || !len)
return 0;

param.id = id;
param.len = len;
param.val = val;

return __nci_request(ndev, nci_set_config_req, (unsigned long)&param,
msecs_to_jiffies(NCI_SET_CONFIG_TIMEOUT));
}
EXPORT_SYMBOL(nci_set_config);

static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev)
{
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
Expand Down

0 comments on commit 22c15bf

Please sign in to comment.