]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Bluetooth: Allow HCI UART reset parameter via flags ioctl
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 24 Feb 2012 16:12:24 +0000 (17:12 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 24 Feb 2012 18:14:56 +0000 (20:14 +0200)
The flags ioctl for HCI UART drivers already allows setting of certain
Bluetooth core quirks. The reset parameter fits right in here. So allow
this as well.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_uart.h

index c2d637adb3ca91f334b47577ed33982ee465f35d..cdc3594f99011cce5e3463f729b23f4351b542d6 100644 (file)
@@ -48,8 +48,6 @@
 
 #define VERSION "2.2"
 
-static bool reset = 0;
-
 static struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];
 
 int hci_uart_register_proto(struct hci_uart_proto *p)
@@ -392,12 +390,12 @@ static int hci_uart_register_dev(struct hci_uart *hu)
        hdev->send  = hci_uart_send_frame;
        hdev->parent = hu->tty->dev;
 
-       if (!reset)
-               set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
-
        if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
                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);
+
        if (hci_register_dev(hdev) < 0) {
                BT_ERR("Can't register HCI device");
                hci_free_dev(hdev);
@@ -584,9 +582,6 @@ static void __exit hci_uart_exit(void)
 module_init(hci_uart_init);
 module_exit(hci_uart_exit);
 
-module_param(reset, bool, 0644);
-MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
-
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION);
 MODULE_VERSION(VERSION);
index 99fb35239d1fe35c6ec7979601da81ab771f7965..54c8983b183e48c9b466d0c1339c5d51499318af 100644 (file)
@@ -45,6 +45,7 @@
 #define HCI_UART_ATH3K 5
 
 #define HCI_UART_RAW_DEVICE    0
+#define HCI_UART_RESET_ON_INIT 1
 
 struct hci_uart;