diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 1 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 2 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index be8da5d54abb..d7c79b5335c2 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -57,6 +57,7 @@ struct inquiry_entry { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | struct discovery_state { | 59 | struct discovery_state { |
60 | int type; | ||
60 | enum { | 61 | enum { |
61 | DISCOVERY_STOPPED, | 62 | DISCOVERY_STOPPED, |
62 | DISCOVERY_STARTING, | 63 | DISCOVERY_STARTING, |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index dc31e7d6028e..29a9b01c3b9b 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -380,6 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state) | |||
380 | 380 | ||
381 | switch (state) { | 381 | switch (state) { |
382 | case DISCOVERY_STOPPED: | 382 | case DISCOVERY_STOPPED: |
383 | hdev->discovery.type = 0; | ||
384 | |||
383 | if (hdev->discovery.state != DISCOVERY_STARTING) | 385 | if (hdev->discovery.state != DISCOVERY_STARTING) |
384 | mgmt_discovering(hdev, 0); | 386 | mgmt_discovering(hdev, 0); |
385 | break; | 387 | break; |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 196215c9d424..9d98382e48c7 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -2192,7 +2192,9 @@ static int start_discovery(struct sock *sk, u16 index, | |||
2192 | goto failed; | 2192 | goto failed; |
2193 | } | 2193 | } |
2194 | 2194 | ||
2195 | switch (cp->type) { | 2195 | hdev->discovery.type = cp->type; |
2196 | |||
2197 | switch (hdev->discovery.type) { | ||
2196 | case DISCOV_TYPE_BREDR: | 2198 | case DISCOV_TYPE_BREDR: |
2197 | case DISCOV_TYPE_INTERLEAVED: | 2199 | case DISCOV_TYPE_INTERLEAVED: |
2198 | err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR); | 2200 | err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR); |