Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong
GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/cache/sources/rtk_hciattach/rtb_fwc.h
8659 views
1
/*
2
* Copyright (C) 2018 Realtek Semiconductor Corporation.
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*/
14
15
struct rtb_struct;
16
17
#define BAUDRATE_4BYTES
18
19
#define ROM_LMP_NONE 0x0000
20
#define ROM_LMP_8723a 0x1200
21
#define ROM_LMP_8723b 0x8723
22
#define ROM_LMP_8821a 0x8821
23
#define ROM_LMP_8761a 0x8761
24
#define ROM_LMP_8761btc 0x8763
25
26
#define ROM_LMP_8703a 0x87b3
27
#define ROM_LMP_8763a 0x8763
28
#define ROM_LMP_8703b 0x8703
29
#define ROM_LMP_8723c 0x87c3 /* ??????? */
30
#define ROM_LMP_8822b 0x8822
31
#define ROM_LMP_8822c 0x8822
32
#define ROM_LMP_8723cs_xx 0x8704
33
#define ROM_LMP_8723cs_cg 0x8705
34
#define ROM_LMP_8723cs_vf 0x8706
35
36
/* Chip type */
37
#define CHIP_8703AS 1
38
#define CHIP_8723CS_CG 3
39
#define CHIP_8723CS_VF 4
40
#define CHIP_8723CS_XX 5
41
#define CHIP_8703BS 7
42
43
/* software id */
44
#define CHIP_UNKNOWN 0x00
45
#define CHIP_8761AT 0x1F
46
#define CHIP_8761ATF 0x2F
47
#define CHIP_8761BTC 0x3F
48
#define CHIP_8761BH4 0x4F
49
#define CHIP_8723BS 0x5F
50
#define CHIP_BEFORE 0x6F
51
#define CHIP_8822BS 0x70
52
#define CHIP_8723DS 0x71
53
#define CHIP_8821CS 0x72
54
#define CHIP_8822CS 0x73
55
#define CHIP_8761B 0x74
56
57
#define RTL_FW_MATCH_CHIP_TYPE (1 << 0)
58
#define RTL_FW_MATCH_HCI_VER (1 << 1)
59
#define RTL_FW_MATCH_HCI_REV (1 << 2)
60
struct patch_info {
61
uint32_t match_flags;
62
uint8_t chip_type;
63
uint16_t lmp_subver;
64
uint16_t proj_id;
65
uint8_t hci_ver;
66
uint16_t hci_rev;
67
char *patch_file;
68
char *config_file;
69
char *ic_name;
70
};
71
72
struct patch_info *get_patch_entry(struct rtb_struct *btrtl);
73
uint8_t *rtb_read_config(struct rtb_struct *btrtl, int *cfg_len);
74
uint8_t *rtb_read_firmware(struct rtb_struct *btrtl, int *fw_len);
75
uint8_t *rtb_get_final_patch(int fd, int proto, int *rlen);
76
77