Bluetooth: Pass desired connection role to hci_connect_le()
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 7 Jul 2014 12:02:28 +0000 (15:02 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 7 Jul 2014 13:18:08 +0000 (15:18 +0200)
commitcdd6275e510bd86c44d3fc85a78306f514bbac9a
treec9f4c491100cef5c0a68e79545b3132073e4fd3a
parentd93375a82da10cb023afc945fa18471bf3c41704
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>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt.c