From 9f2aee848fe60325b1984653833d2d1825ec730d Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 16 Jul 2012 16:12:11 +0300 Subject: Bluetooth: Add delayed init sequence support for UART controllers This patch makes it possible to have UART drivers perform an internal initialization before calling hci_register_dev. This allows moving a lot of init code from user space (hciattach) to the kernel side, thereby creating a more controlled/robust initialization process. Signed-off-by: Johan Hedberg Signed-off-by: Gustavo Padovan --- drivers/bluetooth/hci_uart.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/bluetooth/hci_uart.h') diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index aaf9d7de1b9..fffa61ff5cb 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -47,6 +47,7 @@ #define HCI_UART_RAW_DEVICE 0 #define HCI_UART_RESET_ON_INIT 1 #define HCI_UART_CREATE_AMP 2 +#define HCI_UART_INIT_PENDING 3 struct hci_uart; @@ -66,6 +67,8 @@ struct hci_uart { unsigned long flags; unsigned long hdev_flags; + struct work_struct init_ready; + struct hci_uart_proto *proto; void *priv; @@ -76,6 +79,7 @@ struct hci_uart { /* HCI_UART proto flag bits */ #define HCI_UART_PROTO_SET 0 +#define HCI_UART_REGISTERED 1 /* TX states */ #define HCI_UART_SENDING 1 @@ -84,6 +88,7 @@ struct hci_uart { int hci_uart_register_proto(struct hci_uart_proto *p); int hci_uart_unregister_proto(struct hci_uart_proto *p); int hci_uart_tx_wakeup(struct hci_uart *hu); +int hci_uart_init_ready(struct hci_uart *hu); #ifdef CONFIG_BT_HCIUART_H4 int h4_init(void); -- cgit v1.2.3