xref: /openbmc/linux/drivers/bluetooth/btrtl.h (revision 8571e645)
1 /*
2  *  Bluetooth support for Realtek devices
3  *
4  *  Copyright (C) 2015 Endless Mobile, Inc.
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  */
17 
18 #define RTL_FRAG_LEN 252
19 
20 struct rtl_download_cmd {
21 	__u8 index;
22 	__u8 data[RTL_FRAG_LEN];
23 } __packed;
24 
25 struct rtl_download_response {
26 	__u8 status;
27 	__u8 index;
28 } __packed;
29 
30 struct rtl_rom_version_evt {
31 	__u8 status;
32 	__u8 version;
33 } __packed;
34 
35 struct rtl_epatch_header {
36 	__u8 signature[8];
37 	__le32 fw_version;
38 	__le16 num_patches;
39 } __packed;
40 
41 #if IS_ENABLED(CONFIG_BT_RTL)
42 
43 int btrtl_setup_realtek(struct hci_dev *hdev);
44 
45 #else
46 
47 static inline int btrtl_setup_realtek(struct hci_dev *hdev)
48 {
49 	return -EOPNOTSUPP;
50 }
51 
52 #endif
53