// SPDX-License-Identifier: ISC/* Copyright (C) 2021 MediaTek Inc. * */#include<linux/module.h>#include<linux/firmware.h>#include<linux/usb.h>#include<linux/iopoll.h>#include<asm/unaligned.h>#include<net/bluetooth/bluetooth.h>#include<net/bluetooth/hci_core.h>#include"btmtk.h"#define VERSION "0.1"/* It is for mt79xx download rom patch*/#define MTK_FW_ROM_PATCH_HEADER_SIZE 32#define MTK_FW_ROM_PATCH_GD_SIZE 64#define MTK_FW_ROM_PATCH_SEC_MAP_SIZE 64#define MTK_SEC_MAP_COMMON_SIZE 12#define MTK_SEC_MAP_NEED_SEND_SIZE 52/* It is for mt79xx iso data transmission setting */#define MTK_ISO_THRESHOLD 264structbtmtk_patch_header{u8datetime[16];u8platform[4];__le16hwver;__le16swver;__le32magicnum;}__packed;structbtmtk_global_desc{__le32patch_ver;__le32sub_sys;__le32feature_opt;__le32section_num;}__packed;structbtmtk_section_map{__le32sectype;__le32secoffset;__le32secsize;union{__le32u4SecSpec[13];struct{__le32dlAddr;__le32dlsize;__le32seckeyidx;__le32alignlen;__le32sectype;__le32dlmodecrctype