]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/bluetooth/btintel.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
[mirror_ubuntu-jammy-kernel.git] / drivers / bluetooth / btintel.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
48f0ed1b
MH
2/*
3 *
4 * Bluetooth support for Intel devices
5 *
6 * Copyright (C) 2015 Intel Corporation
48f0ed1b
MH
7 */
8
59a077c4
MH
9struct intel_version {
10 u8 status;
11 u8 hw_platform;
12 u8 hw_variant;
13 u8 hw_revision;
14 u8 fw_variant;
15 u8 fw_revision;
16 u8 fw_build_num;
17 u8 fw_build_ww;
18 u8 fw_build_yy;
19 u8 fw_patch_num;
20} __packed;
21
22struct intel_boot_params {
23 __u8 status;
24 __u8 otp_format;
25 __u8 otp_content;
26 __u8 otp_patch;
27 __le16 dev_revid;
28 __u8 secure_boot;
29 __u8 key_from_hdr;
30 __u8 key_type;
31 __u8 otp_lock;
32 __u8 api_lock;
33 __u8 debug_lock;
34 bdaddr_t otp_bdaddr;
35 __u8 min_fw_build_nn;
36 __u8 min_fw_build_cw;
37 __u8 min_fw_build_yy;
38 __u8 limited_cce;
39 __u8 unlocked_state;
40} __packed;
41
ccd6da2a
MH
42struct intel_bootup {
43 __u8 zero;
44 __u8 num_cmds;
45 __u8 source;
46 __u8 reset_type;
47 __u8 reset_reason;
48 __u8 ddc_status;
49} __packed;
50
51struct intel_secure_send_result {
52 __u8 result;
53 __le16 opcode;
54 __u8 status;
55} __packed;
56
e5889af6
THJA
57struct intel_reset {
58 __u8 reset_type;
59 __u8 patch_enable;
60 __u8 ddc_reload;
61 __u8 boot_option;
62 __le32 boot_param;
63} __packed;
64
48f0ed1b
MH
65#if IS_ENABLED(CONFIG_BT_INTEL)
66
67int btintel_check_bdaddr(struct hci_dev *hdev);
28dc4b92
LP
68int btintel_enter_mfg(struct hci_dev *hdev);
69int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched);
48f0ed1b 70int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
6d2e50d2 71int btintel_set_diag(struct hci_dev *hdev, bool enable);
3e24767b 72int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable);
973bb97e 73void btintel_hw_error(struct hci_dev *hdev, u8 code);
48f0ed1b 74
7feb99e1 75void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver);
09df123d
MH
76int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
77 const void *param);
145f2368 78int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name);
213445b2
MH
79int btintel_set_event_mask(struct hci_dev *hdev, bool debug);
80int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug);
6c483de1 81int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver);
09df123d 82
d06f107b
LP
83struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read,
84 u16 opcode_write);
e5889af6 85int btintel_send_intel_reset(struct hci_dev *hdev, u32 boot_param);
faf174d2
THJA
86int btintel_read_boot_params(struct hci_dev *hdev,
87 struct intel_boot_params *params);
fbbe83c5
THJA
88int btintel_download_firmware(struct hci_dev *dev, const struct firmware *fw,
89 u32 *boot_param);
48f0ed1b
MH
90#else
91
92static inline int btintel_check_bdaddr(struct hci_dev *hdev)
93{
94 return -EOPNOTSUPP;
95}
96
28dc4b92
LP
97static inline int btintel_enter_mfg(struct hci_dev *hdev)
98{
99 return -EOPNOTSUPP;
100}
101
102static inline int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched)
103{
104 return -EOPNOTSUPP;
105}
106
48f0ed1b
MH
107static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
108{
109 return -EOPNOTSUPP;
110}
111
6d2e50d2
MH
112static inline int btintel_set_diag(struct hci_dev *hdev, bool enable)
113{
114 return -EOPNOTSUPP;
115}
116
3e24767b
MH
117static inline int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable)
118{
119 return -EOPNOTSUPP;
120}
121
973bb97e
MH
122static inline void btintel_hw_error(struct hci_dev *hdev, u8 code)
123{
124}
125
0eee53cd
VS
126static inline void btintel_version_info(struct hci_dev *hdev,
127 struct intel_version *ver)
7feb99e1
MH
128{
129}
130
09df123d
MH
131static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type,
132 u32 plen, const void *param)
133{
134 return -EOPNOTSUPP;
135}
136
145f2368
LP
137static inline int btintel_load_ddc_config(struct hci_dev *hdev,
138 const char *ddc_name)
139{
140 return -EOPNOTSUPP;
141}
142
213445b2
MH
143static inline int btintel_set_event_mask(struct hci_dev *hdev, bool debug)
144{
145 return -EOPNOTSUPP;
146}
147
148static inline int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug)
149{
150 return -EOPNOTSUPP;
151}
152
6c483de1
LP
153static inline int btintel_read_version(struct hci_dev *hdev,
154 struct intel_version *ver)
155{
156 return -EOPNOTSUPP;
157}
158
d06f107b
LP
159static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev,
160 u16 opcode_read,
161 u16 opcode_write)
162{
163 return ERR_PTR(-EINVAL);
164}
e5889af6
THJA
165
166static inline int btintel_send_intel_reset(struct hci_dev *hdev,
167 u32 reset_param)
168{
169 return -EOPNOTSUPP;
170}
faf174d2
THJA
171
172static inline int btintel_read_boot_params(struct hci_dev *hdev,
173 struct intel_boot_params *params)
174{
175 return -EOPNOTSUPP;
176}
fbbe83c5
THJA
177
178static inline int btintel_download_firmware(struct hci_dev *dev,
179 const struct firmware *fw,
180 u32 *boot_param)
181{
182 return -EOPNOTSUPP;
183}
48f0ed1b 184#endif