Commit | Line | Data |
---|---|---|
48f0ed1b MH |
1 | /* |
2 | * | |
3 | * Bluetooth support for Intel devices | |
4 | * | |
5 | * Copyright (C) 2015 Intel Corporation | |
6 | * | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | * | |
22 | */ | |
23 | ||
59a077c4 MH |
24 | struct intel_version { |
25 | u8 status; | |
26 | u8 hw_platform; | |
27 | u8 hw_variant; | |
28 | u8 hw_revision; | |
29 | u8 fw_variant; | |
30 | u8 fw_revision; | |
31 | u8 fw_build_num; | |
32 | u8 fw_build_ww; | |
33 | u8 fw_build_yy; | |
34 | u8 fw_patch_num; | |
35 | } __packed; | |
36 | ||
37 | struct intel_boot_params { | |
38 | __u8 status; | |
39 | __u8 otp_format; | |
40 | __u8 otp_content; | |
41 | __u8 otp_patch; | |
42 | __le16 dev_revid; | |
43 | __u8 secure_boot; | |
44 | __u8 key_from_hdr; | |
45 | __u8 key_type; | |
46 | __u8 otp_lock; | |
47 | __u8 api_lock; | |
48 | __u8 debug_lock; | |
49 | bdaddr_t otp_bdaddr; | |
50 | __u8 min_fw_build_nn; | |
51 | __u8 min_fw_build_cw; | |
52 | __u8 min_fw_build_yy; | |
53 | __u8 limited_cce; | |
54 | __u8 unlocked_state; | |
55 | } __packed; | |
56 | ||
ccd6da2a MH |
57 | struct intel_bootup { |
58 | __u8 zero; | |
59 | __u8 num_cmds; | |
60 | __u8 source; | |
61 | __u8 reset_type; | |
62 | __u8 reset_reason; | |
63 | __u8 ddc_status; | |
64 | } __packed; | |
65 | ||
66 | struct intel_secure_send_result { | |
67 | __u8 result; | |
68 | __le16 opcode; | |
69 | __u8 status; | |
70 | } __packed; | |
71 | ||
48f0ed1b MH |
72 | #if IS_ENABLED(CONFIG_BT_INTEL) |
73 | ||
74 | int btintel_check_bdaddr(struct hci_dev *hdev); | |
28dc4b92 LP |
75 | int btintel_enter_mfg(struct hci_dev *hdev); |
76 | int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched); | |
48f0ed1b | 77 | int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); |
6d2e50d2 | 78 | int btintel_set_diag(struct hci_dev *hdev, bool enable); |
3e24767b | 79 | int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable); |
973bb97e | 80 | void btintel_hw_error(struct hci_dev *hdev, u8 code); |
48f0ed1b | 81 | |
7feb99e1 | 82 | void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver); |
09df123d MH |
83 | int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen, |
84 | const void *param); | |
145f2368 | 85 | int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name); |
213445b2 MH |
86 | int btintel_set_event_mask(struct hci_dev *hdev, bool debug); |
87 | int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug); | |
6c483de1 | 88 | int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver); |
09df123d | 89 | |
d06f107b LP |
90 | struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, |
91 | u16 opcode_write); | |
92 | ||
48f0ed1b MH |
93 | #else |
94 | ||
95 | static inline int btintel_check_bdaddr(struct hci_dev *hdev) | |
96 | { | |
97 | return -EOPNOTSUPP; | |
98 | } | |
99 | ||
28dc4b92 LP |
100 | static inline int btintel_enter_mfg(struct hci_dev *hdev) |
101 | { | |
102 | return -EOPNOTSUPP; | |
103 | } | |
104 | ||
105 | static inline int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched) | |
106 | { | |
107 | return -EOPNOTSUPP; | |
108 | } | |
109 | ||
48f0ed1b MH |
110 | static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) |
111 | { | |
112 | return -EOPNOTSUPP; | |
113 | } | |
114 | ||
6d2e50d2 MH |
115 | static inline int btintel_set_diag(struct hci_dev *hdev, bool enable) |
116 | { | |
117 | return -EOPNOTSUPP; | |
118 | } | |
119 | ||
3e24767b MH |
120 | static inline int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable) |
121 | { | |
122 | return -EOPNOTSUPP; | |
123 | } | |
124 | ||
973bb97e MH |
125 | static inline void btintel_hw_error(struct hci_dev *hdev, u8 code) |
126 | { | |
127 | } | |
128 | ||
0eee53cd VS |
129 | static inline void btintel_version_info(struct hci_dev *hdev, |
130 | struct intel_version *ver) | |
7feb99e1 MH |
131 | { |
132 | } | |
133 | ||
09df123d MH |
134 | static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, |
135 | u32 plen, const void *param) | |
136 | { | |
137 | return -EOPNOTSUPP; | |
138 | } | |
139 | ||
145f2368 LP |
140 | static inline int btintel_load_ddc_config(struct hci_dev *hdev, |
141 | const char *ddc_name) | |
142 | { | |
143 | return -EOPNOTSUPP; | |
144 | } | |
145 | ||
213445b2 MH |
146 | static inline int btintel_set_event_mask(struct hci_dev *hdev, bool debug) |
147 | { | |
148 | return -EOPNOTSUPP; | |
149 | } | |
150 | ||
151 | static inline int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug) | |
152 | { | |
153 | return -EOPNOTSUPP; | |
154 | } | |
155 | ||
6c483de1 LP |
156 | static inline int btintel_read_version(struct hci_dev *hdev, |
157 | struct intel_version *ver) | |
158 | { | |
159 | return -EOPNOTSUPP; | |
160 | } | |
161 | ||
d06f107b LP |
162 | static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev, |
163 | u16 opcode_read, | |
164 | u16 opcode_write) | |
165 | { | |
166 | return ERR_PTR(-EINVAL); | |
167 | } | |
48f0ed1b | 168 | #endif |