diff options
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 190668367e42..ccc4653ce658 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -5271,7 +5271,7 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, | |||
5271 | MGMT_STATUS_INVALID_PARAMS, | 5271 | MGMT_STATUS_INVALID_PARAMS, |
5272 | &cp->addr, sizeof(cp->addr)); | 5272 | &cp->addr, sizeof(cp->addr)); |
5273 | 5273 | ||
5274 | if (cp->action != 0x00 && cp->action != 0x01) | 5274 | if (cp->action != 0x00 && cp->action != 0x01 && cp->action != 0x02) |
5275 | return cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, | 5275 | return cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, |
5276 | MGMT_STATUS_INVALID_PARAMS, | 5276 | MGMT_STATUS_INVALID_PARAMS, |
5277 | &cp->addr, sizeof(cp->addr)); | 5277 | &cp->addr, sizeof(cp->addr)); |
@@ -5281,7 +5281,7 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, | |||
5281 | if (cp->addr.type == BDADDR_BREDR) { | 5281 | if (cp->addr.type == BDADDR_BREDR) { |
5282 | bool update_scan; | 5282 | bool update_scan; |
5283 | 5283 | ||
5284 | /* Only "connect" action supported for now */ | 5284 | /* Only incoming connections action is supported for now */ |
5285 | if (cp->action != 0x01) { | 5285 | if (cp->action != 0x01) { |
5286 | err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, | 5286 | err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, |
5287 | MGMT_STATUS_INVALID_PARAMS, | 5287 | MGMT_STATUS_INVALID_PARAMS, |
@@ -5307,8 +5307,10 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, | |||
5307 | else | 5307 | else |
5308 | addr_type = ADDR_LE_DEV_RANDOM; | 5308 | addr_type = ADDR_LE_DEV_RANDOM; |
5309 | 5309 | ||
5310 | if (cp->action) | 5310 | if (cp->action == 0x02) |
5311 | auto_conn = HCI_AUTO_CONN_ALWAYS; | 5311 | auto_conn = HCI_AUTO_CONN_ALWAYS; |
5312 | else if (cp->action == 0x01) | ||
5313 | auto_conn = HCI_AUTO_CONN_DIRECT; | ||
5312 | else | 5314 | else |
5313 | auto_conn = HCI_AUTO_CONN_REPORT; | 5315 | auto_conn = HCI_AUTO_CONN_REPORT; |
5314 | 5316 | ||
@@ -5870,6 +5872,7 @@ static void restart_le_actions(struct hci_dev *hdev) | |||
5870 | list_del_init(&p->action); | 5872 | list_del_init(&p->action); |
5871 | 5873 | ||
5872 | switch (p->auto_connect) { | 5874 | switch (p->auto_connect) { |
5875 | case HCI_AUTO_CONN_DIRECT: | ||
5873 | case HCI_AUTO_CONN_ALWAYS: | 5876 | case HCI_AUTO_CONN_ALWAYS: |
5874 | list_add(&p->action, &hdev->pend_le_conns); | 5877 | list_add(&p->action, &hdev->pend_le_conns); |
5875 | break; | 5878 | break; |