aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 6c1c5048984c..6edd55340157 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -697,7 +697,7 @@ static void hci_req_directed_advertising(struct hci_request *req,
697 697
698struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, 698struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
699 u8 dst_type, u8 sec_level, u16 conn_timeout, 699 u8 dst_type, u8 sec_level, u16 conn_timeout,
700 bool master) 700 u8 role)
701{ 701{
702 struct hci_conn_params *params; 702 struct hci_conn_params *params;
703 struct hci_conn *conn; 703 struct hci_conn *conn;
@@ -769,8 +769,10 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
769 &enable); 769 &enable);
770 } 770 }
771 771
772 conn->role = role;
773
772 /* If requested to connect as slave use directed advertising */ 774 /* If requested to connect as slave use directed advertising */
773 if (!master) { 775 if (conn->role == HCI_ROLE_SLAVE) {
774 /* If we're active scanning most controllers are unable 776 /* If we're active scanning most controllers are unable
775 * to initiate advertising. Simply reject the attempt. 777 * to initiate advertising. Simply reject the attempt.
776 */ 778 */
@@ -786,7 +788,6 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
786 } 788 }
787 789
788 conn->out = true; 790 conn->out = true;
789 conn->role = HCI_ROLE_MASTER;
790 791
791 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); 792 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
792 if (params) { 793 if (params) {