Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
csr_wifi_hip_xbv.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  (c) Cambridge Silicon Radio Limited 2011
4  All rights reserved and confidential information of CSR
5 
6  Refer to LICENSE.txt included with this source for details
7  on the license terms.
8 
9 *****************************************************************************/
10 
11 /*
12  * ---------------------------------------------------------------------------
13  * FILE: csr_wifi_hip_xbv.h
14  *
15  * PURPOSE:
16  * Definitions and declarations for code to read XBV files - the UniFi
17  * firmware download file format.
18  *
19  * ---------------------------------------------------------------------------
20  */
21 #ifndef __XBV_H__
22 #define __XBV_H__
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #ifndef CSR_WIFI_XBV_TEST
29 /* Driver includes */
30 #include "csr_wifi_hip_unifi.h"
31 #endif
32 
33 
34 struct VMEQ
35 {
39 };
40 
41 struct VAND
42 {
45 };
46 
47 struct VERS
48 {
50 };
51 
52 struct FWDL
53 {
57 };
58 
59 struct FWOV
60 {
63 };
64 
65 struct PTDL
66 {
69 };
70 
71 #define MAX_VMEQ 64
72 #define MAX_VAND 64
73 #define MAX_FWDL 256
74 #define MAX_PTDL 256
75 
76 /* An XBV1 file can either contain firmware or patches (at the
77  * moment). The 'mode' member of the xbv1_t structure tells us which
78  * one is the case. */
79 typedef enum
80 {
84 } xbv_mode;
85 
86 typedef struct
87 {
89 
90  /* Parts of a Firmware XBV1 */
91 
92  struct VMEQ vmeq[MAX_VMEQ];
94  struct VAND vand[MAX_VAND];
95  struct VERS vers;
96 
98 
99  /* F/W download image, possibly more than one part */
100  struct FWDL fwdl[MAX_FWDL];
102 
103  /* F/W overlay image, add r not used */
104  struct FWOV fwov;
105 
106  /* Parts of a Patch XBV1 */
107 
109 
110  struct PTDL ptdl[MAX_PTDL];
112 } xbv1_t;
113 
114 
115 typedef s32 (*fwreadfn_t)(void *ospriv, void *dlpriv, u32 offset, void *buf, u32 len);
116 
117 CsrResult xbv1_parse(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo);
118 s32 xbv1_read_slut(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo,
119  symbol_t *slut, u32 slut_len);
120 void* xbv_to_patch(card_t *card, fwreadfn_t readfn, const void *fw_buf, const xbv1_t *fwinfo,
121  u32 *size);
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif /* __XBV_H__ */