Commit 133ffc83 authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Add module parameter for HCI_Reset

This patch adds a module parameter to the hci_uart and hci_usb
drivers for forcing a HCI_Reset on initialization.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 16c59c58
......@@ -51,6 +51,7 @@
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include "hci_uart.h"
#ifndef CONFIG_BT_HCIUART_DEBUG
......@@ -60,6 +61,8 @@
#define BT_DMP( A... )
#endif
static int reset = 0;
static struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];
int hci_uart_register_proto(struct hci_uart_proto *p)
......@@ -412,7 +415,10 @@ static int hci_uart_register_dev(struct hci_uart *hu)
hdev->destruct = hci_uart_destruct;
hdev->owner = THIS_MODULE;
if (reset)
set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
if (hci_register_dev(hdev) < 0) {
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
......@@ -577,7 +583,10 @@ static void __exit hci_uart_exit(void)
module_init(hci_uart_init);
module_exit(hci_uart_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
module_param(reset, bool, 0644);
MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
......
......@@ -66,6 +66,8 @@
#define URB_ZERO_PACKET 0
#endif
static int reset = 0;
#ifdef CONFIG_BT_HCIUSB_SCO
static int isoc = 2;
#endif
......@@ -963,7 +965,7 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
hdev->owner = THIS_MODULE;
if (id->driver_info & HCI_RESET)
if (reset || id->driver_info & HCI_RESET)
set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
if (hci_register_dev(hdev) < 0) {
......@@ -1036,6 +1038,9 @@ static void __exit hci_usb_exit(void)
module_init(hci_usb_init);
module_exit(hci_usb_exit);
module_param(reset, bool, 0644);
MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
#ifdef CONFIG_BT_HCIUSB_SCO
module_param(isoc, int, 0644);
MODULE_PARM_DESC(isoc, "Set isochronous transfers for SCO over HCI support");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment