Skip to content

Commit

Permalink
Bluetooth: Add HCI_PERIODIC_INQ to dev_flags
Browse files Browse the repository at this point in the history
This patch adds the HCI_PERIODIC_INQ flag to dev_flags. This flag
tracks if periodic inquiry is enabled or not.

Signed-off-by: Andre Guedes <aguedespe@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed May 9, 2012
1 parent 4d93483 commit ae854a7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ static void hci_cc_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb)
__u8 status = *((__u8 *) skb->data);

BT_DBG("%s status 0x%x", hdev->name, status);

if (status)
return;

set_bit(HCI_PERIODIC_INQ, &hdev->dev_flags);
}

static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb)
Expand All @@ -85,6 +90,8 @@ static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb)
if (status)
return;

clear_bit(HCI_PERIODIC_INQ, &hdev->dev_flags);

hci_conn_check_pending(hdev);
}

Expand Down Expand Up @@ -199,7 +206,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
hci_req_complete(hdev, HCI_OP_RESET, status);

/* Reset all non-persistent flags */
hdev->dev_flags &= ~(BIT(HCI_LE_SCAN) | BIT(HCI_PENDING_CLASS));
hdev->dev_flags &= ~(BIT(HCI_LE_SCAN) | BIT(HCI_PENDING_CLASS) |
BIT(HCI_PERIODIC_INQ));

hdev->discovery.state = DISCOVERY_STOPPED;
}
Expand Down

0 comments on commit ae854a7

Please sign in to comment.