]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/rt2860/mlme.h
Merge branch 'sony' into release
[~andy/linux] / drivers / staging / rt2860 / mlme.h
index 8585a4d95f0b9a09ff12d10eef7ad0505e733b65..11434132f93b7434bc036283a6c561a8a90f1964 100644 (file)
@@ -187,101 +187,101 @@ if (((__pEntry)) != NULL) \
 /* 802.11 frame formats */
 /* */
 /*  HT Capability INFO field in HT Cap IE . */
-typedef struct PACKED {
-       USHORT AdvCoding:1;
-       USHORT ChannelWidth:1;
-       USHORT MimoPs:2;        /*momi power safe */
-       USHORT GF:1;            /*green field */
-       USHORT ShortGIfor20:1;
-       USHORT ShortGIfor40:1;  /*for40MHz */
-       USHORT TxSTBC:1;
-       USHORT RxSTBC:2;
-       USHORT DelayedBA:1;     /*rt2860c not support */
-       USHORT AMsduSize:1;     /* only support as zero */
-       USHORT CCKmodein40:1;
-       USHORT PSMP:1;
-       USHORT Forty_Mhz_Intolerant:1;
-       USHORT LSIGTxopProSup:1;
-} HT_CAP_INFO, *PHT_CAP_INFO;
+struct PACKED rt_ht_cap_info {
+       u16 AdvCoding:1;
+       u16 ChannelWidth:1;
+       u16 MimoPs:2;   /*momi power safe */
+       u16 GF:1;               /*green field */
+       u16 ShortGIfor20:1;
+       u16 ShortGIfor40:1;     /*for40MHz */
+       u16 TxSTBC:1;
+       u16 RxSTBC:2;
+       u16 DelayedBA:1;        /*rt2860c not support */
+       u16 AMsduSize:1;        /* only support as zero */
+       u16 CCKmodein40:1;
+       u16 PSMP:1;
+       u16 Forty_Mhz_Intolerant:1;
+       u16 LSIGTxopProSup:1;
+};
 
 /*  HT Capability INFO field in HT Cap IE . */
-typedef struct PACKED {
-       UCHAR MaxRAmpduFactor:2;
-       UCHAR MpduDensity:3;
-       UCHAR rsv:3;            /*momi power safe */
-} HT_CAP_PARM, *PHT_CAP_PARM;
+struct PACKED rt_ht_cap_parm {
+       u8 MaxRAmpduFactor:2;
+       u8 MpduDensity:3;
+       u8 rsv:3;               /*momi power safe */
+};
 
 /*  HT Capability INFO field in HT Cap IE . */
-typedef struct PACKED {
-       UCHAR MCSSet[10];
-       UCHAR SupRate[2];       /* unit : 1Mbps */
-       UCHAR TxMCSSetDefined:1;
-       UCHAR TxRxNotEqual:1;
-       UCHAR TxStream:2;
-       UCHAR MpduDensity:1;
-       UCHAR rsv:3;
-       UCHAR rsv3[3];
-} HT_MCS_SET, *PHT_MCS_SET;
+struct PACKED rt_ht_mcs_set {
+       u8 MCSSet[10];
+       u8 SupRate[2];  /* unit : 1Mbps */
+       u8 TxMCSSetDefined:1;
+       u8 TxRxNotEqual:1;
+       u8 TxStream:2;
+       u8 MpduDensity:1;
+       u8 rsv:3;
+       u8 rsv3[3];
+};
 
 /*  HT Capability INFO field in HT Cap IE . */
-typedef struct PACKED {
-       USHORT Pco:1;
-       USHORT TranTime:2;
-       USHORT rsv:5;           /*momi power safe */
-       USHORT MCSFeedback:2;   /*0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback,  1:rsv. */
-       USHORT PlusHTC:1;       /*+HTC control field support */
-       USHORT RDGSupport:1;    /*reverse Direction Grant  support */
-       USHORT rsv2:4;
-} EXT_HT_CAP_INFO, *PEXT_HT_CAP_INFO;
+struct PACKED rt_ext_ht_cap_info {
+       u16 Pco:1;
+       u16 TranTime:2;
+       u16 rsv:5;              /*momi power safe */
+       u16 MCSFeedback:2;      /*0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback,  1:rsv. */
+       u16 PlusHTC:1;  /*+HTC control field support */
+       u16 RDGSupport:1;       /*reverse Direction Grant  support */
+       u16 rsv2:4;
+};
 
 /*  HT Beamforming field in HT Cap IE . */
-typedef struct PACKED _HT_BF_CAP {
-       ULONG TxBFRecCapable:1;
-       ULONG RxSoundCapable:1;
-       ULONG TxSoundCapable:1;
-       ULONG RxNDPCapable:1;
-       ULONG TxNDPCapable:1;
-       ULONG ImpTxBFCapable:1;
-       ULONG Calibration:2;
-       ULONG ExpCSICapable:1;
-       ULONG ExpNoComSteerCapable:1;
-       ULONG ExpComSteerCapable:1;
-       ULONG ExpCSIFbk:2;
-       ULONG ExpNoComBF:2;
-       ULONG ExpComBF:2;
-       ULONG MinGrouping:2;
-       ULONG CSIBFAntSup:2;
-       ULONG NoComSteerBFAntSup:2;
-       ULONG ComSteerBFAntSup:2;
-       ULONG CSIRowBFSup:2;
-       ULONG ChanEstimation:2;
-       ULONG rsv:3;
-} HT_BF_CAP, *PHT_BF_CAP;
+struct PACKED rt_ht_bf_cap {
+       unsigned long TxBFRecCapable:1;
+       unsigned long RxSoundCapable:1;
+       unsigned long TxSoundCapable:1;
+       unsigned long RxNDPCapable:1;
+       unsigned long TxNDPCapable:1;
+       unsigned long ImpTxBFCapable:1;
+       unsigned long Calibration:2;
+       unsigned long ExpCSICapable:1;
+       unsigned long ExpNoComSteerCapable:1;
+       unsigned long ExpComSteerCapable:1;
+       unsigned long ExpCSIFbk:2;
+       unsigned long ExpNoComBF:2;
+       unsigned long ExpComBF:2;
+       unsigned long MinGrouping:2;
+       unsigned long CSIBFAntSup:2;
+       unsigned long NoComSteerBFAntSup:2;
+       unsigned long ComSteerBFAntSup:2;
+       unsigned long CSIRowBFSup:2;
+       unsigned long ChanEstimation:2;
+       unsigned long rsv:3;
+};
 
 /*  HT antenna selection field in HT Cap IE . */
-typedef struct PACKED _HT_AS_CAP {
-       UCHAR AntSelect:1;
-       UCHAR ExpCSIFbkTxASEL:1;
-       UCHAR AntIndFbkTxASEL:1;
-       UCHAR ExpCSIFbk:1;
-       UCHAR AntIndFbk:1;
-       UCHAR RxASel:1;
-       UCHAR TxSoundPPDU:1;
-       UCHAR rsv:1;
-} HT_AS_CAP, *PHT_AS_CAP;
+struct PACKED rt_ht_as_cap {
+       u8 AntSelect:1;
+       u8 ExpCSIFbkTxASEL:1;
+       u8 AntIndFbkTxASEL:1;
+       u8 ExpCSIFbk:1;
+       u8 AntIndFbk:1;
+       u8 RxASel:1;
+       u8 TxSoundPPDU:1;
+       u8 rsv:1;
+};
 
 /* Draft 1.0 set IE length 26, but is extensible.. */
 #define SIZE_HT_CAP_IE         26
 /* The structure for HT Capability IE. */
-typedef struct PACKED _HT_CAPABILITY_IE {
-       HT_CAP_INFO HtCapInfo;
-       HT_CAP_PARM HtCapParm;
-/*      HT_MCS_SET              HtMCSSet; */
-       UCHAR MCSSet[16];
-       EXT_HT_CAP_INFO ExtHtCapInfo;
-       HT_BF_CAP TxBFCap;      /* beamforming cap. rt2860c not support beamforming. */
-       HT_AS_CAP ASCap;        /*antenna selection. */
-} HT_CAPABILITY_IE, *PHT_CAPABILITY_IE;
+struct PACKED rt_ht_capability_ie {
+       struct rt_ht_cap_info HtCapInfo;
+       struct rt_ht_cap_parm HtCapParm;
+/*      struct rt_ht_mcs_set              HtMCSSet; */
+       u8 MCSSet[16];
+       struct rt_ext_ht_cap_info ExtHtCapInfo;
+       struct rt_ht_bf_cap TxBFCap;    /* beamforming cap. rt2860c not support beamforming. */
+       struct rt_ht_as_cap ASCap;      /*antenna selection. */
+};
 
 /* 802.11n draft3 related structure definitions. */
 /* 7.3.2.60 */
@@ -296,377 +296,376 @@ typedef struct PACKED _HT_CAPABILITY_IE {
                                                                                                                                /*      (dot11BSSWidthChannelTransactionDelayFactor * dot11BSSWidthTriggerScanInterval) seconds without */
                                                                                                                                /*      being obligated to perform OBSS Scan operations. default is 25(== 0.25%) */
 
-typedef struct PACKED _OVERLAP_BSS_SCAN_IE {
-       USHORT ScanPassiveDwell;
-       USHORT ScanActiveDwell;
-       USHORT TriggerScanInt;  /* Trigger scan interval */
-       USHORT PassiveTalPerChannel;    /* passive total per channel */
-       USHORT ActiveTalPerChannel;     /* active total per channel */
-       USHORT DelayFactor;     /* BSS width channel transition delay factor */
-       USHORT ScanActThre;     /* Scan Activity threshold */
-} OVERLAP_BSS_SCAN_IE, *POVERLAP_BSS_SCAN_IE;
+struct PACKED rt_overlap_bss_scan_ie {
+       u16 ScanPassiveDwell;
+       u16 ScanActiveDwell;
+       u16 TriggerScanInt;     /* Trigger scan interval */
+       u16 PassiveTalPerChannel;       /* passive total per channel */
+       u16 ActiveTalPerChannel;        /* active total per channel */
+       u16 DelayFactor;        /* BSS width channel transition delay factor */
+       u16 ScanActThre;        /* Scan Activity threshold */
+};
 
 /*  7.3.2.56. 20/40 Coexistence element used in  Element ID = 72 = IE_2040_BSS_COEXIST */
 typedef union PACKED _BSS_2040_COEXIST_IE {
        struct PACKED {
-               UCHAR InfoReq:1;
-               UCHAR Intolerant40:1;   /* Inter-BSS. set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS. */
-               UCHAR BSS20WidthReq:1;  /* Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS. */
-               UCHAR rsv:5;
+               u8 InfoReq:1;
+               u8 Intolerant40:1;      /* Inter-BSS. set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS. */
+               u8 BSS20WidthReq:1;     /* Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS. */
+               u8 rsv:5;
        } field;
-       UCHAR word;
+       u8 word;
 } BSS_2040_COEXIST_IE, *PBSS_2040_COEXIST_IE;
 
-typedef struct _TRIGGER_EVENTA {
+struct rt_trigger_eventa {
        BOOLEAN bValid;
-       UCHAR BSSID[6];
-       UCHAR RegClass;         /* Regulatory Class */
-       USHORT Channel;
-       ULONG CDCounter;        /* Maintain a seperate count down counter for each Event A. */
-} TRIGGER_EVENTA, *PTRIGGER_EVENTA;
+       u8 BSSID[6];
+       u8 RegClass;            /* Regulatory Class */
+       u16 Channel;
+       unsigned long CDCounter;        /* Maintain a seperate count down counter for each Event A. */
+};
 
 /* 20/40 trigger event table */
 /* If one Event A delete or created, or if Event B is detected or not detected, STA should send 2040BSSCoexistence to AP. */
 #define MAX_TRIGGER_EVENT              64
-typedef struct _TRIGGER_EVENT_TAB {
-       UCHAR EventANo;
-       TRIGGER_EVENTA EventA[MAX_TRIGGER_EVENT];
-       ULONG EventBCountDown;  /* Count down counter for Event B. */
-} TRIGGER_EVENT_TAB, *PTRIGGER_EVENT_TAB;
+struct rt_trigger_event_tab {
+       u8 EventANo;
+       struct rt_trigger_eventa EventA[MAX_TRIGGER_EVENT];
+       unsigned long EventBCountDown;  /* Count down counter for Event B. */
+};
 
 /* 7.3.27 20/40 Bss Coexistence Mgmt capability used in extended capabilities information IE( ID = 127 = IE_EXT_CAPABILITY). */
 /*      This is the first octet and was defined in 802.11n D3.03 and 802.11yD9.0 */
-typedef struct PACKED _EXT_CAP_INFO_ELEMENT {
-       UCHAR BssCoexistMgmtSupport:1;
-       UCHAR rsv:1;
-       UCHAR ExtendChannelSwitch:1;
-       UCHAR rsv2:5;
-} EXT_CAP_INFO_ELEMENT, *PEXT_CAP_INFO_ELEMENT;
+struct PACKED rt_ext_cap_info_element {
+       u8 BssCoexistMgmtSupport:1;
+       u8 rsv:1;
+       u8 ExtendChannelSwitch:1;
+       u8 rsv2:5;
+};
 
 /* 802.11n 7.3.2.61 */
-typedef struct PACKED _BSS_2040_COEXIST_ELEMENT {
-       UCHAR ElementID;        /* ID = IE_2040_BSS_COEXIST = 72 */
-       UCHAR Len;
+struct PACKED rt_bss_2040_coexist_element {
+       u8 ElementID;   /* ID = IE_2040_BSS_COEXIST = 72 */
+       u8 Len;
        BSS_2040_COEXIST_IE BssCoexistIe;
-} BSS_2040_COEXIST_ELEMENT, *PBSS_2040_COEXIST_ELEMENT;
+};
 
 /*802.11n 7.3.2.59 */
-typedef struct PACKED _BSS_2040_INTOLERANT_CH_REPORT {
-       UCHAR ElementID;        /* ID = IE_2040_BSS_INTOLERANT_REPORT = 73 */
-       UCHAR Len;
-       UCHAR RegulatoryClass;
-       UCHAR ChList[0];
-} BSS_2040_INTOLERANT_CH_REPORT, *PBSS_2040_INTOLERANT_CH_REPORT;
+struct PACKED rt_bss_2040_intolerant_ch_report {
+       u8 ElementID;   /* ID = IE_2040_BSS_INTOLERANT_REPORT = 73 */
+       u8 Len;
+       u8 RegulatoryClass;
+       u8 ChList[0];
+};
 
 /* The structure for channel switch annoucement IE. This is in 802.11n D3.03 */
-typedef struct PACKED _CHA_SWITCH_ANNOUNCE_IE {
-       UCHAR SwitchMode;       /*channel switch mode */
-       UCHAR NewChannel;       /* */
-       UCHAR SwitchCount;      /* */
-} CHA_SWITCH_ANNOUNCE_IE, *PCHA_SWITCH_ANNOUNCE_IE;
+struct PACKED rt_cha_switch_announce_ie {
+       u8 SwitchMode;  /*channel switch mode */
+       u8 NewChannel;  /* */
+       u8 SwitchCount; /* */
+};
 
 /* The structure for channel switch annoucement IE. This is in 802.11n D3.03 */
-typedef struct PACKED _SEC_CHA_OFFSET_IE {
-       UCHAR SecondaryChannelOffset;   /* 1: Secondary above, 3: Secondary below, 0: no Secondary */
-} SEC_CHA_OFFSET_IE, *PSEC_CHA_OFFSET_IE;
+struct PACKED rt_sec_cha_offset_ie {
+       u8 SecondaryChannelOffset;      /* 1: Secondary above, 3: Secondary below, 0: no Secondary */
+};
 
-/* This structure is extracted from struct RT_HT_CAPABILITY */
-typedef struct {
+/* This structure is extracted from struct struct rt_ht_capability */
+struct rt_ht_phy_info {
        BOOLEAN bHtEnable;      /* If we should use ht rate. */
        BOOLEAN bPreNHt;        /* If we should use ht rate. */
        /*Substract from HT Capability IE */
-       UCHAR MCSSet[16];
-} RT_HT_PHY_INFO, *PRT_HT_PHY_INFO;
+       u8 MCSSet[16];
+};
 
 /*This structure substracts ralink supports from all 802.11n-related features. */
 /*Features not listed here but contained in 802.11n spec are not supported in rt2860. */
-typedef struct {
-       USHORT ChannelWidth:1;
-       USHORT MimoPs:2;        /*mimo power safe MMPS_ */
-       USHORT GF:1;            /*green field */
-       USHORT ShortGIfor20:1;
-       USHORT ShortGIfor40:1;  /*for40MHz */
-       USHORT TxSTBC:1;
-       USHORT RxSTBC:2;        /* 2 bits */
-       USHORT AmsduEnable:1;   /* Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n */
-       USHORT AmsduSize:1;     /* Max receiving A-MSDU size */
-       USHORT rsv:5;
+struct rt_ht_capability {
+       u16 ChannelWidth:1;
+       u16 MimoPs:2;   /*mimo power safe MMPS_ */
+       u16 GF:1;               /*green field */
+       u16 ShortGIfor20:1;
+       u16 ShortGIfor40:1;     /*for40MHz */
+       u16 TxSTBC:1;
+       u16 RxSTBC:2;   /* 2 bits */
+       u16 AmsduEnable:1;      /* Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n */
+       u16 AmsduSize:1;        /* Max receiving A-MSDU size */
+       u16 rsv:5;
 
        /*Substract from Addiont HT INFO IE */
-       UCHAR MaxRAmpduFactor:2;
-       UCHAR MpduDensity:3;
-       UCHAR ExtChanOffset:2;  /* Please not the difference with following     UCHAR   NewExtChannelOffset; from 802.11n */
-       UCHAR RecomWidth:1;
+       u8 MaxRAmpduFactor:2;
+       u8 MpduDensity:3;
+       u8 ExtChanOffset:2;     /* Please not the difference with following     u8   NewExtChannelOffset; from 802.11n */
+       u8 RecomWidth:1;
 
-       USHORT OperaionMode:2;
-       USHORT NonGfPresent:1;
-       USHORT rsv3:1;
-       USHORT OBSS_NonHTExist:1;
-       USHORT rsv2:11;
+       u16 OperaionMode:2;
+       u16 NonGfPresent:1;
+       u16 rsv3:1;
+       u16 OBSS_NonHTExist:1;
+       u16 rsv2:11;
 
        /* New Extension Channel Offset IE */
-       UCHAR NewExtChannelOffset;
+       u8 NewExtChannelOffset;
        /* Extension Capability IE = 127 */
-       UCHAR BSSCoexist2040;
-} RT_HT_CAPABILITY, *PRT_HT_CAPABILITY;
+       u8 BSSCoexist2040;
+};
 
 /*   field in Addtional HT Information IE . */
-typedef struct PACKED {
-       UCHAR ExtChanOffset:2;
-       UCHAR RecomWidth:1;
-       UCHAR RifsMode:1;
-       UCHAR S_PSMPSup:1;      /*Indicate support for scheduled PSMP */
-       UCHAR SerInterGranu:3;  /*service interval granularity */
-} ADD_HTINFO, *PADD_HTINFO;
-
-typedef struct PACKED {
-       USHORT OperaionMode:2;
-       USHORT NonGfPresent:1;
-       USHORT rsv:1;
-       USHORT OBSS_NonHTExist:1;
-       USHORT rsv2:11;
-} ADD_HTINFO2, *PADD_HTINFO2;
+struct PACKED rt_add_htinfo {
+       u8 ExtChanOffset:2;
+       u8 RecomWidth:1;
+       u8 RifsMode:1;
+       u8 S_PSMPSup:1; /*Indicate support for scheduled PSMP */
+       u8 SerInterGranu:3;     /*service interval granularity */
+};
+
+struct PACKED rt_add_htinfo2 {
+       u16 OperaionMode:2;
+       u16 NonGfPresent:1;
+       u16 rsv:1;
+       u16 OBSS_NonHTExist:1;
+       u16 rsv2:11;
+};
 
 /* TODO: Need sync with spec about the definition of StbcMcs. In Draft 3.03, it's reserved. */
-typedef struct PACKED {
-       USHORT StbcMcs:6;
-       USHORT DualBeacon:1;
-       USHORT DualCTSProtect:1;
-       USHORT STBCBeacon:1;
-       USHORT LsigTxopProt:1;  /* L-SIG TXOP protection full support */
-       USHORT PcoActive:1;
-       USHORT PcoPhase:1;
-       USHORT rsv:4;
-} ADD_HTINFO3, *PADD_HTINFO3;
+struct PACKED rt_add_htinfo3 {
+       u16 StbcMcs:6;
+       u16 DualBeacon:1;
+       u16 DualCTSProtect:1;
+       u16 STBCBeacon:1;
+       u16 LsigTxopProt:1;     /* L-SIG TXOP protection full support */
+       u16 PcoActive:1;
+       u16 PcoPhase:1;
+       u16 rsv:4;
+};
 
 #define SIZE_ADD_HT_INFO_IE            22
-typedef struct PACKED {
-       UCHAR ControlChan;
-       ADD_HTINFO AddHtInfo;
-       ADD_HTINFO2 AddHtInfo2;
-       ADD_HTINFO3 AddHtInfo3;
-       UCHAR MCSSet[16];       /* Basic MCS set */
-} ADD_HT_INFO_IE, *PADD_HT_INFO_IE;
-
-typedef struct PACKED {
-       UCHAR NewExtChanOffset;
-} NEW_EXT_CHAN_IE, *PNEW_EXT_CHAN_IE;
-
-typedef struct PACKED _FRAME_802_11 {
-       HEADER_802_11 Hdr;
-       UCHAR Octet[1];
-} FRAME_802_11, *PFRAME_802_11;
+struct PACKED rt_add_ht_info_ie {
+       u8 ControlChan;
+       struct rt_add_htinfo AddHtInfo;
+       struct rt_add_htinfo2 AddHtInfo2;
+       struct rt_add_htinfo3 AddHtInfo3;
+       u8 MCSSet[16];  /* Basic MCS set */
+};
+
+struct PACKED rt_new_ext_chan_ie {
+       u8 NewExtChanOffset;
+};
+
+struct PACKED rt_frame_802_11 {
+       struct rt_header_802_11 Hdr;
+       u8 Octet[1];
+};
 
 /* QoSNull embedding of management action. When HT Control MA field set to 1. */
-typedef struct PACKED _MA_BODY {
-       UCHAR Category;
-       UCHAR Action;
-       UCHAR Octet[1];
-} MA_BODY, *PMA_BODY;
-
-typedef struct PACKED _HEADER_802_3 {
-       UCHAR DAAddr1[MAC_ADDR_LEN];
-       UCHAR SAAddr2[MAC_ADDR_LEN];
-       UCHAR Octet[2];
-} HEADER_802_3, *PHEADER_802_3;
+struct PACKED rt_ma_body {
+       u8 Category;
+       u8 Action;
+       u8 Octet[1];
+};
+
+struct PACKED rt_header_802_3 {
+       u8 DAAddr1[MAC_ADDR_LEN];
+       u8 SAAddr2[MAC_ADDR_LEN];
+       u8 Octet[2];
+};
 /*//Block ACK related format */
 /* 2-byte BA Parameter  field  in       DELBA frames to terminate an already set up bA */
-typedef struct PACKED {
-       USHORT Rsv:11;          /* always set to 0 */
-       USHORT Initiator:1;     /* 1: originator    0:recipient */
-       USHORT TID:4;           /* value of TC os TS */
-} DELBA_PARM, *PDELBA_PARM;
+struct PACKED rt_delba_parm {
+       u16 Rsv:11;             /* always set to 0 */
+       u16 Initiator:1;        /* 1: originator    0:recipient */
+       u16 TID:4;              /* value of TC os TS */
+};
 
 /* 2-byte BA Parameter Set field  in ADDBA frames to signal parm for setting up a BA */
-typedef struct PACKED {
-       USHORT AMSDUSupported:1;        /* 0: not permitted             1: permitted */
-       USHORT BAPolicy:1;      /* 1: immediately BA    0:delayed BA */
-       USHORT TID:4;           /* value of TC os TS */
-       USHORT BufSize:10;      /* number of buffe of size 2304 octetsr */
-} BA_PARM, *PBA_PARM;
+struct PACKED rt_ba_parm {
+       u16 AMSDUSupported:1;   /* 0: not permitted             1: permitted */
+       u16 BAPolicy:1; /* 1: immediately BA    0:delayed BA */
+       u16 TID:4;              /* value of TC os TS */
+       u16 BufSize:10; /* number of buffe of size 2304 octetsr */
+};
 
 /* 2-byte BA Starting Seq CONTROL field */
-typedef union PACKED {
+typedef union PACKED _BASEQ_CONTROL {
        struct PACKED {
-               USHORT FragNum:4;       /* always set to 0 */
-               USHORT StartSeq:12;     /* sequence number of the 1st MSDU for which this BAR is sent */
+               u16 FragNum:4;  /* always set to 0 */
+               u16 StartSeq:12;        /* sequence number of the 1st MSDU for which this BAR is sent */
        } field;
-       USHORT word;
+       u16 word;
 } BASEQ_CONTROL, *PBASEQ_CONTROL;
 
 /*BAControl and BARControl are the same */
 /* 2-byte BA CONTROL field in BA frame */
-typedef struct PACKED {
-       USHORT ACKPolicy:1;     /* only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK  1:No ACK */
-       USHORT MTID:1;          /*EWC V1.24 */
-       USHORT Compressed:1;
-       USHORT Rsv:9;
-       USHORT TID:4;
-} BA_CONTROL, *PBA_CONTROL;
+struct PACKED rt_ba_control {
+       u16 ACKPolicy:1;        /* only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK  1:No ACK */
+       u16 MTID:1;             /*EWC V1.24 */
+       u16 Compressed:1;
+       u16 Rsv:9;
+       u16 TID:4;
+};
 
 /* 2-byte BAR CONTROL field in BAR frame */
-typedef struct PACKED {
-       USHORT ACKPolicy:1;     /* 0:normal ack,  1:no ack. */
-       USHORT MTID:1;          /*if this bit1, use  FRAME_MTBA_REQ,  if 0, use FRAME_BA_REQ */
-       USHORT Compressed:1;
-       USHORT Rsv1:9;
-       USHORT TID:4;
-} BAR_CONTROL, *PBAR_CONTROL;
+struct PACKED rt_bar_control {
+       u16 ACKPolicy:1;        /* 0:normal ack,  1:no ack. */
+       u16 MTID:1;             /*if this bit1, use  struct rt_frame_mtba_req,  if 0, use struct rt_frame_ba_req */
+       u16 Compressed:1;
+       u16 Rsv1:9;
+       u16 TID:4;
+};
 
 /* BARControl in MTBAR frame */
-typedef struct PACKED {
-       USHORT ACKPolicy:1;
-       USHORT MTID:1;
-       USHORT Compressed:1;
-       USHORT Rsv1:9;
-       USHORT NumTID:4;
-} MTBAR_CONTROL, *PMTBAR_CONTROL;
-
-typedef struct PACKED {
-       USHORT Rsv1:12;
-       USHORT TID:4;
-} PER_TID_INFO, *PPER_TID_INFO;
-
-typedef struct {
-       PER_TID_INFO PerTID;
+struct PACKED rt_mtbar_control {
+       u16 ACKPolicy:1;
+       u16 MTID:1;
+       u16 Compressed:1;
+       u16 Rsv1:9;
+       u16 NumTID:4;
+};
+
+struct PACKED rt_per_tid_info {
+       u16 Rsv1:12;
+       u16 TID:4;
+};
+
+struct rt_each_tid {
+       struct rt_per_tid_info PerTID;
        BASEQ_CONTROL BAStartingSeq;
-} EACH_TID, *PEACH_TID;
+};
 
 /* BAREQ AND MTBAREQ have the same subtype BAR, 802.11n BAR use compressed bitmap. */
-typedef struct PACKED _FRAME_BA_REQ {
-       FRAME_CONTROL FC;
-       USHORT Duration;
-       UCHAR Addr1[MAC_ADDR_LEN];
-       UCHAR Addr2[MAC_ADDR_LEN];
-       BAR_CONTROL BARControl;
+struct PACKED rt_frame_ba_req {
+       struct rt_frame_control FC;
+       u16 Duration;
+       u8 Addr1[MAC_ADDR_LEN];
+       u8 Addr2[MAC_ADDR_LEN];
+       struct rt_bar_control BARControl;
        BASEQ_CONTROL BAStartingSeq;
-} FRAME_BA_REQ, *PFRAME_BA_REQ;
-
-typedef struct PACKED _FRAME_MTBA_REQ {
-       FRAME_CONTROL FC;
-       USHORT Duration;
-       UCHAR Addr1[MAC_ADDR_LEN];
-       UCHAR Addr2[MAC_ADDR_LEN];
-       MTBAR_CONTROL MTBARControl;
-       PER_TID_INFO PerTIDInfo;
+};
+
+struct PACKED rt_frame_mtba_req {
+       struct rt_frame_control FC;
+       u16 Duration;
+       u8 Addr1[MAC_ADDR_LEN];
+       u8 Addr2[MAC_ADDR_LEN];
+       struct rt_mtbar_control MTBARControl;
+       struct rt_per_tid_info PerTIDInfo;
        BASEQ_CONTROL BAStartingSeq;
-} FRAME_MTBA_REQ, *PFRAME_MTBA_REQ;
+};
 
 /* Compressed format is mandantory in HT STA */
-typedef struct PACKED _FRAME_MTBA {
-       FRAME_CONTROL FC;
-       USHORT Duration;
-       UCHAR Addr1[MAC_ADDR_LEN];
-       UCHAR Addr2[MAC_ADDR_LEN];
-       BA_CONTROL BAControl;
+struct PACKED rt_frame_mtba {
+       struct rt_frame_control FC;
+       u16 Duration;
+       u8 Addr1[MAC_ADDR_LEN];
+       u8 Addr2[MAC_ADDR_LEN];
+       struct rt_ba_control BAControl;
        BASEQ_CONTROL BAStartingSeq;
-       UCHAR BitMap[8];
-} FRAME_MTBA, *PFRAME_MTBA;
-
-typedef struct PACKED _FRAME_PSMP_ACTION {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-       UCHAR Psmp;             /* 7.3.1.25 */
-} FRAME_PSMP_ACTION, *PFRAME_PSMP_ACTION;
-
-typedef struct PACKED _FRAME_ACTION_HDR {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-} FRAME_ACTION_HDR, *PFRAME_ACTION_HDR;
+       u8 BitMap[8];
+};
+
+struct PACKED rt_frame_psmp_action {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+       u8 Psmp;                /* 7.3.1.25 */
+};
+
+struct PACKED rt_frame_action_hdr {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+};
 
 /*Action Frame */
 /*Action Frame  Category:Spectrum,  Action:Channel Switch. 7.3.2.20 */
-typedef struct PACKED _CHAN_SWITCH_ANNOUNCE {
-       UCHAR ElementID;        /* ID = IE_CHANNEL_SWITCH_ANNOUNCEMENT = 37 */
-       UCHAR Len;
-       CHA_SWITCH_ANNOUNCE_IE CSAnnounceIe;
-} CHAN_SWITCH_ANNOUNCE, *PCHAN_SWITCH_ANNOUNCE;
+struct PACKED rt_chan_switch_announce {
+       u8 ElementID;   /* ID = IE_CHANNEL_SWITCH_ANNOUNCEMENT = 37 */
+       u8 Len;
+       struct rt_cha_switch_announce_ie CSAnnounceIe;
+};
 
 /*802.11n : 7.3.2.20a */
-typedef struct PACKED _SECOND_CHAN_OFFSET {
-       UCHAR ElementID;        /* ID = IE_SECONDARY_CH_OFFSET = 62 */
-       UCHAR Len;
-       SEC_CHA_OFFSET_IE SecChOffsetIe;
-} SECOND_CHAN_OFFSET, *PSECOND_CHAN_OFFSET;
-
-typedef struct PACKED _FRAME_SPETRUM_CS {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-       CHAN_SWITCH_ANNOUNCE CSAnnounce;
-       SECOND_CHAN_OFFSET SecondChannel;
-} FRAME_SPETRUM_CS, *PFRAME_SPETRUM_CS;
-
-typedef struct PACKED _FRAME_ADDBA_REQ {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-       UCHAR Token;            /* 1 */
-       BA_PARM BaParm;         /*  2 - 10 */
-       USHORT TimeOutValue;    /* 0 - 0 */
+struct PACKED rt_second_chan_offset {
+       u8 ElementID;   /* ID = IE_SECONDARY_CH_OFFSET = 62 */
+       u8 Len;
+       struct rt_sec_cha_offset_ie SecChOffsetIe;
+};
+
+struct PACKED rt_frame_spetrum_cs {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+       struct rt_chan_switch_announce CSAnnounce;
+       struct rt_second_chan_offset SecondChannel;
+};
+
+struct PACKED rt_frame_addba_req {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+       u8 Token;               /* 1 */
+       struct rt_ba_parm BaParm;               /*  2 - 10 */
+       u16 TimeOutValue;       /* 0 - 0 */
        BASEQ_CONTROL BaStartSeq;       /* 0-0 */
-} FRAME_ADDBA_REQ, *PFRAME_ADDBA_REQ;
-
-typedef struct PACKED _FRAME_ADDBA_RSP {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-       UCHAR Token;
-       USHORT StatusCode;
-       BA_PARM BaParm;         /*0 - 2 */
-       USHORT TimeOutValue;
-} FRAME_ADDBA_RSP, *PFRAME_ADDBA_RSP;
-
-typedef struct PACKED _FRAME_DELBA_REQ {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-       DELBA_PARM DelbaParm;
-       USHORT ReasonCode;
-} FRAME_DELBA_REQ, *PFRAME_DELBA_REQ;
+};
+
+struct PACKED rt_frame_addba_rsp {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+       u8 Token;
+       u16 StatusCode;
+       struct rt_ba_parm BaParm;               /*0 - 2 */
+       u16 TimeOutValue;
+};
+
+struct PACKED rt_frame_delba_req {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+       struct rt_delba_parm DelbaParm;
+       u16 ReasonCode;
+};
 
 /*7.2.1.7 */
-typedef struct PACKED _FRAME_BAR {
-       FRAME_CONTROL FC;
-       USHORT Duration;
-       UCHAR Addr1[MAC_ADDR_LEN];
-       UCHAR Addr2[MAC_ADDR_LEN];
-       BAR_CONTROL BarControl;
+struct PACKED rt_frame_bar {
+       struct rt_frame_control FC;
+       u16 Duration;
+       u8 Addr1[MAC_ADDR_LEN];
+       u8 Addr2[MAC_ADDR_LEN];
+       struct rt_bar_control BarControl;
        BASEQ_CONTROL StartingSeq;
-} FRAME_BAR, *PFRAME_BAR;
+};
 
 /*7.2.1.7 */
-typedef struct PACKED _FRAME_BA {
-       FRAME_CONTROL FC;
-       USHORT Duration;
-       UCHAR Addr1[MAC_ADDR_LEN];
-       UCHAR Addr2[MAC_ADDR_LEN];
-       BAR_CONTROL BarControl;
+struct PACKED rt_frame_ba {
+       struct rt_frame_control FC;
+       u16 Duration;
+       u8 Addr1[MAC_ADDR_LEN];
+       u8 Addr2[MAC_ADDR_LEN];
+       struct rt_bar_control BarControl;
        BASEQ_CONTROL StartingSeq;
-       UCHAR bitmask[8];
-} FRAME_BA, *PFRAME_BA;
+       u8 bitmask[8];
+};
 
 /* Radio Measuement Request Frame Format */
-typedef struct PACKED _FRAME_RM_REQ_ACTION {
-       HEADER_802_11 Hdr;
-       UCHAR Category;
-       UCHAR Action;
-       UCHAR Token;
-       USHORT Repetition;
-       UCHAR data[0];
-} FRAME_RM_REQ_ACTION, *PFRAME_RM_REQ_ACTION;
-
-typedef struct PACKED {
-       UCHAR ID;
-       UCHAR Length;
-       UCHAR ChannelSwitchMode;
-       UCHAR NewRegClass;
-       UCHAR NewChannelNum;
-       UCHAR ChannelSwitchCount;
-} HT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE,
-    *PHT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE;
+struct PACKED rt_frame_rm_req_action {
+       struct rt_header_802_11 Hdr;
+       u8 Category;
+       u8 Action;
+       u8 Token;
+       u16 Repetition;
+       u8 data[0];
+};
+
+struct PACKED rt_ht_ext_channel_switch_announcement_ie {
+       u8 ID;
+       u8 Length;
+       u8 ChannelSwitchMode;
+       u8 NewRegClass;
+       u8 NewChannelNum;
+       u8 ChannelSwitchCount;
+};
 
 /* */
 /* _Limit must be the 2**n - 1 */
@@ -681,24 +680,24 @@ typedef struct PACKED {
 /* */
 /* Contention-free parameter (without ID and Length) */
 /* */
-typedef struct PACKED {
+struct PACKED rt_cf_parm {
        BOOLEAN bValid;         /* 1: variable contains valid value */
-       UCHAR CfpCount;
-       UCHAR CfpPeriod;
-       USHORT CfpMaxDuration;
-       USHORT CfpDurRemaining;
-} CF_PARM, *PCF_PARM;
+       u8 CfpCount;
+       u8 CfpPeriod;
+       u16 CfpMaxDuration;
+       u16 CfpDurRemaining;
+};
 
-typedef struct _CIPHER_SUITE {
+struct rt_cipher_suite {
        NDIS_802_11_ENCRYPTION_STATUS PairCipher;       /* Unicast cipher 1, this one has more secured cipher suite */
        NDIS_802_11_ENCRYPTION_STATUS PairCipherAux;    /* Unicast cipher 2 if AP announce two unicast cipher suite */
        NDIS_802_11_ENCRYPTION_STATUS GroupCipher;      /* Group cipher */
-       USHORT RsnCapability;   /* RSN capability from beacon */
+       u16 RsnCapability;      /* RSN capability from beacon */
        BOOLEAN bMixMode;       /* Indicate Pair & Group cipher might be different */
-} CIPHER_SUITE, *PCIPHER_SUITE;
+};
 
 /* EDCA configuration from AP's BEACON/ProbeRsp */
-typedef struct {
+struct rt_edca_parm {
        BOOLEAN bValid;         /* 1: variable contains valid value */
        BOOLEAN bAdd;           /* 1: variable contains valid value */
        BOOLEAN bQAck;
@@ -706,156 +705,156 @@ typedef struct {
        BOOLEAN bTxopRequest;
        BOOLEAN bAPSDCapable;
 /*  BOOLEAN     bMoreDataAck; */
-       UCHAR EdcaUpdateCount;
-       UCHAR Aifsn[4];         /* 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO */
-       UCHAR Cwmin[4];
-       UCHAR Cwmax[4];
-       USHORT Txop[4];         /* in unit of 32-us */
+       u8 EdcaUpdateCount;
+       u8 Aifsn[4];            /* 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO */
+       u8 Cwmin[4];
+       u8 Cwmax[4];
+       u16 Txop[4];            /* in unit of 32-us */
        BOOLEAN bACM[4];        /* 1: Admission Control of AC_BK is mandattory */
-} EDCA_PARM, *PEDCA_PARM;
+};
 
 /* QBSS LOAD information from QAP's BEACON/ProbeRsp */
-typedef struct {
+struct rt_qbss_load_parm {
        BOOLEAN bValid;         /* 1: variable contains valid value */
-       USHORT StaNum;
-       UCHAR ChannelUtilization;
-       USHORT RemainingAdmissionControl;       /* in unit of 32-us */
-} QBSS_LOAD_PARM, *PQBSS_LOAD_PARM;
+       u16 StaNum;
+       u8 ChannelUtilization;
+       u16 RemainingAdmissionControl;  /* in unit of 32-us */
+};
 
 /* QBSS Info field in QSTA's assoc req */
-typedef struct PACKED {
-       UCHAR UAPSD_AC_VO:1;
-       UCHAR UAPSD_AC_VI:1;
-       UCHAR UAPSD_AC_BK:1;
-       UCHAR UAPSD_AC_BE:1;
-       UCHAR Rsv1:1;
-       UCHAR MaxSPLength:2;
-       UCHAR Rsv2:1;
-} QBSS_STA_INFO_PARM, *PQBSS_STA_INFO_PARM;
+struct PACKED rt_qbss_sta_info_parm {
+       u8 UAPSD_AC_VO:1;
+       u8 UAPSD_AC_VI:1;
+       u8 UAPSD_AC_BK:1;
+       u8 UAPSD_AC_BE:1;
+       u8 Rsv1:1;
+       u8 MaxSPLength:2;
+       u8 Rsv2:1;
+};
 
 /* QBSS Info field in QAP's Beacon/ProbeRsp */
-typedef struct PACKED {
-       UCHAR ParamSetCount:4;
-       UCHAR Rsv:3;
-       UCHAR UAPSD:1;
-} QBSS_AP_INFO_PARM, *PQBSS_AP_INFO_PARM;
+struct PACKED rt_qbss_ap_info_parm {
+       u8 ParamSetCount:4;
+       u8 Rsv:3;
+       u8 UAPSD:1;
+};
 
 /* QOS Capability reported in QAP's BEACON/ProbeRsp */
 /* QOS Capability sent out in QSTA's AssociateReq/ReAssociateReq */
-typedef struct {
+struct rt_qos_capability_parm {
        BOOLEAN bValid;         /* 1: variable contains valid value */
        BOOLEAN bQAck;
        BOOLEAN bQueueRequest;
        BOOLEAN bTxopRequest;
 /*  BOOLEAN     bMoreDataAck; */
-       UCHAR EdcaUpdateCount;
-} QOS_CAPABILITY_PARM, *PQOS_CAPABILITY_PARM;
-
-typedef struct {
-       UCHAR IELen;
-       UCHAR IE[MAX_CUSTOM_LEN];
-} WPA_IE_;
-
-typedef struct {
-       UCHAR Bssid[MAC_ADDR_LEN];
-       UCHAR Channel;
-       UCHAR CentralChannel;   /*Store the wide-band central channel for 40MHz.  .used in 40MHz AP. Or this is the same as Channel. */
-       UCHAR BssType;
-       USHORT AtimWin;
-       USHORT BeaconPeriod;
-
-       UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
-       UCHAR SupRateLen;
-       UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
-       UCHAR ExtRateLen;
-       HT_CAPABILITY_IE HtCapability;
-       UCHAR HtCapabilityLen;
-       ADD_HT_INFO_IE AddHtInfo;       /* AP might use this additional ht info IE */
-       UCHAR AddHtInfoLen;
-       UCHAR NewExtChanOffset;
-       CHAR Rssi;
-       UCHAR Privacy;          /* Indicate security function ON/OFF. Don't mess up with auth mode. */
-       UCHAR Hidden;
-
-       USHORT DtimPeriod;
-       USHORT CapabilityInfo;
-
-       USHORT CfpCount;
-       USHORT CfpPeriod;
-       USHORT CfpMaxDuration;
-       USHORT CfpDurRemaining;
-       UCHAR SsidLen;
-       CHAR Ssid[MAX_LEN_OF_SSID];
-
-       ULONG LastBeaconRxTime; /* OS's timestamp */
+       u8 EdcaUpdateCount;
+};
+
+struct rt_wpa_ie {
+       u8 IELen;
+       u8 IE[MAX_CUSTOM_LEN];
+};
+
+struct rt_bss_entry {
+       u8 Bssid[MAC_ADDR_LEN];
+       u8 Channel;
+       u8 CentralChannel;      /*Store the wide-band central channel for 40MHz.  .used in 40MHz AP. Or this is the same as Channel. */
+       u8 BssType;
+       u16 AtimWin;
+       u16 BeaconPeriod;
+
+       u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES];
+       u8 SupRateLen;
+       u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
+       u8 ExtRateLen;
+       struct rt_ht_capability_ie HtCapability;
+       u8 HtCapabilityLen;
+       struct rt_add_ht_info_ie AddHtInfo;     /* AP might use this additional ht info IE */
+       u8 AddHtInfoLen;
+       u8 NewExtChanOffset;
+       char Rssi;
+       u8 Privacy;             /* Indicate security function ON/OFF. Don't mess up with auth mode. */
+       u8 Hidden;
+
+       u16 DtimPeriod;
+       u16 CapabilityInfo;
+
+       u16 CfpCount;
+       u16 CfpPeriod;
+       u16 CfpMaxDuration;
+       u16 CfpDurRemaining;
+       u8 SsidLen;
+       char Ssid[MAX_LEN_OF_SSID];
+
+       unsigned long LastBeaconRxTime; /* OS's timestamp */
 
        BOOLEAN bSES;
 
        /* New for WPA2 */
-       CIPHER_SUITE WPA;       /* AP announced WPA cipher suite */
-       CIPHER_SUITE WPA2;      /* AP announced WPA2 cipher suite */
+       struct rt_cipher_suite WPA;     /* AP announced WPA cipher suite */
+       struct rt_cipher_suite WPA2;    /* AP announced WPA2 cipher suite */
 
        /* New for microsoft WPA support */
-       NDIS_802_11_FIXED_IEs FixIEs;
+       struct rt_ndis_802_11_fixed_ies FixIEs;
        NDIS_802_11_AUTHENTICATION_MODE AuthModeAux;    /* Addition mode for WPA2 / WPA capable AP */
        NDIS_802_11_AUTHENTICATION_MODE AuthMode;
        NDIS_802_11_WEP_STATUS WepStatus;       /* Unicast Encryption Algorithm extract from VAR_IE */
-       USHORT VarIELen;        /* Length of next VIE include EID & Length */
-       UCHAR VarIEs[MAX_VIE_LEN];
+       u16 VarIELen;   /* Length of next VIE include EID & Length */
+       u8 VarIEs[MAX_VIE_LEN];
 
        /* CCX Ckip information */
-       UCHAR CkipFlag;
+       u8 CkipFlag;
 
        /* CCX 2 TSF */
-       UCHAR PTSF[4];          /* Parent TSF */
-       UCHAR TTSF[8];          /* Target TSF */
+       u8 PTSF[4];             /* Parent TSF */
+       u8 TTSF[8];             /* Target TSF */
 
        /* 802.11e d9, and WMM */
-       EDCA_PARM EdcaParm;
-       QOS_CAPABILITY_PARM QosCapability;
-       QBSS_LOAD_PARM QbssLoad;
-       WPA_IE_ WpaIE;
-       WPA_IE_ RsnIE;
-} BSS_ENTRY, *PBSS_ENTRY;
-
-typedef struct {
-       UCHAR BssNr;
-       UCHAR BssOverlapNr;
-       BSS_ENTRY BssEntry[MAX_LEN_OF_BSS_TABLE];
-} BSS_TABLE, *PBSS_TABLE;
-
-typedef struct _MLME_QUEUE_ELEM {
-       ULONG Machine;
-       ULONG MsgType;
-       ULONG MsgLen;
-       UCHAR Msg[MGMT_DMA_BUFFER_SIZE];
+       struct rt_edca_parm EdcaParm;
+       struct rt_qos_capability_parm QosCapability;
+       struct rt_qbss_load_parm QbssLoad;
+       struct rt_wpa_ie WpaIE;
+       struct rt_wpa_ie RsnIE;
+};
+
+struct rt_bss_table {
+       u8 BssNr;
+       u8 BssOverlapNr;
+       struct rt_bss_entry BssEntry[MAX_LEN_OF_BSS_TABLE];
+};
+
+struct rt_mlme_queue_elem {
+       unsigned long Machine;
+       unsigned long MsgType;
+       unsigned long MsgLen;
+       u8 Msg[MGMT_DMA_BUFFER_SIZE];
        LARGE_INTEGER TimeStamp;
-       UCHAR Rssi0;
-       UCHAR Rssi1;
-       UCHAR Rssi2;
-       UCHAR Signal;
-       UCHAR Channel;
-       UCHAR Wcid;
+       u8 Rssi0;
+       u8 Rssi1;
+       u8 Rssi2;
+       u8 Signal;
+       u8 Channel;
+       u8 Wcid;
        BOOLEAN Occupied;
-} MLME_QUEUE_ELEM, *PMLME_QUEUE_ELEM;
-
-typedef struct _MLME_QUEUE {
-       ULONG Num;
-       ULONG Head;
-       ULONG Tail;
-       NDIS_SPIN_LOCK Lock;
-       MLME_QUEUE_ELEM Entry[MAX_LEN_OF_MLME_QUEUE];
-} MLME_QUEUE, *PMLME_QUEUE;
-
-typedef VOID(*STATE_MACHINE_FUNC) (VOID * Adaptor, MLME_QUEUE_ELEM * Elem);
-
-typedef struct _STATE_MACHINE {
-       ULONG Base;
-       ULONG NrState;
-       ULONG NrMsg;
-       ULONG CurrState;
+};
+
+struct rt_mlme_queue {
+       unsigned long Num;
+       unsigned long Head;
+       unsigned long Tail;
+       spinlock_t Lock;
+       struct rt_mlme_queue_elem Entry[MAX_LEN_OF_MLME_QUEUE];
+};
+
+typedef void(*STATE_MACHINE_FUNC) (void * Adaptor, struct rt_mlme_queue_elem *Elem);
+
+struct rt_state_machine {
+       unsigned long Base;
+       unsigned long NrState;
+       unsigned long NrMsg;
+       unsigned long CurrState;
        STATE_MACHINE_FUNC *TransFunc;
-} STATE_MACHINE, *PSTATE_MACHINE;
+};
 
 /* MLME AUX data structure that hold temporarliy settings during a connection attempt. */
 /* Once this attemp succeeds, all settings will be copy to pAd->StaActive. */
@@ -863,133 +862,132 @@ typedef struct _STATE_MACHINE {
 /* several steps (JOIN, AUTH, ASSOC or REASSOC) and may fail at any step. We purposely */
 /* separate this under-trial settings away from pAd->StaActive so that once */
 /* this new attempt failed, driver can auto-recover back to the active settings. */
-typedef struct _MLME_AUX {
-       UCHAR BssType;
-       UCHAR Ssid[MAX_LEN_OF_SSID];
-       UCHAR SsidLen;
-       UCHAR Bssid[MAC_ADDR_LEN];
-       UCHAR AutoReconnectSsid[MAX_LEN_OF_SSID];
-       UCHAR AutoReconnectSsidLen;
-       USHORT Alg;
-       UCHAR ScanType;
-       UCHAR Channel;
-       UCHAR CentralChannel;
-       USHORT Aid;
-       USHORT CapabilityInfo;
-       USHORT BeaconPeriod;
-       USHORT CfpMaxDuration;
-       USHORT CfpPeriod;
-       USHORT AtimWin;
+struct rt_mlme_aux {
+       u8 BssType;
+       u8 Ssid[MAX_LEN_OF_SSID];
+       u8 SsidLen;
+       u8 Bssid[MAC_ADDR_LEN];
+       u8 AutoReconnectSsid[MAX_LEN_OF_SSID];
+       u8 AutoReconnectSsidLen;
+       u16 Alg;
+       u8 ScanType;
+       u8 Channel;
+       u8 CentralChannel;
+       u16 Aid;
+       u16 CapabilityInfo;
+       u16 BeaconPeriod;
+       u16 CfpMaxDuration;
+       u16 CfpPeriod;
+       u16 AtimWin;
 
        /* Copy supported rate from desired AP's beacon. We are trying to match */
        /* AP's supported and extended rate settings. */
-       UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
-       UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
-       UCHAR SupRateLen;
-       UCHAR ExtRateLen;
-       HT_CAPABILITY_IE HtCapability;
-       UCHAR HtCapabilityLen;
-       ADD_HT_INFO_IE AddHtInfo;       /* AP might use this additional ht info IE */
-       UCHAR NewExtChannelOffset;
-       /*RT_HT_CAPABILITY      SupportedHtPhy; */
+       u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES];
+       u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
+       u8 SupRateLen;
+       u8 ExtRateLen;
+       struct rt_ht_capability_ie HtCapability;
+       u8 HtCapabilityLen;
+       struct rt_add_ht_info_ie AddHtInfo;     /* AP might use this additional ht info IE */
+       u8 NewExtChannelOffset;
+       /*struct rt_ht_capability      SupportedHtPhy; */
 
        /* new for QOS */
-       QOS_CAPABILITY_PARM APQosCapability;    /* QOS capability of the current associated AP */
-       EDCA_PARM APEdcaParm;   /* EDCA parameters of the current associated AP */
-       QBSS_LOAD_PARM APQbssLoad;      /* QBSS load of the current associated AP */
+       struct rt_qos_capability_parm APQosCapability;  /* QOS capability of the current associated AP */
+       struct rt_edca_parm APEdcaParm; /* EDCA parameters of the current associated AP */
+       struct rt_qbss_load_parm APQbssLoad;    /* QBSS load of the current associated AP */
 
        /* new to keep Ralink specific feature */
-       ULONG APRalinkIe;
+       unsigned long APRalinkIe;
 
-       BSS_TABLE SsidBssTab;   /* AP list for the same SSID */
-       BSS_TABLE RoamTab;      /* AP list eligible for roaming */
-       ULONG BssIdx;
-       ULONG RoamIdx;
+       struct rt_bss_table SsidBssTab; /* AP list for the same SSID */
+       struct rt_bss_table RoamTab;    /* AP list eligible for roaming */
+       unsigned long BssIdx;
+       unsigned long RoamIdx;
 
        BOOLEAN CurrReqIsFromNdis;
 
-       RALINK_TIMER_STRUCT BeaconTimer, ScanTimer;
-       RALINK_TIMER_STRUCT AuthTimer;
-       RALINK_TIMER_STRUCT AssocTimer, ReassocTimer, DisassocTimer;
-} MLME_AUX, *PMLME_AUX;
-
-typedef struct _MLME_ADDBA_REQ_STRUCT {
-       UCHAR Wcid;             /* */
-       UCHAR pAddr[MAC_ADDR_LEN];
-       UCHAR BaBufSize;
-       USHORT TimeOutValue;
-       UCHAR TID;
-       UCHAR Token;
-       USHORT BaStartSeq;
-} MLME_ADDBA_REQ_STRUCT, *PMLME_ADDBA_REQ_STRUCT;
-
-typedef struct _MLME_DELBA_REQ_STRUCT {
-       UCHAR Wcid;             /* */
-       UCHAR Addr[MAC_ADDR_LEN];
-       UCHAR TID;
-       UCHAR Initiator;
-} MLME_DELBA_REQ_STRUCT, *PMLME_DELBA_REQ_STRUCT;
+       struct rt_ralink_timer BeaconTimer, ScanTimer;
+       struct rt_ralink_timer AuthTimer;
+       struct rt_ralink_timer AssocTimer, ReassocTimer, DisassocTimer;
+};
+
+struct rt_mlme_addba_req {
+       u8 Wcid;                /* */
+       u8 pAddr[MAC_ADDR_LEN];
+       u8 BaBufSize;
+       u16 TimeOutValue;
+       u8 TID;
+       u8 Token;
+       u16 BaStartSeq;
+};
+
+struct rt_mlme_delba_req {
+       u8 Wcid;                /* */
+       u8 Addr[MAC_ADDR_LEN];
+       u8 TID;
+       u8 Initiator;
+};
 
 /* assoc struct is equal to reassoc */
-typedef struct _MLME_ASSOC_REQ_STRUCT {
-       UCHAR Addr[MAC_ADDR_LEN];
-       USHORT CapabilityInfo;
-       USHORT ListenIntv;
-       ULONG Timeout;
-} MLME_ASSOC_REQ_STRUCT, *PMLME_ASSOC_REQ_STRUCT, MLME_REASSOC_REQ_STRUCT,
-    *PMLME_REASSOC_REQ_STRUCT;
-
-typedef struct _MLME_DISASSOC_REQ_STRUCT {
-       UCHAR Addr[MAC_ADDR_LEN];
-       USHORT Reason;
-} MLME_DISASSOC_REQ_STRUCT, *PMLME_DISASSOC_REQ_STRUCT;
-
-typedef struct _MLME_AUTH_REQ_STRUCT {
-       UCHAR Addr[MAC_ADDR_LEN];
-       USHORT Alg;
-       ULONG Timeout;
-} MLME_AUTH_REQ_STRUCT, *PMLME_AUTH_REQ_STRUCT;
-
-typedef struct _MLME_DEAUTH_REQ_STRUCT {
-       UCHAR Addr[MAC_ADDR_LEN];
-       USHORT Reason;
-} MLME_DEAUTH_REQ_STRUCT, *PMLME_DEAUTH_REQ_STRUCT;
-
-typedef struct {
-       ULONG BssIdx;
-} MLME_JOIN_REQ_STRUCT;
-
-typedef struct _MLME_SCAN_REQ_STRUCT {
-       UCHAR Bssid[MAC_ADDR_LEN];
-       UCHAR BssType;
-       UCHAR ScanType;
-       UCHAR SsidLen;
-       CHAR Ssid[MAX_LEN_OF_SSID];
-} MLME_SCAN_REQ_STRUCT, *PMLME_SCAN_REQ_STRUCT;
-
-typedef struct _MLME_START_REQ_STRUCT {
-       CHAR Ssid[MAX_LEN_OF_SSID];
-       UCHAR SsidLen;
-} MLME_START_REQ_STRUCT, *PMLME_START_REQ_STRUCT;
-
-typedef struct PACKED {
-       UCHAR Eid;
-       UCHAR Len;
-       UCHAR Octet[1];
-} EID_STRUCT, *PEID_STRUCT, BEACON_EID_STRUCT, *PBEACON_EID_STRUCT;
-
-typedef struct PACKED _RTMP_TX_RATE_SWITCH {
-       UCHAR ItemNo;
-       UCHAR STBC:1;
-       UCHAR ShortGI:1;
-       UCHAR BW:1;
-       UCHAR Rsv1:1;
-       UCHAR Mode:2;
-       UCHAR Rsv2:2;
-       UCHAR CurrMCS;
-       UCHAR TrainUp;
-       UCHAR TrainDown;
-} RRTMP_TX_RATE_SWITCH, *PRTMP_TX_RATE_SWITCH;
+struct rt_mlme_assoc_req {
+       u8 Addr[MAC_ADDR_LEN];
+       u16 CapabilityInfo;
+       u16 ListenIntv;
+       unsigned long Timeout;
+};
+
+struct rt_mlme_disassoc_req {
+       u8 Addr[MAC_ADDR_LEN];
+       u16 Reason;
+};
+
+struct rt_mlme_auth_req {
+       u8 Addr[MAC_ADDR_LEN];
+       u16 Alg;
+       unsigned long Timeout;
+};
+
+struct rt_mlme_deauth_req {
+       u8 Addr[MAC_ADDR_LEN];
+       u16 Reason;
+};
+
+struct rt_mlme_join_req {
+       unsigned long BssIdx;
+};
+
+struct rt_mlme_scan_req {
+       u8 Bssid[MAC_ADDR_LEN];
+       u8 BssType;
+       u8 ScanType;
+       u8 SsidLen;
+       char Ssid[MAX_LEN_OF_SSID];
+};
+
+struct rt_mlme_start_req {
+       char Ssid[MAX_LEN_OF_SSID];
+       u8 SsidLen;
+};
+
+struct PACKED rt_eid {
+       u8 Eid;
+       u8 Len;
+       u8 Octet[1];
+};
+
+struct PACKED rt_rtmp_tx_rate_switch {
+       u8 ItemNo;
+       u8 STBC:1;
+       u8 ShortGI:1;
+       u8 BW:1;
+       u8 Rsv1:1;
+       u8 Mode:2;
+       u8 Rsv2:2;
+       u8 CurrMCS;
+       u8 TrainUp;
+       u8 TrainDown;
+};
 
 /* ========================== AP mlme.h =============================== */
 #define TBTT_PRELOAD_TIME       384    /* usec. LomgPreamble + 24-byte at 1Mbps */