2012-06-19 17:15:42 -06:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
(c) Cambridge Silicon Radio Limited 2011
|
|
|
|
All rights reserved and confidential information of CSR
|
|
|
|
|
|
|
|
Refer to LICENSE.txt included with this source for details
|
|
|
|
on the license terms.
|
|
|
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ---------------------------------------------------------------------------
|
|
|
|
* FILE: csr_wifi_hip_xbv.h
|
|
|
|
*
|
|
|
|
* PURPOSE:
|
|
|
|
* Definitions and declarations for code to read XBV files - the UniFi
|
|
|
|
* firmware download file format.
|
|
|
|
*
|
|
|
|
* ---------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef __XBV_H__
|
|
|
|
#define __XBV_H__
|
|
|
|
|
|
|
|
#ifndef CSR_WIFI_XBV_TEST
|
|
|
|
/* Driver includes */
|
|
|
|
#include "csr_wifi_hip_unifi.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
struct VMEQ
|
|
|
|
{
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 addr;
|
2012-07-20 13:00:10 -06:00
|
|
|
u16 mask;
|
|
|
|
u16 value;
|
2012-06-19 17:15:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VAND
|
|
|
|
{
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 first;
|
|
|
|
u32 count;
|
2012-06-19 17:15:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VERS
|
|
|
|
{
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 num_vand;
|
2012-06-19 17:15:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FWDL
|
|
|
|
{
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 dl_addr;
|
|
|
|
u32 dl_size;
|
|
|
|
u32 dl_offset;
|
2012-06-19 17:15:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FWOV
|
|
|
|
{
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 dl_size;
|
|
|
|
u32 dl_offset;
|
2012-06-19 17:15:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PTDL
|
|
|
|
{
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 dl_size;
|
|
|
|
u32 dl_offset;
|
2012-06-19 17:15:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
#define MAX_VMEQ 64
|
|
|
|
#define MAX_VAND 64
|
|
|
|
#define MAX_FWDL 256
|
|
|
|
#define MAX_PTDL 256
|
|
|
|
|
|
|
|
/* An XBV1 file can either contain firmware or patches (at the
|
|
|
|
* moment). The 'mode' member of the xbv1_t structure tells us which
|
|
|
|
* one is the case. */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
xbv_unknown,
|
|
|
|
xbv_firmware,
|
|
|
|
xbv_patch
|
|
|
|
} xbv_mode;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
xbv_mode mode;
|
|
|
|
|
|
|
|
/* Parts of a Firmware XBV1 */
|
|
|
|
|
|
|
|
struct VMEQ vmeq[MAX_VMEQ];
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 num_vmeq;
|
2012-06-19 17:15:42 -06:00
|
|
|
struct VAND vand[MAX_VAND];
|
|
|
|
struct VERS vers;
|
|
|
|
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 slut_addr;
|
2012-06-19 17:15:42 -06:00
|
|
|
|
|
|
|
/* F/W download image, possibly more than one part */
|
|
|
|
struct FWDL fwdl[MAX_FWDL];
|
2012-07-20 13:02:00 -06:00
|
|
|
s16 num_fwdl;
|
2012-06-19 17:15:42 -06:00
|
|
|
|
|
|
|
/* F/W overlay image, add r not used */
|
|
|
|
struct FWOV fwov;
|
|
|
|
|
|
|
|
/* Parts of a Patch XBV1 */
|
|
|
|
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 build_id;
|
2012-06-19 17:15:42 -06:00
|
|
|
|
|
|
|
struct PTDL ptdl[MAX_PTDL];
|
2012-07-20 13:02:00 -06:00
|
|
|
s16 num_ptdl;
|
2012-06-19 17:15:42 -06:00
|
|
|
} xbv1_t;
|
|
|
|
|
|
|
|
|
2012-07-20 13:07:25 -06:00
|
|
|
typedef s32 (*fwreadfn_t)(void *ospriv, void *dlpriv, u32 offset, void *buf, u32 len);
|
2012-06-19 17:15:42 -06:00
|
|
|
|
|
|
|
CsrResult xbv1_parse(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo);
|
2012-07-20 13:07:25 -06:00
|
|
|
s32 xbv1_read_slut(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo,
|
2012-07-20 13:05:42 -06:00
|
|
|
symbol_t *slut, u32 slut_len);
|
2012-06-19 17:15:42 -06:00
|
|
|
void* xbv_to_patch(card_t *card, fwreadfn_t readfn, const void *fw_buf, const xbv1_t *fwinfo,
|
2012-07-20 13:05:42 -06:00
|
|
|
u32 *size);
|
2012-06-19 17:15:42 -06:00
|
|
|
|
|
|
|
#endif /* __XBV_H__ */
|