From: Johan Hedberg <johan.hedberg@gmail.com>
To: Andre Guedes <andre.guedes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC v11 06/15] Bluetooth: Introduce LE auto connection infrastructure
Date: Tue, 25 Feb 2014 06:23:37 +0200 [thread overview]
Message-ID: <20140225042337.GA27803@localhost.P-661HNU-F1> (raw)
In-Reply-To: <1393281061-14320-7-git-send-email-andre.guedes@openbossa.org>
Hi Andre,
On Mon, Feb 24, 2014, Andre Guedes wrote:
> + if (hci_update_random_address(&req, false, &own_addr_type))
> + return;
Don't we want require_privacy = true here?
> + if (addr_type == ADDR_LE_DEV_PUBLIC)
> + bdaddr_type = BDADDR_LE_PUBLIC;
> + else
> + bdaddr_type = BDADDR_LE_RANDOM;
> +
> + conn = hci_connect(hdev, LE_LINK, addr, bdaddr_type, BT_SECURITY_LOW,
> + HCI_AT_NO_BONDING);
All hci_connect is is a very short wrapper to hci_connect_acl/le. The
hci_connect_le function in turn does the following:
/* Convert from L2CAP channel address type to HCI address type */
if (dst_type == BDADDR_LE_PUBLIC)
dst_type = ADDR_LE_DEV_PUBLIC;
else
dst_type = ADDR_LE_DEV_RANDOM;
So it seems a bit silly to do this kind of back and forth conversions.
Instead, I think the hci_connect API should take the address type that's
used for struct hci_conn, i.e. the HCI one (not the L2CAP/mgmt one).
Also, since pretty much all places that are calling hci_connect pass an
explicit value as the link type I think the most sensible thing to do
would be to completely remove this function and export hci_connect_le &
hci_connect_acl from hci_conn.c.
Johan
next prev parent reply other threads:[~2014-02-25 4:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 22:30 [RFC v11 00/15] LE auto connection Andre Guedes
2014-02-24 22:30 ` [RFC v11 01/15] Bluetooth: Create hci_req_add_le_scan_disable helper Andre Guedes
2014-02-25 5:57 ` Johan Hedberg
2014-02-25 17:16 ` Andre Guedes
2014-02-24 22:30 ` [RFC v11 02/15] Bluetooth: Declare le_conn_failed in hci_core.h Andre Guedes
2014-02-24 22:30 ` [RFC v11 03/15] Bluetooth: Stop scanning on LE connection Andre Guedes
2014-02-24 22:30 ` [RFC v11 04/15] Bluetooth: Remove unused function Andre Guedes
2014-02-24 22:30 ` [RFC v11 05/15] Bluetooth: Introduce hdev->pend_le_conn list Andre Guedes
2014-02-24 22:30 ` [RFC v11 06/15] Bluetooth: Introduce LE auto connection infrastructure Andre Guedes
2014-02-25 4:23 ` Johan Hedberg [this message]
2014-02-25 17:16 ` Andre Guedes
2014-02-25 17:43 ` Marcel Holtmann
2014-02-24 22:30 ` [RFC v11 07/15] Bluetooth: Introduce LE auto connect options Andre Guedes
2014-02-24 22:30 ` [RFC v11 08/15] Bluetooth: Connection parameters and auto connection Andre Guedes
2014-02-24 22:30 ` [RFC v11 09/15] Bluetooth: Temporarily stop background scanning on discovery Andre Guedes
2014-02-24 22:30 ` [RFC v11 10/15] Bluetooth: Auto connection and power on Andre Guedes
2014-02-24 22:30 ` [RFC v11 11/15] Bluetooth: Connection parameters and resolvable address Andre Guedes
2014-02-24 22:30 ` [RFC v11 12/15] Bluetooth: Support resolvable private addresses Andre Guedes
2014-02-24 22:30 ` [RFC v11 13/15] Bluetooth: Add le_auto_conn file on debugfs Andre Guedes
2014-02-24 22:31 ` [RFC v11 14/15] Bluetooth: Create hci_req_add_le_passive_scan helper Andre Guedes
2014-02-24 22:31 ` [RFC v11 15/15] Bluetooth: Update background scan parameters 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=20140225042337.GA27803@localhost.P-661HNU-F1 \
--to=johan.hedberg@gmail.com \
--cc=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