1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Bluetooth support for Realtek devices
5 * Copyright (C) 2015 Endless Mobile, Inc.
8 #define RTL_FRAG_LEN 252
10 #define rtl_dev_err(dev, fmt, ...) bt_dev_err(dev, "RTL: " fmt, ##__VA_ARGS__)
11 #define rtl_dev_warn(dev, fmt, ...) bt_dev_warn(dev, "RTL: " fmt, ##__VA_ARGS__)
12 #define rtl_dev_info(dev, fmt, ...) bt_dev_info(dev, "RTL: " fmt, ##__VA_ARGS__)
13 #define rtl_dev_dbg(dev, fmt, ...) bt_dev_dbg(dev, "RTL: " fmt, ##__VA_ARGS__)
15 struct btrtl_device_info;
17 struct rtl_download_cmd {
19 __u8 data[RTL_FRAG_LEN];
22 struct rtl_download_response {
27 struct rtl_rom_version_evt {
32 struct rtl_epatch_header {
38 struct rtl_vendor_config_entry {
44 struct rtl_vendor_config {
47 struct rtl_vendor_config_entry entry[];
50 #if IS_ENABLED(CONFIG_BT_RTL)
52 struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
54 void btrtl_free(struct btrtl_device_info *btrtl_dev);
55 int btrtl_download_firmware(struct hci_dev *hdev,
56 struct btrtl_device_info *btrtl_dev);
57 void btrtl_set_quirks(struct hci_dev *hdev,
58 struct btrtl_device_info *btrtl_dev);
59 int btrtl_setup_realtek(struct hci_dev *hdev);
60 int btrtl_shutdown_realtek(struct hci_dev *hdev);
61 int btrtl_get_uart_settings(struct hci_dev *hdev,
62 struct btrtl_device_info *btrtl_dev,
63 unsigned int *controller_baudrate,
64 u32 *device_baudrate, bool *flow_control);
68 static inline struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
71 return ERR_PTR(-EOPNOTSUPP);
74 static inline void btrtl_free(struct btrtl_device_info *btrtl_dev)
78 static inline int btrtl_download_firmware(struct hci_dev *hdev,
79 struct btrtl_device_info *btrtl_dev)
84 static inline void btrtl_set_quirks(struct hci_dev *hdev,
85 struct btrtl_device_info *btrtl_dev)
89 static inline int btrtl_setup_realtek(struct hci_dev *hdev)
94 static inline int btrtl_shutdown_realtek(struct hci_dev *hdev)
99 static inline int btrtl_get_uart_settings(struct hci_dev *hdev,
100 struct btrtl_device_info *btrtl_dev,
101 unsigned int *controller_baudrate,
102 u32 *device_baudrate,