Re: Is it incorrect in checking of "NO_RESET" bit in hci_core.c:hci_dev_do_close()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chen,

> static int hci_dev_do_close(struct hci_dev *hdev)
> {
>     ...
> 
>     /* Reset device */
>     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)) {
>         set_bit(HCI_INIT, &hdev->flags);
>         __hci_request(hdev, hci_reset_req, 0,
>                     msecs_to_jiffies(250));
>         clear_bit(HCI_INIT, &hdev->flags);
>     }
>     ...
> }
> 
> I guess the condition should be as following:
> 
>     if (!test_bit(HCI_RAW, &hdev->flags) &&
>                 *! *test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks))
> 
> it means the code should sent HCI_RESET, only if both of the following
> conditions are met:
> 1. HCI_RAW is NOT set;
> 2. HCI_QUIRK_NO_RESET is *NOT* set.

the name is confusing, when closing the device and NO_RESET is set, then
it needs to send the HCI Reset.

Regards

Marcel


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux