aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/wlan-ng/hfa384x.h182
1 files changed, 107 insertions, 75 deletions
<
diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
index 46cce8159e59..5984d74dfce2 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -61,17 +61,17 @@
61#include <linux/if_ether.h> 61#include <linux/if_ether.h>
62 62
63/*--- Mins & Maxs -----------------------------------*/ 63/*--- Mins & Maxs -----------------------------------*/
64#define HFA384x_PORTID_MAX ((u16)7) 64#define HFA384x_PORTID_MAX ((u16)7)
65#define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1)) 65#define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1))
66#define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */ 66#define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */
67#define HFA384x_PDA_RECS_MAX ((u16)200) /* a guess */ 67#define HFA384x_PDA_RECS_MAX ((u16)200) /* a guess */
68#define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK */ 68#define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK*/
69#define HFA384x_SCANRESULT_MAX ((u16)31) 69#define HFA384x_SCANRESULT_MAX ((u16)31)
70#define HFA384x_HSCANRESULT_MAX ((u16)31) 70#define HFA384x_HSCANRESULT_MAX ((u16)31)
71#define HFA384x_CHINFORESULT_MAX ((u16)16) 71#define HFA384x_CHINFORESULT_MAX ((u16)16)
72#define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ 72#define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */
73#define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN 73#define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN
74#define HFA384x_USB_RWMEM_MAXLEN 2048 74#define HFA384x_USB_RWMEM_MAXLEN 2048
75 75
76/*--- Support Constants -----------------------------*/ 76/*--- Support Constants -----------------------------*/
77#define HFA384x_PORTTYPE_IBSS ((u16)0) 77#define HFA384x_PORTTYPE_IBSS ((u16)0)
@@ -114,9 +114,9 @@
114#define HFA384x_ADDR_AUX_OFF_MASK (0x007f) 114#define HFA384x_ADDR_AUX_OFF_MASK (0x007f)
115 115
116/* Make a 32-bit flat address from AUX format 16-bit page and offset */ 116/* Make a 32-bit flat address from AUX format 16-bit page and offset */
117#define HFA384x_ADDR_AUX_MKFLAT(p, o) \ 117#define HFA384x_ADDR_AUX_MKFLAT(p, o) \
118 (((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \ 118 ((((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \
119 ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK)) 119 ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK)))
120 120
121/* Make CMD format offset and page from a 32-bit flat address */ 121/* Make CMD format offset and page from a 32-bit flat address */
122#define HFA384x_ADDR_CMD_MKPAGE(f) \ 122#define HFA384x_ADDR_CMD_MKPAGE(f) \
@@ -135,12 +135,21 @@
135#define HFA384x_DLSTATE_FLASHENABLED 2 135#define HFA384x_DLSTATE_FLASHENABLED 2
136 136
137/*--- Register Field Masks --------------------------*/ 137/*--- Register Field Masks --------------------------*/
138#define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8))) 138#define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) \
139#define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8))) 139 | BIT(12) | BIT(11) \
140 | BIT(10) | BIT(9) \
141 | BIT(8)))
142#define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | \
143 BIT(8)))
140#define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8))) 144#define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8)))
141#define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0))) 145#define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | \
146 BIT(3) | BIT(2) | \
147 BIT(1) | BIT(0)))
142 148
143#define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8))) 149#define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) \
150 | BIT(12) | BIT(11) \
151 | BIT(10) | BIT(9) \
152 | BIT(8)))
144 153
145/*--- Command Code Constants --------------------------*/ 154/*--- Command Code Constants --------------------------*/
146/*--- Controller Commands --------------------------*/ 155/*--- Controller Commands --------------------------*/
@@ -244,8 +253,10 @@ Information RID Lengths: MAC Information
244 This is the length of JUST the DATA part of the RID (does not 253 This is the length of JUST the DATA part of the RID (does not
245 include the len or code fields) 254 include the len or code fields)
246--------------------------------------------------------------------*/ 255--------------------------------------------------------------------*/
247#define HFA384x_RID_DBMCOMMSQUALITY_LEN ((u16)sizeof(hfa384x_dbmcommsquality_t)) 256#define HFA384x_RID_DBMCOMMSQUALITY_LEN \
248#define HFA384x_RID_JOINREQUEST_LEN ((u16)sizeof(hfa384x_JoinRequest_data_t)) 257 ((u16) sizeof(hfa384x_dbmcommsquality_t))
258#define HFA384x_RID_JOINREQUEST_LEN \
259 ((u16)sizeof(hfa384x_JoinRequest_data_t))
249 260
250/*-------------------------------------------------------------------- 261/*--------------------------------------------------------------------
251Information RIDs: Modem Information 262Information RIDs: Modem Information
@@ -322,9 +333,11 @@ PD Record codes
322 333
323/*--- Register Test/Get/Set Field macros ------------------------*/ 334/*--- Register Test/Get/Set Field macros ------------------------*/
324 335
325#define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8)) 336#define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8))
326#define HFA384x_CMD_MACPORT_SET(value) ((u16)HFA384x_CMD_AINFO_SET(value)) 337#define HFA384x_CMD_MACPORT_SET(value) \
327#define HFA384x_CMD_PROGMODE_SET(value) ((u16)HFA384x_CMD_AINFO_SET((u16)value)) 338 ((u16)HFA384x_CMD_AINFO_SET(value))
339#define HFA384x_CMD_PROGMODE_SET(value) \
340 ((u16)HFA384x_CMD_AINFO_SET((u16)value))
328#define HFA384x_CMD_CMDCODE_SET(value) ((u16)(value)) 341#define HFA384x_CMD_CMDCODE_SET(value) ((u16)(value))
329 342
330#define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8) 343#define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8)
@@ -402,7 +415,7 @@ typedef struct hfa384x_authenticateStation_data {
402/*-- Configuration Record: WPAData (data portion only) --*/ 415/*-- Configuration Record: WPAData (data portion only) --*/
403typedef struct hfa384x_WPAData { 416typedef struct hfa384x_WPAData {
404 u16 datalen; 417 u16 datalen;
405 u8 data[0]; // max 80 418 u8 data[0]; /* max 80 */
406} __attribute__ ((packed)) hfa384x_WPAData_t; 419} __attribute__ ((packed)) hfa384x_WPAData_t;
407 420
408/*-------------------------------------------------------------------- 421/*--------------------------------------------------------------------
@@ -479,7 +492,8 @@ Communication Frames: Field Masks for Transmit Frames
479#define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1)) 492#define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1))
480#define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0)) 493#define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0))
481/*-- Transmit Control Field --*/ 494/*-- Transmit Control Field --*/
482#define HFA384x_TX_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8))) 495#define HFA384x_TX_MACPORT ((u16)(BIT(10) | \
496 BIT(9) | BIT(8)))
483#define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3))) 497#define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3)))
484#define HFA384x_TX_TXEX ((u16)BIT(2)) 498#define HFA384x_TX_TXEX ((u16)BIT(2))
485#define HFA384x_TX_TXOK ((u16)BIT(1)) 499#define HFA384x_TX_TXOK ((u16)BIT(1))
@@ -496,7 +510,8 @@ Communication Frames: Test/Get/Set Field Values for Transmit Frames
496#define HFA384x_TX_SET(v, m, s) ((((u16)(v))<<((u16)(s)))&((u16)(m))) 510#define HFA384x_TX_SET(v, m, s) ((((u16)(v))<<((u16)(s)))&((u16)(m)))
497 511
498#define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) 512#define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
499#define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3) 513#define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, \
514 HFA384x_TX_STRUCTYPE, 3)
500#define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) 515#define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2)
501#define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) 516#define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)
502/*-------------------------------------------------------------------- 517/*--------------------------------------------------------------------
@@ -534,13 +549,17 @@ Communication Frames: Field Masks for Receive Frames
534--------------------------------------------------------------------*/ 549--------------------------------------------------------------------*/
535 550
536/*-- Status Fields --*/ 551/*-- Status Fields --*/
537#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8))) 552#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | \
553 BIT(9) | \
554 BIT(8)))
538#define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0)) 555#define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0))
539/*-------------------------------------------------------------------- 556/*--------------------------------------------------------------------
540Communication Frames: Test/Get/Set Field Values for Receive Frames 557Communication Frames: Test/Get/Set Field Values for Receive Frames
541--------------------------------------------------------------------*/ 558--------------------------------------------------------------------*/
542#define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8)) 559#define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) \
543#define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) & HFA384x_RXSTATUS_FCSERR)) 560 & HFA384x_RXSTATUS_MACPORT) >> 8))
561#define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) \
562 & HFA384x_RXSTATUS_FCSERR))
544/*-------------------------------------------------------------------- 563/*--------------------------------------------------------------------
545 FRAME STRUCTURES: Information Types and Information Frame Structures 564 FRAME STRUCTURES: Information Types and Information Frame Structures
546---------------------------------------------------------------------- 565----------------------------------------------------------------------
@@ -1133,7 +1152,7 @@ struct hfa384x;
1133 1152
1134typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *); 1153typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *);
1135 1154
1136typedef void (*ctlx_usercb_t) (struct hfa384x * hw, 1155typedef void (*ctlx_usercb_t) (struct hfa384x *hw,
1137 void *ctlxresult, void *usercb_data); 1156 void *ctlxresult, void *usercb_data);
1138 1157
1139typedef struct hfa384x_usbctlx { 1158typedef struct hfa384x_usbctlx {
@@ -1174,14 +1193,14 @@ typedef struct hfa484x_metacmd {
1174} hfa384x_metacmd_t; 1193} hfa384x_metacmd_t;