1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef __INC_FIRMWARE_H
20#define __INC_FIRMWARE_H
21
22#define RTL8190_CPU_START_OFFSET 0x80
23
24#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8)
25
26#define RTL8192E_BOOT_IMG_FW "RTL8192E/boot.img"
27#define RTL8192E_MAIN_IMG_FW "RTL8192E/main.img"
28#define RTL8192E_DATA_IMG_FW "RTL8192E/data.img"
29
30enum firmware_init_step {
31 FW_INIT_STEP0_BOOT = 0,
32 FW_INIT_STEP1_MAIN = 1,
33 FW_INIT_STEP2_DATA = 2,
34};
35
36enum opt_rst_type {
37 OPT_SYSTEM_RESET = 0,
38 OPT_FIRMWARE_RESET = 1,
39};
40
41enum desc_packet_type {
42 DESC_PACKET_TYPE_INIT = 0,
43 DESC_PACKET_TYPE_NORMAL = 1,
44};
45
46enum firmware_status {
47 FW_STATUS_0_INIT = 0,
48 FW_STATUS_1_MOVE_BOOT_CODE = 1,
49 FW_STATUS_2_MOVE_MAIN_CODE = 2,
50 FW_STATUS_3_TURNON_CPU = 3,
51 FW_STATUS_4_MOVE_DATA_CODE = 4,
52 FW_STATUS_5_READY = 5,
53};
54
55struct fw_seg_container {
56 u16 seg_size;
57 u8 *seg_ptr;
58};
59
60struct rt_firmware {
61 enum firmware_status firmware_status;
62 u16 cmdpacket_frag_thresold;
63#define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000
64#define MAX_FW_INIT_STEP 3
65 u8 firmware_buf[MAX_FW_INIT_STEP][RTL8190_MAX_FIRMWARE_CODE_SIZE];
66 u16 firmware_buf_size[MAX_FW_INIT_STEP];
67};
68
69bool init_firmware(struct net_device *dev);
70extern void firmware_init_param(struct net_device *dev);
71
72#endif
73