Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / inc / k2 / 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
21 struct romp_api {
22         void (*_romp_init)(void);
23         BOOLEAN (*_romp_download)(uint16_t );
24         BOOLEAN (*_romp_install)(void);
25         BOOLEAN (*_romp_decode)(uint32_t );
26 };
27
28 #define _ROMP_MAGIC_ "[PaTcH]"
29
30 struct rom_patch_st {
31         uint16_t crc16;         // crc filed to maintain the integrity
32         uint16_t len;           // length of the patch code
33         uint32_t ld_addr;       // load address of the patch code
34         uint32_t fun_addr;  // entry address of the patch code
35         uint8_t *pfun;          // patch code
36 };
37
38
39 struct eep_redir_addr {
40         uint16_t offset;
41         uint16_t size;
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