提交 4aab14e5 编写于 作者: A Andre Guedes 提交者: Johan Hedberg

Bluetooth: Track discovery type

This patch adds to struct discovery_state the field 'type' so that
we can track the discovery type the device is performing.
Signed-off-by: NAndre Guedes <andre.guedes@openbossa.org>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 f39799f5
...@@ -57,6 +57,7 @@ struct inquiry_entry { ...@@ -57,6 +57,7 @@ struct inquiry_entry {
}; };
struct discovery_state { struct discovery_state {
int type;
enum { enum {
DISCOVERY_STOPPED, DISCOVERY_STOPPED,
DISCOVERY_STARTING, DISCOVERY_STARTING,
......
...@@ -380,6 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state) ...@@ -380,6 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state)
switch (state) { switch (state) {
case DISCOVERY_STOPPED: case DISCOVERY_STOPPED:
hdev->discovery.type = 0;
if (hdev->discovery.state != DISCOVERY_STARTING) if (hdev->discovery.state != DISCOVERY_STARTING)
mgmt_discovering(hdev, 0); mgmt_discovering(hdev, 0);
break; break;
......
...@@ -2192,7 +2192,9 @@ static int start_discovery(struct sock *sk, u16 index, ...@@ -2192,7 +2192,9 @@ static int start_discovery(struct sock *sk, u16 index,
goto failed; goto failed;
} }
switch (cp->type) { hdev->discovery.type = cp->type;
switch (hdev->discovery.type) {
case DISCOV_TYPE_BREDR: case DISCOV_TYPE_BREDR:
case DISCOV_TYPE_INTERLEAVED: case DISCOV_TYPE_INTERLEAVED:
err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR); err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册