xref: /freebsd/sys/dev/rtwn/if_rtwn_fw.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
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 IF_RTWN_FW_H
21 #define IF_RTWN_FW_H
22 
23 /*
24  * Firmware base address.
25  */
26 #define R92C_FW_START_ADDR		0x1000
27 #define R92C_FW_PAGE_SIZE		4096
28 #define R92C_FW_MAX_BLOCK_SIZE		196
29 
30 /*
31  * Firmware image header.
32  */
33 struct r92c_fw_hdr {
34 	/* QWORD0 */
35 	uint16_t	signature;
36 	uint8_t		category;
37 	uint8_t		function;
38 	uint16_t	version;
39 	uint16_t	subversion;
40 	/* QWORD1 */
41 	uint8_t		month;
42 	uint8_t		date;
43 	uint8_t		hour;
44 	uint8_t		minute;
45 	uint16_t	ramcodesize;
46 	uint16_t	reserved2;
47 	/* QWORD2 */
48 	uint32_t	svnidx;
49 	uint32_t	reserved3;
50 	/* QWORD3 */
51 	uint32_t	reserved4;
52 	uint32_t	reserved5;
53 } __packed;
54 
55 int		rtwn_load_firmware(struct rtwn_softc *);
56 
57 #endif	/* IF_RTWN_FW_H */
58