summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/sd8797/mlan/mlan_init.h
blob: 4496741a3cfb295f4fe8cf1f22b17002fc29d6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/** @file mlan_init.h
 *
 *  @brief This file defines the FW initialization data
 *  structures.
 *
 *  Copyright (C) 2008-2011, Marvell International Ltd. 
 *
 *  This software file (the "File") is distributed by Marvell International
 *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
 *  (the "License").  You may use, redistribute and/or modify this File in
 *  accordance with the terms and conditions of the License, a copy of which
 *  is available by writing to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
 *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
 *
 *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
 *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
 *  this warranty disclaimer.
 */

/******************************************************
Change log:
    10/13/2008: initial version
******************************************************/

#ifndef _MLAN_INIT_H_
#define _MLAN_INIT_H_

/** Tx buffer size for firmware download*/
#define FW_DNLD_TX_BUF_SIZE	620
/** Rx buffer size for firmware download*/
#define FW_DNLD_RX_BUF_SIZE       2048
/** Max firmware retry */
#define MAX_FW_RETRY        	3

/** Firmware has last block */
#define FW_HAS_LAST_BLOCK		0x00000004

/** Firmware data transmit size */
#define FW_DATA_XMIT_SIZE \
	sizeof(FWHeader) + DataLength + sizeof(t_u32)

/** FWHeader */
typedef struct _FWHeader
{
    /** FW download command */
    t_u32 dnld_cmd;
    /** FW base address */
    t_u32 base_addr;
    /** FW data length */
    t_u32 data_length;
    /** FW CRC */
    t_u32 crc;
} FWHeader;

/** FWData */
typedef struct _FWData
{
    /** FW data header */
    FWHeader fw_header;
    /** FW data sequence number */
    t_u32 seq_num;
    /** FW data buffer */
    t_u8 data[1];
} FWData;

/** FWSyncHeader */
typedef struct _FWSyncHeader
{
    /** FW sync header command */
    t_u32 cmd;
    /** FW sync header sequence number */
    t_u32 seq_num;
} FWSyncHeader;

#ifdef BIG_ENDIAN_SUPPORT
/** Convert sequence number and command fields of fwheader to correct endian format */
#define endian_convert_syncfwheader(x)  { \
		(x)->cmd = wlan_le32_to_cpu((x)->cmd); \
		(x)->seq_num = wlan_le32_to_cpu((x)->seq_num); \
	}
#else
/** Convert sequence number and command fields of fwheader to correct endian format */
#define endian_convert_syncfwheader(x)
#endif /* BIG_ENDIAN_SUPPORT */

#endif /* _MLAN_INIT_H_ */