From 6dacfadd8fa88417dae666153b05a2c4e4acae7e Mon Sep 17 00:00:00 2001 From: Andre Guedes Date: Fri, 17 Feb 2012 20:39:36 -0300 Subject: [PATCH] --- yaml --- r: 290971 b: refs/heads/master c: 4aab14e5504e84c42534378f91e836e6f55d0886 h: refs/heads/master i: 290969: 80c03f44ae7220bacec10a7690db6cb7025ac4bd 290967: d2b25deb770f062bb4c3e3b26f21ce513f755f85 v: v3 --- [refs] | 2 +- trunk/include/net/bluetooth/hci_core.h | 1 + trunk/net/bluetooth/hci_core.c | 2 ++ trunk/net/bluetooth/mgmt.c | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index bed21c398da2..cd50cb8937d5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f39799f5047c4827b200acbf33cd0ba076afd7ed +refs/heads/master: 4aab14e5504e84c42534378f91e836e6f55d0886 diff --git a/trunk/include/net/bluetooth/hci_core.h b/trunk/include/net/bluetooth/hci_core.h index be8da5d54abb..d7c79b5335c2 100644 --- a/trunk/include/net/bluetooth/hci_core.h +++ b/trunk/include/net/bluetooth/hci_core.h @@ -57,6 +57,7 @@ struct inquiry_entry { }; struct discovery_state { + int type; enum { DISCOVERY_STOPPED, DISCOVERY_STARTING, diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index dc31e7d6028e..29a9b01c3b9b 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -380,6 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state) switch (state) { case DISCOVERY_STOPPED: + hdev->discovery.type = 0; + if (hdev->discovery.state != DISCOVERY_STARTING) mgmt_discovering(hdev, 0); break; diff --git a/trunk/net/bluetooth/mgmt.c b/trunk/net/bluetooth/mgmt.c index 196215c9d424..9d98382e48c7 100644 --- a/trunk/net/bluetooth/mgmt.c +++ b/trunk/net/bluetooth/mgmt.c @@ -2192,7 +2192,9 @@ static int start_discovery(struct sock *sk, u16 index, goto failed; } - switch (cp->type) { + hdev->discovery.type = cp->type; + + switch (hdev->discovery.type) { case DISCOV_TYPE_BREDR: case DISCOV_TYPE_INTERLEAVED: err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);