From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [RFC v4 01/12] Bluetooth: Save connection interval parameters in hci_conn
Date: Fri, 6 Dec 2013 19:05:38 -0300 [thread overview]
Message-ID: <1386367549-29136-2-git-send-email-andre.guedes@openbossa.org> (raw)
In-Reply-To: <1386367549-29136-1-git-send-email-andre.guedes@openbossa.org>
This patch creates two new fields in struct hci_conn to save the
minimum and maximum connection interval values used to establish
the connection this object represents.
This change is required in order to know what parameters the
connection is currently using.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
include/net/bluetooth/hci_core.h | 2 ++
net/bluetooth/hci_conn.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f8555ad7..434ab31 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -332,6 +332,8 @@ struct hci_conn {
__u8 passkey_entered;
__u16 disc_timeout;
__u16 setting;
+ __u16 le_conn_min_interval;
+ __u16 le_conn_max_interval;
unsigned long flags;
__u8 remote_cap;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index ba5366c..15c689e 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -558,8 +558,8 @@ static int hci_create_le_conn(struct hci_conn *conn)
bacpy(&cp.peer_addr, &conn->dst);
cp.peer_addr_type = conn->dst_type;
cp.own_address_type = conn->src_type;
- cp.conn_interval_min = cpu_to_le16(hdev->le_conn_min_interval);
- cp.conn_interval_max = cpu_to_le16(hdev->le_conn_max_interval);
+ cp.conn_interval_min = cpu_to_le16(conn->le_conn_min_interval);
+ cp.conn_interval_max = cpu_to_le16(conn->le_conn_max_interval);
cp.supervision_timeout = __constant_cpu_to_le16(0x002a);
cp.min_ce_len = __constant_cpu_to_le16(0x0000);
cp.max_ce_len = __constant_cpu_to_le16(0x0000);
@@ -624,6 +624,8 @@ static struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
conn->sec_level = BT_SECURITY_LOW;
conn->pending_sec_level = sec_level;
conn->auth_type = auth_type;
+ conn->le_conn_min_interval = hdev->le_conn_min_interval;
+ conn->le_conn_max_interval = hdev->le_conn_max_interval;
err = hci_create_le_conn(conn);
if (err)
--
1.8.4.2
next prev parent reply other threads:[~2013-12-06 22:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 22:05 [RFC v4 00/12] LE auto connection and connection parameters Andre Guedes
2013-12-06 22:05 ` Andre Guedes [this message]
2013-12-06 22:05 ` [RFC v4 02/12] Bluetooth: Group list_head fields from strcut hci_dev together Andre Guedes
2013-12-06 22:05 ` [RFC v4 03/12] Bluetooth: Introduce connection parameters list Andre Guedes
2013-12-06 22:05 ` [RFC v4 04/12] Bluetooth: Use connection parameters if any Andre Guedes
2013-12-06 22:05 ` [RFC v4 05/12] Bluetooth: Stop scanning on LE connection Andre Guedes
2013-12-10 13:21 ` Johan Hedberg
2013-12-17 14:05 ` Andre Guedes
2013-12-18 11:11 ` Johan Hedberg
2013-12-19 21:07 ` Andre Guedes
2013-12-06 22:05 ` [RFC v4 06/12] Bluetooth: Introduce hdev->pend_le_conn list Andre Guedes
2013-12-06 22:05 ` [RFC v4 07/12] Bluetooth: Introduce LE auto connection infrastructure Andre Guedes
2013-12-06 22:05 ` [RFC v4 08/12] Bluetooth: Re-enable background scan in case of error Andre Guedes
2013-12-06 22:05 ` [RFC v4 09/12] Bluetooth: Temporarily stop background scanning on discovery Andre Guedes
2013-12-06 22:05 ` [RFC v4 10/12] Bluetooth: Auto connection and power on Andre Guedes
2013-12-06 22:05 ` [RFC v4 11/12] Bleutooth: Add support for auto connect options Andre Guedes
2013-12-06 22:05 ` [RFC v4 12/12] Bluetooth: Add le_auto_conn file on debugfs Andre Guedes
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=1386367549-29136-2-git-send-email-andre.guedes@openbossa.org \
--to=andre.guedes@openbossa.org \
--cc=linux-bluetooth@vger.kernel.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).