xref: /freebsd/sys/dev/rtwn/rtl8188e/r88e_rom_image.h (revision f39bffc62c1395bde25d152c7f68fdf7cbaab414)
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  * $FreeBSD$
17  */
18 
19 #ifndef R88E_ROM_IMAGE_H
20 #define R88E_ROM_IMAGE_H
21 
22 #include <dev/rtwn/rtl8188e/r88e_rom_defs.h>
23 
24 /*
25  * RTL8188EU ROM image.
26  */
27 struct r88e_rom {
28 	uint8_t		reserved1[16];
29 	uint8_t		cck_tx_pwr[R88E_GROUP_2G];
30 	uint8_t		ht40_tx_pwr[R88E_GROUP_2G - 1];
31 	uint8_t		tx_pwr_diff;
32 	uint8_t		reserved2[156];
33 	uint8_t		channel_plan;
34 	uint8_t		crystalcap;
35 #define R88E_ROM_CRYSTALCAP_DEF		0x20
36 
37 	uint8_t		thermal_meter;
38 	uint8_t		reserved3[6];
39 	uint8_t		rf_board_opt;
40 	uint8_t		rf_feature_opt;
41 	uint8_t		rf_bt_opt;
42 	uint8_t		version;
43 	uint8_t		customer_id;
44 	uint8_t		reserved4[3];
45 	uint8_t		rf_ant_opt;
46 	uint8_t		reserved5[6];
47 	uint16_t	vid;
48 	uint16_t	pid;
49 	uint8_t		usb_opt;
50 	uint8_t		reserved6[2];
51 	uint8_t		macaddr[IEEE80211_ADDR_LEN];
52 	uint8_t		reserved7[2];
53 	uint8_t		string[33];	/* "realtek 802.11n NIC" */
54 	uint8_t		reserved8[256];
55 } __packed;
56 
57 _Static_assert(sizeof(struct r88e_rom) == R88E_EFUSE_MAP_LEN,
58     "R88E_EFUSE_MAP_LEN must be equal to sizeof(struct r88e_rom)!");
59 
60 #endif	/* R88E_ROM_IMAGE_H */
61