Skip to contentSkip to conversation

Bluetooth: Allow HCI UART reset parameter via flags ioctl

PATCH Applied Marcel Holtmann 2 participants 2 messages Feb 24, 2012 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Allow HCI UART reset parameter via flags ioctl

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.

---
 drivers/bluetooth/hci_ldisc.c |   11 +++--------
 drivers/bluetooth/hci_uart.h  |    1 +
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/bluetooth/hci_ldisc.c +3 -8
index c2d637a..cdc3594 100644
@@ -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 <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION);
 MODULE_VERSION(VERSION);
drivers/bluetooth/hci_uart.h +1 -0
index 99fb352..54c8983 100644
@@ -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;
 
Signature · 1 line
1.7.7.6
#1 lore raw

Hi Marcel,

Quoted 9 lines · Marcel Holtmann

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.

---
 drivers/bluetooth/hci_ldisc.c |   11 +++--------
 drivers/bluetooth/hci_uart.h  |    1 +
 2 files changed, 4 insertions(+), 8 deletions(-)

Applied. Thanks.

Johan