diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-07 14:02:28 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-07 15:18:08 +0200 |
commit | cdd6275e510bd86c44d3fc85a78306f514bbac9a (patch) | |
tree | c9f4c491100cef5c0a68e79545b3132073e4fd3a /net/bluetooth/mgmt.c | |
parent | Bluetooth: Remove auth_type parameter from hci_connect_le() (diff) | |
download | linux-cdd6275e510bd86c44d3fc85a78306f514bbac9a.tar.xz linux-cdd6275e510bd86c44d3fc85a78306f514bbac9a.zip |
Bluetooth: Pass desired connection role to hci_connect_le()
If we have both LE scanning and advertising simultaneously enabled we
need a way to tell hci_connect_le() in which role to initiate a
connection. This patch adds a new parameter to the function to give it
the necessary information. For auto-connect and mgmt_pair_device we
always use master role, whereas for L2CAP users (in practice sockets) we
use slave role whenever HCI_ADVERTISING is set and master role
otherwise.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to '')
-rw-r--r-- | net/bluetooth/mgmt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e7047de1ba11..b391e2fef4b6 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -3117,8 +3117,9 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, */ hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type); + /* Request a connection with master = true role */ conn = hci_connect_le(hdev, &cp->addr.bdaddr, addr_type, - sec_level, HCI_LE_CONN_TIMEOUT); + sec_level, HCI_LE_CONN_TIMEOUT, true); } if (IS_ERR(conn)) { |