Commit | Line | Data |
---|---|---|
94a79942 LF |
1 | /****************************************************************************** |
2 | * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. | |
3 | * | |
4 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
5 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
6 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
7 | * more details. | |
8 | * | |
9 | * You should have received a copy of the GNU General Public License along with | |
10 | * this program; if not, write to the Free Software Foundation, Inc., | |
11 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | |
12 | * | |
13 | * The full GNU General Public License is included in this distribution in the | |
14 | * file called LICENSE. | |
15 | * | |
16 | * Contact Information: | |
17 | * wlanfae <wlanfae@realtek.com> | |
18 | ******************************************************************************/ | |
19 | #ifndef __INC_FIRMWARE_H | |
20 | #define __INC_FIRMWARE_H | |
21 | ||
22 | #define RTL8190_CPU_START_OFFSET 0x80 | |
23 | ||
11632a0e | 24 | #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8) |
94a79942 | 25 | |
7f34f412 TG |
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 | ||
cec07695 | 30 | enum firmware_init_step { |
94a79942 LF |
31 | FW_INIT_STEP0_BOOT = 0, |
32 | FW_INIT_STEP1_MAIN = 1, | |
33 | FW_INIT_STEP2_DATA = 2, | |
cec07695 | 34 | }; |
94a79942 | 35 | |
6bf04003 | 36 | enum opt_rst_type { |
94a79942 LF |
37 | OPT_SYSTEM_RESET = 0, |
38 | OPT_FIRMWARE_RESET = 1, | |
6bf04003 | 39 | }; |
94a79942 | 40 | |
8ce50cf3 | 41 | enum desc_packet_type { |
94a79942 LF |
42 | DESC_PACKET_TYPE_INIT = 0, |
43 | DESC_PACKET_TYPE_NORMAL = 1, | |
8ce50cf3 | 44 | }; |
94a79942 | 45 | |
d4b8c177 | 46 | enum firmware_status { |
94a79942 LF |
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, | |
d4b8c177 | 53 | }; |
94a79942 | 54 | |
b25765ce | 55 | struct fw_seg_container { |
94a79942 LF |
56 | u16 seg_size; |
57 | u8 *seg_ptr; | |
d3b2c172 | 58 | }; |
94a79942 | 59 | |
5aca114d | 60 | struct rt_firmware { |
d4b8c177 | 61 | enum firmware_status firmware_status; |
94a79942 LF |
62 | u16 cmdpacket_frag_thresold; |
63 | #define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000 | |
64 | #define MAX_FW_INIT_STEP 3 | |
11632a0e | 65 | u8 firmware_buf[MAX_FW_INIT_STEP][RTL8190_MAX_FIRMWARE_CODE_SIZE]; |
94a79942 | 66 | u16 firmware_buf_size[MAX_FW_INIT_STEP]; |
5aca114d | 67 | }; |
94a79942 LF |
68 | |
69 | bool init_firmware(struct net_device *dev); | |
70 | extern void firmware_init_param(struct net_device *dev); | |
71 | ||
72 | #endif |