xref: /freebsd/sys/dev/rtwn/rtl8188e/r88e_rom_image.h (revision 2008043f386721d58158e37e0d7e50df8095942d)
1 /*-
2  * Copyright (c) 2015-2016 Andriy Voskoboinyk <avos@FreeBSD.org>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef R88E_ROM_IMAGE_H
18 #define R88E_ROM_IMAGE_H
19 
20 #include <dev/rtwn/rtl8188e/r88e_rom_defs.h>
21 
22 /*
23  * RTL8188EU ROM image.
24  */
25 struct r88e_rom {
26 	uint8_t		reserved1[16];
27 	uint8_t		cck_tx_pwr[R88E_GROUP_2G];
28 	uint8_t		ht40_tx_pwr[R88E_GROUP_2G - 1];
29 	uint8_t		tx_pwr_diff;
30 	uint8_t		reserved2[156];
31 	uint8_t		channel_plan;
32 	uint8_t		crystalcap;
33 #define R88E_ROM_CRYSTALCAP_DEF		0x20
34 
35 	uint8_t		thermal_meter;
36 	uint8_t		reserved3[6];
37 	uint8_t		rf_board_opt;
38 	uint8_t		rf_feature_opt;
39 	uint8_t		rf_bt_opt;
40 	uint8_t		version;
41 	uint8_t		customer_id;
42 	uint8_t		reserved4[3];
43 	uint8_t		rf_ant_opt;
44 	uint8_t		reserved5[6];
45 
46 	union {
47 		struct {
48 			uint16_t	vid;
49 			uint16_t	pid;
50 			uint8_t		usb_opt;
51 			uint8_t		reserved6[2];
52 			uint8_t		macaddr[IEEE80211_ADDR_LEN];
53 		} __packed usb;
54 
55 		struct {
56 			uint8_t		macaddr[IEEE80211_ADDR_LEN];
57 			uint16_t	vid;
58 			uint16_t	pid;
59 			uint8_t		reserved6[3];
60 		} __packed pci;
61 	} __packed diff_d0;
62 
63 	uint8_t		reserved7[2];
64 	uint8_t		string[33];	/* "realtek 802.11n NIC" */
65 	uint8_t		reserved8[256];
66 } __packed;
67 
68 _Static_assert(sizeof(struct r88e_rom) == R88E_EFUSE_MAP_LEN,
69     "R88E_EFUSE_MAP_LEN must be equal to sizeof(struct r88e_rom)!");
70 
71 #endif	/* R88E_ROM_IMAGE_H */
72