diff -drupN a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h --- a/drivers/bluetooth/hci_uart.h 2018-08-06 17:23:04.000000000 +0300 +++ b/drivers/bluetooth/hci_uart.h 2022-06-12 05:28:14.000000000 +0300 @@ -17,16 +17,25 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include +#include +#include + +/* #define HCI_VERSION_CODE KERNEL_VERSION(3, 14, 41) */ +#define HCI_VERSION_CODE LINUX_VERSION_CODE #ifndef N_HCI #define N_HCI 15 #endif +#ifndef CONFIG_BT_HCIUART_H4 +#define CONFIG_BT_HCIUART_H4 +#endif + +#define BTCOEX + /* Ioctls */ #define HCIUARTSETPROTO _IOW('U', 200, int) #define HCIUARTGETPROTO _IOR('U', 201, int) @@ -83,10 +92,14 @@ struct hci_uart { struct work_struct init_ready; struct work_struct write_work; + struct workqueue_struct *hci_uart_wq; - const struct hci_uart_proto *proto; + const struct hci_uart_proto *proto; + rwlock_t proto_lock; /* Stop work for proto close */ void *priv; + spinlock_t tx_lock; + struct sk_buff *tx_skb; unsigned long tx_state; @@ -172,6 +185,11 @@ int h5_init(void); int h5_deinit(void); #endif +#ifdef CONFIG_BT_HCIUART_RTL3WIRE +int h5_rtk_init(void); +int h5_rtk_deinit(void); +#endif + #ifdef CONFIG_BT_HCIUART_INTEL int intel_init(void); int intel_deinit(void); @@ -196,3 +214,10 @@ int ag6xx_deinit(void); int mrvl_init(void); int mrvl_deinit(void); #endif + +#if HCI_VERSION_CODE < KERNEL_VERSION(3, 13, 0) +static int hci_uart_send_frame(struct sk_buff *skb); +#else +static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb); +#endif +