|
@@ -733,6 +733,14 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
|
|
struct hci_request req;
|
|
struct hci_request req;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
|
|
+ /* Let's make sure that le is enabled.*/
|
|
|
|
+ if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
|
|
|
|
+ if (lmp_le_capable(hdev))
|
|
|
|
+ return ERR_PTR(-ECONNREFUSED);
|
|
|
|
+
|
|
|
|
+ return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Some devices send ATT messages as soon as the physical link is
|
|
/* Some devices send ATT messages as soon as the physical link is
|
|
* established. To be able to handle these ATT messages, the user-
|
|
* established. To be able to handle these ATT messages, the user-
|
|
* space first establishes the connection and then starts the pairing
|
|
* space first establishes the connection and then starts the pairing
|