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