netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Dolca <robert.dolca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	Lauro Ramos Venancio
	<lauro.venancio-430g2QfJUUCGglJvpFV4uA@public.gmane.org>,
	Aloisio Almeida Jr
	<aloisio.almeida-430g2QfJUUCGglJvpFV4uA@public.gmane.org>,
	Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Robert Dolca
	<robert.dolca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christophe Ricard
	<christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Robert Dolca
	<robert.dolca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v4 09/10] nfc: nci: add nci_get_conn_info_by_id function
Date: Thu, 22 Oct 2015 12:11:41 +0300	[thread overview]
Message-ID: <1445505102-16639-10-git-send-email-robert.dolca@intel.com> (raw)
In-Reply-To: <1445505102-16639-1-git-send-email-robert.dolca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 include/net/nfc/nci_core.h |  1 +
 net/nfc/nci/core.c         | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 5daf004..0569cb2 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -374,6 +374,7 @@ void nci_clear_target_list(struct nci_dev *ndev);
 void nci_req_complete(struct nci_dev *ndev, int result);
 struct nci_conn_info *nci_get_conn_info_by_conn_id(struct nci_dev *ndev,
 						   int conn_id);
+int nci_get_conn_info_by_id(struct nci_dev *ndev, u8 id);
 
 /* ----- NCI status code ----- */
 int nci_to_errno(__u8 code);
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 9d5f7a2..75bda34 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)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-10-22  9:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  9:11 [PATCH v4 00/10] Add Intel FieldsPeak NFC solution driver Robert Dolca
2015-10-22  9:11 ` [PATCH v4 01/10] nfc: nci: Export nci data send API Robert Dolca
2015-10-22  9:11 ` [PATCH v4 02/10] nfc: nci: Add function to get max packet size for conn Robert Dolca
2015-10-22  9:11 ` [PATCH v4 03/10] nfc: nci: Introduce new core opcodes Robert Dolca
2015-10-22  9:11 ` [PATCH v4 04/10] nfc: nci: Do not call post_setup when setup fails Robert Dolca
2015-10-22  9:11 ` [PATCH v4 05/10] nfc: nci: Introduce nci_core_cmd Robert Dolca
2015-10-22  9:11 ` [PATCH v4 06/10] nfc: nci: Allow the driver to set handler for core nci ops Robert Dolca
2015-10-22  9:11 ` [PATCH v4 07/10] nfc: nci: rename nci_prop_ops to nci_driver_ops Robert Dolca
2015-10-22  9:11 ` [PATCH v4 08/10] nfc: nci: fix possible crash in nci_core_conn_create Robert Dolca
     [not found] ` <1445505102-16639-1-git-send-email-robert.dolca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-10-22  9:11   ` Robert Dolca [this message]
2015-10-22  9:11 ` [PATCH v4 10/10] nfc: Add Intel Fields Peak NFC solution driver Robert Dolca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445505102-16639-10-git-send-email-robert.dolca@intel.com \
    --to=robert.dolca-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=aloisio.almeida-430g2QfJUUCGglJvpFV4uA@public.gmane.org \
    --cc=christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=lauro.venancio-430g2QfJUUCGglJvpFV4uA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfc-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robert.dolca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).