From 85b9ce9a21b119a8163f20d60e7f0ce58fffbeef Mon Sep 17 00:00:00 2001 From: Robert Dolca Date: Thu, 22 Oct 2015 12:11:41 +0300 Subject: NFC: nci: add nci_get_conn_info_by_id function This functin takes as a parameter a pointer to the nci_dev struct and the first byte from the values of the first domain specific parameter that was used for the connection creation. Signed-off-by: Robert Dolca Signed-off-by: Samuel Ortiz --- net/nfc/nci/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'net/nfc') diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 9d5f7a2b1d03..75bda34fd8e4 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -64,6 +64,19 @@ struct nci_conn_info *nci_get_conn_info_by_conn_id(struct nci_dev *ndev, return NULL; } +int nci_get_conn_info_by_id(struct nci_dev *ndev, u8 id) +{ + struct nci_conn_info *conn_info; + + list_for_each_entry(conn_info, &ndev->conn_info_list, list) { + if (conn_info->id == id) + return conn_info->conn_id; + } + + return -EINVAL; +} +EXPORT_SYMBOL(nci_get_conn_info_by_id); + /* ---- NCI requests ---- */ void nci_req_complete(struct nci_dev *ndev, int result) -- cgit