xref: /freebsd/sys/dev/rtwn/rtl8192c/r92c_rom_image.h (revision 783d3ff6d7fae619db8a7990b8a6387de0c677b5)
1 /*-
2  * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
3  * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  *
17  * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $
18  */
19 
20 #ifndef R92C_ROM_IMAGE_H
21 #define R92C_ROM_IMAGE_H
22 
23 #include <dev/rtwn/rtl8192c/r92c_rom_defs.h>
24 
25 /*
26  * RTL8192CU ROM image.
27  */
28 struct r92c_rom {
29 	uint16_t	id;		/* 0x8192 */
30 	uint8_t		reserved1[5];
31 	uint8_t		dbg_sel;
32 	uint16_t	reserved2;
33 	uint16_t	vid;
34 	uint16_t	pid;
35 	uint8_t		usb_opt;
36 	uint8_t		ep_setting;
37 	uint16_t	reserved3;
38 	uint8_t		usb_phy;
39 	uint8_t		reserved4[3];
40 	uint8_t		macaddr[IEEE80211_ADDR_LEN];
41 	uint8_t		string[61];	/* "Realtek" */
42 	uint8_t		subcustomer_id;
43 	uint8_t		cck_tx_pwr[R92C_MAX_CHAINS][R92C_GROUP_2G];
44 	uint8_t		ht40_1s_tx_pwr[R92C_MAX_CHAINS][R92C_GROUP_2G];
45 	uint8_t		ht40_2s_tx_pwr_diff[R92C_GROUP_2G];
46 	uint8_t		ht20_tx_pwr_diff[R92C_GROUP_2G];
47 	uint8_t		ofdm_tx_pwr_diff[R92C_GROUP_2G];
48 	uint8_t		ht40_max_pwr[R92C_GROUP_2G];
49 	uint8_t		ht20_max_pwr[R92C_GROUP_2G];
50 	uint8_t		channel_plan;
51 	uint8_t		tssi[R92C_MAX_CHAINS];
52 	uint8_t		thermal_meter;
53 #define R92C_ROM_THERMAL_METER_M	0x1f
54 #define R92C_ROM_THERMAL_METER_S	0
55 
56 	uint8_t		rf_opt1;
57 	uint8_t		rf_opt2;
58 	uint8_t		rf_opt3;
59 	uint8_t		rf_opt4;
60 	uint8_t		reserved5;
61 	uint8_t		version;
62 	uint8_t		customer_id;
63 } __packed;
64 
65 _Static_assert(sizeof(struct r92c_rom) == R92C_EFUSE_MAP_LEN,
66     "R92C_EFUSE_MAP_LEN must be equal to sizeof(struct r92c_rom)!");
67 
68 #endif	/* R92C_ROM_IMAGE_H */
69