diff options
author | Robert Dolca <robert.dolca@intel.com> | 2015-10-22 05:11:41 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-10-25 15:29:11 -0400 |
commit | 85b9ce9a21b119a8163f20d60e7f0ce58fffbeef (patch) | |
tree | 86c2206f1149930987b1b6b001e5b19a3f09732b /net/nfc | |
parent | caa575a86ec1f177730cafa089d69ab4e424860c (diff) |
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 <robert.dolca@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/nci/core.c | 13 |
1 files changed, 13 insertions, 0 deletions
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, | |||
64 | return NULL; | 64 | return NULL; |
65 | } | 65 | } |
66 | 66 | ||
67 | int nci_get_conn_info_by_id(struct nci_dev *ndev, u8 id) | ||
68 | { | ||
69 | struct nci_conn_info *conn_info; | ||
70 | |||
71 | list_for_each_entry(conn_info, &ndev->conn_info_list, list) { | ||
72 | if (conn_info->id == id) | ||
73 | return conn_info->conn_id; | ||
74 | } | ||
75 | |||
76 | return -EINVAL; | ||
77 | } | ||
78 | EXPORT_SYMBOL(nci_get_conn_info_by_id); | ||
79 | |||
67 | /* ---- NCI requests ---- */ | 80 | /* ---- NCI requests ---- */ |
68 | 81 | ||
69 | void nci_req_complete(struct nci_dev *ndev, int result) | 82 | void nci_req_complete(struct nci_dev *ndev, int result) |