summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/btrtl.h
diff options
context:
space:
mode:
authorMax Chou <max.chou@realtek.com>2023-04-17 10:33:58 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-04-23 22:06:09 -0700
commit9a24ce5e29b15c4c6b0c89c04f9df6ce14addefa (patch)
treef3eaf1a4a3916263027e4532e3c58e5fe93d1969 /drivers/bluetooth/btrtl.h
parent0ab905c3be8c2be368821dd2bd1f8d126064d993 (diff)
Bluetooth: btrtl: Firmware format v2 support
Realtek changed the format of the firmware file as v2. The driver should implement the patch to extract the firmware data from the firmware file. The future chips must apply this patch for firmware loading. This patch is compatible with the both previous format and v2 as well. Signed-off-by: Allen Chen <allen_chen@realsil.com.cn> Signed-off-by: Alex Lu <alex_lu@realsil.com.cn> Tested-by: Hilda Wu <hildawu@realtek.com> Signed-off-by: Max Chou <max.chou@realtek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth/btrtl.h')
-rw-r--r--drivers/bluetooth/btrtl.h53
1 files changed, 52 insertions, 1 deletions
diff --git a/drivers/bluetooth/btrtl.h b/drivers/bluetooth/btrtl.h
index 349d72ee571b..adb4c2c9abc5 100644
--- a/drivers/bluetooth/btrtl.h
+++ b/drivers/bluetooth/btrtl.h
@@ -49,7 +49,58 @@ struct rtl_vendor_config_entry {
struct rtl_vendor_config {
__le32 signature;
__le16 total_len;
- struct rtl_vendor_config_entry entry[];
+ __u8 entry[];
+} __packed;
+
+struct rtl_epatch_header_v2 {
+ __u8 signature[8];
+ __u8 fw_version[8];
+ __le32 num_sections;
+} __packed;
+
+struct rtl_section {
+ __le32 opcode;
+ __le32 len;
+ u8 data[];
+} __packed;
+
+struct rtl_section_hdr {
+ __le16 num;
+ __le16 reserved;
+} __packed;
+
+struct rtl_common_subsec {
+ __u8 eco;
+ __u8 prio;
+ __u8 cb[2];
+ __le32 len;
+ __u8 data[];
+};
+
+struct rtl_sec_hdr {
+ __u8 eco;
+ __u8 prio;
+ __u8 key_id;
+ __u8 reserved;
+ __le32 len;
+ __u8 data[];
+} __packed;
+
+struct rtl_subsection {
+ struct list_head list;
+ u32 opcode;
+ u32 len;
+ u8 prio;
+ u8 *data;
+};
+
+struct rtl_iovec {
+ u8 *data;
+ u32 len;
+};
+
+struct rtl_vendor_cmd {
+ __u8 param[5];
} __packed;
enum {