aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/defs.h')
-rw-r--r--drivers/net/wireless/libertas/defs.h120
1 files changed, 59 insertions, 61 deletions
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index d00c728cec47..ab966f08024a 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -1,7 +1,7 @@
1/** 1/*
2 * This header file contains global constant/enum definitions, 2 * This header file contains global constant/enum definitions,
3 * global variable declaration. 3 * global variable declaration.
4 */ 4 */
5#ifndef _LBS_DEFS_H_ 5#ifndef _LBS_DEFS_H_
6#define _LBS_DEFS_H_ 6#define _LBS_DEFS_H_
7 7
@@ -89,13 +89,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \
89#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args) 89#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
90#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args) 90#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)
91 91
92#define lbs_pr_info(format, args...) \
93 printk(KERN_INFO DRV_NAME": " format, ## args)
94#define lbs_pr_err(format, args...) \
95 printk(KERN_ERR DRV_NAME": " format, ## args)
96#define lbs_pr_alert(format, args...) \
97 printk(KERN_ALERT DRV_NAME": " format, ## args)
98
99#ifdef DEBUG 92#ifdef DEBUG
100static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len) 93static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
101{ 94{
@@ -123,19 +116,19 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
123 116
124 117
125 118
126/** Buffer Constants */ 119/* Buffer Constants */
127 120
128/* The size of SQ memory PPA, DPA are 8 DWORDs, that keep the physical 121/* The size of SQ memory PPA, DPA are 8 DWORDs, that keep the physical
129* addresses of TxPD buffers. Station has only 8 TxPD available, Whereas 122 * addresses of TxPD buffers. Station has only 8 TxPD available, Whereas
130* driver has more local TxPDs. Each TxPD on the host memory is associated 123 * driver has more local TxPDs. Each TxPD on the host memory is associated
131* with a Tx control node. The driver maintains 8 RxPD descriptors for 124 * with a Tx control node. The driver maintains 8 RxPD descriptors for
132* station firmware to store Rx packet information. 125 * station firmware to store Rx packet information.
133* 126 *
134* Current version of MAC has a 32x6 multicast address buffer. 127 * Current version of MAC has a 32x6 multicast address buffer.
135* 128 *
136* 802.11b can have up to 14 channels, the driver keeps the 129 * 802.11b can have up to 14 channels, the driver keeps the
137* BSSID(MAC address) of each APs or Ad hoc stations it has sensed. 130 * BSSID(MAC address) of each APs or Ad hoc stations it has sensed.
138*/ 131 */
139 132
140#define MRVDRV_MAX_MULTICAST_LIST_SIZE 32 133#define MRVDRV_MAX_MULTICAST_LIST_SIZE 32
141#define LBS_NUM_CMD_BUFFERS 10 134#define LBS_NUM_CMD_BUFFERS 10
@@ -166,7 +159,7 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
166#define WOL_RESULT_NOSPC_ERR 1 159#define WOL_RESULT_NOSPC_ERR 1
167#define WOL_RESULT_EEXIST_ERR 2 160#define WOL_RESULT_EEXIST_ERR 2
168 161
169/** Misc constants */ 162/* Misc constants */
170/* This section defines 802.11 specific contants */ 163/* This section defines 802.11 specific contants */
171 164
172#define MRVDRV_MAX_BSS_DESCRIPTS 16 165#define MRVDRV_MAX_BSS_DESCRIPTS 16
@@ -183,7 +176,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
183 176
184#define MARVELL_MESH_IE_LENGTH 9 177#define MARVELL_MESH_IE_LENGTH 9
185 178
186/* Values used to populate the struct mrvl_mesh_ie. The only time you need this 179/*
180 * Values used to populate the struct mrvl_mesh_ie. The only time you need this
187 * is when enabling the mesh using CMD_MESH_CONFIG. 181 * is when enabling the mesh using CMD_MESH_CONFIG.
188 */ 182 */
189#define MARVELL_MESH_IE_TYPE 4 183#define MARVELL_MESH_IE_TYPE 4
@@ -193,7 +187,7 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
193#define MARVELL_MESH_METRIC_ID 0 187#define MARVELL_MESH_METRIC_ID 0
194#define MARVELL_MESH_CAPABILITY 0 188#define MARVELL_MESH_CAPABILITY 0
195 189
196/** INT status Bit Definition*/ 190/* INT status Bit Definition */
197#define MRVDRV_TX_DNLD_RDY 0x0001 191#define MRVDRV_TX_DNLD_RDY 0x0001
198#define MRVDRV_RX_UPLD_RDY 0x0002 192#define MRVDRV_RX_UPLD_RDY 0x0002
199#define MRVDRV_CMD_DNLD_RDY 0x0004 193#define MRVDRV_CMD_DNLD_RDY 0x0004
@@ -208,59 +202,63 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
208#define TPC_DEFAULT_P1 10 202#define TPC_DEFAULT_P1 10
209#define TPC_DEFAULT_P2 13 203#define TPC_DEFAULT_P2 13
210 204
211/** TxPD status */ 205/* TxPD status */
212 206
213/* Station firmware use TxPD status field to report final Tx transmit 207/*
214* result, Bit masks are used to present combined situations. 208 * Station firmware use TxPD status field to report final Tx transmit
215*/ 209 * result, Bit masks are used to present combined situations.
210 */
216 211
217#define MRVDRV_TxPD_POWER_MGMT_NULL_PACKET 0x01 212#define MRVDRV_TxPD_POWER_MGMT_NULL_PACKET 0x01
218#define MRVDRV_TxPD_POWER_MGMT_LAST_PACKET 0x08 213#define MRVDRV_TxPD_POWER_MGMT_LAST_PACKET 0x08
219 214
220/** Tx mesh flag */ 215/* Tx mesh flag */
221/* Currently we are using normal WDS flag as mesh flag. 216/*
217 * Currently we are using normal WDS flag as mesh flag.
222 * TODO: change to proper mesh flag when MAC understands it. 218 * TODO: change to proper mesh flag when MAC understands it.
223 */ 219 */
224#define TxPD_CONTROL_WDS_FRAME (1<<17) 220#define TxPD_CONTROL_WDS_FRAME (1<<17)
225#define TxPD_MESH_FRAME TxPD_CONTROL_WDS_FRAME 221#define TxPD_MESH_FRAME TxPD_CONTROL_WDS_FRAME
226 222
227/** Mesh interface ID */ 223/* Mesh interface ID */
228#define MESH_IFACE_ID 0x0001 224#define MESH_IFACE_ID 0x0001
229/** Mesh id should be in bits 14-13-12 */ 225/* Mesh id should be in bits 14-13-12 */
230#define MESH_IFACE_BIT_OFFSET 0x000c 226#define MESH_IFACE_BIT_OFFSET 0x000c
231/** Mesh enable bit in FW capability */ 227/* Mesh enable bit in FW capability */
232#define MESH_CAPINFO_ENABLE_MASK (1<<16) 228#define MESH_CAPINFO_ENABLE_MASK (1<<16)
233 229
234/** FW definition from Marvell v4 */ 230/* FW definition from Marvell v4 */
235#define MRVL_FW_V4 (0x04) 231#define MRVL_FW_V4 (0x04)
236/** FW definition from Marvell v5 */ 232/* FW definition from Marvell v5 */
237#define MRVL_FW_V5 (0x05) 233#define MRVL_FW_V5 (0x05)
238/** FW definition from Marvell v10 */ 234/* FW definition from Marvell v10 */
239#define MRVL_FW_V10 (0x0a) 235#define MRVL_FW_V10 (0x0a)
240/** FW major revision definition */ 236/* FW major revision definition */
241#define MRVL_FW_MAJOR_REV(x) ((x)>>24) 237#define MRVL_FW_MAJOR_REV(x) ((x)>>24)
242 238
243/** RxPD status */ 239/* RxPD status */
244 240
245#define MRVDRV_RXPD_STATUS_OK 0x0001 241#define MRVDRV_RXPD_STATUS_OK 0x0001
246 242
247/** RxPD status - Received packet types */ 243/* RxPD status - Received packet types */
248/** Rx mesh flag */ 244/* Rx mesh flag */
249/* Currently we are using normal WDS flag as mesh flag. 245/*
246 * Currently we are using normal WDS flag as mesh flag.
250 * TODO: change to proper mesh flag when MAC understands it. 247 * TODO: change to proper mesh flag when MAC understands it.
251 */ 248 */
252#define RxPD_CONTROL_WDS_FRAME (0x40) 249#define RxPD_CONTROL_WDS_FRAME (0x40)
253#define RxPD_MESH_FRAME RxPD_CONTROL_WDS_FRAME 250#define RxPD_MESH_FRAME RxPD_CONTROL_WDS_FRAME
254 251
255/** RSSI-related defines */ 252/* RSSI-related defines */
256/* RSSI constants are used to implement 802.11 RSSI threshold 253/*
257* indication. if the Rx packet signal got too weak for 5 consecutive 254 * RSSI constants are used to implement 802.11 RSSI threshold
258* times, miniport driver (driver) will report this event to wrapper 255 * indication. if the Rx packet signal got too weak for 5 consecutive
259*/ 256 * times, miniport driver (driver) will report this event to wrapper
257 */
260 258
261#define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96) 259#define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96)
262 260
263/** RTS/FRAG related defines */ 261/* RTS/FRAG related defines */
264#define MRVDRV_RTS_MIN_VALUE 0 262#define MRVDRV_RTS_MIN_VALUE 0
265#define MRVDRV_RTS_MAX_VALUE 2347 263#define MRVDRV_RTS_MAX_VALUE 2347
266#define MRVDRV_FRAG_MIN_VALUE 256 264#define MRVDRV_FRAG_MIN_VALUE 256
@@ -300,36 +298,36 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
300 298
301#define MAX_LEDS 8 299#define MAX_LEDS 8
302 300
303/** Global Variable Declaration */ 301/* Global Variable Declaration */
304extern const char lbs_driver_version[]; 302extern const char lbs_driver_version[];
305extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE]; 303extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE];
306 304
307 305
308/** ENUM definition*/ 306/* ENUM definition */
309/** SNRNF_TYPE */ 307/* SNRNF_TYPE */
310enum SNRNF_TYPE { 308enum SNRNF_TYPE {
311 TYPE_BEACON = 0, 309 TYPE_BEACON = 0,
312 TYPE_RXPD, 310 TYPE_RXPD,
313 MAX_TYPE_B 311 MAX_TYPE_B
314}; 312};
315 313
316/** SNRNF_DATA*/ 314/* SNRNF_DATA */
317enum SNRNF_DATA { 315enum SNRNF_DATA {
318 TYPE_NOAVG = 0, 316 TYPE_NOAVG = 0,
319 TYPE_AVG, 317 TYPE_AVG,
320 MAX_TYPE_AVG 318 MAX_TYPE_AVG
321}; 319};
322 320
323/** LBS_802_11_POWER_MODE */ 321/* LBS_802_11_POWER_MODE */
324enum LBS_802_11_POWER_MODE { 322enum LBS_802_11_POWER_MODE {
325 LBS802_11POWERMODECAM, 323 LBS802_11POWERMODECAM,
326 LBS802_11POWERMODEMAX_PSP, 324 LBS802_11POWERMODEMAX_PSP,
327 LBS802_11POWERMODEFAST_PSP, 325 LBS802_11POWERMODEFAST_PSP,
328 /*not a real mode, defined as an upper bound */ 326 /* not a real mode, defined as an upper bound */
329 LBS802_11POWEMODEMAX 327 LBS802_11POWEMODEMAX
330}; 328};
331 329
332/** PS_STATE */ 330/* PS_STATE */
333enum PS_STATE { 331enum PS_STATE {
334 PS_STATE_FULL_POWER, 332 PS_STATE_FULL_POWER,
335 PS_STATE_AWAKE, 333 PS_STATE_AWAKE,
@@ -337,7 +335,7 @@ enum PS_STATE {
337 PS_STATE_SLEEP 335 PS_STATE_SLEEP
338}; 336};
339 337
340/** DNLD_STATE */ 338/* DNLD_STATE */
341enum DNLD_STATE { 339enum DNLD_STATE {
342 DNLD_RES_RECEIVED, 340 DNLD_RES_RECEIVED,
343 DNLD_DATA_SENT, 341 DNLD_DATA_SENT,
@@ -345,19 +343,19 @@ enum DNLD_STATE {
345 DNLD_BOOTCMD_SENT, 343 DNLD_BOOTCMD_SENT,
346}; 344};
347 345
348/** LBS_MEDIA_STATE */ 346/* LBS_MEDIA_STATE */
349enum LBS_MEDIA_STATE { 347enum LBS_MEDIA_STATE {
350 LBS_CONNECTED, 348 LBS_CONNECTED,
351 LBS_DISCONNECTED 349 LBS_DISCONNECTED
352}; 350};
353 351
354/** LBS_802_11_PRIVACY_FILTER */ 352/* LBS_802_11_PRIVACY_FILTER */
355enum LBS_802_11_PRIVACY_FILTER { 353enum LBS_802_11_PRIVACY_FILTER {
356 LBS802_11PRIVFILTERACCEPTALL, 354 LBS802_11PRIVFILTERACCEPTALL,
357 LBS802_11PRIVFILTER8021XWEP 355 LBS802_11PRIVFILTER8021XWEP
358}; 356};
359 357
360/** mv_ms_type */ 358/* mv_ms_type */
361enum mv_ms_type { 359enum mv_ms_type {
362 MVMS_DAT = 0, 360 MVMS_DAT = 0,
363 MVMS_CMD = 1, 361 MVMS_CMD = 1,
@@ -365,14 +363,14 @@ enum mv_ms_type {
365 MVMS_EVENT 363 MVMS_EVENT
366}; 364};
367 365
368/** KEY_TYPE_ID */ 366/* KEY_TYPE_ID */
369enum KEY_TYPE_ID { 367enum KEY_TYPE_ID {
370 KEY_TYPE_ID_WEP = 0, 368 KEY_TYPE_ID_WEP = 0,
371 KEY_TYPE_ID_TKIP, 369 KEY_TYPE_ID_TKIP,
372 KEY_TYPE_ID_AES 370 KEY_TYPE_ID_AES
373}; 371};
374 372
375/** KEY_INFO_WPA (applies to both TKIP and AES/CCMP) */ 373/* KEY_INFO_WPA (applies to both TKIP and AES/CCMP) */
376enum KEY_INFO_WPA { 374enum KEY_INFO_WPA {
377 KEY_INFO_WPA_MCAST = 0x01, 375 KEY_INFO_WPA_MCAST = 0x01,
378 KEY_INFO_WPA_UNICAST = 0x02, 376 KEY_INFO_WPA_UNICAST = 0x02,