Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4aab14e5 authored by Andre Guedes's avatar Andre Guedes Committed by Johan Hedberg
Browse files

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: default avatarAndre Guedes <andre.guedes@openbossa.org>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent f39799f5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ struct inquiry_entry {
};

struct discovery_state {
	int type;
	enum {
		DISCOVERY_STOPPED,
		DISCOVERY_STARTING,
+2 −0
Original line number Diff line number Diff line
@@ -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;
+3 −1
Original line number Diff line number Diff line
@@ -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);