Path: blob/next/external/cache/sources/rtk_hciattach/rtb_fwc.h
8659 views
/*1* Copyright (C) 2018 Realtek Semiconductor Corporation.2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*/1314struct rtb_struct;1516#define BAUDRATE_4BYTES1718#define ROM_LMP_NONE 0x000019#define ROM_LMP_8723a 0x120020#define ROM_LMP_8723b 0x872321#define ROM_LMP_8821a 0x882122#define ROM_LMP_8761a 0x876123#define ROM_LMP_8761btc 0x87632425#define ROM_LMP_8703a 0x87b326#define ROM_LMP_8763a 0x876327#define ROM_LMP_8703b 0x870328#define ROM_LMP_8723c 0x87c3 /* ??????? */29#define ROM_LMP_8822b 0x882230#define ROM_LMP_8822c 0x882231#define ROM_LMP_8723cs_xx 0x870432#define ROM_LMP_8723cs_cg 0x870533#define ROM_LMP_8723cs_vf 0x87063435/* Chip type */36#define CHIP_8703AS 137#define CHIP_8723CS_CG 338#define CHIP_8723CS_VF 439#define CHIP_8723CS_XX 540#define CHIP_8703BS 74142/* software id */43#define CHIP_UNKNOWN 0x0044#define CHIP_8761AT 0x1F45#define CHIP_8761ATF 0x2F46#define CHIP_8761BTC 0x3F47#define CHIP_8761BH4 0x4F48#define CHIP_8723BS 0x5F49#define CHIP_BEFORE 0x6F50#define CHIP_8822BS 0x7051#define CHIP_8723DS 0x7152#define CHIP_8821CS 0x7253#define CHIP_8822CS 0x7354#define CHIP_8761B 0x745556#define RTL_FW_MATCH_CHIP_TYPE (1 << 0)57#define RTL_FW_MATCH_HCI_VER (1 << 1)58#define RTL_FW_MATCH_HCI_REV (1 << 2)59struct patch_info {60uint32_t match_flags;61uint8_t chip_type;62uint16_t lmp_subver;63uint16_t proj_id;64uint8_t hci_ver;65uint16_t hci_rev;66char *patch_file;67char *config_file;68char *ic_name;69};7071struct patch_info *get_patch_entry(struct rtb_struct *btrtl);72uint8_t *rtb_read_config(struct rtb_struct *btrtl, int *cfg_len);73uint8_t *rtb_read_firmware(struct rtb_struct *btrtl, int *fw_len);74uint8_t *rtb_get_final_patch(int fd, int proto, int *rlen);757677