1 //------------------------------------------------------------------------------
2 // <copyright file="bmi.h" company="Atheros">
3 //    Copyright (c) 2004-2010 Atheros Corporation.  All rights reserved.
4 //
5 //
6 // Permission to use, copy, modify, and/or distribute this software for any
7 // purpose with or without fee is hereby granted, provided that the above
8 // copyright notice and this permission notice appear in all copies.
9 //
10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 //
18 //
19 //------------------------------------------------------------------------------
20 //==============================================================================
21 // BMI declarations and prototypes
22 //
23 // Author(s): ="Atheros"
24 //==============================================================================
25 #ifndef _BMI_H_
26 #define _BMI_H_
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
32 /* Header files */
33 #include "a_config.h"
34 #include "athdefs.h"
35 #include "a_types.h"
36 #include "hif.h"
37 #include "a_osapi.h"
38 #include "bmi_msg.h"
39 
40 void
41 BMIInit(void);
42 
43 void
44 BMICleanup(void);
45 
46 int
47 BMIDone(struct hif_device *device);
48 
49 int
50 BMIGetTargetInfo(struct hif_device *device, struct bmi_target_info *targ_info);
51 
52 int
53 BMIReadMemory(struct hif_device *device,
54               u32 address,
55               u8 *buffer,
56               u32 length);
57 
58 int
59 BMIWriteMemory(struct hif_device *device,
60                u32 address,
61                u8 *buffer,
62                u32 length);
63 
64 int
65 BMIExecute(struct hif_device *device,
66            u32 address,
67            u32 *param);
68 
69 int
70 BMISetAppStart(struct hif_device *device,
71                u32 address);
72 
73 int
74 BMIReadSOCRegister(struct hif_device *device,
75                    u32 address,
76                    u32 *param);
77 
78 int
79 BMIWriteSOCRegister(struct hif_device *device,
80                     u32 address,
81                     u32 param);
82 
83 int
84 BMIrompatchInstall(struct hif_device *device,
85                    u32 ROM_addr,
86                    u32 RAM_addr,
87                    u32 nbytes,
88                    u32 do_activate,
89                    u32 *patch_id);
90 
91 int
92 BMIrompatchUninstall(struct hif_device *device,
93                      u32 rompatch_id);
94 
95 int
96 BMIrompatchActivate(struct hif_device *device,
97                     u32 rompatch_count,
98                     u32 *rompatch_list);
99 
100 int
101 BMIrompatchDeactivate(struct hif_device *device,
102                       u32 rompatch_count,
103                       u32 *rompatch_list);
104 
105 int
106 BMILZStreamStart(struct hif_device *device,
107                  u32 address);
108 
109 int
110 BMILZData(struct hif_device *device,
111           u8 *buffer,
112           u32 length);
113 
114 int
115 BMIFastDownload(struct hif_device *device,
116                 u32 address,
117                 u8 *buffer,
118                 u32 length);
119 
120 int
121 BMIRawWrite(struct hif_device *device,
122             u8 *buffer,
123             u32 length);
124 
125 int
126 BMIRawRead(struct hif_device *device,
127            u8 *buffer,
128            u32 length,
129            bool want_timeout);
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* _BMI_H_ */
136