#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
+
#include "hci_uart.h"
#ifndef CONFIG_BT_HCIUART_DEBUG
#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)
int len;
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
- len = tty->driver->write(tty, 0, skb->data, skb->len);
+ len = tty->driver->write(tty, skb->data, skb->len);
hdev->stat.byte_tx += len;
skb_pull(skb, len);
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);
{
return 0;
}
-static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, const unsigned char __user *data, size_t count)
+static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, const unsigned char *data, size_t count)
{
return 0;
}
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");