summaryrefslogtreecommitdiff
path: root/fwcmd.h
blob: cc4b7d9e51dd1fc0a39692b81f1ea0779135fd7d (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*
 * Copyright (C) 2006-2015, 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.
 *
 * 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.
 */

/* Description:  This file defines firmware host command related
 * functions.
 */

#ifndef _FWCMD_H_
#define _FWCMD_H_

/*  Define OpMode for SoftAP/Station mode
 *
 *  The following mode signature has to be written to PCI scratch register#0
 *  right after successfully downloading the last block of firmware and
 *  before waiting for firmware ready signature
 */

#define HOSTCMD_STA_MODE                0x5A
#define HOSTCMD_SOFTAP_MODE             0xA5

#define HOSTCMD_STA_FWRDY_SIGNATURE     0xF0F1F2F4
#define HOSTCMD_SOFTAP_FWRDY_SIGNATURE  0xF1F2F4A5

#define GUARD_INTERVAL_STANDARD         1
#define GUARD_INTERVAL_SHORT            2
#define GUARD_INTERVAL_AUTO             3

#define	LINK_CS_STATE_CONSERV           0
#define	LINK_CS_STATE_AGGR              1
#define	LINK_CS_STATE_AUTO              2
#define	LINK_CS_STATE_AUTO_DISABLED     3

enum {
	WL_ANTENNATYPE_RX = 1,
	WL_ANTENNATYPE_TX = 2,
};

enum encr_type {
	ENCR_TYPE_WEP = 0,
	ENCR_TYPE_DISABLE = 1,
	ENCR_TYPE_TKIP = 4,
	ENCR_TYPE_AES = 6,
	ENCR_TYPE_MIX = 7,
};

void mwl_fwcmd_reset(struct ieee80211_hw *hw);

void mwl_fwcmd_int_enable(struct ieee80211_hw *hw);

void mwl_fwcmd_int_disable(struct ieee80211_hw *hw);

int mwl_fwcmd_get_hw_specs(struct ieee80211_hw *hw);

int mwl_fwcmd_set_hw_specs(struct ieee80211_hw *hw);

int mwl_fwcmd_get_stat(struct ieee80211_hw *hw,
		       struct ieee80211_low_level_stats *stats);

int mwl_fwcmd_radio_enable(struct ieee80211_hw *hw);

int mwl_fwcmd_radio_disable(struct ieee80211_hw *hw);

int mwl_fwcmd_set_radio_preamble(struct ieee80211_hw *hw,
				 bool short_preamble);

int mwl_fwcmd_get_addr_value(struct ieee80211_hw *hw, u32 addr, u32 len,
			     u32 *val, u16 set);

int mwl_fwcmd_max_tx_power(struct ieee80211_hw *hw,
			   struct ieee80211_conf *conf, u8 fraction);

int mwl_fwcmd_tx_power(struct ieee80211_hw *hw,
		       struct ieee80211_conf *conf, u8 fraction);

int mwl_fwcmd_rf_antenna(struct ieee80211_hw *hw, int dir, int antenna);

int mwl_fwcmd_broadcast_ssid_enable(struct ieee80211_hw *hw,
				    struct ieee80211_vif *vif, bool enable);

int mwl_fwcmd_set_rf_channel(struct ieee80211_hw *hw,
			     struct ieee80211_conf *conf);

int mwl_fwcmd_set_aid(struct ieee80211_hw *hw,
		      struct ieee80211_vif *vif, u8 *bssid, u16 aid);

int mwl_fwcmd_set_infra_mode(struct ieee80211_hw *hw,
			     struct ieee80211_vif *vif);

int mwl_fwcmd_set_rts_threshold(struct ieee80211_hw *hw,
				int threshold);

int mwl_fwcmd_set_edca_params(struct ieee80211_hw *hw, u8 index,
			      u16 cw_min, u16 cw_max, u8 aifs, u16 txop);

int mwl_fwcmd_set_wmm_mode(struct ieee80211_hw *hw, bool enable);

int mwl_fwcmd_ht_guard_interval(struct ieee80211_hw *hw, u32 gi_type);

int mwl_fwcmd_use_fixed_rate(struct ieee80211_hw *hw,
			     int mcast, int mgmt);

int mwl_fwcmd_set_linkadapt_cs_mode(struct ieee80211_hw *hw,
				    u16 cs_mode);

int mwl_fwcmd_set_rate_adapt_mode(struct ieee80211_hw *hw,
				  u16 mode);

int mwl_fwcmd_set_mac_addr_client(struct ieee80211_hw *hw,
				  struct ieee80211_vif *vif, u8 *mac_addr);

int mwl_fwcmd_get_watchdog_bitmap(struct ieee80211_hw *hw,
				  u8 *bitmap);

int mwl_fwcmd_remove_mac_addr(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif, u8 *mac_addr);

int mwl_fwcmd_bss_start(struct ieee80211_hw *hw,
			struct ieee80211_vif *vif, bool enable);

int mwl_fwcmd_set_beacon(struct ieee80211_hw *hw,
			 struct ieee80211_vif *vif, u8 *beacon, int len);

int mwl_fwcmd_set_new_stn_add(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif,
			      struct ieee80211_sta *sta);

int mwl_fwcmd_set_new_stn_add_self(struct ieee80211_hw *hw,
				   struct ieee80211_vif *vif);

int mwl_fwcmd_set_new_stn_del(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif, u8 *addr);

int mwl_fwcmd_set_apmode(struct ieee80211_hw *hw, u8 apmode);

int mwl_fwcmd_update_encryption_enable(struct ieee80211_hw *hw,
				       struct ieee80211_vif *vif,
				       u8 *addr, u8 encr_type);

int mwl_fwcmd_encryption_set_key(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif, u8 *addr,
				 struct ieee80211_key_conf *key);

int mwl_fwcmd_encryption_remove_key(struct ieee80211_hw *hw,
				    struct ieee80211_vif *vif, u8 *addr,
				    struct ieee80211_key_conf *key);

int mwl_fwcmd_check_ba(struct ieee80211_hw *hw,
		       struct mwl_ampdu_stream *stream,
		       struct ieee80211_vif *vif);

int mwl_fwcmd_create_ba(struct ieee80211_hw *hw,
			struct mwl_ampdu_stream *stream,
			u8 buf_size, struct ieee80211_vif *vif);

int mwl_fwcmd_destroy_ba(struct ieee80211_hw *hw,
			 u8 idx);

struct mwl_ampdu_stream *mwl_fwcmd_add_stream(struct ieee80211_hw *hw,
					      struct ieee80211_sta *sta,
					      u8 tid);

void mwl_fwcmd_del_sta_streams(struct ieee80211_hw *hw,
			       struct ieee80211_sta *sta);

int mwl_fwcmd_start_stream(struct ieee80211_hw *hw,
			   struct mwl_ampdu_stream *stream);

void mwl_fwcmd_remove_stream(struct ieee80211_hw *hw,
			     struct mwl_ampdu_stream *stream);

struct mwl_ampdu_stream *mwl_fwcmd_lookup_stream(struct ieee80211_hw *hw,
						 u8 *addr, u8 tid);

bool mwl_fwcmd_ampdu_allowed(struct ieee80211_sta *sta, u8 tid);

int mwl_fwcmd_set_optimization_level(struct ieee80211_hw *hw, u8 opt_level);

int mwl_fwcmd_set_dwds_stamode(struct ieee80211_hw *hw, bool enable);

int mwl_fwcmd_set_fw_flush_timer(struct ieee80211_hw *hw, u32 value);

int mwl_fwcmd_set_cdd(struct ieee80211_hw *hw);

int mwl_fwcmd_send_mfg_cmd(struct mwl_priv *priv, char *mfgcmd);

#endif /* _FWCMD_H_ */