Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / build / magpie_1_1 / inc / romp_api.h
1 /*************************************************************************/
2 /*  Copyright (c) 2008 Atheros Communications, Inc., All Rights Reserved */
3 /*                                                                       */
4 /*  Module Name : romp_api.h                                                     */
5 /*                                                                       */
6 /*  Abstract                                                             */
7 /*      This file contains definition of data structure and interface    */
8 /*                                                                       */
9 /*  NOTES                                                                */
10 /*      None                                                             */
11 /*                                                                       */
12 /*************************************************************************/
13
14 #ifndef _ROMP_API_H_
15 #define _ROMP_API_H_
16
17 #include "dt_defs.h"
18
19 /******** hardware API table structure (API descriptions below) *************/
20 struct romp_api {
21     void (*_romp_init)(void);
22     BOOLEAN (*_romp_download)(uint16_t );
23     BOOLEAN (*_romp_install)(void);
24     BOOLEAN (*_romp_decode)(uint32_t );
25 };
26
27 #define _ROMP_MAGIC_ "[PaTcH]"
28
29 struct rom_patch_st {
30     uint16_t crc16;             // crc filed to maintain the integrity
31     uint16_t len;               // length of the patch code
32     uint32_t ld_addr;   // load address of the patch code
33         uint32_t fun_addr;  // entry address of the patch code
34     uint8_t *pfun;              // patch code
35 };
36
37
38 struct eep_redir_addr {
39     uint16_t offset;
40     uint16_t size;
41 };
42
43
44 /************************* EXPORT function ***************************/
45 uint16_t cal_crc16(uint32_t sz, uint8_t *p);
46
47 #endif  // end of _UART_API_H_
48