Skip to content

Commit

Permalink
Bluetooth: Rename HCI_QUIRK_NO_RESET to HCI_QUIRK_RESET_ON_CLOSE
Browse files Browse the repository at this point in the history
HCI_QUIRK_NO_RESET name is misleading - purpose of this quirk is to
reset device on close instead of init, not to not reset at all.
Rename it to HCI_QUIRK_RESET_ON_CLOSE to avoid confusion.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Szymon Janc authored and Johan Hedberg committed Jun 5, 2012
1 parent 38351c6 commit a6c511c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
hdev->flush = bpa10x_flush;
hdev->send = bpa10x_send_frame;

set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);

err = hci_register_dev(hdev);
if (err < 0) {
Expand Down
6 changes: 3 additions & 3 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ static int btusb_probe(struct usb_interface *intf,
data->isoc = usb_ifnum_to_if(data->udev, 1);

if (!reset)
set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);

if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) {
if (!disable_scofix)
Expand All @@ -1038,15 +1038,15 @@ static int btusb_probe(struct usb_interface *intf,

if (id->driver_info & BTUSB_DIGIANSWER) {
data->cmdreq_type = USB_TYPE_VENDOR;
set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
}

if (id->driver_info & BTUSB_CSR) {
struct usb_device *udev = data->udev;

/* Old firmware would otherwise execute USB reset */
if (le16_to_cpu(udev->descriptor.bcdDevice) < 0x117)
set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
}

if (id->driver_info & BTUSB_SNIFFER) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int hci_uart_register_dev(struct hci_uart *hu)
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);

if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);

if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
hdev->dev_type = HCI_AMP;
Expand Down
2 changes: 1 addition & 1 deletion include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

/* HCI device quirks */
enum {
HCI_QUIRK_NO_RESET,
HCI_QUIRK_RESET_ON_CLOSE,
HCI_QUIRK_RAW_DEVICE,
HCI_QUIRK_FIXUP_BUFFER_SIZE
};
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static void bredr_init(struct hci_dev *hdev)
/* Mandatory initialization */

/* Reset */
if (!test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) {
if (!test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks)) {
set_bit(HCI_RESET, &hdev->flags);
hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL);
}
Expand Down Expand Up @@ -792,7 +792,7 @@ static int hci_dev_do_close(struct hci_dev *hdev)
skb_queue_purge(&hdev->cmd_q);
atomic_set(&hdev->cmd_cnt, 1);
if (!test_bit(HCI_RAW, &hdev->flags) &&
test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) {
test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks)) {
set_bit(HCI_INIT, &hdev->flags);
__hci_request(hdev, hci_reset_req, 0,
msecs_to_jiffies(250));
Expand Down

0 comments on commit a6c511c

Please sign in to comment.