iPXE
hfa384x.h
Go to the documentation of this file.
00001 /* src/prism2/include/prism2/hfa384x.h
00002 *
00003 * Defines the constants and data structures for the hfa384x
00004 *
00005 * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
00006 * --------------------------------------------------------------------
00007 *
00008 * linux-wlan
00009 *
00010 *   The contents of this file are subject to the Mozilla Public
00011 *   License Version 1.1 (the "License"); you may not use this file
00012 *   except in compliance with the License. You may obtain a copy of
00013 *   the License at http://www.mozilla.org/MPL/
00014 *
00015 *   Software distributed under the License is distributed on an "AS
00016 *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
00017 *   implied. See the License for the specific language governing
00018 *   rights and limitations under the License.
00019 *
00020 *   Alternatively, the contents of this file may be used under the
00021 *   terms of the GNU Public License version 2 (the "GPL"), in which
00022 *   case the provisions of the GPL are applicable instead of the
00023 *   above.  If you wish to allow the use of your version of this file
00024 *   only under the terms of the GPL and not to allow others to use
00025 *   your version of this file under the MPL, indicate your decision
00026 *   by deleting the provisions above and replace them with the notice
00027 *   and other provisions required by the GPL.  If you do not delete
00028 *   the provisions above, a recipient may use your version of this
00029 *   file under either the MPL or the GPL.
00030 *
00031 * --------------------------------------------------------------------
00032 *
00033 * Inquiries regarding the linux-wlan Open Source project can be
00034 * made directly to:
00035 *
00036 * AbsoluteValue Systems Inc.
00037 * info@linux-wlan.com
00038 * http://www.linux-wlan.com
00039 *
00040 * --------------------------------------------------------------------
00041 *
00042 * Portions of the development of this software were funded by
00043 * Intersil Corporation as part of PRISM(R) chipset product development.
00044 *
00045 * --------------------------------------------------------------------
00046 *
00047 *   [Implementation and usage notes]
00048 *
00049 *   [References]
00050 *       CW10 Programmer's Manual v1.5
00051 *       IEEE 802.11 D10.0
00052 *
00053 * --------------------------------------------------------------------
00054 */
00055 
00056 FILE_LICENCE ( GPL2_ONLY );
00057 
00058 #ifndef _HFA384x_H
00059 #define _HFA384x_H
00060 
00061 /*=============================================================*/
00062 #define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
00063 
00064 #define HFA384x_LEVEL_TO_dBm(v)   (0x100 + (v) * 100 / 255 - 100)
00065 
00066 /*------ Constants --------------------------------------------*/
00067 /*--- Mins & Maxs -----------------------------------*/
00068 #define         HFA384x_CMD_ALLOC_LEN_MIN       ((uint16_t)4)
00069 #define         HFA384x_CMD_ALLOC_LEN_MAX       ((uint16_t)2400)
00070 #define         HFA384x_BAP_DATALEN_MAX         ((uint16_t)4096)
00071 #define         HFA384x_BAP_OFFSET_MAX          ((uint16_t)4096)
00072 #define         HFA384x_PORTID_MAX              ((uint16_t)7)
00073 #define         HFA384x_NUMPORTS_MAX            ((uint16_t)(HFA384x_PORTID_MAX+1))
00074 #define         HFA384x_PDR_LEN_MAX             ((uint16_t)512) /* in bytes, from EK */
00075 #define         HFA384x_PDA_RECS_MAX            ((uint16_t)200) /* a guess */
00076 #define         HFA384x_PDA_LEN_MAX             ((uint16_t)1024)        /* in bytes, from EK */
00077 #define         HFA384x_SCANRESULT_MAX          ((uint16_t)31)
00078 #define         HFA384x_HSCANRESULT_MAX         ((uint16_t)31)
00079 #define         HFA384x_CHINFORESULT_MAX        ((uint16_t)16)
00080 #define         HFA384x_DRVR_FIDSTACKLEN_MAX    (10)
00081 #define         HFA384x_DRVR_TXBUF_MAX          (sizeof(hfa384x_tx_frame_t) + \
00082                                                 WLAN_DATA_MAXLEN - \
00083                                                 WLAN_WEP_IV_LEN - \
00084                                                 WLAN_WEP_ICV_LEN + 2)
00085 #define         HFA384x_DRVR_MAGIC              (0x4a2d)
00086 #define         HFA384x_INFODATA_MAXLEN         (sizeof(hfa384x_infodata_t))
00087 #define         HFA384x_INFOFRM_MAXLEN          (sizeof(hfa384x_InfFrame_t))
00088 #define         HFA384x_RID_GUESSING_MAXLEN     2048  /* I'm not really sure */
00089 #define         HFA384x_RIDDATA_MAXLEN          HFA384x_RID_GUESSING_MAXLEN
00090 #define         HFA384x_USB_RWMEM_MAXLEN        2048
00091 
00092 /*--- Support Constants -----------------------------*/
00093 #define         HFA384x_BAP_PROC                        ((uint16_t)0)
00094 #define         HFA384x_BAP_int                         ((uint16_t)1)
00095 #define         HFA384x_PORTTYPE_IBSS                   ((uint16_t)0)
00096 #define         HFA384x_PORTTYPE_BSS                    ((uint16_t)1)
00097 #define         HFA384x_PORTTYPE_WDS                    ((uint16_t)2)
00098 #define         HFA384x_PORTTYPE_PSUEDOIBSS             ((uint16_t)3)
00099 #define         HFA384x_PORTTYPE_HOSTAP                 ((uint16_t)6)
00100 #define         HFA384x_WEPFLAGS_PRIVINVOKED            ((uint16_t)BIT0)
00101 #define         HFA384x_WEPFLAGS_EXCLUDE                ((uint16_t)BIT1)
00102 #define         HFA384x_WEPFLAGS_DISABLE_TXCRYPT        ((uint16_t)BIT4)
00103 #define         HFA384x_WEPFLAGS_DISABLE_RXCRYPT        ((uint16_t)BIT7)
00104 #define         HFA384x_WEPFLAGS_DISALLOW_MIXED         ((uint16_t)BIT11)
00105 #define         HFA384x_WEPFLAGS_IV_INTERVAL1           ((uint16_t)0)
00106 #define         HFA384x_WEPFLAGS_IV_INTERVAL10          ((uint16_t)BIT5)
00107 #define         HFA384x_WEPFLAGS_IV_INTERVAL50          ((uint16_t)BIT6)
00108 #define         HFA384x_WEPFLAGS_IV_INTERVAL100         ((uint16_t)(BIT5 | BIT6))
00109 #define         HFA384x_WEPFLAGS_FIRMWARE_WPA           ((uint16_t)BIT8)
00110 #define         HFA384x_WEPFLAGS_HOST_MIC               ((uint16_t)BIT9)
00111 #define         HFA384x_ROAMMODE_FWSCAN_FWROAM          ((uint16_t)1)
00112 #define         HFA384x_ROAMMODE_FWSCAN_HOSTROAM        ((uint16_t)2)
00113 #define         HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM      ((uint16_t)3)
00114 #define         HFA384x_PORTSTATUS_DISABLED             ((uint16_t)1)
00115 #define         HFA384x_PORTSTATUS_INITSRCH             ((uint16_t)2)
00116 #define         HFA384x_PORTSTATUS_CONN_IBSS            ((uint16_t)3)
00117 #define         HFA384x_PORTSTATUS_CONN_ESS             ((uint16_t)4)
00118 #define         HFA384x_PORTSTATUS_OOR_ESS              ((uint16_t)5)
00119 #define         HFA384x_PORTSTATUS_CONN_WDS             ((uint16_t)6)
00120 #define         HFA384x_PORTSTATUS_HOSTAP               ((uint16_t)8)
00121 #define         HFA384x_RATEBIT_1                       ((uint16_t)1)
00122 #define         HFA384x_RATEBIT_2                       ((uint16_t)2)
00123 #define         HFA384x_RATEBIT_5dot5                   ((uint16_t)4)
00124 #define         HFA384x_RATEBIT_11                      ((uint16_t)8)
00125 
00126 /*--- Just some symbolic names for legibility -------*/
00127 #define         HFA384x_TXCMD_NORECL            ((uint16_t)0)
00128 #define         HFA384x_TXCMD_RECL              ((uint16_t)1)
00129 
00130 /*--- MAC Internal memory constants and macros ------*/
00131 /* masks and macros used to manipulate MAC internal memory addresses. */
00132 /* MAC internal memory addresses are 23 bit quantities.  The MAC uses
00133  * a paged address space where the upper 16 bits are the page number
00134  * and the lower 7 bits are the offset.  There are various Host API
00135  * elements that require two 16-bit quantities to specify a MAC
00136  * internal memory address.  Unfortunately, some of the API's use a
00137  * page/offset format where the offset value is JUST the lower seven
00138  * bits and the page is  the remaining 16 bits.  Some of the API's
00139  * assume that the 23 bit address has been split at the 16th bit.  We
00140  * refer to these two formats as AUX format and CMD format.  The
00141  * macros below help handle some of this.
00142  */
00143 
00144 /* Handy constant */
00145 #define         HFA384x_ADDR_AUX_OFF_MAX        ((uint16_t)0x007f)
00146 
00147 /* Mask bits for discarding unwanted pieces in a flat address */
00148 #define         HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80)
00149 #define         HFA384x_ADDR_FLAT_AUX_OFF_MASK  (0x0000007f)
00150 #define         HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000)
00151 #define         HFA384x_ADDR_FLAT_CMD_OFF_MASK  (0x0000ffff)
00152 
00153 /* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */
00154 #define         HFA384x_ADDR_AUX_PAGE_MASK      (0xffff)
00155 #define         HFA384x_ADDR_AUX_OFF_MASK       (0x007f)
00156 
00157 /* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */
00158 #define         HFA384x_ADDR_CMD_PAGE_MASK      (0x007f)
00159 #define         HFA384x_ADDR_CMD_OFF_MASK       (0xffff)
00160 
00161 /* Make a 32-bit flat address from AUX format 16-bit page and offset */
00162 #define         HFA384x_ADDR_AUX_MKFLAT(p,o)    \
00163                 (((uint32_t)(((uint16_t)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \
00164                 ((uint32_t)(((uint16_t)(o))&HFA384x_ADDR_AUX_OFF_MASK))
00165 
00166 /* Make a 32-bit flat address from CMD format 16-bit page and offset */
00167 #define         HFA384x_ADDR_CMD_MKFLAT(p,o)    \
00168                 (((uint32_t)(((uint16_t)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \
00169                 ((uint32_t)(((uint16_t)(o))&HFA384x_ADDR_CMD_OFF_MASK))
00170 
00171 /* Make AUX format offset and page from a 32-bit flat address */
00172 #define         HFA384x_ADDR_AUX_MKPAGE(f) \
00173                 ((uint16_t)((((uint32_t)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7))
00174 #define         HFA384x_ADDR_AUX_MKOFF(f) \
00175                 ((uint16_t)(((uint32_t)(f))&HFA384x_ADDR_FLAT_AUX_OFF_MASK))
00176 
00177 /* Make CMD format offset and page from a 32-bit flat address */
00178 #define         HFA384x_ADDR_CMD_MKPAGE(f) \
00179                 ((uint16_t)((((uint32_t)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))
00180 #define         HFA384x_ADDR_CMD_MKOFF(f) \
00181                 ((uint16_t)(((uint32_t)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))
00182 
00183 /*--- Aux register masks/tests ----------------------*/
00184 /* Some of the upper bits of the AUX offset register are used to */
00185 /*  select address space. */
00186 #define         HFA384x_AUX_CTL_EXTDS   (0x00)
00187 #define         HFA384x_AUX_CTL_NV      (0x01)
00188 #define         HFA384x_AUX_CTL_PHY     (0x02)
00189 #define         HFA384x_AUX_CTL_ICSRAM  (0x03)
00190 
00191 /* Make AUX register offset and page values from a flat address */
00192 #define         HFA384x_AUX_MKOFF(f, c) \
00193         (HFA384x_ADDR_AUX_MKOFF(f) | (((uint16_t)(c))<<12))
00194 #define         HFA384x_AUX_MKPAGE(f)   HFA384x_ADDR_AUX_MKPAGE(f)
00195 
00196 
00197 /*--- Controller Memory addresses -------------------*/
00198 #define         HFA3842_PDA_BASE        (0x007f0000UL)
00199 #define         HFA3841_PDA_BASE        (0x003f0000UL)
00200 #define         HFA3841_PDA_BOGUS_BASE  (0x00390000UL)
00201 
00202 /*--- Driver Download states  -----------------------*/
00203 #define         HFA384x_DLSTATE_DISABLED                0
00204 #define         HFA384x_DLSTATE_RAMENABLED              1
00205 #define         HFA384x_DLSTATE_FLASHENABLED            2
00206 #define         HFA384x_DLSTATE_FLASHWRITTEN            3
00207 #define         HFA384x_DLSTATE_FLASHWRITEPENDING       4
00208 #define         HFA384x_DLSTATE_GENESIS                 5
00209 
00210 /*--- Register I/O offsets --------------------------*/
00211 #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
00212 
00213 #define         HFA384x_CMD_OFF                 (0x00)
00214 #define         HFA384x_PARAM0_OFF              (0x02)
00215 #define         HFA384x_PARAM1_OFF              (0x04)
00216 #define         HFA384x_PARAM2_OFF              (0x06)
00217 #define         HFA384x_STATUS_OFF              (0x08)
00218 #define         HFA384x_RESP0_OFF               (0x0A)
00219 #define         HFA384x_RESP1_OFF               (0x0C)
00220 #define         HFA384x_RESP2_OFF               (0x0E)
00221 #define         HFA384x_INFOFID_OFF             (0x10)
00222 #define         HFA384x_RXFID_OFF               (0x20)
00223 #define         HFA384x_ALLOCFID_OFF            (0x22)
00224 #define         HFA384x_TXCOMPLFID_OFF          (0x24)
00225 #define         HFA384x_SELECT0_OFF             (0x18)
00226 #define         HFA384x_OFFSET0_OFF             (0x1C)
00227 #define         HFA384x_DATA0_OFF               (0x36)
00228 #define         HFA384x_SELECT1_OFF             (0x1A)
00229 #define         HFA384x_OFFSET1_OFF             (0x1E)
00230 #define         HFA384x_DATA1_OFF               (0x38)
00231 #define         HFA384x_EVSTAT_OFF              (0x30)
00232 #define         HFA384x_INTEN_OFF               (0x32)
00233 #define         HFA384x_EVACK_OFF               (0x34)
00234 #define         HFA384x_CONTROL_OFF             (0x14)
00235 #define         HFA384x_SWSUPPORT0_OFF          (0x28)
00236 #define         HFA384x_SWSUPPORT1_OFF          (0x2A)
00237 #define         HFA384x_SWSUPPORT2_OFF          (0x2C)
00238 #define         HFA384x_AUXPAGE_OFF             (0x3A)
00239 #define         HFA384x_AUXOFFSET_OFF           (0x3C)
00240 #define         HFA384x_AUXDATA_OFF             (0x3E)
00241 
00242 #elif (WLAN_HOSTIF == WLAN_PCI || WLAN_HOSTIF == WLAN_USB)
00243 
00244 #define         HFA384x_CMD_OFF                 (0x00)
00245 #define         HFA384x_PARAM0_OFF              (0x04)
00246 #define         HFA384x_PARAM1_OFF              (0x08)
00247 #define         HFA384x_PARAM2_OFF              (0x0c)
00248 #define         HFA384x_STATUS_OFF              (0x10)
00249 #define         HFA384x_RESP0_OFF               (0x14)
00250 #define         HFA384x_RESP1_OFF               (0x18)
00251 #define         HFA384x_RESP2_OFF               (0x1c)
00252 #define         HFA384x_INFOFID_OFF             (0x20)
00253 #define         HFA384x_RXFID_OFF               (0x40)
00254 #define         HFA384x_ALLOCFID_OFF            (0x44)
00255 #define         HFA384x_TXCOMPLFID_OFF          (0x48)
00256 #define         HFA384x_SELECT0_OFF             (0x30)
00257 #define         HFA384x_OFFSET0_OFF             (0x38)
00258 #define         HFA384x_DATA0_OFF               (0x6c)
00259 #define         HFA384x_SELECT1_OFF             (0x34)
00260 #define         HFA384x_OFFSET1_OFF             (0x3c)
00261 #define         HFA384x_DATA1_OFF               (0x70)
00262 #define         HFA384x_EVSTAT_OFF              (0x60)
00263 #define         HFA384x_INTEN_OFF               (0x64)
00264 #define         HFA384x_EVACK_OFF               (0x68)
00265 #define         HFA384x_CONTROL_OFF             (0x28)
00266 #define         HFA384x_SWSUPPORT0_OFF          (0x50)
00267 #define         HFA384x_SWSUPPORT1_OFF          (0x54)
00268 #define         HFA384x_SWSUPPORT2_OFF          (0x58)
00269 #define         HFA384x_AUXPAGE_OFF             (0x74)
00270 #define         HFA384x_AUXOFFSET_OFF           (0x78)
00271 #define         HFA384x_AUXDATA_OFF             (0x7c)
00272 #define         HFA384x_PCICOR_OFF              (0x4c)
00273 #define         HFA384x_PCIHCR_OFF              (0x5c)
00274 #define         HFA384x_PCI_M0_ADDRH_OFF        (0x80)
00275 #define         HFA384x_PCI_M0_ADDRL_OFF        (0x84)
00276 #define         HFA384x_PCI_M0_LEN_OFF          (0x88)
00277 #define         HFA384x_PCI_M0_CTL_OFF          (0x8c)
00278 #define         HFA384x_PCI_STATUS_OFF          (0x98)
00279 #define         HFA384x_PCI_M1_ADDRH_OFF        (0xa0)
00280 #define         HFA384x_PCI_M1_ADDRL_OFF        (0xa4)
00281 #define         HFA384x_PCI_M1_LEN_OFF          (0xa8)
00282 #define         HFA384x_PCI_M1_CTL_OFF          (0xac)
00283 
00284 #endif
00285 
00286 /*--- Register Field Masks --------------------------*/
00287 #define         HFA384x_CMD_BUSY                ((uint16_t)BIT15)
00288 #define         HFA384x_CMD_AINFO               ((uint16_t)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
00289 #define         HFA384x_CMD_MACPORT             ((uint16_t)(BIT10 | BIT9 | BIT8))
00290 #define         HFA384x_CMD_RECL                ((uint16_t)BIT8)
00291 #define         HFA384x_CMD_WRITE               ((uint16_t)BIT8)
00292 #define         HFA384x_CMD_PROGMODE            ((uint16_t)(BIT9 | BIT8))
00293 #define         HFA384x_CMD_CMDCODE             ((uint16_t)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
00294 
00295 #define         HFA384x_STATUS_RESULT           ((uint16_t)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
00296 #define         HFA384x_STATUS_CMDCODE          ((uint16_t)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
00297 
00298 #define         HFA384x_OFFSET_BUSY             ((uint16_t)BIT15)
00299 #define         HFA384x_OFFSET_ERR              ((uint16_t)BIT14)
00300 #define         HFA384x_OFFSET_DATAOFF          ((uint16_t)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))
00301 
00302 #define         HFA384x_EVSTAT_TICK             ((uint16_t)BIT15)
00303 #define         HFA384x_EVSTAT_WTERR            ((uint16_t)BIT14)
00304 #define         HFA384x_EVSTAT_INFDROP          ((uint16_t)BIT13)
00305 #define         HFA384x_EVSTAT_INFO             ((uint16_t)BIT7)
00306 #define         HFA384x_EVSTAT_DTIM             ((uint16_t)BIT5)
00307 #define         HFA384x_EVSTAT_CMD              ((uint16_t)BIT4)
00308 #define         HFA384x_EVSTAT_ALLOC            ((uint16_t)BIT3)
00309 #define         HFA384x_EVSTAT_TXEXC            ((uint16_t)BIT2)
00310 #define         HFA384x_EVSTAT_TX               ((uint16_t)BIT1)
00311 #define         HFA384x_EVSTAT_RX               ((uint16_t)BIT0)
00312 
00313 #define         HFA384x_INT_BAP_OP           (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC)
00314 
00315 #define         HFA384x_INT_NORMAL           (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC|HFA384x_EVSTAT_INFDROP|HFA384x_EVSTAT_ALLOC|HFA384x_EVSTAT_DTIM)
00316 
00317 #define         HFA384x_INTEN_TICK              ((uint16_t)BIT15)
00318 #define         HFA384x_INTEN_WTERR             ((uint16_t)BIT14)
00319 #define         HFA384x_INTEN_INFDROP           ((uint16_t)BIT13)
00320 #define         HFA384x_INTEN_INFO              ((uint16_t)BIT7)
00321 #define         HFA384x_INTEN_DTIM              ((uint16_t)BIT5)
00322 #define         HFA384x_INTEN_CMD               ((uint16_t)BIT4)
00323 #define         HFA384x_INTEN_ALLOC             ((uint16_t)BIT3)
00324 #define         HFA384x_INTEN_TXEXC             ((uint16_t)BIT2)
00325 #define         HFA384x_INTEN_TX                ((uint16_t)BIT1)
00326 #define         HFA384x_INTEN_RX                ((uint16_t)BIT0)
00327 
00328 #define         HFA384x_EVACK_TICK              ((uint16_t)BIT15)
00329 #define         HFA384x_EVACK_WTERR             ((uint16_t)BIT14)
00330 #define         HFA384x_EVACK_INFDROP           ((uint16_t)BIT13)
00331 #define         HFA384x_EVACK_INFO              ((uint16_t)BIT7)
00332 #define         HFA384x_EVACK_DTIM              ((uint16_t)BIT5)
00333 #define         HFA384x_EVACK_CMD               ((uint16_t)BIT4)
00334 #define         HFA384x_EVACK_ALLOC             ((uint16_t)BIT3)
00335 #define         HFA384x_EVACK_TXEXC             ((uint16_t)BIT2)
00336 #define         HFA384x_EVACK_TX                ((uint16_t)BIT1)
00337 #define         HFA384x_EVACK_RX                ((uint16_t)BIT0)
00338 
00339 #define         HFA384x_CONTROL_AUXEN           ((uint16_t)(BIT15 | BIT14))
00340 
00341 
00342 /*--- Command Code Constants --------------------------*/
00343 /*--- Controller Commands --------------------------*/
00344 #define         HFA384x_CMDCODE_INIT            ((uint16_t)0x00)
00345 #define         HFA384x_CMDCODE_ENABLE          ((uint16_t)0x01)
00346 #define         HFA384x_CMDCODE_DISABLE         ((uint16_t)0x02)
00347 #define         HFA384x_CMDCODE_DIAG            ((uint16_t)0x03)
00348 
00349 /*--- Buffer Mgmt Commands --------------------------*/
00350 #define         HFA384x_CMDCODE_ALLOC           ((uint16_t)0x0A)
00351 #define         HFA384x_CMDCODE_TX              ((uint16_t)0x0B)
00352 #define         HFA384x_CMDCODE_CLRPRST         ((uint16_t)0x12)
00353 
00354 /*--- Regulate Commands --------------------------*/
00355 #define         HFA384x_CMDCODE_NOTIFY          ((uint16_t)0x10)
00356 #define         HFA384x_CMDCODE_INQ             ((uint16_t)0x11)
00357 
00358 /*--- Configure Commands --------------------------*/
00359 #define         HFA384x_CMDCODE_ACCESS          ((uint16_t)0x21)
00360 #define         HFA384x_CMDCODE_DOWNLD          ((uint16_t)0x22)
00361 
00362 /*--- Debugging Commands -----------------------------*/
00363 #define         HFA384x_CMDCODE_MONITOR         ((uint16_t)(0x38))
00364 #define         HFA384x_MONITOR_ENABLE          ((uint16_t)(0x0b))
00365 #define         HFA384x_MONITOR_DISABLE         ((uint16_t)(0x0f))
00366 
00367 /*--- Result Codes --------------------------*/
00368 #define         HFA384x_SUCCESS                 ((uint16_t)(0x00))
00369 #define         HFA384x_CARD_FAIL               ((uint16_t)(0x01))
00370 #define         HFA384x_NO_BUFF                 ((uint16_t)(0x05))
00371 #define         HFA384x_CMD_ERR                 ((uint16_t)(0x7F))
00372 
00373 /*--- Programming Modes --------------------------
00374         MODE 0: Disable programming
00375         MODE 1: Enable volatile memory programming
00376         MODE 2: Enable non-volatile memory programming
00377         MODE 3: Program non-volatile memory section
00378 --------------------------------------------------*/
00379 #define         HFA384x_PROGMODE_DISABLE        ((uint16_t)0x00)
00380 #define         HFA384x_PROGMODE_RAM            ((uint16_t)0x01)
00381 #define         HFA384x_PROGMODE_NV             ((uint16_t)0x02)
00382 #define         HFA384x_PROGMODE_NVWRITE        ((uint16_t)0x03)
00383 
00384 /*--- AUX register enable --------------------------*/
00385 #define         HFA384x_AUXPW0                  ((uint16_t)0xfe01)
00386 #define         HFA384x_AUXPW1                  ((uint16_t)0xdc23)
00387 #define         HFA384x_AUXPW2                  ((uint16_t)0xba45)
00388 
00389 #define         HFA384x_CONTROL_AUX_ISDISABLED  ((uint16_t)0x0000)
00390 #define         HFA384x_CONTROL_AUX_ISENABLED   ((uint16_t)0xc000)
00391 #define         HFA384x_CONTROL_AUX_DOENABLE    ((uint16_t)0x8000)
00392 #define         HFA384x_CONTROL_AUX_DODISABLE   ((uint16_t)0x4000)
00393 
00394 /*--- Record ID Constants --------------------------*/
00395 /*--------------------------------------------------------------------
00396 Configuration RIDs: Network Parameters, Static Configuration Entities
00397 --------------------------------------------------------------------*/
00398 #define         HFA384x_RID_CNFPORTTYPE         ((uint16_t)0xFC00)
00399 #define         HFA384x_RID_CNFOWNMACADDR       ((uint16_t)0xFC01)
00400 #define         HFA384x_RID_CNFDESIREDSSID      ((uint16_t)0xFC02)
00401 #define         HFA384x_RID_CNFOWNCHANNEL       ((uint16_t)0xFC03)
00402 #define         HFA384x_RID_CNFOWNSSID          ((uint16_t)0xFC04)
00403 #define         HFA384x_RID_CNFOWNATIMWIN       ((uint16_t)0xFC05)
00404 #define         HFA384x_RID_CNFSYSSCALE         ((uint16_t)0xFC06)
00405 #define         HFA384x_RID_CNFMAXDATALEN       ((uint16_t)0xFC07)
00406 #define         HFA384x_RID_CNFWDSADDR          ((uint16_t)0xFC08)
00407 #define         HFA384x_RID_CNFPMENABLED        ((uint16_t)0xFC09)
00408 #define         HFA384x_RID_CNFPMEPS            ((uint16_t)0xFC0A)
00409 #define         HFA384x_RID_CNFMULTICASTRX      ((uint16_t)0xFC0B)
00410 #define         HFA384x_RID_CNFMAXSLEEPDUR      ((uint16_t)0xFC0C)
00411 #define         HFA384x_RID_CNFPMHOLDDUR        ((uint16_t)0xFC0D)
00412 #define         HFA384x_RID_CNFOWNNAME          ((uint16_t)0xFC0E)
00413 #define         HFA384x_RID_CNFOWNDTIMPER       ((uint16_t)0xFC10)
00414 #define         HFA384x_RID_CNFWDSADDR1         ((uint16_t)0xFC11)
00415 #define         HFA384x_RID_CNFWDSADDR2         ((uint16_t)0xFC12)
00416 #define         HFA384x_RID_CNFWDSADDR3         ((uint16_t)0xFC13)
00417 #define         HFA384x_RID_CNFWDSADDR4         ((uint16_t)0xFC14)
00418 #define         HFA384x_RID_CNFWDSADDR5         ((uint16_t)0xFC15)
00419 #define         HFA384x_RID_CNFWDSADDR6         ((uint16_t)0xFC16)
00420 #define         HFA384x_RID_CNFMCASTPMBUFF      ((uint16_t)0xFC17)
00421 
00422 /*--------------------------------------------------------------------
00423 Configuration RID lengths: Network Params, Static Config Entities
00424   This is the length of JUST the DATA part of the RID (does not
00425   include the len or code fields)
00426 --------------------------------------------------------------------*/
00427 /* TODO: fill in the rest of these */
00428 #define         HFA384x_RID_CNFPORTTYPE_LEN     ((uint16_t)2)
00429 #define         HFA384x_RID_CNFOWNMACADDR_LEN   ((uint16_t)6)
00430 #define         HFA384x_RID_CNFDESIREDSSID_LEN  ((uint16_t)34)
00431 #define         HFA384x_RID_CNFOWNCHANNEL_LEN   ((uint16_t)2)
00432 #define         HFA384x_RID_CNFOWNSSID_LEN      ((uint16_t)34)
00433 #define         HFA384x_RID_CNFOWNATIMWIN_LEN   ((uint16_t)2)
00434 #define         HFA384x_RID_CNFSYSSCALE_LEN     ((uint16_t)0)
00435 #define         HFA384x_RID_CNFMAXDATALEN_LEN   ((uint16_t)0)
00436 #define         HFA384x_RID_CNFWDSADDR_LEN      ((uint16_t)6)
00437 #define         HFA384x_RID_CNFPMENABLED_LEN    ((uint16_t)0)
00438 #define         HFA384x_RID_CNFPMEPS_LEN        ((uint16_t)0)
00439 #define         HFA384x_RID_CNFMULTICASTRX_LEN  ((uint16_t)0)
00440 #define         HFA384x_RID_CNFMAXSLEEPDUR_LEN  ((uint16_t)0)
00441 #define         HFA384x_RID_CNFPMHOLDDUR_LEN    ((uint16_t)0)
00442 #define         HFA384x_RID_CNFOWNNAME_LEN      ((uint16_t)34)
00443 #define         HFA384x_RID_CNFOWNDTIMPER_LEN   ((uint16_t)0)
00444 #define         HFA384x_RID_CNFWDSADDR1_LEN     ((uint16_t)6)
00445 #define         HFA384x_RID_CNFWDSADDR2_LEN     ((uint16_t)6)
00446 #define         HFA384x_RID_CNFWDSADDR3_LEN     ((uint16_t)6)
00447 #define         HFA384x_RID_CNFWDSADDR4_LEN     ((uint16_t)6)
00448 #define         HFA384x_RID_CNFWDSADDR5_LEN     ((uint16_t)6)
00449 #define         HFA384x_RID_CNFWDSADDR6_LEN     ((uint16_t)6)
00450 #define         HFA384x_RID_CNFMCASTPMBUFF_LEN  ((uint16_t)0)
00451 #define         HFA384x_RID_CNFAUTHENTICATION_LEN ((uint16_t)sizeof(uint16_t))
00452 #define         HFA384x_RID_CNFMAXSLEEPDUR_LEN  ((uint16_t)0)
00453 
00454 /*--------------------------------------------------------------------
00455 Configuration RIDs: Network Parameters, Dynamic Configuration Entities
00456 --------------------------------------------------------------------*/
00457 #define         HFA384x_RID_GROUPADDR           ((uint16_t)0xFC80)
00458 #define         HFA384x_RID_CREATEIBSS          ((uint16_t)0xFC81)
00459 #define         HFA384x_RID_FRAGTHRESH          ((uint16_t)0xFC82)
00460 #define         HFA384x_RID_RTSTHRESH           ((uint16_t)0xFC83)
00461 #define         HFA384x_RID_TXRATECNTL          ((uint16_t)0xFC84)
00462 #define         HFA384x_RID_PROMISCMODE         ((uint16_t)0xFC85)
00463 #define         HFA384x_RID_FRAGTHRESH0         ((uint16_t)0xFC90)
00464 #define         HFA384x_RID_FRAGTHRESH1         ((uint16_t)0xFC91)
00465 #define         HFA384x_RID_FRAGTHRESH2         ((uint16_t)0xFC92)
00466 #define         HFA384x_RID_FRAGTHRESH3         ((uint16_t)0xFC93)
00467 #define         HFA384x_RID_FRAGTHRESH4         ((uint16_t)0xFC94)
00468 #define         HFA384x_RID_FRAGTHRESH5         ((uint16_t)0xFC95)
00469 #define         HFA384x_RID_FRAGTHRESH6         ((uint16_t)0xFC96)
00470 #define         HFA384x_RID_RTSTHRESH0          ((uint16_t)0xFC97)
00471 #define         HFA384x_RID_RTSTHRESH1          ((uint16_t)0xFC98)
00472 #define         HFA384x_RID_RTSTHRESH2          ((uint16_t)0xFC99)
00473 #define         HFA384x_RID_RTSTHRESH3          ((uint16_t)0xFC9A)
00474 #define         HFA384x_RID_RTSTHRESH4          ((uint16_t)0xFC9B)
00475 #define         HFA384x_RID_RTSTHRESH5          ((uint16_t)0xFC9C)
00476 #define         HFA384x_RID_RTSTHRESH6          ((uint16_t)0xFC9D)
00477 #define         HFA384x_RID_TXRATECNTL0         ((uint16_t)0xFC9E)
00478 #define         HFA384x_RID_TXRATECNTL1         ((uint16_t)0xFC9F)
00479 #define         HFA384x_RID_TXRATECNTL2         ((uint16_t)0xFCA0)
00480 #define         HFA384x_RID_TXRATECNTL3         ((uint16_t)0xFCA1)
00481 #define         HFA384x_RID_TXRATECNTL4         ((uint16_t)0xFCA2)
00482 #define         HFA384x_RID_TXRATECNTL5         ((uint16_t)0xFCA3)
00483 #define         HFA384x_RID_TXRATECNTL6         ((uint16_t)0xFCA4)
00484 
00485 /*--------------------------------------------------------------------
00486 Configuration RID Lengths: Network Param, Dynamic Config Entities
00487   This is the length of JUST the DATA part of the RID (does not
00488   include the len or code fields)
00489 --------------------------------------------------------------------*/
00490 /* TODO: fill in the rest of these */
00491 #define         HFA384x_RID_GROUPADDR_LEN       ((uint16_t)16 * WLAN_ADDR_LEN)
00492 #define         HFA384x_RID_CREATEIBSS_LEN      ((uint16_t)0)
00493 #define         HFA384x_RID_FRAGTHRESH_LEN      ((uint16_t)0)
00494 #define         HFA384x_RID_RTSTHRESH_LEN       ((uint16_t)0)
00495 #define         HFA384x_RID_TXRATECNTL_LEN      ((uint16_t)4)
00496 #define         HFA384x_RID_PROMISCMODE_LEN     ((uint16_t)2)
00497 #define         HFA384x_RID_FRAGTHRESH0_LEN     ((uint16_t)0)
00498 #define         HFA384x_RID_FRAGTHRESH1_LEN     ((uint16_t)0)
00499 #define         HFA384x_RID_FRAGTHRESH2_LEN     ((uint16_t)0)
00500 #define         HFA384x_RID_FRAGTHRESH3_LEN     ((uint16_t)0)
00501 #define         HFA384x_RID_FRAGTHRESH4_LEN     ((uint16_t)0)
00502 #define         HFA384x_RID_FRAGTHRESH5_LEN     ((uint16_t)0)
00503 #define         HFA384x_RID_FRAGTHRESH6_LEN     ((uint16_t)0)
00504 #define         HFA384x_RID_RTSTHRESH0_LEN      ((uint16_t)0)
00505 #define         HFA384x_RID_RTSTHRESH1_LEN      ((uint16_t)0)
00506 #define         HFA384x_RID_RTSTHRESH2_LEN      ((uint16_t)0)
00507 #define         HFA384x_RID_RTSTHRESH3_LEN      ((uint16_t)0)
00508 #define         HFA384x_RID_RTSTHRESH4_LEN      ((uint16_t)0)
00509 #define         HFA384x_RID_RTSTHRESH5_LEN      ((uint16_t)0)
00510 #define         HFA384x_RID_RTSTHRESH6_LEN      ((uint16_t)0)
00511 #define         HFA384x_RID_TXRATECNTL0_LEN     ((uint16_t)0)
00512 #define         HFA384x_RID_TXRATECNTL1_LEN     ((uint16_t)0)
00513 #define         HFA384x_RID_TXRATECNTL2_LEN     ((uint16_t)0)
00514 #define         HFA384x_RID_TXRATECNTL3_LEN     ((uint16_t)0)
00515 #define         HFA384x_RID_TXRATECNTL4_LEN     ((uint16_t)0)
00516 #define         HFA384x_RID_TXRATECNTL5_LEN     ((uint16_t)0)
00517 #define         HFA384x_RID_TXRATECNTL6_LEN     ((uint16_t)0)
00518 
00519 /*--------------------------------------------------------------------
00520 Configuration RIDs: Behavior Parameters
00521 --------------------------------------------------------------------*/
00522 #define         HFA384x_RID_ITICKTIME           ((uint16_t)0xFCE0)
00523 
00524 /*--------------------------------------------------------------------
00525 Configuration RID Lengths: Behavior Parameters
00526   This is the length of JUST the DATA part of the RID (does not
00527   include the len or code fields)
00528 --------------------------------------------------------------------*/
00529 #define         HFA384x_RID_ITICKTIME_LEN       ((uint16_t)2)
00530 
00531 /*----------------------------------------------------------------------
00532 Information RIDs: NIC Information
00533 --------------------------------------------------------------------*/
00534 #define         HFA384x_RID_MAXLOADTIME         ((uint16_t)0xFD00)
00535 #define         HFA384x_RID_DOWNLOADBUFFER      ((uint16_t)0xFD01)
00536 #define         HFA384x_RID_PRIIDENTITY         ((uint16_t)0xFD02)
00537 #define         HFA384x_RID_PRISUPRANGE         ((uint16_t)0xFD03)
00538 #define         HFA384x_RID_PRI_CFIACTRANGES    ((uint16_t)0xFD04)
00539 #define         HFA384x_RID_NICSERIALNUMBER     ((uint16_t)0xFD0A)
00540 #define         HFA384x_RID_NICIDENTITY         ((uint16_t)0xFD0B)
00541 #define         HFA384x_RID_MFISUPRANGE         ((uint16_t)0xFD0C)
00542 #define         HFA384x_RID_CFISUPRANGE         ((uint16_t)0xFD0D)
00543 #define         HFA384x_RID_CHANNELLIST         ((uint16_t)0xFD10)
00544 #define         HFA384x_RID_REGULATORYDOMAINS   ((uint16_t)0xFD11)
00545 #define         HFA384x_RID_TEMPTYPE            ((uint16_t)0xFD12)
00546 #define         HFA384x_RID_CIS                 ((uint16_t)0xFD13)
00547 #define         HFA384x_RID_STAIDENTITY         ((uint16_t)0xFD20)
00548 #define         HFA384x_RID_STASUPRANGE         ((uint16_t)0xFD21)
00549 #define         HFA384x_RID_STA_MFIACTRANGES    ((uint16_t)0xFD22)
00550 #define         HFA384x_RID_STA_CFIACTRANGES    ((uint16_t)0xFD23)
00551 #define         HFA384x_RID_BUILDSEQ            ((uint16_t)0xFFFE)
00552 #define         HFA384x_RID_FWID                ((uint16_t)0xFFFF)
00553 
00554 /*----------------------------------------------------------------------
00555 Information RID Lengths: NIC Information
00556   This is the length of JUST the DATA part of the RID (does not
00557   include the len or code fields)
00558 --------------------------------------------------------------------*/
00559 #define         HFA384x_RID_MAXLOADTIME_LEN             ((uint16_t)0)
00560 #define         HFA384x_RID_DOWNLOADBUFFER_LEN          ((uint16_t)sizeof(hfa384x_downloadbuffer_t))
00561 #define         HFA384x_RID_PRIIDENTITY_LEN             ((uint16_t)8)
00562 #define         HFA384x_RID_PRISUPRANGE_LEN             ((uint16_t)10)
00563 #define         HFA384x_RID_CFIACTRANGES_LEN            ((uint16_t)10)
00564 #define         HFA384x_RID_NICSERIALNUMBER_LEN         ((uint16_t)12)
00565 #define         HFA384x_RID_NICIDENTITY_LEN             ((uint16_t)8)
00566 #define         HFA384x_RID_MFISUPRANGE_LEN             ((uint16_t)10)
00567 #define         HFA384x_RID_CFISUPRANGE_LEN             ((uint16_t)10)
00568 #define         HFA384x_RID_CHANNELLIST_LEN             ((uint16_t)0)
00569 #define         HFA384x_RID_REGULATORYDOMAINS_LEN       ((uint16_t)12)
00570 #define         HFA384x_RID_TEMPTYPE_LEN                ((uint16_t)0)
00571 #define         HFA384x_RID_CIS_LEN                     ((uint16_t)480)
00572 #define         HFA384x_RID_STAIDENTITY_LEN             ((uint16_t)8)
00573 #define         HFA384x_RID_STASUPRANGE_LEN             ((uint16_t)10)
00574 #define         HFA384x_RID_MFIACTRANGES_LEN            ((uint16_t)10)
00575 #define         HFA384x_RID_CFIACTRANGES2_LEN           ((uint16_t)10)
00576 #define         HFA384x_RID_BUILDSEQ_LEN                ((uint16_t)sizeof(hfa384x_BuildSeq_t))
00577 #define         HFA384x_RID_FWID_LEN                    ((uint16_t)sizeof(hfa384x_FWID_t))
00578 
00579 /*--------------------------------------------------------------------
00580 Information RIDs:  MAC Information
00581 --------------------------------------------------------------------*/
00582 #define         HFA384x_RID_PORTSTATUS          ((uint16_t)0xFD40)
00583 #define         HFA384x_RID_CURRENTSSID         ((uint16_t)0xFD41)
00584 #define         HFA384x_RID_CURRENTBSSID        ((uint16_t)0xFD42)
00585 #define         HFA384x_RID_COMMSQUALITY        ((uint16_t)0xFD43)
00586 #define         HFA384x_RID_CURRENTTXRATE       ((uint16_t)0xFD44)
00587 #define         HFA384x_RID_CURRENTBCNint       ((uint16_t)0xFD45)
00588 #define         HFA384x_RID_CURRENTSCALETHRESH  ((uint16_t)0xFD46)
00589 #define         HFA384x_RID_PROTOCOLRSPTIME     ((uint16_t)0xFD47)
00590 #define         HFA384x_RID_SHORTRETRYLIMIT     ((uint16_t)0xFD48)
00591 #define         HFA384x_RID_LONGRETRYLIMIT      ((uint16_t)0xFD49)
00592 #define         HFA384x_RID_MAXTXLIFETIME       ((uint16_t)0xFD4A)
00593 #define         HFA384x_RID_MAXRXLIFETIME       ((uint16_t)0xFD4B)
00594 #define         HFA384x_RID_CFPOLLABLE          ((uint16_t)0xFD4C)
00595 #define         HFA384x_RID_AUTHALGORITHMS      ((uint16_t)0xFD4D)
00596 #define         HFA384x_RID_PRIVACYOPTIMP       ((uint16_t)0xFD4F)
00597 #define         HFA384x_RID_DBMCOMMSQUALITY     ((uint16_t)0xFD51)
00598 #define         HFA384x_RID_CURRENTTXRATE1      ((uint16_t)0xFD80)
00599 #define         HFA384x_RID_CURRENTTXRATE2      ((uint16_t)0xFD81)
00600 #define         HFA384x_RID_CURRENTTXRATE3      ((uint16_t)0xFD82)
00601 #define         HFA384x_RID_CURRENTTXRATE4      ((uint16_t)0xFD83)
00602 #define         HFA384x_RID_CURRENTTXRATE5      ((uint16_t)0xFD84)
00603 #define         HFA384x_RID_CURRENTTXRATE6      ((uint16_t)0xFD85)
00604 #define         HFA384x_RID_OWNMACADDRESS       ((uint16_t)0xFD86)
00605 // #define      HFA384x_RID_PCFINFO             ((uint16_t)0xFD87)
00606 #define         HFA384x_RID_SCANRESULTS         ((uint16_t)0xFD88) // NEW
00607 #define         HFA384x_RID_HOSTSCANRESULTS     ((uint16_t)0xFD89) // NEW
00608 #define         HFA384x_RID_AUTHENTICATIONUSED  ((uint16_t)0xFD8A) // NEW
00609 #define         HFA384x_RID_ASSOCIATEFAILURE    ((uint16_t)0xFD8D) // 1.8.0
00610 
00611 /*--------------------------------------------------------------------
00612 Information RID Lengths:  MAC Information
00613   This is the length of JUST the DATA part of the RID (does not
00614   include the len or code fields)
00615 --------------------------------------------------------------------*/
00616 #define         HFA384x_RID_PORTSTATUS_LEN              ((uint16_t)0)
00617 #define         HFA384x_RID_CURRENTSSID_LEN             ((uint16_t)34)
00618 #define         HFA384x_RID_CURRENTBSSID_LEN            ((uint16_t)WLAN_BSSID_LEN)
00619 #define         HFA384x_RID_COMMSQUALITY_LEN            ((uint16_t)sizeof(hfa384x_commsquality_t))
00620 #define         HFA384x_RID_DBMCOMMSQUALITY_LEN         ((uint16_t)sizeof(hfa384x_dbmcommsquality_t))
00621 #define         HFA384x_RID_CURRENTTXRATE_LEN           ((uint16_t)0)
00622 #define         HFA384x_RID_CURRENTBCNINT_LEN           ((uint16_t)0)
00623 #define         HFA384x_RID_STACURSCALETHRESH_LEN       ((uint16_t)12)
00624 #define         HFA384x_RID_APCURSCALETHRESH_LEN        ((uint16_t)6)
00625 #define         HFA384x_RID_PROTOCOLRSPTIME_LEN         ((uint16_t)0)
00626 #define         HFA384x_RID_SHORTRETRYLIMIT_LEN         ((uint16_t)0)
00627 #define         HFA384x_RID_LONGRETRYLIMIT_LEN          ((uint16_t)0)
00628 #define         HFA384x_RID_MAXTXLIFETIME_LEN           ((uint16_t)0)
00629 #define         HFA384x_RID_MAXRXLIFETIME_LEN           ((uint16_t)0)
00630 #define         HFA384x_RID_CFPOLLABLE_LEN              ((uint16_t)0)
00631 #define         HFA384x_RID_AUTHALGORITHMS_LEN          ((uint16_t)4)
00632 #define         HFA384x_RID_PRIVACYOPTIMP_LEN           ((uint16_t)0)
00633 #define         HFA384x_RID_CURRENTTXRATE1_LEN          ((uint16_t)0)
00634 #define         HFA384x_RID_CURRENTTXRATE2_LEN          ((uint16_t)0)
00635 #define         HFA384x_RID_CURRENTTXRATE3_LEN          ((uint16_t)0)
00636 #define         HFA384x_RID_CURRENTTXRATE4_LEN          ((uint16_t)0)
00637 #define         HFA384x_RID_CURRENTTXRATE5_LEN          ((uint16_t)0)
00638 #define         HFA384x_RID_CURRENTTXRATE6_LEN          ((uint16_t)0)
00639 #define         HFA384x_RID_OWNMACADDRESS_LEN           ((uint16_t)6)
00640 #define         HFA384x_RID_PCFINFO_LEN                 ((uint16_t)6)
00641 #define         HFA384x_RID_CNFAPPCFINFO_LEN            ((uint16_t)sizeof(hfa384x_PCFInfo_data_t))
00642 #define         HFA384x_RID_SCANREQUEST_LEN             ((uint16_t)sizeof(hfa384x_ScanRequest_data_t))
00643 #define         HFA384x_RID_JOINREQUEST_LEN             ((uint16_t)sizeof(hfa384x_JoinRequest_data_t))
00644 #define         HFA384x_RID_AUTHENTICATESTA_LEN         ((uint16_t)sizeof(hfa384x_authenticateStation_data_t))
00645 #define         HFA384x_RID_CHANNELINFOREQUEST_LEN      ((uint16_t)sizeof(hfa384x_ChannelInfoRequest_data_t))
00646 /*--------------------------------------------------------------------
00647 Information RIDs:  Modem Information
00648 --------------------------------------------------------------------*/
00649 #define         HFA384x_RID_PHYTYPE             ((uint16_t)0xFDC0)
00650 #define         HFA384x_RID_CURRENTCHANNEL      ((uint16_t)0xFDC1)
00651 #define         HFA384x_RID_CURRENTPOWERSTATE   ((uint16_t)0xFDC2)
00652 #define         HFA384x_RID_CCAMODE             ((uint16_t)0xFDC3)
00653 #define         HFA384x_RID_SUPPORTEDDATARATES  ((uint16_t)0xFDC6)
00654 #define         HFA384x_RID_LFOSTATUS           ((uint16_t)0xFDC7) // 1.7.1
00655 
00656 /*--------------------------------------------------------------------
00657 Information RID Lengths:  Modem Information
00658   This is the length of JUST the DATA part of the RID (does not
00659   include the len or code fields)
00660 --------------------------------------------------------------------*/
00661 #define         HFA384x_RID_PHYTYPE_LEN                 ((uint16_t)0)
00662 #define         HFA384x_RID_CURRENTCHANNEL_LEN          ((uint16_t)0)
00663 #define         HFA384x_RID_CURRENTPOWERSTATE_LEN       ((uint16_t)0)
00664 #define         HFA384x_RID_CCAMODE_LEN                 ((uint16_t)0)
00665 #define         HFA384x_RID_SUPPORTEDDATARATES_LEN      ((uint16_t)10)
00666 
00667 /*--------------------------------------------------------------------
00668 API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
00669 --------------------------------------------------------------------*/
00670 #define         HFA384x_RID_CNFWEPDEFAULTKEYID  ((uint16_t)0xFC23)
00671 #define         HFA384x_RID_CNFWEPDEFAULTKEY0   ((uint16_t)0xFC24)
00672 #define         HFA384x_RID_CNFWEPDEFAULTKEY1   ((uint16_t)0xFC25)
00673 #define         HFA384x_RID_CNFWEPDEFAULTKEY2   ((uint16_t)0xFC26)
00674 #define         HFA384x_RID_CNFWEPDEFAULTKEY3   ((uint16_t)0xFC27)
00675 #define         HFA384x_RID_CNFWEPFLAGS         ((uint16_t)0xFC28)
00676 #define         HFA384x_RID_CNFWEPKEYMAPTABLE   ((uint16_t)0xFC29)
00677 #define         HFA384x_RID_CNFAUTHENTICATION   ((uint16_t)0xFC2A)
00678 #define         HFA384x_RID_CNFMAXASSOCSTATIONS ((uint16_t)0xFC2B)
00679 #define         HFA384x_RID_CNFTXCONTROL        ((uint16_t)0xFC2C)
00680 #define         HFA384x_RID_CNFROAMINGMODE      ((uint16_t)0xFC2D)
00681 #define         HFA384x_RID_CNFHOSTAUTHASSOC    ((uint16_t)0xFC2E)
00682 #define         HFA384x_RID_CNFRCVCRCERROR      ((uint16_t)0xFC30)
00683 // #define              HFA384x_RID_CNFMMLIFE           ((uint16_t)0xFC31)
00684 #define         HFA384x_RID_CNFALTRETRYCNT      ((uint16_t)0xFC32)
00685 #define         HFA384x_RID_CNFAPBCNint         ((uint16_t)0xFC33)
00686 #define         HFA384x_RID_CNFAPPCFINFO        ((uint16_t)0xFC34)
00687 #define         HFA384x_RID_CNFSTAPCFINFO       ((uint16_t)0xFC35)
00688 #define         HFA384x_RID_CNFPRIORITYQUSAGE   ((uint16_t)0xFC37)
00689 #define         HFA384x_RID_CNFTIMCTRL          ((uint16_t)0xFC40)
00690 #define         HFA384x_RID_CNFTHIRTY2TALLY     ((uint16_t)0xFC42)
00691 #define         HFA384x_RID_CNFENHSECURITY      ((uint16_t)0xFC43)
00692 #define         HFA384x_RID_CNFDBMADJUST        ((uint16_t)0xFC46) // NEW
00693 #define         HFA384x_RID_CNFWPADATA          ((uint16_t)0xFC48) // 1.7.0
00694 #define         HFA384x_RID_CNFPROPOGATIONDELAY ((uint16_t)0xFC49) // 1.7.6
00695 #define         HFA384x_RID_CNFSHORTPREAMBLE    ((uint16_t)0xFCB0)
00696 #define         HFA384x_RID_CNFEXCLONGPREAMBLE  ((uint16_t)0xFCB1)
00697 #define         HFA384x_RID_CNFAUTHRSPTIMEOUT   ((uint16_t)0xFCB2)
00698 #define         HFA384x_RID_CNFBASICRATES       ((uint16_t)0xFCB3)
00699 #define         HFA384x_RID_CNFSUPPRATES        ((uint16_t)0xFCB4)
00700 #define         HFA384x_RID_CNFFALLBACKCTRL     ((uint16_t)0xFCB5) // NEW
00701 #define         HFA384x_RID_WEPKEYSTATUS        ((uint16_t)0xFCB6) // NEW
00702 #define         HFA384x_RID_WEPKEYMAPINDEX      ((uint16_t)0xFCB7) // NEW
00703 #define         HFA384x_RID_BROADCASTKEYID      ((uint16_t)0xFCB8) // NEW
00704 #define         HFA384x_RID_ENTSECFLAGEYID      ((uint16_t)0xFCB9) // NEW
00705 #define         HFA384x_RID_CNFPASSIVESCANCTRL  ((uint16_t)0xFCBA) // NEW STA
00706 #define         HFA384x_RID_CNFWPAHANDLING      ((uint16_t)0xFCBB) // 1.7.0
00707 #define         HFA384x_RID_MDCCONTROL          ((uint16_t)0xFCBC) // 1.7.0/1.4.0
00708 #define         HFA384x_RID_MDCCOUNTRY          ((uint16_t)0xFCBD) // 1.7.0/1.4.0
00709 #define         HFA384x_RID_TXPOWERMAX          ((uint16_t)0xFCBE) // 1.7.0/1.4.0
00710 #define         HFA384x_RID_CNFLFOENBLED        ((uint16_t)0xFCBF) // 1.6.3
00711 #define         HFA384x_RID_CAPINFO             ((uint16_t)0xFCC0) // 1.7.0/1.3.7
00712 #define         HFA384x_RID_LISTENINTERVAL      ((uint16_t)0xFCC1) // 1.7.0/1.3.7
00713 #define         HFA384x_RID_DIVERSITYENABLED    ((uint16_t)0xFCC2) // 1.7.0/1.3.7
00714 #define         HFA384x_RID_LED_CONTROL         ((uint16_t)0xFCC4) // 1.7.6
00715 #define         HFA384x_RID_HFO_DELAY           ((uint16_t)0xFCC5) // 1.7.6
00716 #define         HFA384x_RID_DISSALOWEDBSSID     ((uint16_t)0xFCC6) // 1.8.0
00717 #define         HFA384x_RID_SCANREQUEST         ((uint16_t)0xFCE1)
00718 #define         HFA384x_RID_JOINREQUEST         ((uint16_t)0xFCE2)
00719 #define         HFA384x_RID_AUTHENTICATESTA     ((uint16_t)0xFCE3)
00720 #define         HFA384x_RID_CHANNELINFOREQUEST  ((uint16_t)0xFCE4)
00721 #define         HFA384x_RID_HOSTSCAN            ((uint16_t)0xFCE5) // NEW STA
00722 #define         HFA384x_RID_ASSOCIATESTA        ((uint16_t)0xFCE6)
00723 
00724 #define         HFA384x_RID_CNFWEPDEFAULTKEY_LEN        ((uint16_t)6)
00725 #define         HFA384x_RID_CNFWEP128DEFAULTKEY_LEN     ((uint16_t)14)
00726 #define         HFA384x_RID_CNFPRIOQUSAGE_LEN           ((uint16_t)4)
00727 /*--------------------------------------------------------------------
00728 PD Record codes
00729 --------------------------------------------------------------------*/
00730 #define HFA384x_PDR_PCB_PARTNUM         ((uint16_t)0x0001)
00731 #define HFA384x_PDR_PDAVER              ((uint16_t)0x0002)
00732 #define HFA384x_PDR_NIC_SERIAL          ((uint16_t)0x0003)
00733 #define HFA384x_PDR_MKK_MEASUREMENTS    ((uint16_t)0x0004)
00734 #define HFA384x_PDR_NIC_RAMSIZE         ((uint16_t)0x0005)
00735 #define HFA384x_PDR_MFISUPRANGE         ((uint16_t)0x0006)
00736 #define HFA384x_PDR_CFISUPRANGE         ((uint16_t)0x0007)
00737 #define HFA384x_PDR_NICID               ((uint16_t)0x0008)
00738 //#define HFA384x_PDR_REFDAC_MEASUREMENTS       ((uint16_t)0x0010)
00739 //#define HFA384x_PDR_VGDAC_MEASUREMENTS        ((uint16_t)0x0020)
00740 //#define HFA384x_PDR_LEVEL_COMP_MEASUREMENTS   ((uint16_t)0x0030)
00741 //#define HFA384x_PDR_MODEM_TRIMDAC_MEASUREMENTS        ((uint16_t)0x0040)
00742 //#define HFA384x_PDR_COREGA_HACK               ((uint16_t)0x00ff)
00743 #define HFA384x_PDR_MAC_ADDRESS         ((uint16_t)0x0101)
00744 //#define HFA384x_PDR_MKK_CALLNAME      ((uint16_t)0x0102)
00745 #define HFA384x_PDR_REGDOMAIN           ((uint16_t)0x0103)
00746 #define HFA384x_PDR_ALLOWED_CHANNEL     ((uint16_t)0x0104)
00747 #define HFA384x_PDR_DEFAULT_CHANNEL     ((uint16_t)0x0105)
00748 //#define HFA384x_PDR_PRIVACY_OPTION    ((uint16_t)0x0106)
00749 #define HFA384x_PDR_TEMPTYPE            ((uint16_t)0x0107)
00750 //#define HFA384x_PDR_REFDAC_SETUP      ((uint16_t)0x0110)
00751 //#define HFA384x_PDR_VGDAC_SETUP               ((uint16_t)0x0120)
00752 //#define HFA384x_PDR_LEVEL_COMP_SETUP  ((uint16_t)0x0130)
00753 //#define HFA384x_PDR_TRIMDAC_SETUP     ((uint16_t)0x0140)
00754 #define HFA384x_PDR_IFR_SETTING         ((uint16_t)0x0200)
00755 #define HFA384x_PDR_RFR_SETTING         ((uint16_t)0x0201)
00756 #define HFA384x_PDR_HFA3861_BASELINE    ((uint16_t)0x0202)
00757 #define HFA384x_PDR_HFA3861_SHADOW      ((uint16_t)0x0203)
00758 #define HFA384x_PDR_HFA3861_IFRF        ((uint16_t)0x0204)
00759 #define HFA384x_PDR_HFA3861_CHCALSP     ((uint16_t)0x0300)
00760 #define HFA384x_PDR_HFA3861_CHCALI      ((uint16_t)0x0301)
00761 #define HFA384x_PDR_MAX_TX_POWER        ((uint16_t)0x0302)
00762 #define HFA384x_PDR_MASTER_CHAN_LIST    ((uint16_t)0x0303)
00763 #define HFA384x_PDR_3842_NIC_CONFIG     ((uint16_t)0x0400)
00764 #define HFA384x_PDR_USB_ID              ((uint16_t)0x0401)
00765 #define HFA384x_PDR_PCI_ID              ((uint16_t)0x0402)
00766 #define HFA384x_PDR_PCI_IFCONF          ((uint16_t)0x0403)
00767 #define HFA384x_PDR_PCI_PMCONF          ((uint16_t)0x0404)
00768 #define HFA384x_PDR_RFENRGY             ((uint16_t)0x0406)
00769 #define HFA384x_PDR_USB_POWER_TYPE      ((uint16_t)0x0407)
00770 //#define HFA384x_PDR_UNKNOWN408                ((uint16_t)0x0408)
00771 #define HFA384x_PDR_USB_MAX_POWER       ((uint16_t)0x0409)
00772 #define HFA384x_PDR_USB_MANUFACTURER    ((uint16_t)0x0410)
00773 #define HFA384x_PDR_USB_PRODUCT         ((uint16_t)0x0411)
00774 #define HFA384x_PDR_ANT_DIVERSITY       ((uint16_t)0x0412)
00775 #define HFA384x_PDR_HFO_DELAY           ((uint16_t)0x0413)
00776 #define HFA384x_PDR_SCALE_THRESH        ((uint16_t)0x0414)
00777 
00778 #define HFA384x_PDR_HFA3861_MANF_TESTSP ((uint16_t)0x0900)
00779 #define HFA384x_PDR_HFA3861_MANF_TESTI  ((uint16_t)0x0901)
00780 #define HFA384x_PDR_END_OF_PDA          ((uint16_t)0x0000)
00781 
00782 
00783 /*=============================================================*/
00784 /*------ Macros -----------------------------------------------*/
00785 
00786 /*--- Register ID macros ------------------------*/
00787 
00788 #define         HFA384x_CMD             HFA384x_CMD_OFF
00789 #define         HFA384x_PARAM0          HFA384x_PARAM0_OFF
00790 #define         HFA384x_PARAM1          HFA384x_PARAM1_OFF
00791 #define         HFA384x_PARAM2          HFA384x_PARAM2_OFF
00792 #define         HFA384x_STATUS          HFA384x_STATUS_OFF
00793 #define         HFA384x_RESP0           HFA384x_RESP0_OFF
00794 #define         HFA384x_RESP1           HFA384x_RESP1_OFF
00795 #define         HFA384x_RESP2           HFA384x_RESP2_OFF
00796 #define         HFA384x_INFOFID         HFA384x_INFOFID_OFF
00797 #define         HFA384x_RXFID           HFA384x_RXFID_OFF
00798 #define         HFA384x_ALLOCFID        HFA384x_ALLOCFID_OFF
00799 #define         HFA384x_TXCOMPLFID      HFA384x_TXCOMPLFID_OFF
00800 #define         HFA384x_SELECT0         HFA384x_SELECT0_OFF
00801 #define         HFA384x_OFFSET0         HFA384x_OFFSET0_OFF
00802 #define         HFA384x_DATA0           HFA384x_DATA0_OFF
00803 #define         HFA384x_SELECT1         HFA384x_SELECT1_OFF
00804 #define         HFA384x_OFFSET1         HFA384x_OFFSET1_OFF
00805 #define         HFA384x_DATA1           HFA384x_DATA1_OFF
00806 #define         HFA384x_EVSTAT          HFA384x_EVSTAT_OFF
00807 #define         HFA384x_INTEN           HFA384x_INTEN_OFF
00808 #define         HFA384x_EVACK           HFA384x_EVACK_OFF
00809 #define         HFA384x_CONTROL         HFA384x_CONTROL_OFF
00810 #define         HFA384x_SWSUPPORT0      HFA384x_SWSUPPORT0_OFF
00811 #define         HFA384x_SWSUPPORT1      HFA384x_SWSUPPORT1_OFF
00812 #define         HFA384x_SWSUPPORT2      HFA384x_SWSUPPORT2_OFF
00813 #define         HFA384x_AUXPAGE         HFA384x_AUXPAGE_OFF
00814 #define         HFA384x_AUXOFFSET       HFA384x_AUXOFFSET_OFF
00815 #define         HFA384x_AUXDATA         HFA384x_AUXDATA_OFF
00816 #define         HFA384x_PCICOR          HFA384x_PCICOR_OFF
00817 #define         HFA384x_PCIHCR          HFA384x_PCIHCR_OFF
00818 
00819 
00820 /*--- Register Test/Get/Set Field macros ------------------------*/
00821 
00822 #define         HFA384x_CMD_ISBUSY(value)               ((uint16_t)(((uint16_t)value) & HFA384x_CMD_BUSY))
00823 #define         HFA384x_CMD_AINFO_GET(value)            ((uint16_t)(((uint16_t)(value) & HFA384x_CMD_AINFO) >> 8))
00824 #define         HFA384x_CMD_AINFO_SET(value)            ((uint16_t)((uint16_t)(value) << 8))
00825 #define         HFA384x_CMD_MACPORT_GET(value)          ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_MACPORT)))
00826 #define         HFA384x_CMD_MACPORT_SET(value)          ((uint16_t)HFA384x_CMD_AINFO_SET(value))
00827 #define         HFA384x_CMD_ISRECL(value)               ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_RECL)))
00828 #define         HFA384x_CMD_RECL_SET(value)             ((uint16_t)HFA384x_CMD_AINFO_SET(value))
00829 #define         HFA384x_CMD_QOS_GET(value)              ((uint16_t((((uint16_t)(value))&((uint16_t)0x3000)) >> 12))
00830 #define         HFA384x_CMD_QOS_SET(value)              ((uint16_t)((((uint16_t)(value)) << 12) & 0x3000))
00831 #define         HFA384x_CMD_ISWRITE(value)              ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_WRITE)))
00832 #define         HFA384x_CMD_WRITE_SET(value)            ((uint16_t)HFA384x_CMD_AINFO_SET((uint16_t)value))
00833 #define         HFA384x_CMD_PROGMODE_GET(value)         ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_PROGMODE)))
00834 #define         HFA384x_CMD_PROGMODE_SET(value)         ((uint16_t)HFA384x_CMD_AINFO_SET((uint16_t)value))
00835 #define         HFA384x_CMD_CMDCODE_GET(value)          ((uint16_t)(((uint16_t)(value)) & HFA384x_CMD_CMDCODE))
00836 #define         HFA384x_CMD_CMDCODE_SET(value)          ((uint16_t)(value))
00837 
00838 #define         HFA384x_STATUS_RESULT_GET(value)        ((uint16_t)((((uint16_t)(value)) & HFA384x_STATUS_RESULT) >> 8))
00839 #define         HFA384x_STATUS_RESULT_SET(value)        (((uint16_t)(value)) << 8)
00840 #define         HFA384x_STATUS_CMDCODE_GET(value)       (((uint16_t)(value)) & HFA384x_STATUS_CMDCODE)
00841 #define         HFA384x_STATUS_CMDCODE_SET(value)       ((uint16_t)(value))
00842 
00843 #define         HFA384x_OFFSET_ISBUSY(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_OFFSET_BUSY))
00844 #define         HFA384x_OFFSET_ISERR(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_OFFSET_ERR))
00845 #define         HFA384x_OFFSET_DATAOFF_GET(value)       ((uint16_t)(((uint16_t)(value)) & HFA384x_OFFSET_DATAOFF))
00846 #define         HFA384x_OFFSET_DATAOFF_SET(value)       ((uint16_t)(value))
00847 
00848 #define         HFA384x_EVSTAT_ISTICK(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_TICK))
00849 #define         HFA384x_EVSTAT_ISWTERR(value)           ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_WTERR))
00850 #define         HFA384x_EVSTAT_ISINFDROP(value)         ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_INFDROP))
00851 #define         HFA384x_EVSTAT_ISINFO(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_INFO))
00852 #define         HFA384x_EVSTAT_ISDTIM(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_DTIM))
00853 #define         HFA384x_EVSTAT_ISCMD(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_CMD))
00854 #define         HFA384x_EVSTAT_ISALLOC(value)           ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_ALLOC))
00855 #define         HFA384x_EVSTAT_ISTXEXC(value)           ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_TXEXC))
00856 #define         HFA384x_EVSTAT_ISTX(value)              ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_TX))
00857 #define         HFA384x_EVSTAT_ISRX(value)              ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_RX))
00858 
00859 #define         HFA384x_EVSTAT_ISBAP_OP(value)          ((uint16_t)(((uint16_t)(value)) & HFA384x_INT_BAP_OP))
00860 
00861 #define         HFA384x_INTEN_ISTICK(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_TICK))
00862 #define         HFA384x_INTEN_TICK_SET(value)           ((uint16_t)(((uint16_t)(value)) << 15))
00863 #define         HFA384x_INTEN_ISWTERR(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_WTERR))
00864 #define         HFA384x_INTEN_WTERR_SET(value)          ((uint16_t)(((uint16_t)(value)) << 14))
00865 #define         HFA384x_INTEN_ISINFDROP(value)          ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_INFDROP))
00866 #define         HFA384x_INTEN_INFDROP_SET(value)        ((uint16_t)(((uint16_t)(value)) << 13))
00867 #define         HFA384x_INTEN_ISINFO(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_INFO))
00868 #define         HFA384x_INTEN_INFO_SET(value)           ((uint16_t)(((uint16_t)(value)) << 7))
00869 #define         HFA384x_INTEN_ISDTIM(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_DTIM))
00870 #define         HFA384x_INTEN_DTIM_SET(value)           ((uint16_t)(((uint16_t)(value)) << 5))
00871 #define         HFA384x_INTEN_ISCMD(value)              ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_CMD))
00872 #define         HFA384x_INTEN_CMD_SET(value)            ((uint16_t)(((uint16_t)(value)) << 4))
00873 #define         HFA384x_INTEN_ISALLOC(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_ALLOC))
00874 #define         HFA384x_INTEN_ALLOC_SET(value)          ((uint16_t)(((uint16_t)(value)) << 3))
00875 #define         HFA384x_INTEN_ISTXEXC(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_TXEXC))
00876 #define         HFA384x_INTEN_TXEXC_SET(value)          ((uint16_t)(((uint16_t)(value)) << 2))
00877 #define         HFA384x_INTEN_ISTX(value)               ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_TX))
00878 #define         HFA384x_INTEN_TX_SET(value)             ((uint16_t)(((uint16_t)(value)) << 1))
00879 #define         HFA384x_INTEN_ISRX(value)               ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_RX))
00880 #define         HFA384x_INTEN_RX_SET(value)             ((uint16_t)(((uint16_t)(value)) << 0))
00881 
00882 #define         HFA384x_EVACK_ISTICK(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_TICK))
00883 #define         HFA384x_EVACK_TICK_SET(value)           ((uint16_t)(((uint16_t)(value)) << 15))
00884 #define         HFA384x_EVACK_ISWTERR(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_WTERR))
00885 #define         HFA384x_EVACK_WTERR_SET(value)          ((uint16_t)(((uint16_t)(value)) << 14))
00886 #define         HFA384x_EVACK_ISINFDROP(value)          ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_INFDROP))
00887 #define         HFA384x_EVACK_INFDROP_SET(value)        ((uint16_t)(((uint16_t)(value)) << 13))
00888 #define         HFA384x_EVACK_ISINFO(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_INFO))
00889 #define         HFA384x_EVACK_INFO_SET(value)           ((uint16_t)(((uint16_t)(value)) << 7))
00890 #define         HFA384x_EVACK_ISDTIM(value)             ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_DTIM))
00891 #define         HFA384x_EVACK_DTIM_SET(value)           ((uint16_t)(((uint16_t)(value)) << 5))
00892 #define         HFA384x_EVACK_ISCMD(value)              ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_CMD))
00893 #define         HFA384x_EVACK_CMD_SET(value)            ((uint16_t)(((uint16_t)(value)) << 4))
00894 #define         HFA384x_EVACK_ISALLOC(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_ALLOC))
00895 #define         HFA384x_EVACK_ALLOC_SET(value)          ((uint16_t)(((uint16_t)(value)) << 3))
00896 #define         HFA384x_EVACK_ISTXEXC(value)            ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_TXEXC))
00897 #define         HFA384x_EVACK_TXEXC_SET(value)          ((uint16_t)(((uint16_t)(value)) << 2))
00898 #define         HFA384x_EVACK_ISTX(value)               ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_TX))
00899 #define         HFA384x_EVACK_TX_SET(value)             ((uint16_t)(((uint16_t)(value)) << 1))
00900 #define         HFA384x_EVACK_ISRX(value)               ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_RX))
00901 #define         HFA384x_EVACK_RX_SET(value)             ((uint16_t)(((uint16_t)(value)) << 0))
00902 
00903 #define         HFA384x_CONTROL_AUXEN_SET(value)        ((uint16_t)(((uint16_t)(value)) << 14))
00904 #define         HFA384x_CONTROL_AUXEN_GET(value)        ((uint16_t)(((uint16_t)(value)) >> 14))
00905 
00906 /* Byte Order */
00907 #ifdef __KERNEL__
00908 #define hfa384x2host_16(n)      (__le16_to_cpu((uint16_t)(n)))
00909 #define hfa384x2host_32(n)      (__le32_to_cpu((uint32_t)(n)))
00910 #define host2hfa384x_16(n)      (__cpu_to_le16((uint16_t)(n)))
00911 #define host2hfa384x_32(n)      (__cpu_to_le32((uint32_t)(n)))
00912 #endif
00913 
00914 /* Host Maintained State Info */
00915 #define HFA384x_STATE_PREINIT   0
00916 #define HFA384x_STATE_INIT      1
00917 #define HFA384x_STATE_RUNNING   2
00918 
00919 /*=============================================================*/
00920 /*------ Types and their related constants --------------------*/
00921 
00922 #define HFA384x_HOSTAUTHASSOC_HOSTAUTH   BIT0
00923 #define HFA384x_HOSTAUTHASSOC_HOSTASSOC  BIT1
00924 
00925 #define HFA384x_WHAHANDLING_DISABLED     0
00926 #define HFA384x_WHAHANDLING_PASSTHROUGH  BIT1
00927 
00928 /*-------------------------------------------------------------*/
00929 /* Commonly used basic types */
00930 typedef struct hfa384x_bytestr
00931 {
00932         uint16_t        len;
00933         uint8_t data[0];
00934 } __WLAN_ATTRIB_PACK__ hfa384x_bytestr_t;
00935 
00936 typedef struct hfa384x_bytestr32
00937 {
00938         uint16_t        len;
00939         uint8_t data[32];
00940 } __WLAN_ATTRIB_PACK__ hfa384x_bytestr32_t;
00941 
00942 /*--------------------------------------------------------------------
00943 Configuration Record Structures:
00944         Network Parameters, Static Configuration Entities
00945 --------------------------------------------------------------------*/
00946 /* Prototype structure: all configuration record structures start with
00947 these members */
00948 
00949 typedef struct hfa384x_record
00950 {
00951         uint16_t        reclen;
00952         uint16_t        rid;
00953 } __WLAN_ATTRIB_PACK__ hfa384x_rec_t;
00954 
00955 typedef struct hfa384x_record16
00956 {
00957         uint16_t        reclen;
00958         uint16_t        rid;
00959         uint16_t        val;
00960 } __WLAN_ATTRIB_PACK__ hfa384x_rec16_t;
00961 
00962 typedef struct hfa384x_record32
00963 {
00964         uint16_t        reclen;
00965         uint16_t        rid;
00966         uint32_t        val;
00967 } __WLAN_ATTRIB_PACK__ hfa384x_rec32;
00968 
00969 /*-- Hardware/Firmware Component Information ----------*/
00970 typedef struct hfa384x_compident
00971 {
00972         uint16_t        id;
00973         uint16_t        variant;
00974         uint16_t        major;
00975         uint16_t        minor;
00976 } __WLAN_ATTRIB_PACK__ hfa384x_compident_t;
00977 
00978 typedef struct hfa384x_caplevel
00979 {
00980         uint16_t        role;
00981         uint16_t        id;
00982         uint16_t        variant;
00983         uint16_t        bottom;
00984         uint16_t        top;
00985 } __WLAN_ATTRIB_PACK__ hfa384x_caplevel_t;
00986 
00987 /*-- Configuration Record: cnfPortType --*/
00988 typedef struct hfa384x_cnfPortType
00989 {
00990         uint16_t        cnfPortType;
00991 } __WLAN_ATTRIB_PACK__ hfa384x_cnfPortType_t;
00992 
00993 /*-- Configuration Record: cnfOwnMACAddress --*/
00994 typedef struct hfa384x_cnfOwnMACAddress
00995 {
00996         uint8_t cnfOwnMACAddress[6];
00997 } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnMACAddress_t;
00998 
00999 /*-- Configuration Record: cnfDesiredSSID --*/
01000 typedef struct hfa384x_cnfDesiredSSID
01001 {
01002         uint8_t cnfDesiredSSID[34];
01003 } __WLAN_ATTRIB_PACK__ hfa384x_cnfDesiredSSID_t;
01004 
01005 /*-- Configuration Record: cnfOwnChannel --*/
01006 typedef struct hfa384x_cnfOwnChannel
01007 {
01008         uint16_t        cnfOwnChannel;
01009 } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnChannel_t;
01010 
01011 /*-- Configuration Record: cnfOwnSSID --*/
01012 typedef struct hfa384x_cnfOwnSSID
01013 {
01014         uint8_t cnfOwnSSID[34];
01015 } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnSSID_t;
01016 
01017 /*-- Configuration Record: cnfOwnATIMWindow --*/
01018 typedef struct hfa384x_cnfOwnATIMWindow
01019 {
01020         uint16_t        cnfOwnATIMWindow;
01021 } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnATIMWindow_t;
01022 
01023 /*-- Configuration Record: cnfSystemScale --*/
01024 typedef struct hfa384x_cnfSystemScale
01025 {
01026         uint16_t        cnfSystemScale;
01027 } __WLAN_ATTRIB_PACK__ hfa384x_cnfSystemScale_t;
01028 
01029 /*-- Configuration Record: cnfMaxDataLength --*/
01030 typedef struct hfa384x_cnfMaxDataLength
01031 {
01032         uint16_t        cnfMaxDataLength;
01033 } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxDataLength_t;
01034 
01035 /*-- Configuration Record: cnfWDSAddress --*/
01036 typedef struct hfa384x_cnfWDSAddress
01037 {
01038         uint8_t cnfWDSAddress[6];
01039 } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddress_t;
01040 
01041 /*-- Configuration Record: cnfPMEnabled --*/
01042 typedef struct hfa384x_cnfPMEnabled
01043 {
01044         uint16_t        cnfPMEnabled;
01045 } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEnabled_t;
01046 
01047 /*-- Configuration Record: cnfPMEPS --*/
01048 typedef struct hfa384x_cnfPMEPS
01049 {
01050         uint16_t        cnfPMEPS;
01051 } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEPS_t;
01052 
01053 /*-- Configuration Record: cnfMulticastReceive --*/
01054 typedef struct hfa384x_cnfMulticastReceive
01055 {
01056         uint16_t        cnfMulticastReceive;
01057 } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastReceive_t;
01058 
01059 /*-- Configuration Record: cnfAuthentication --*/
01060 #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM    0x0001
01061 #define HFA384x_CNFAUTHENTICATION_SHAREDKEY     0x0002
01062 #define HFA384x_CNFAUTHENTICATION_LEAP          0x0004
01063 
01064 /*-- Configuration Record: cnfMaxSleepDuration --*/
01065 typedef struct hfa384x_cnfMaxSleepDuration
01066 {
01067         uint16_t        cnfMaxSleepDuration;
01068 } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxSleepDuration_t;
01069 
01070 /*-- Configuration Record: cnfPMHoldoverDuration --*/
01071 typedef struct hfa384x_cnfPMHoldoverDuration
01072 {
01073         uint16_t        cnfPMHoldoverDuration;
01074 } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMHoldoverDuration_t;
01075 
01076 /*-- Configuration Record: cnfOwnName --*/
01077 typedef struct hfa384x_cnfOwnName
01078 {
01079         uint8_t cnfOwnName[34];
01080 } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnName_t;
01081 
01082 /*-- Configuration Record: cnfOwnDTIMPeriod --*/
01083 typedef struct hfa384x_cnfOwnDTIMPeriod
01084 {
01085         uint16_t        cnfOwnDTIMPeriod;
01086 } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnDTIMPeriod_t;
01087 
01088 /*-- Configuration Record: cnfWDSAddress --*/
01089 typedef struct hfa384x_cnfWDSAddressN
01090 {
01091         uint8_t cnfWDSAddress[6];
01092 } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddressN_t;
01093 
01094 /*-- Configuration Record: cnfMulticastPMBuffering --*/
01095 typedef struct hfa384x_cnfMulticastPMBuffering
01096 {
01097         uint16_t        cnfMulticastPMBuffering;
01098 } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastPMBuffering_t;
01099 
01100 /*--------------------------------------------------------------------
01101 Configuration Record Structures:
01102         Network Parameters, Dynamic Configuration Entities
01103 --------------------------------------------------------------------*/
01104 
01105 /*-- Configuration Record: GroupAddresses --*/
01106 typedef struct hfa384x_GroupAddresses
01107 {
01108         uint8_t MACAddress[16][6];
01109 } __WLAN_ATTRIB_PACK__ hfa384x_GroupAddresses_t;
01110 
01111 /*-- Configuration Record: CreateIBSS --*/
01112 typedef struct hfa384x_CreateIBSS
01113 {
01114         uint16_t        CreateIBSS;
01115 } __WLAN_ATTRIB_PACK__ hfa384x_CreateIBSS_t;
01116 
01117 #define HFA384x_CREATEIBSS_JOINCREATEIBSS          0
01118 #define HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS  1
01119 #define HFA384x_CREATEIBSS_JOINIBSS                2
01120 #define HFA384x_CREATEIBSS_JOINESS_JOINIBSS        3
01121 
01122 /*-- Configuration Record: FragmentationThreshold --*/
01123 typedef struct hfa384x_FragmentationThreshold
01124 {
01125         uint16_t        FragmentationThreshold;
01126 } __WLAN_ATTRIB_PACK__ hfa384x_FragmentationThreshold_t;
01127 
01128 /*-- Configuration Record: RTSThreshold --*/
01129 typedef struct hfa384x_RTSThreshold
01130 {
01131         uint16_t        RTSThreshold;
01132 } __WLAN_ATTRIB_PACK__ hfa384x_RTSThreshold_t;
01133 
01134 /*-- Configuration Record: TxRateControl --*/
01135 typedef struct hfa384x_TxRateControl
01136 {
01137         uint16_t        TxRateControl;
01138 } __WLAN_ATTRIB_PACK__ hfa384x_TxRateControl_t;
01139 
01140 /*-- Configuration Record: PromiscuousMode --*/
01141 typedef struct hfa384x_PromiscuousMode
01142 {
01143         uint16_t        PromiscuousMode;
01144 } __WLAN_ATTRIB_PACK__ hfa384x_PromiscuousMode_t;
01145 
01146 /*-- Configuration Record: ScanRequest (data portion only) --*/
01147 typedef struct hfa384x_ScanRequest_data
01148 {
01149         uint16_t        channelList;
01150         uint16_t        txRate;
01151 } __WLAN_ATTRIB_PACK__ hfa384x_ScanRequest_data_t;
01152 
01153 /*-- Configuration Record: HostScanRequest (data portion only) --*/
01154 typedef struct hfa384x_HostScanRequest_data
01155 {
01156         uint16_t        channelList;
01157         uint16_t        txRate;
01158         hfa384x_bytestr32_t ssid;
01159 } __WLAN_ATTRIB_PACK__ hfa384x_HostScanRequest_data_t;
01160 
01161 /*-- Configuration Record: JoinRequest (data portion only) --*/
01162 typedef struct hfa384x_JoinRequest_data
01163 {
01164         uint8_t bssid[WLAN_BSSID_LEN];
01165         uint16_t        channel;
01166 } __WLAN_ATTRIB_PACK__ hfa384x_JoinRequest_data_t;
01167 
01168 /*-- Configuration Record: authenticateStation (data portion only) --*/
01169 typedef struct hfa384x_authenticateStation_data
01170 {
01171         uint8_t address[WLAN_ADDR_LEN];
01172         uint16_t        status;
01173         uint16_t        algorithm;
01174 } __WLAN_ATTRIB_PACK__ hfa384x_authenticateStation_data_t;
01175 
01176 /*-- Configuration Record: associateStation (data portion only) --*/
01177 typedef struct hfa384x_associateStation_data
01178 {
01179         uint8_t address[WLAN_ADDR_LEN];
01180         uint16_t        status;
01181         uint16_t        type;
01182 } __WLAN_ATTRIB_PACK__ hfa384x_associateStation_data_t;
01183 
01184 /*-- Configuration Record: ChannelInfoRequest (data portion only) --*/
01185 typedef struct hfa384x_ChannelInfoRequest_data
01186 {
01187         uint16_t        channelList;
01188         uint16_t        channelDwellTime;
01189 } __WLAN_ATTRIB_PACK__ hfa384x_ChannelInfoRequest_data_t;
01190 
01191 /*-- Configuration Record: WEPKeyMapping (data portion only) --*/
01192 typedef struct hfa384x_WEPKeyMapping
01193 {
01194         uint8_t address[WLAN_ADDR_LEN];
01195         uint16_t        key_index;
01196         uint8_t         key[16];
01197         uint8_t         mic_transmit_key[4];
01198         uint8_t         mic_receive_key[4];
01199 } __WLAN_ATTRIB_PACK__ hfa384x_WEPKeyMapping_t;
01200 
01201 /*-- Configuration Record: WPAData       (data portion only) --*/
01202 typedef struct hfa384x_WPAData
01203 {
01204         uint16_t        datalen;
01205         uint8_t         data[0]; // max 80
01206 } __WLAN_ATTRIB_PACK__ hfa384x_WPAData_t;
01207 
01208 /*--------------------------------------------------------------------
01209 Configuration Record Structures: Behavior Parameters
01210 --------------------------------------------------------------------*/
01211 
01212 /*-- Configuration Record: TickTime --*/
01213 typedef struct hfa384x_TickTime
01214 {
01215         uint16_t        TickTime;
01216 } __WLAN_ATTRIB_PACK__ hfa384x_TickTime_t;
01217 
01218 /*--------------------------------------------------------------------
01219 Information Record Structures: NIC Information
01220 --------------------------------------------------------------------*/
01221 
01222 /*-- Information Record: MaxLoadTime --*/
01223 typedef struct hfa384x_MaxLoadTime
01224 {
01225         uint16_t        MaxLoadTime;
01226 } __WLAN_ATTRIB_PACK__ hfa384x_MaxLoadTime_t;
01227 
01228 /*-- Information Record: DownLoadBuffer --*/
01229 /* NOTE: The page and offset are in AUX format */
01230 typedef struct hfa384x_downloadbuffer
01231 {
01232         uint16_t        page;
01233         uint16_t        offset;
01234         uint16_t        len;
01235 } __WLAN_ATTRIB_PACK__ hfa384x_downloadbuffer_t;
01236 
01237 /*-- Information Record: PRIIdentity --*/
01238 typedef struct hfa384x_PRIIdentity
01239 {
01240         uint16_t        PRICompID;
01241         uint16_t        PRIVariant;
01242         uint16_t        PRIMajorVersion;
01243         uint16_t        PRIMinorVersion;
01244 } __WLAN_ATTRIB_PACK__ hfa384x_PRIIdentity_t;
01245 
01246 /*-- Information Record: PRISupRange --*/
01247 typedef struct hfa384x_PRISupRange
01248 {
01249         uint16_t        PRIRole;
01250         uint16_t        PRIID;
01251         uint16_t        PRIVariant;
01252         uint16_t        PRIBottom;
01253         uint16_t        PRITop;
01254 } __WLAN_ATTRIB_PACK__ hfa384x_PRISupRange_t;
01255 
01256 /*-- Information Record: CFIActRanges --*/
01257 typedef struct hfa384x_CFIActRanges
01258 {
01259         uint16_t        CFIRole;
01260         uint16_t        CFIID;
01261         uint16_t        CFIVariant;
01262         uint16_t        CFIBottom;
01263         uint16_t        CFITop;
01264 } __WLAN_ATTRIB_PACK__ hfa384x_CFIActRanges_t;
01265 
01266 /*-- Information Record: NICSerialNumber --*/
01267 typedef struct hfa384x_NICSerialNumber
01268 {
01269         uint8_t NICSerialNumber[12];
01270 } __WLAN_ATTRIB_PACK__ hfa384x_NICSerialNumber_t;
01271 
01272 /*-- Information Record: NICIdentity --*/
01273 typedef struct hfa384x_NICIdentity
01274 {
01275         uint16_t        NICCompID;
01276         uint16_t        NICVariant;
01277         uint16_t        NICMajorVersion;
01278         uint16_t        NICMinorVersion;
01279 } __WLAN_ATTRIB_PACK__ hfa384x_NICIdentity_t;
01280 
01281 /*-- Information Record: MFISupRange --*/
01282 typedef struct hfa384x_MFISupRange
01283 {
01284         uint16_t        MFIRole;
01285         uint16_t        MFIID;
01286         uint16_t        MFIVariant;
01287         uint16_t        MFIBottom;
01288         uint16_t        MFITop;
01289 } __WLAN_ATTRIB_PACK__ hfa384x_MFISupRange_t;
01290 
01291 /*-- Information Record: CFISupRange --*/
01292 typedef struct hfa384x_CFISupRange
01293 {
01294         uint16_t        CFIRole;
01295         uint16_t        CFIID;
01296         uint16_t        CFIVariant;
01297         uint16_t        CFIBottom;
01298         uint16_t        CFITop;
01299 } __WLAN_ATTRIB_PACK__ hfa384x_CFISupRange_t;
01300 
01301 /*-- Information Record: BUILDSEQ:BuildSeq --*/
01302 typedef struct hfa384x_BuildSeq {
01303         uint16_t        primary;
01304         uint16_t        secondary;
01305 } __WLAN_ATTRIB_PACK__ hfa384x_BuildSeq_t;
01306 
01307 /*-- Information Record: FWID --*/
01308 #define HFA384x_FWID_LEN        14
01309 typedef struct hfa384x_FWID {
01310         uint8_t primary[HFA384x_FWID_LEN];
01311         uint8_t secondary[HFA384x_FWID_LEN];
01312 } __WLAN_ATTRIB_PACK__ hfa384x_FWID_t;
01313 
01314 /*-- Information Record: ChannelList --*/
01315 typedef struct hfa384x_ChannelList
01316 {
01317         uint16_t        ChannelList;
01318 } __WLAN_ATTRIB_PACK__ hfa384x_ChannelList_t;
01319 
01320 /*-- Information Record: RegulatoryDomains --*/
01321 typedef struct hfa384x_RegulatoryDomains
01322 {
01323         uint8_t RegulatoryDomains[12];
01324 } __WLAN_ATTRIB_PACK__ hfa384x_RegulatoryDomains_t;
01325 
01326 /*-- Information Record: TempType --*/
01327 typedef struct hfa384x_TempType
01328 {
01329         uint16_t        TempType;
01330 } __WLAN_ATTRIB_PACK__ hfa384x_TempType_t;
01331 
01332 /*-- Information Record: CIS --*/
01333 typedef struct hfa384x_CIS
01334 {
01335         uint8_t CIS[480];
01336 } __WLAN_ATTRIB_PACK__ hfa384x_CIS_t;
01337 
01338 /*-- Information Record: STAIdentity --*/
01339 typedef struct hfa384x_STAIdentity
01340 {
01341         uint16_t        STACompID;
01342         uint16_t        STAVariant;
01343         uint16_t        STAMajorVersion;
01344         uint16_t        STAMinorVersion;
01345 } __WLAN_ATTRIB_PACK__ hfa384x_STAIdentity_t;
01346 
01347 /*-- Information Record: STASupRange --*/
01348 typedef struct hfa384x_STASupRange
01349 {
01350         uint16_t        STARole;
01351         uint16_t        STAID;
01352         uint16_t        STAVariant;
01353         uint16_t        STABottom;
01354         uint16_t        STATop;
01355 } __WLAN_ATTRIB_PACK__ hfa384x_STASupRange_t;
01356 
01357 /*-- Information Record: MFIActRanges --*/
01358 typedef struct hfa384x_MFIActRanges
01359 {
01360         uint16_t        MFIRole;
01361         uint16_t        MFIID;
01362         uint16_t        MFIVariant;
01363         uint16_t        MFIBottom;
01364         uint16_t        MFITop;
01365 } __WLAN_ATTRIB_PACK__ hfa384x_MFIActRanges_t;
01366 
01367 /*--------------------------------------------------------------------
01368 Information Record Structures: NIC Information
01369 --------------------------------------------------------------------*/
01370 
01371 /*-- Information Record: PortStatus --*/
01372 typedef struct hfa384x_PortStatus
01373 {
01374         uint16_t        PortStatus;
01375 } __WLAN_ATTRIB_PACK__ hfa384x_PortStatus_t;
01376 
01377 #define HFA384x_PSTATUS_DISABLED        ((uint16_t)1)
01378 #define HFA384x_PSTATUS_SEARCHING       ((uint16_t)2)
01379 #define HFA384x_PSTATUS_CONN_IBSS       ((uint16_t)3)
01380 #define HFA384x_PSTATUS_CONN_ESS        ((uint16_t)4)
01381 #define HFA384x_PSTATUS_OUTOFRANGE      ((uint16_t)5)
01382 #define HFA384x_PSTATUS_CONN_WDS        ((uint16_t)6)
01383 
01384 /*-- Information Record: CurrentSSID --*/
01385 typedef struct hfa384x_CurrentSSID
01386 {
01387         uint8_t CurrentSSID[34];
01388 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentSSID_t;
01389 
01390 /*-- Information Record: CurrentBSSID --*/
01391 typedef struct hfa384x_CurrentBSSID
01392 {
01393         uint8_t CurrentBSSID[6];
01394 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBSSID_t;
01395 
01396 /*-- Information Record: commsquality --*/
01397 typedef struct hfa384x_commsquality
01398 {
01399         uint16_t        CQ_currBSS;
01400         uint16_t        ASL_currBSS;
01401         uint16_t        ANL_currFC;
01402 } __WLAN_ATTRIB_PACK__ hfa384x_commsquality_t;
01403 
01404 /*-- Information Record: dmbcommsquality --*/
01405 typedef struct hfa384x_dbmcommsquality
01406 {
01407         uint16_t        CQdbm_currBSS;
01408         uint16_t        ASLdbm_currBSS;
01409         uint16_t        ANLdbm_currFC;
01410 } __WLAN_ATTRIB_PACK__ hfa384x_dbmcommsquality_t;
01411 
01412 /*-- Information Record: CurrentTxRate --*/
01413 typedef struct hfa384x_CurrentTxRate
01414 {
01415         uint16_t        CurrentTxRate;
01416 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentTxRate_t;
01417 
01418 /*-- Information Record: CurrentBeaconInterval --*/
01419 typedef struct hfa384x_CurrentBeaconInterval
01420 {
01421         uint16_t        CurrentBeaconInterval;
01422 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBeaconInterval_t;
01423 
01424 /*-- Information Record: CurrentScaleThresholds --*/
01425 typedef struct hfa384x_CurrentScaleThresholds
01426 {
01427         uint16_t        EnergyDetectThreshold;
01428         uint16_t        CarrierDetectThreshold;
01429         uint16_t        DeferDetectThreshold;
01430         uint16_t        CellSearchThreshold; /* Stations only */
01431         uint16_t        DeadSpotThreshold; /* Stations only */
01432 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentScaleThresholds_t;
01433 
01434 /*-- Information Record: ProtocolRspTime --*/
01435 typedef struct hfa384x_ProtocolRspTime
01436 {
01437         uint16_t        ProtocolRspTime;
01438 } __WLAN_ATTRIB_PACK__ hfa384x_ProtocolRspTime_t;
01439 
01440 /*-- Information Record: ShortRetryLimit --*/
01441 typedef struct hfa384x_ShortRetryLimit
01442 {
01443         uint16_t        ShortRetryLimit;
01444 } __WLAN_ATTRIB_PACK__ hfa384x_ShortRetryLimit_t;
01445 
01446 /*-- Information Record: LongRetryLimit --*/
01447 typedef struct hfa384x_LongRetryLimit
01448 {
01449         uint16_t        LongRetryLimit;
01450 } __WLAN_ATTRIB_PACK__ hfa384x_LongRetryLimit_t;
01451 
01452 /*-- Information Record: MaxTransmitLifetime --*/
01453 typedef struct hfa384x_MaxTransmitLifetime
01454 {
01455         uint16_t        MaxTransmitLifetime;
01456 } __WLAN_ATTRIB_PACK__ hfa384x_MaxTransmitLifetime_t;
01457 
01458 /*-- Information Record: MaxReceiveLifetime --*/
01459 typedef struct hfa384x_MaxReceiveLifetime
01460 {
01461         uint16_t        MaxReceiveLifetime;
01462 } __WLAN_ATTRIB_PACK__ hfa384x_MaxReceiveLifetime_t;
01463 
01464 /*-- Information Record: CFPollable --*/
01465 typedef struct hfa384x_CFPollable
01466 {
01467         uint16_t        CFPollable;
01468 } __WLAN_ATTRIB_PACK__ hfa384x_CFPollable_t;
01469 
01470 /*-- Information Record: AuthenticationAlgorithms --*/
01471 typedef struct hfa384x_AuthenticationAlgorithms
01472 {
01473         uint16_t        AuthenticationType;
01474         uint16_t        TypeEnabled;
01475 } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_t;
01476 
01477 /*-- Information Record: AuthenticationAlgorithms
01478 (data only --*/
01479 typedef struct hfa384x_AuthenticationAlgorithms_data
01480 {
01481         uint16_t        AuthenticationType;
01482         uint16_t        TypeEnabled;
01483 } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_data_t;
01484 
01485 /*-- Information Record: PrivacyOptionImplemented --*/
01486 typedef struct hfa384x_PrivacyOptionImplemented
01487 {
01488         uint16_t        PrivacyOptionImplemented;
01489 } __WLAN_ATTRIB_PACK__ hfa384x_PrivacyOptionImplemented_t;
01490 
01491 /*-- Information Record: OwnMACAddress --*/
01492 typedef struct hfa384x_OwnMACAddress
01493 {
01494         uint8_t OwnMACAddress[6];
01495 } __WLAN_ATTRIB_PACK__ hfa384x_OwnMACAddress_t;
01496 
01497 /*-- Information Record: PCFInfo --*/
01498 typedef struct hfa384x_PCFInfo
01499 {
01500         uint16_t        MediumOccupancyLimit;
01501         uint16_t        CFPPeriod;
01502         uint16_t        CFPMaxDuration;
01503         uint16_t        CFPFlags;
01504 } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_t;
01505 
01506 /*-- Information Record: PCFInfo (data portion only) --*/
01507 typedef struct hfa384x_PCFInfo_data
01508 {
01509         uint16_t        MediumOccupancyLimit;
01510         uint16_t        CFPPeriod;
01511         uint16_t        CFPMaxDuration;
01512         uint16_t        CFPFlags;
01513 } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_data_t;
01514 
01515 /*--------------------------------------------------------------------
01516 Information Record Structures: Modem Information Records
01517 --------------------------------------------------------------------*/
01518 
01519 /*-- Information Record: PHYType --*/
01520 typedef struct hfa384x_PHYType
01521 {
01522         uint16_t        PHYType;
01523 } __WLAN_ATTRIB_PACK__ hfa384x_PHYType_t;
01524 
01525 /*-- Information Record: CurrentChannel --*/
01526 typedef struct hfa384x_CurrentChannel
01527 {
01528         uint16_t        CurrentChannel;
01529 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentChannel_t;
01530 
01531 /*-- Information Record: CurrentPowerState --*/
01532 typedef struct hfa384x_CurrentPowerState
01533 {
01534         uint16_t        CurrentPowerState;
01535 } __WLAN_ATTRIB_PACK__ hfa384x_CurrentPowerState_t;
01536 
01537 /*-- Information Record: CCAMode --*/
01538 typedef struct hfa384x_CCAMode
01539 {
01540         uint16_t        CCAMode;
01541 } __WLAN_ATTRIB_PACK__ hfa384x_CCAMode_t;
01542 
01543 /*-- Information Record: SupportedDataRates --*/
01544 typedef struct hfa384x_SupportedDataRates
01545 {
01546         uint8_t SupportedDataRates[10];
01547 } __WLAN_ATTRIB_PACK__ hfa384x_SupportedDataRates_t;
01548 
01549 /*-- Information Record: LFOStatus --*/
01550 typedef struct hfa384x_LFOStatus
01551 {
01552         uint16_t  TestResults;
01553         uint16_t  LFOResult;
01554         uint16_t  VRHFOResult;
01555 } __WLAN_ATTRIB_PACK__ hfa384x_LFOStatus_t;
01556 
01557 #define HFA384x_TESTRESULT_ALLPASSED    BIT0
01558 #define HFA384x_TESTRESULT_LFO_FAIL     BIT1
01559 #define HFA384x_TESTRESULT_VR_HF0_FAIL  BIT2
01560 #define HFA384x_HOST_FIRM_COORDINATE    BIT7
01561 #define HFA384x_TESTRESULT_COORDINATE   BIT15
01562 
01563 /*-- Information Record: LEDControl --*/
01564 typedef struct hfa384x_LEDControl
01565 {
01566         uint16_t  searching_on;
01567         uint16_t  searching_off;
01568         uint16_t  assoc_on;
01569         uint16_t  assoc_off;
01570         uint16_t  activity;
01571 } __WLAN_ATTRIB_PACK__ hfa384x_LEDControl_t;
01572 
01573 /*--------------------------------------------------------------------
01574                  FRAME DESCRIPTORS AND FRAME STRUCTURES
01575 
01576 FRAME DESCRIPTORS: Offsets
01577 
01578 ----------------------------------------------------------------------
01579 Control Info (offset 44-51)
01580 --------------------------------------------------------------------*/
01581 #define         HFA384x_FD_STATUS_OFF                   ((uint16_t)0x44)
01582 #define         HFA384x_FD_TIME_OFF                     ((uint16_t)0x46)
01583 #define         HFA384x_FD_SWSUPPORT_OFF                ((uint16_t)0x4A)
01584 #define         HFA384x_FD_SILENCE_OFF                  ((uint16_t)0x4A)
01585 #define         HFA384x_FD_SIGNAL_OFF                   ((uint16_t)0x4B)
01586 #define         HFA384x_FD_RATE_OFF                     ((uint16_t)0x4C)
01587 #define         HFA384x_FD_RXFLOW_OFF                   ((uint16_t)0x4D)
01588 #define         HFA384x_FD_RESERVED_OFF                 ((uint16_t)0x4E)
01589 #define         HFA384x_FD_TXCONTROL_OFF                ((uint16_t)0x50)
01590 /*--------------------------------------------------------------------
01591 802.11 Header (offset 52-6B)
01592 --------------------------------------------------------------------*/
01593 #define         HFA384x_FD_FRAMECONTROL_OFF             ((uint16_t)0x52)
01594 #define         HFA384x_FD_DURATIONID_OFF               ((uint16_t)0x54)
01595 #define         HFA384x_FD_ADDRESS1_OFF                 ((uint16_t)0x56)
01596 #define         HFA384x_FD_ADDRESS2_OFF                 ((uint16_t)0x5C)
01597 #define         HFA384x_FD_ADDRESS3_OFF                 ((uint16_t)0x62)
01598 #define         HFA384x_FD_SEQCONTROL_OFF               ((uint16_t)0x68)
01599 #define         HFA384x_FD_ADDRESS4_OFF                 ((uint16_t)0x6A)
01600 #define         HFA384x_FD_DATALEN_OFF                  ((uint16_t)0x70)
01601 /*--------------------------------------------------------------------
01602 802.3 Header (offset 72-7F)
01603 --------------------------------------------------------------------*/
01604 #define         HFA384x_FD_DESTADDRESS_OFF              ((uint16_t)0x72)
01605 #define         HFA384x_FD_SRCADDRESS_OFF               ((uint16_t)0x78)
01606 #define         HFA384x_FD_DATALENGTH_OFF               ((uint16_t)0x7E)
01607 
01608 /*--------------------------------------------------------------------
01609 FRAME STRUCTURES: Communication Frames
01610 ----------------------------------------------------------------------
01611 Communication Frames: Transmit Frames
01612 --------------------------------------------------------------------*/
01613 /*-- Communication Frame: Transmit Frame Structure --*/
01614 typedef struct hfa384x_tx_frame
01615 {
01616         uint16_t        status;
01617         uint16_t        reserved1;
01618         uint16_t        reserved2;
01619         uint32_t        sw_support;
01620         uint8_t tx_retrycount;
01621         uint8_t   tx_rate;
01622         uint16_t        tx_control;
01623 
01624         /*-- 802.11 Header Information --*/
01625 
01626         uint16_t        frame_control;
01627         uint16_t        duration_id;
01628         uint8_t address1[6];
01629         uint8_t address2[6];
01630         uint8_t address3[6];
01631         uint16_t        sequence_control;
01632         uint8_t address4[6];
01633         uint16_t        data_len; /* little endian format */
01634 
01635         /*-- 802.3 Header Information --*/
01636 
01637         uint8_t dest_addr[6];
01638         uint8_t src_addr[6];
01639         uint16_t        data_length; /* big endian format */
01640 } __WLAN_ATTRIB_PACK__ hfa384x_tx_frame_t;
01641 /*--------------------------------------------------------------------
01642 Communication Frames: Field Masks for Transmit Frames
01643 --------------------------------------------------------------------*/
01644 /*-- Status Field --*/
01645 #define         HFA384x_TXSTATUS_ACKERR                 ((uint16_t)BIT5)
01646 #define         HFA384x_TXSTATUS_FORMERR                ((uint16_t)BIT3)
01647 #define         HFA384x_TXSTATUS_DISCON                 ((uint16_t)BIT2)
01648 #define         HFA384x_TXSTATUS_AGEDERR                ((uint16_t)BIT1)
01649 #define         HFA384x_TXSTATUS_RETRYERR               ((uint16_t)BIT0)
01650 /*-- Transmit Control Field --*/
01651 #define         HFA384x_TX_CFPOLL                       ((uint16_t)BIT12)
01652 #define         HFA384x_TX_PRST                         ((uint16_t)BIT11)
01653 #define         HFA384x_TX_MACPORT                      ((uint16_t)(BIT10 | BIT9 | BIT8))
01654 #define         HFA384x_TX_NOENCRYPT                    ((uint16_t)BIT7)
01655 #define         HFA384x_TX_RETRYSTRAT                   ((uint16_t)(BIT6 | BIT5))
01656 #define         HFA384x_TX_STRUCTYPE                    ((uint16_t)(BIT4 | BIT3))
01657 #define         HFA384x_TX_TXEX                         ((uint16_t)BIT2)
01658 #define         HFA384x_TX_TXOK                         ((uint16_t)BIT1)
01659 /*--------------------------------------------------------------------
01660 Communication Frames: Test/Get/Set Field Values for Transmit Frames
01661 --------------------------------------------------------------------*/
01662 /*-- Status Field --*/
01663 #define HFA384x_TXSTATUS_ISERROR(v)     \
01664         (((uint16_t)(v))&\
01665         (HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\
01666         HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\
01667         HFA384x_TXSTATUS_RETRYERR))
01668 
01669 #define HFA384x_TXSTATUS_ISACKERR(v)    ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_ACKERR))
01670 #define HFA384x_TXSTATUS_ISFORMERR(v)   ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_FORMERR))
01671 #define HFA384x_TXSTATUS_ISDISCON(v)    ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_DISCON))
01672 #define HFA384x_TXSTATUS_ISAGEDERR(v)   ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_AGEDERR))
01673 #define HFA384x_TXSTATUS_ISRETRYERR(v)  ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_RETRYERR))
01674 
01675 #define HFA384x_TX_GET(v,m,s)           ((((uint16_t)(v))&((uint16_t)(m)))>>((uint16_t)(s)))
01676 #define HFA384x_TX_SET(v,m,s)           ((((uint16_t)(v))<<((uint16_t)(s)))&((uint16_t)(m)))
01677 
01678 #define HFA384x_TX_CFPOLL_GET(v)        HFA384x_TX_GET(v, HFA384x_TX_CFPOLL,12)
01679 #define HFA384x_TX_CFPOLL_SET(v)        HFA384x_TX_SET(v, HFA384x_TX_CFPOLL,12)
01680 #define HFA384x_TX_PRST_GET(v)          HFA384x_TX_GET(v, HFA384x_TX_PRST,11)
01681 #define HFA384x_TX_PRST_SET(v)          HFA384x_TX_SET(v, HFA384x_TX_PRST,11)
01682 #define HFA384x_TX_MACPORT_GET(v)       HFA384x_TX_GET(v, HFA384x_TX_MACPORT, 8)
01683 #define HFA384x_TX_MACPORT_SET(v)       HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
01684 #define HFA384x_TX_NOENCRYPT_GET(v)     HFA384x_TX_GET(v, HFA384x_TX_NOENCRYPT, 7)
01685 #define HFA384x_TX_NOENCRYPT_SET(v)     HFA384x_TX_SET(v, HFA384x_TX_NOENCRYPT, 7)
01686 #define HFA384x_TX_RETRYSTRAT_GET(v)    HFA384x_TX_GET(v, HFA384x_TX_RETRYSTRAT, 5)
01687 #define HFA384x_TX_RETRYSTRAT_SET(v)    HFA384x_TX_SET(v, HFA384x_TX_RETRYSTRAT, 5)
01688 #define HFA384x_TX_STRUCTYPE_GET(v)     HFA384x_TX_GET(v, HFA384x_TX_STRUCTYPE, 3)
01689 #define HFA384x_TX_STRUCTYPE_SET(v)     HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3)
01690 #define HFA384x_TX_TXEX_GET(v)          HFA384x_TX_GET(v, HFA384x_TX_TXEX, 2)
01691 #define HFA384x_TX_TXEX_SET(v)          HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2)
01692 #define HFA384x_TX_TXOK_GET(v)          HFA384x_TX_GET(v, HFA384x_TX_TXOK, 1)
01693 #define HFA384x_TX_TXOK_SET(v)          HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)
01694 /*--------------------------------------------------------------------
01695 Communication Frames: Receive Frames
01696 --------------------------------------------------------------------*/
01697 /*-- Communication Frame: Receive Frame Structure --*/
01698 typedef struct hfa384x_rx_frame
01699 {
01700         /*-- MAC rx descriptor (hfa384x byte order) --*/
01701         uint16_t        status;
01702         uint32_t        time;
01703         uint8_t silence;
01704         uint8_t signal;
01705         uint8_t rate;
01706         uint8_t rx_flow;
01707         uint16_t        reserved1;
01708         uint16_t        reserved2;
01709 
01710         /*-- 802.11 Header Information (802.11 byte order) --*/
01711         uint16_t        frame_control;
01712         uint16_t        duration_id;
01713         uint8_t address1[6];
01714         uint8_t address2[6];
01715         uint8_t address3[6];
01716         uint16_t        sequence_control;
01717         uint8_t address4[6];
01718         uint16_t        data_len; /* hfa384x (little endian) format */
01719 
01720         /*-- 802.3 Header Information --*/
01721         uint8_t dest_addr[6];
01722         uint8_t src_addr[6];
01723         uint16_t        data_length; /* IEEE? (big endian) format */
01724 } __WLAN_ATTRIB_PACK__ hfa384x_rx_frame_t;
01725 /*--------------------------------------------------------------------
01726 Communication Frames: Field Masks for Receive Frames
01727 --------------------------------------------------------------------*/
01728 /*-- Offsets --------*/
01729 #define         HFA384x_RX_DATA_LEN_OFF                 ((uint16_t)44)
01730 #define         HFA384x_RX_80211HDR_OFF                 ((uint16_t)14)
01731 #define         HFA384x_RX_DATA_OFF                     ((uint16_t)60)
01732 
01733 /*-- Status Fields --*/
01734 #define         HFA384x_RXSTATUS_MSGTYPE                ((uint16_t)(BIT15 | BIT14 | BIT13))
01735 #define         HFA384x_RXSTATUS_MACPORT                ((uint16_t)(BIT10 | BIT9 | BIT8))
01736 #define         HFA384x_RXSTATUS_UNDECR                 ((uint16_t)BIT1)
01737 #define         HFA384x_RXSTATUS_FCSERR                 ((uint16_t)BIT0)
01738 /*--------------------------------------------------------------------
01739 Communication Frames: Test/Get/Set Field Values for Receive Frames
01740 --------------------------------------------------------------------*/
01741 #define         HFA384x_RXSTATUS_MSGTYPE_GET(value)     ((uint16_t)((((uint16_t)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13))
01742 #define         HFA384x_RXSTATUS_MSGTYPE_SET(value)     ((uint16_t)(((uint16_t)(value)) << 13))
01743 #define         HFA384x_RXSTATUS_MACPORT_GET(value)     ((uint16_t)((((uint16_t)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8))
01744 #define         HFA384x_RXSTATUS_MACPORT_SET(value)     ((uint16_t)(((uint16_t)(value)) << 8))
01745 #define         HFA384x_RXSTATUS_ISUNDECR(value)        ((uint16_t)(((uint16_t)(value)) & HFA384x_RXSTATUS_UNDECR))
01746 #define         HFA384x_RXSTATUS_ISFCSERR(value)        ((uint16_t)(((uint16_t)(value)) & HFA384x_RXSTATUS_FCSERR))
01747 /*--------------------------------------------------------------------
01748  FRAME STRUCTURES: Information Types and Information Frame Structures
01749 ----------------------------------------------------------------------
01750 Information Types
01751 --------------------------------------------------------------------*/
01752 #define         HFA384x_IT_HANDOVERADDR                 ((uint16_t)0xF000UL)
01753 #define         HFA384x_IT_HANDOVERDEAUTHADDRESS        ((uint16_t)0xF001UL)//AP 1.3.7
01754 #define         HFA384x_IT_COMMTALLIES                  ((uint16_t)0xF100UL)
01755 #define         HFA384x_IT_SCANRESULTS                  ((uint16_t)0xF101UL)
01756 #define         HFA384x_IT_CHINFORESULTS                ((uint16_t)0xF102UL)
01757 #define         HFA384x_IT_HOSTSCANRESULTS              ((uint16_t)0xF103UL)
01758 #define         HFA384x_IT_LINKSTATUS                   ((uint16_t)0xF200UL)
01759 #define         HFA384x_IT_ASSOCSTATUS                  ((uint16_t)0xF201UL)
01760 #define         HFA384x_IT_AUTHREQ                      ((uint16_t)0xF202UL)
01761 #define         HFA384x_IT_PSUSERCNT                    ((uint16_t)0xF203UL)
01762 #define         HFA384x_IT_KEYIDCHANGED                 ((uint16_t)0xF204UL)
01763 #define         HFA384x_IT_ASSOCREQ                     ((uint16_t)0xF205UL)
01764 #define         HFA384x_IT_MICFAILURE                   ((uint16_t)0xF206UL)
01765 
01766 /*--------------------------------------------------------------------
01767 Information Frames Structures
01768 ----------------------------------------------------------------------
01769 Information Frames: Notification Frame Structures
01770 --------------------------------------------------------------------*/
01771 /*--  Notification Frame,MAC Mgmt: Handover Address --*/
01772 typedef struct hfa384x_HandoverAddr
01773 {
01774         uint16_t        framelen;
01775         uint16_t        infotype;
01776         uint8_t handover_addr[WLAN_BSSID_LEN];
01777 } __WLAN_ATTRIB_PACK__ hfa384x_HandoverAddr_t;
01778 
01779 /*--  Inquiry Frame, Diagnose: Communication Tallies --*/
01780 typedef struct hfa384x_CommTallies16
01781 {
01782         uint16_t        txunicastframes;
01783         uint16_t        txmulticastframes;
01784         uint16_t        txfragments;
01785         uint16_t        txunicastoctets;
01786         uint16_t        txmulticastoctets;
01787         uint16_t        txdeferredtrans;
01788         uint16_t        txsingleretryframes;
01789         uint16_t        txmultipleretryframes;
01790         uint16_t        txretrylimitexceeded;
01791         uint16_t        txdiscards;
01792         uint16_t        rxunicastframes;
01793         uint16_t        rxmulticastframes;
01794         uint16_t        rxfragments;
01795         uint16_t        rxunicastoctets;
01796         uint16_t        rxmulticastoctets;
01797         uint16_t        rxfcserrors;
01798         uint16_t        rxdiscardsnobuffer;
01799         uint16_t        txdiscardswrongsa;
01800         uint16_t        rxdiscardswepundecr;
01801         uint16_t        rxmsginmsgfrag;
01802         uint16_t        rxmsginbadmsgfrag;
01803 } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies16_t;
01804 
01805 typedef struct hfa384x_CommTallies32
01806 {
01807         uint32_t        txunicastframes;
01808         uint32_t        txmulticastframes;
01809         uint32_t        txfragments;
01810         uint32_t        txunicastoctets;
01811         uint32_t        txmulticastoctets;
01812         uint32_t        txdeferredtrans;
01813         uint32_t        txsingleretryframes;
01814         uint32_t        txmultipleretryframes;
01815         uint32_t        txretrylimitexceeded;
01816         uint32_t        txdiscards;
01817         uint32_t        rxunicastframes;
01818         uint32_t        rxmulticastframes;
01819         uint32_t        rxfragments;
01820         uint32_t        rxunicastoctets;
01821         uint32_t        rxmulticastoctets;
01822         uint32_t        rxfcserrors;
01823         uint32_t        rxdiscardsnobuffer;
01824         uint32_t        txdiscardswrongsa;
01825         uint32_t        rxdiscardswepundecr;
01826         uint32_t        rxmsginmsgfrag;
01827         uint32_t        rxmsginbadmsgfrag;
01828 } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies32_t;
01829 
01830 /*--  Inquiry Frame, Diagnose: Scan Results & Subfields--*/
01831 typedef struct hfa384x_ScanResultSub
01832 {
01833         uint16_t        chid;
01834         uint16_t        anl;
01835         uint16_t        sl;
01836         uint8_t bssid[WLAN_BSSID_LEN];
01837         uint16_t        bcnint;
01838         uint16_t        capinfo;
01839         hfa384x_bytestr32_t     ssid;
01840         uint8_t supprates[10]; /* 802.11 info element */
01841         uint16_t        proberesp_rate;
01842 } __WLAN_ATTRIB_PACK__ hfa384x_ScanResultSub_t;
01843 
01844 typedef struct hfa384x_ScanResult
01845 {
01846         uint16_t        rsvd;
01847         uint16_t        scanreason;
01848         hfa384x_ScanResultSub_t
01849                 result[HFA384x_SCANRESULT_MAX];
01850 } __WLAN_ATTRIB_PACK__ hfa384x_ScanResult_t;
01851 
01852 /*--  Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
01853 typedef struct hfa384x_ChInfoResultSub
01854 {
01855         uint16_t        chid;
01856         uint16_t        anl;
01857         uint16_t        pnl;
01858         uint16_t        active;
01859 } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResultSub_t;
01860 
01861 #define HFA384x_CHINFORESULT_BSSACTIVE  BIT0
01862 #define HFA384x_CHINFORESULT_PCFACTIVE  BIT1
01863 
01864 typedef struct hfa384x_ChInfoResult
01865 {
01866         uint16_t        scanchannels;
01867         hfa384x_ChInfoResultSub_t
01868                 result[HFA384x_CHINFORESULT_MAX];
01869 } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResult_t;
01870 
01871 /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
01872 typedef struct hfa384x_HScanResultSub
01873 {
01874         uint16_t        chid;
01875         uint16_t        anl;
01876         uint16_t        sl;
01877         uint8_t bssid[WLAN_BSSID_LEN];
01878         uint16_t        bcnint;
01879         uint16_t        capinfo;
01880         hfa384x_bytestr32_t     ssid;
01881         uint8_t supprates[10]; /* 802.11 info element */
01882         uint16_t        proberesp_rate;
01883         uint16_t        atim;
01884 } __WLAN_ATTRIB_PACK__ hfa384x_HScanResultSub_t;
01885 
01886 typedef struct hfa384x_HScanResult
01887 {
01888         uint16_t        nresult;
01889         uint16_t        rsvd;
01890         hfa384x_HScanResultSub_t
01891                 result[HFA384x_HSCANRESULT_MAX];
01892 } __WLAN_ATTRIB_PACK__ hfa384x_HScanResult_t;
01893 
01894 /*--  Unsolicited Frame, MAC Mgmt: LinkStatus --*/
01895 
01896 #define HFA384x_LINK_NOTCONNECTED       ((uint16_t)0)
01897 #define HFA384x_LINK_CONNECTED          ((uint16_t)1)
01898 #define HFA384x_LINK_DISCONNECTED       ((uint16_t)2)
01899 #define HFA384x_LINK_AP_CHANGE          ((uint16_t)3)
01900 #define HFA384x_LINK_AP_OUTOFRANGE      ((uint16_t)4)
01901 #define HFA384x_LINK_AP_INRANGE         ((uint16_t)5)
01902 #define HFA384x_LINK_ASSOCFAIL          ((uint16_t)6)
01903 
01904 typedef struct hfa384x_LinkStatus
01905 {
01906         uint16_t        linkstatus;
01907 } __WLAN_ATTRIB_PACK__ hfa384x_LinkStatus_t;
01908 
01909 
01910 /*--  Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
01911 
01912 #define HFA384x_ASSOCSTATUS_STAASSOC    ((uint16_t)1)
01913 #define HFA384x_ASSOCSTATUS_REASSOC     ((uint16_t)2)
01914 #define HFA384x_ASSOCSTATUS_DISASSOC    ((uint16_t)3)
01915 #define HFA384x_ASSOCSTATUS_ASSOCFAIL   ((uint16_t)4)
01916 #define HFA384x_ASSOCSTATUS_AUTHFAIL    ((uint16_t)5)
01917 
01918 typedef struct hfa384x_AssocStatus
01919 {
01920         uint16_t        assocstatus;
01921         uint8_t sta_addr[WLAN_ADDR_LEN];
01922         /* old_ap_addr is only valid if assocstatus == 2 */
01923         uint8_t old_ap_addr[WLAN_ADDR_LEN];
01924         uint16_t        reason;
01925         uint16_t        reserved;
01926 } __WLAN_ATTRIB_PACK__ hfa384x_AssocStatus_t;
01927 
01928 /*--  Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
01929 
01930 typedef struct hfa384x_AuthRequest
01931 {
01932         uint8_t sta_addr[WLAN_ADDR_LEN];
01933         uint16_t        algorithm;
01934 } __WLAN_ATTRIB_PACK__ hfa384x_AuthReq_t;
01935 
01936 /*--  Unsolicited Frame, MAC Mgmt: AssocRequest (AP Only) --*/
01937 
01938 typedef struct hfa384x_AssocRequest
01939 {
01940         uint8_t sta_addr[WLAN_ADDR_LEN];
01941         uint16_t        type;
01942         uint8_t   wpa_data[80];
01943 } __WLAN_ATTRIB_PACK__ hfa384x_AssocReq_t;
01944 
01945 
01946 #define HFA384x_ASSOCREQ_TYPE_ASSOC     0
01947 #define HFA384x_ASSOCREQ_TYPE_REASSOC   1
01948 
01949 /*--  Unsolicited Frame, MAC Mgmt: MIC Failure  (AP Only) --*/
01950 
01951 typedef struct hfa384x_MicFailure
01952 {
01953         uint8_t sender[WLAN_ADDR_LEN];
01954         uint8_t dest[WLAN_ADDR_LEN];
01955 } __WLAN_ATTRIB_PACK__ hfa384x_MicFailure_t;
01956 
01957 /*--  Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
01958 
01959 typedef struct hfa384x_PSUserCount
01960 {
01961         uint16_t        usercnt;
01962 } __WLAN_ATTRIB_PACK__ hfa384x_PSUserCount_t;
01963 
01964 typedef struct hfa384x_KeyIDChanged
01965 {
01966         uint8_t sta_addr[WLAN_ADDR_LEN];
01967         uint16_t        keyid;
01968 } __WLAN_ATTRIB_PACK__ hfa384x_KeyIDChanged_t;
01969 
01970 /*--  Collection of all Inf frames ---------------*/
01971 typedef union hfa384x_infodata {
01972         hfa384x_CommTallies16_t commtallies16;
01973         hfa384x_CommTallies32_t commtallies32;
01974         hfa384x_ScanResult_t    scanresult;
01975         hfa384x_ChInfoResult_t  chinforesult;
01976         hfa384x_HScanResult_t   hscanresult;
01977         hfa384x_LinkStatus_t    linkstatus;
01978         hfa384x_AssocStatus_t   assocstatus;
01979         hfa384x_AuthReq_t       authreq;
01980         hfa384x_PSUserCount_t   psusercnt;
01981         hfa384x_KeyIDChanged_t  keyidchanged;
01982 } __WLAN_ATTRIB_PACK__ hfa384x_infodata_t;
01983 
01984 typedef struct hfa384x_InfFrame
01985 {
01986         uint16_t                        framelen;
01987         uint16_t                        infotype;
01988         hfa384x_infodata_t      info;
01989 } __WLAN_ATTRIB_PACK__ hfa384x_InfFrame_t;
01990 
01991 #if (WLAN_HOSTIF == WLAN_USB)
01992 /*--------------------------------------------------------------------
01993 USB Packet structures and constants.
01994 --------------------------------------------------------------------*/
01995 
01996 /* Should be sent to the ctrlout endpoint */
01997 #define HFA384x_USB_ENBULKIN    6
01998 
01999 /* Should be sent to the bulkout endpoint */
02000 #define HFA384x_USB_TXFRM       0
02001 #define HFA384x_USB_CMDREQ      1
02002 #define HFA384x_USB_WRIDREQ     2
02003 #define HFA384x_USB_RRIDREQ     3
02004 #define HFA384x_USB_WMEMREQ     4
02005 #define HFA384x_USB_RMEMREQ     5
02006 
02007 /* Received from the bulkin endpoint */
02008 #define HFA384x_USB_ISFRM(a)    (!((a) & 0x8000))
02009 #define HFA384x_USB_ISTXFRM(a)  (((a) & 0x9000) == 0x1000)
02010 #define HFA384x_USB_ISRXFRM(a)  (!((a) & 0x9000))
02011 #define HFA384x_USB_INFOFRM     0x8000
02012 #define HFA384x_USB_CMDRESP     0x8001
02013 #define HFA384x_USB_WRIDRESP    0x8002
02014 #define HFA384x_USB_RRIDRESP    0x8003
02015 #define HFA384x_USB_WMEMRESP    0x8004
02016 #define HFA384x_USB_RMEMRESP    0x8005
02017 #define HFA384x_USB_BUFAVAIL    0x8006
02018 #define HFA384x_USB_ERROR       0x8007
02019 
02020 /*------------------------------------*/
02021 /* Request (bulk OUT) packet contents */
02022 
02023 typedef struct hfa384x_usb_txfrm {
02024         hfa384x_tx_frame_t      desc;
02025         uint8_t                 data[WLAN_DATA_MAXLEN];
02026 } __WLAN_ATTRIB_PACK__ hfa384x_usb_txfrm_t;
02027 
02028 typedef struct hfa384x_usb_cmdreq {
02029         uint16_t                type;
02030         uint16_t                cmd;
02031         uint16_t                parm0;
02032         uint16_t                parm1;
02033         uint16_t                parm2;
02034         uint8_t         pad[54];
02035 } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdreq_t;
02036 
02037 typedef struct hfa384x_usb_wridreq {
02038         uint16_t                type;
02039         uint16_t                frmlen;
02040         uint16_t                rid;
02041         uint8_t         data[HFA384x_RIDDATA_MAXLEN];
02042 } __WLAN_ATTRIB_PACK__ hfa384x_usb_wridreq_t;
02043 
02044 typedef struct hfa384x_usb_rridreq {
02045         uint16_t                type;
02046         uint16_t                frmlen;
02047         uint16_t                rid;
02048         uint8_t         pad[58];
02049 } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridreq_t;
02050 
02051 typedef struct hfa384x_usb_wmemreq {
02052         uint16_t                type;
02053         uint16_t                frmlen;
02054         uint16_t                offset;
02055         uint16_t                page;
02056         uint8_t         data[HFA384x_USB_RWMEM_MAXLEN];
02057 } __WLAN_ATTRIB_PACK__ hfa384x_usb_wmemreq_t;
02058 
02059 typedef struct hfa384x_usb_rmemreq {
02060         uint16_t                type;
02061         uint16_t                frmlen;
02062         uint16_t                offset;
02063         uint16_t                page;
02064         uint8_t         pad[56];
02065 } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemreq_t;
02066 
02067 /*------------------------------------*/
02068 /* Response (bulk IN) packet contents */
02069 
02070 typedef struct hfa384x_usb_rxfrm {
02071         hfa384x_rx_frame_t      desc;
02072         uint8_t                 data[WLAN_DATA_MAXLEN];
02073 } __WLAN_ATTRIB_PACK__ hfa384x_usb_rxfrm_t;
02074 
02075 typedef struct hfa384x_usb_infofrm {
02076         uint16_t                        type;
02077         hfa384x_InfFrame_t      info;
02078 } __WLAN_ATTRIB_PACK__ hfa384x_usb_infofrm_t;
02079 
02080 typedef struct hfa384x_usb_statusresp {
02081         uint16_t                type;
02082         uint16_t                status;
02083         uint16_t                resp0;
02084         uint16_t                resp1;
02085         uint16_t                resp2;
02086 } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdresp_t;
02087 
02088 typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t;
02089 
02090 typedef struct hfa384x_usb_rridresp {
02091         uint16_t                type;
02092         uint16_t                frmlen;
02093         uint16_t                rid;
02094         uint8_t         data[HFA384x_RIDDATA_MAXLEN];
02095 } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridresp_t;
02096 
02097 typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t;
02098 
02099 typedef struct hfa384x_usb_rmemresp {
02100         uint16_t                type;
02101         uint16_t                frmlen;
02102         uint8_t         data[HFA384x_USB_RWMEM_MAXLEN];
02103 } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemresp_t;
02104 
02105 typedef struct hfa384x_usb_bufavail {
02106         uint16_t                type;
02107         uint16_t                frmlen;
02108 } __WLAN_ATTRIB_PACK__ hfa384x_usb_bufavail_t;
02109 
02110 typedef struct hfa384x_usb_error {
02111         uint16_t                type;
02112         uint16_t                errortype;
02113 } __WLAN_ATTRIB_PACK__ hfa384x_usb_error_t;
02114 
02115 /*----------------------------------------------------------*/
02116 /* Unions for packaging all the known packet types together */
02117 
02118 typedef union hfa384x_usbout {
02119         uint16_t                        type;
02120         hfa384x_usb_txfrm_t     txfrm;
02121         hfa384x_usb_cmdreq_t    cmdreq;
02122         hfa384x_usb_wridreq_t   wridreq;
02123         hfa384x_usb_rridreq_t   rridreq;
02124         hfa384x_usb_wmemreq_t   wmemreq;
02125         hfa384x_usb_rmemreq_t   rmemreq;
02126 } __WLAN_ATTRIB_PACK__ hfa384x_usbout_t;
02127 
02128 typedef union hfa384x_usbin {
02129         uint16_t                        type;
02130         hfa384x_usb_rxfrm_t     rxfrm;
02131         hfa384x_usb_txfrm_t     txfrm;
02132         hfa384x_usb_infofrm_t   infofrm;
02133         hfa384x_usb_cmdresp_t   cmdresp;
02134         hfa384x_usb_wridresp_t  wridresp;
02135         hfa384x_usb_rridresp_t  rridresp;
02136         hfa384x_usb_wmemresp_t  wmemresp;
02137         hfa384x_usb_rmemresp_t  rmemresp;
02138         hfa384x_usb_bufavail_t  bufavail;
02139         hfa384x_usb_error_t     usberror;
02140         uint8_t                 boguspad[3000];
02141 } __WLAN_ATTRIB_PACK__ hfa384x_usbin_t;
02142 
02143 #endif /* WLAN_USB */
02144 
02145 /*--------------------------------------------------------------------
02146 PD record structures.
02147 --------------------------------------------------------------------*/
02148 
02149 typedef struct hfa384x_pdr_pcb_partnum
02150 {
02151         uint8_t num[8];
02152 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_partnum_t;
02153 
02154 typedef struct hfa384x_pdr_pcb_tracenum
02155 {
02156         uint8_t num[8];
02157 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_tracenum_t;
02158 
02159 typedef struct hfa384x_pdr_nic_serial
02160 {
02161         uint8_t num[12];
02162 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_serial_t;
02163 
02164 typedef struct hfa384x_pdr_mkk_measurements
02165 {
02166         double  carrier_freq;
02167         double  occupied_band;
02168         double  power_density;
02169         double  tx_spur_f1;
02170         double  tx_spur_f2;
02171         double  tx_spur_f3;
02172         double  tx_spur_f4;
02173         double  tx_spur_l1;
02174         double  tx_spur_l2;
02175         double  tx_spur_l3;
02176         double  tx_spur_l4;
02177         double  rx_spur_f1;
02178         double  rx_spur_f2;
02179         double  rx_spur_l1;
02180         double  rx_spur_l2;
02181 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_measurements_t;
02182 
02183 typedef struct hfa384x_pdr_nic_ramsize
02184 {
02185         uint8_t size[12]; /* units of KB */
02186 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_ramsize_t;
02187 
02188 typedef struct hfa384x_pdr_mfisuprange
02189 {
02190         uint16_t        id;
02191         uint16_t        variant;
02192         uint16_t        bottom;
02193         uint16_t        top;
02194 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mfisuprange_t;
02195 
02196 typedef struct hfa384x_pdr_cfisuprange
02197 {
02198         uint16_t        id;
02199         uint16_t        variant;
02200         uint16_t        bottom;
02201         uint16_t        top;
02202 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_cfisuprange_t;
02203 
02204 typedef struct hfa384x_pdr_nicid
02205 {
02206         uint16_t        id;
02207         uint16_t        variant;
02208         uint16_t        major;
02209         uint16_t        minor;
02210 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nicid_t;
02211 
02212 
02213 typedef struct hfa384x_pdr_refdac_measurements
02214 {
02215         uint16_t        value[0];
02216 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_measurements_t;
02217 
02218 typedef struct hfa384x_pdr_vgdac_measurements
02219 {
02220         uint16_t        value[0];
02221 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_measurements_t;
02222 
02223 typedef struct hfa384x_pdr_level_comp_measurements
02224 {
02225         uint16_t        value[0];
02226 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_compc_measurements_t;
02227 
02228 typedef struct hfa384x_pdr_mac_address
02229 {
02230         uint8_t addr[6];
02231 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mac_address_t;
02232 
02233 typedef struct hfa384x_pdr_mkk_callname
02234 {
02235         uint8_t callname[8];
02236 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_callname_t;
02237 
02238 typedef struct hfa384x_pdr_regdomain
02239 {
02240         uint16_t        numdomains;
02241         uint16_t        domain[5];
02242 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_regdomain_t;
02243 
02244 typedef struct hfa384x_pdr_allowed_channel
02245 {
02246         uint16_t        ch_bitmap;
02247 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_allowed_channel_t;
02248 
02249 typedef struct hfa384x_pdr_default_channel
02250 {
02251         uint16_t        channel;
02252 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_default_channel_t;
02253 
02254 typedef struct hfa384x_pdr_privacy_option
02255 {
02256         uint16_t        available;
02257 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_privacy_option_t;
02258 
02259 typedef struct hfa384x_pdr_temptype
02260 {
02261         uint16_t        type;
02262 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_temptype_t;
02263 
02264 typedef struct hfa384x_pdr_refdac_setup
02265 {
02266         uint16_t        ch_value[14];
02267 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_setup_t;
02268 
02269 typedef struct hfa384x_pdr_vgdac_setup
02270 {
02271         uint16_t        ch_value[14];
02272 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_setup_t;
02273 
02274 typedef struct hfa384x_pdr_level_comp_setup
02275 {
02276         uint16_t        ch_value[14];
02277 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_comp_setup_t;
02278 
02279 typedef struct hfa384x_pdr_trimdac_setup
02280 {
02281         uint16_t        trimidac;
02282         uint16_t        trimqdac;
02283 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_trimdac_setup_t;
02284 
02285 typedef struct hfa384x_pdr_ifr_setting
02286 {
02287         uint16_t        value[3];
02288 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_ifr_setting_t;
02289 
02290 typedef struct hfa384x_pdr_rfr_setting
02291 {
02292         uint16_t        value[3];
02293 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_rfr_setting_t;
02294 
02295 typedef struct hfa384x_pdr_hfa3861_baseline
02296 {
02297         uint16_t        value[50];
02298 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_baseline_t;
02299 
02300 typedef struct hfa384x_pdr_hfa3861_shadow
02301 {
02302         uint32_t        value[32];
02303 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_shadow_t;
02304 
02305 typedef struct hfa384x_pdr_hfa3861_ifrf
02306 {
02307         uint32_t        value[20];
02308 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_ifrf_t;
02309 
02310 typedef struct hfa384x_pdr_hfa3861_chcalsp
02311 {
02312         uint16_t        value[14];
02313 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcalsp_t;
02314 
02315 typedef struct hfa384x_pdr_hfa3861_chcali
02316 {
02317         uint16_t        value[17];
02318 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcali_t;
02319 
02320 typedef struct hfa384x_pdr_hfa3861_nic_config
02321 {
02322         uint16_t        config_bitmap;
02323 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_config_t;
02324 
02325 typedef struct hfa384x_pdr_hfo_delay
02326 {
02327         uint8_t   hfo_delay;
02328 } __WLAN_ATTRIB_PACK__ hfa384x_hfo_delay_t;
02329 
02330 typedef struct hfa384x_pdr_hfa3861_manf_testsp
02331 {
02332         uint16_t        value[30];
02333 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testsp_t;
02334 
02335 typedef struct hfa384x_pdr_hfa3861_manf_testi
02336 {
02337         uint16_t        value[30];
02338 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testi_t;
02339 
02340 typedef struct hfa384x_end_of_pda
02341 {
02342         uint16_t        crc;
02343 } __WLAN_ATTRIB_PACK__ hfa384x_pdr_end_of_pda_t;
02344 
02345 typedef struct hfa384x_pdrec
02346 {
02347         uint16_t        len; /* in words */
02348         uint16_t        code;
02349         union pdr {
02350         hfa384x_pdr_pcb_partnum_t       pcb_partnum;
02351         hfa384x_pdr_pcb_tracenum_t      pcb_tracenum;
02352         hfa384x_pdr_nic_serial_t        nic_serial;
02353         hfa384x_pdr_mkk_measurements_t  mkk_measurements;
02354         hfa384x_pdr_nic_ramsize_t       nic_ramsize;
02355         hfa384x_pdr_mfisuprange_t       mfisuprange;
02356         hfa384x_pdr_cfisuprange_t       cfisuprange;
02357         hfa384x_pdr_nicid_t             nicid;
02358         hfa384x_pdr_refdac_measurements_t       refdac_measurements;
02359         hfa384x_pdr_vgdac_measurements_t        vgdac_measurements;
02360         hfa384x_pdr_level_compc_measurements_t  level_compc_measurements;
02361         hfa384x_pdr_mac_address_t       mac_address;
02362         hfa384x_pdr_mkk_callname_t      mkk_callname;
02363         hfa384x_pdr_regdomain_t         regdomain;
02364         hfa384x_pdr_allowed_channel_t   allowed_channel;
02365         hfa384x_pdr_default_channel_t   default_channel;
02366         hfa384x_pdr_privacy_option_t    privacy_option;
02367         hfa384x_pdr_temptype_t          temptype;
02368         hfa384x_pdr_refdac_setup_t      refdac_setup;
02369         hfa384x_pdr_vgdac_setup_t       vgdac_setup;
02370         hfa384x_pdr_level_comp_setup_t  level_comp_setup;
02371         hfa384x_pdr_trimdac_setup_t     trimdac_setup;
02372         hfa384x_pdr_ifr_setting_t       ifr_setting;
02373         hfa384x_pdr_rfr_setting_t       rfr_setting;
02374         hfa384x_pdr_hfa3861_baseline_t  hfa3861_baseline;
02375         hfa384x_pdr_hfa3861_shadow_t    hfa3861_shadow;
02376         hfa384x_pdr_hfa3861_ifrf_t      hfa3861_ifrf;
02377         hfa384x_pdr_hfa3861_chcalsp_t   hfa3861_chcalsp;
02378         hfa384x_pdr_hfa3861_chcali_t    hfa3861_chcali;
02379         hfa384x_pdr_nic_config_t        nic_config;
02380         hfa384x_hfo_delay_t             hfo_delay;
02381         hfa384x_pdr_hfa3861_manf_testsp_t       hfa3861_manf_testsp;
02382         hfa384x_pdr_hfa3861_manf_testi_t        hfa3861_manf_testi;
02383         hfa384x_pdr_end_of_pda_t        end_of_pda;
02384 
02385         } data;
02386 } __WLAN_ATTRIB_PACK__ hfa384x_pdrec_t;
02387 
02388 
02389 #ifdef __KERNEL__
02390 /*--------------------------------------------------------------------
02391 ---  MAC state structure, argument to all functions --
02392 ---  Also, a collection of support types --
02393 --------------------------------------------------------------------*/
02394 typedef struct hfa384x_statusresult
02395 {
02396         uint16_t        status;
02397         uint16_t        resp0;
02398         uint16_t        resp1;
02399         uint16_t        resp2;
02400 } hfa384x_cmdresult_t;
02401 
02402 #if (WLAN_HOSTIF == WLAN_USB)
02403 
02404 /* USB Control Exchange (CTLX):
02405  *  A queue of the structure below is maintained for all of the
02406  *  Request/Response type USB packets supported by Prism2.
02407  */
02408 /* The following hfa384x_* structures are arguments to
02409  * the usercb() for the different CTLX types.
02410  */
02411 typedef hfa384x_cmdresult_t hfa384x_wridresult_t;
02412 typedef hfa384x_cmdresult_t hfa384x_wmemresult_t;
02413 
02414 typedef struct hfa384x_rridresult
02415 {
02416         uint16_t                rid;
02417         const void      *riddata;
02418         unsigned int            riddata_len;
02419 } hfa384x_rridresult_t;
02420 
02421 enum ctlx_state {
02422         CTLX_START = 0, /* Start state, not queued */
02423 
02424         CTLX_COMPLETE,  /* CTLX successfully completed */
02425         CTLX_REQ_FAILED,        /* OUT URB completed w/ error */
02426 
02427         CTLX_PENDING,           /* Queued, data valid */
02428         CTLX_REQ_SUBMITTED,     /* OUT URB submitted */
02429         CTLX_REQ_COMPLETE,      /* OUT URB complete */
02430         CTLX_RESP_COMPLETE      /* IN URB received */
02431 };
02432 typedef enum ctlx_state  CTLX_STATE;
02433 
02434 struct hfa384x_usbctlx;
02435 struct hfa384x;
02436 
02437 typedef void (*ctlx_cmdcb_t)( struct hfa384x*, const struct hfa384x_usbctlx* );
02438 
02439 typedef void (*ctlx_usercb_t)(
02440         struct hfa384x  *hw,
02441         void            *ctlxresult,
02442         void            *usercb_data);
02443 
02444 typedef struct hfa384x_usbctlx
02445 {
02446         struct list_head        list;
02447 
02448         size_t                  outbufsize;
02449         hfa384x_usbout_t        outbuf;         /* pkt buf for OUT */
02450         hfa384x_usbin_t         inbuf;          /* pkt buf for IN(a copy) */
02451 
02452         CTLX_STATE              state;          /* Tracks running state */
02453 
02454         struct completion       done;
02455         volatile int            reapable;       /* Food for the reaper task */
02456 
02457         ctlx_cmdcb_t            cmdcb;          /* Async command callback */
02458         ctlx_usercb_t           usercb;         /* Async user callback, */
02459         void                    *usercb_data;   /*  at CTLX completion  */
02460 
02461         int                     variant;        /* Identifies cmd variant */
02462 } hfa384x_usbctlx_t;
02463 
02464 typedef struct hfa384x_usbctlxq
02465 {
02466         spinlock_t              lock;
02467         struct list_head        pending;
02468         struct list_head        active;
02469         struct list_head        completing;
02470         struct list_head        reapable;
02471 } hfa384x_usbctlxq_t;
02472 #endif
02473 
02474 typedef struct hfa484x_metacmd
02475 {
02476         uint16_t                cmd;
02477 
02478         uint16_t          parm0;
02479         uint16_t          parm1;
02480         uint16_t          parm2;
02481 
02482 #if 0 //XXX cmd irq stuff
02483         uint16_t          bulkid;         /* what RID/FID to copy down. */
02484         int             bulklen;        /* how much to copy from BAP */
02485         char            *bulkdata;      /* And to where? */
02486 #endif
02487 
02488         hfa384x_cmdresult_t result;
02489 } hfa384x_metacmd_t;
02490 
02491 #define MAX_PRISM2_GRP_ADDR     16
02492 #define MAX_GRP_ADDR            32
02493 #define WLAN_COMMENT_MAX        80  /* Max. length of user comment string. */
02494 
02495 #define MM_SAT_PCF              (BIT14)
02496 #define MM_GCSD_PCF             (BIT15)
02497 #define MM_GCSD_PCF_EB          (BIT14 | BIT15)
02498 
02499 #define WLAN_STATE_STOPPED      0   /* Network is not active. */
02500 #define WLAN_STATE_STARTED      1   /* Network has been started. */
02501 
02502 #define WLAN_AUTH_MAX           60  /* Max. # of authenticated stations. */
02503 #define WLAN_ACCESS_MAX         60  /* Max. # of stations in an access list. */
02504 #define WLAN_ACCESS_NONE        0   /* No stations may be authenticated. */
02505 #define WLAN_ACCESS_ALL         1   /* All stations may be authenticated. */
02506 #define WLAN_ACCESS_ALLOW       2   /* Authenticate only "allowed" stations. */
02507 #define WLAN_ACCESS_DENY        3   /* Do not authenticate "denied" stations. */
02508 
02509 /* XXX These are going away ASAP */
02510 typedef struct prism2sta_authlist
02511 {
02512         unsigned int    cnt;
02513         uint8_t addr[WLAN_AUTH_MAX][WLAN_ADDR_LEN];
02514         uint8_t assoc[WLAN_AUTH_MAX];
02515 } prism2sta_authlist_t;
02516 
02517 typedef struct prism2sta_accesslist
02518 {
02519         unsigned int    modify;
02520         unsigned int    cnt;
02521         uint8_t addr[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
02522         unsigned int    cnt1;
02523         uint8_t addr1[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
02524 } prism2sta_accesslist_t;
02525 
02526 typedef struct hfa384x
02527 {
02528 #if (WLAN_HOSTIF != WLAN_USB)
02529         /* Resource config */
02530         uint32_t                        iobase;
02531         char                    __iomem *membase;
02532         uint32_t                        irq;
02533 #else
02534         /* USB support data */
02535         struct usb_device       *usb;
02536         struct urb              rx_urb;
02537         struct sk_buff          *rx_urb_skb;
02538         struct urb              tx_urb;
02539         struct urb              ctlx_urb;
02540         hfa384x_usbout_t        txbuff;
02541         hfa384x_usbctlxq_t      ctlxq;
02542         struct timer_list       reqtimer;
02543         struct timer_list       resptimer;
02544 
02545         struct timer_list       throttle;
02546 
02547         struct tasklet_struct   reaper_bh;
02548         struct tasklet_struct   completion_bh;
02549 
02550         struct work_struct      usb_work;
02551 
02552         unsigned long           usb_flags;
02553 #define THROTTLE_RX     0
02554 #define THROTTLE_TX     1
02555 #define WORK_RX_HALT    2
02556 #define WORK_TX_HALT    3
02557 #define WORK_RX_RESUME  4
02558 #define WORK_TX_RESUME  5
02559 
02560         unsigned short          req_timer_done:1;
02561         unsigned short          resp_timer_done:1;
02562 
02563         int                     endp_in;
02564         int                     endp_out;
02565 #endif /* !USB */
02566 
02567 #if (WLAN_HOSTIF == WLAN_PCMCIA)
02568 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)
02569         struct pcmcia_device *pdev;
02570 #else
02571         dev_link_t      *link;
02572 #endif
02573         dev_node_t      node;
02574 #endif
02575 
02576         int                     sniff_fcs;
02577         int                     sniff_channel;
02578         int                     sniff_truncate;
02579         int                     sniffhdr;
02580 
02581         wait_queue_head_t cmdq;         /* wait queue itself */
02582 
02583         /* Controller state */
02584         uint32_t                state;
02585         uint32_t                isap;
02586         uint8_t         port_enabled[HFA384x_NUMPORTS_MAX];
02587 #if (WLAN_HOSTIF != WLAN_USB)
02588         unsigned int            auxen;
02589         unsigned int            isram16;
02590 #endif /* !USB */
02591 
02592         /* Download support */
02593         unsigned int                            dlstate;
02594         hfa384x_downloadbuffer_t        bufinfo;
02595         uint16_t                                dltimeout;
02596 
02597 #if (WLAN_HOSTIF != WLAN_USB)
02598         spinlock_t      cmdlock;
02599         volatile int    cmdflag;        /* wait queue flag */
02600         hfa384x_metacmd_t *cmddata;      /* for our async callback */
02601 
02602         /* BAP support */
02603         spinlock_t      baplock;
02604         struct tasklet_struct   bap_tasklet;
02605 
02606         /* MAC buffer ids */
02607         uint16_t          txfid_head;
02608         uint16_t          txfid_tail;
02609         unsigned int            txfid_N;
02610         uint16_t          txfid_queue[HFA384x_DRVR_FIDSTACKLEN_MAX];
02611         uint16_t                        infofid;
02612         struct semaphore        infofid_sem;
02613 #endif /* !USB */
02614 
02615         int                          scanflag;    /* to signal scan comlete */
02616         int                          join_ap;        /* are we joined to a specific ap */
02617         int                          join_retries;   /* number of join retries till we fail */
02618         hfa384x_JoinRequest_data_t   joinreq;        /* join request saved data */
02619 
02620         wlandevice_t            *wlandev;
02621         /* Timer to allow for the deferred processing of linkstatus messages */
02622         struct work_struct      link_bh;
02623 
02624         struct work_struct      commsqual_bh;
02625         hfa384x_commsquality_t  qual;
02626         struct timer_list       commsqual_timer;
02627 
02628         uint16_t link_status;
02629         uint16_t link_status_new;
02630         struct sk_buff_head        authq;
02631 
02632         /* And here we have stuff that used to be in priv */
02633 
02634         /* State variables */
02635         unsigned int            presniff_port_type;
02636         uint16_t                presniff_wepflags;
02637         uint32_t                dot11_desired_bss_type;
02638         int             ap;     /* AP flag: 0 - Station, 1 - Access Point. */
02639 
02640         int             dbmadjust;
02641 
02642         /* Group Addresses - right now, there are up to a total
02643         of MAX_GRP_ADDR group addresses */
02644         uint8_t         dot11_grp_addr[MAX_GRP_ADDR][WLAN_ADDR_LEN];
02645         unsigned int            dot11_grpcnt;
02646 
02647         /* Component Identities */
02648         hfa384x_compident_t     ident_nic;
02649         hfa384x_compident_t     ident_pri_fw;
02650         hfa384x_compident_t     ident_sta_fw;
02651         hfa384x_compident_t     ident_ap_fw;
02652         uint16_t                        mm_mods;
02653 
02654         /* Supplier compatibility ranges */
02655         hfa384x_caplevel_t      cap_sup_mfi;
02656         hfa384x_caplevel_t      cap_sup_cfi;
02657         hfa384x_caplevel_t      cap_sup_pri;
02658         hfa384x_caplevel_t      cap_sup_sta;
02659         hfa384x_caplevel_t      cap_sup_ap;
02660 
02661         /* Actor compatibility ranges */
02662         hfa384x_caplevel_t      cap_act_pri_cfi; /* pri f/w to controller interface */
02663         hfa384x_caplevel_t      cap_act_sta_cfi; /* sta f/w to controller interface */
02664         hfa384x_caplevel_t      cap_act_sta_mfi; /* sta f/w to modem interface */
02665         hfa384x_caplevel_t      cap_act_ap_cfi;  /* ap f/w to controller interface */
02666         hfa384x_caplevel_t      cap_act_ap_mfi;  /* ap f/w to modem interface */
02667 
02668         uint32_t                        psusercount;  /* Power save user count. */
02669         hfa384x_CommTallies32_t tallies;      /* Communication tallies. */
02670         uint8_t                 comment[WLAN_COMMENT_MAX+1]; /* User comment */
02671 
02672         /* Channel Info request results (AP only) */
02673         struct {
02674                 atomic_t                done;
02675                 uint8_t                 count;
02676                 hfa384x_ChInfoResult_t  results;
02677         } channel_info;
02678 
02679         hfa384x_InfFrame_t      *scanresults;
02680 
02681 
02682         prism2sta_authlist_t    authlist;     /* Authenticated station list. */
02683         unsigned int                    accessmode;   /* Access mode. */
02684         prism2sta_accesslist_t  allow;        /* Allowed station list. */
02685         prism2sta_accesslist_t  deny;         /* Denied station list. */
02686 
02687 } hfa384x_t;
02688 
02689 /*=============================================================*/
02690 /*--- Function Declarations -----------------------------------*/
02691 /*=============================================================*/
02692 #if (WLAN_HOSTIF == WLAN_USB)
02693 void
02694 hfa384x_create(
02695         hfa384x_t *hw,
02696         struct usb_device *usb);
02697 #else
02698 void
02699 hfa384x_create(
02700         hfa384x_t *hw,
02701         unsigned int irq,
02702         uint32_t iobase,
02703         uint8_t __iomem *membase);
02704 #endif
02705 
02706 void hfa384x_destroy(hfa384x_t *hw);
02707 
02708 irqreturn_t
02709 hfa384x_INTerrupt(int irq, void *dev_id PT_REGS);
02710 int
02711 hfa384x_corereset( hfa384x_t *hw, int holdtime, int settletime, int genesis);
02712 int
02713 hfa384x_drvr_chinforesults( hfa384x_t *hw);
02714 int
02715 hfa384x_drvr_commtallies( hfa384x_t *hw);
02716 int
02717 hfa384x_drvr_disable(hfa384x_t *hw, uint16_t macport);
02718 int
02719 hfa384x_drvr_enable(hfa384x_t *hw, uint16_t macport);
02720 int
02721 hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
02722 int
02723 hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
02724 int
02725 hfa384x_drvr_flashdl_write(hfa384x_t *hw, uint32_t daddr, void* buf, uint32_t len);
02726 int
02727 hfa384x_drvr_getconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len);
02728 int
02729 hfa384x_drvr_handover( hfa384x_t *hw, uint8_t *addr);
02730 int
02731 hfa384x_drvr_hostscanresults( hfa384x_t *hw);
02732 int
02733 hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd);
02734 int
02735 hfa384x_drvr_mmi_read(hfa384x_t *hw, uint32_t address, uint32_t *result);
02736 int
02737 hfa384x_drvr_mmi_write(hfa384x_t *hw, uint32_t address, uint32_t data);
02738 int
02739 hfa384x_drvr_ramdl_enable(hfa384x_t *hw, uint32_t exeaddr);
02740 int
02741 hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
02742 int
02743 hfa384x_drvr_ramdl_write(hfa384x_t *hw, uint32_t daddr, void* buf, uint32_t len);
02744 int
02745 hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
02746 int
02747 hfa384x_drvr_scanresults( hfa384x_t *hw);
02748 
02749 int
02750 hfa384x_drvr_setconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len);
02751 
02752 static inline int
02753 hfa384x_drvr_getconfig16(hfa384x_t *hw, uint16_t rid, void *val)
02754 {
02755         int             result = 0;
02756         result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint16_t));
02757         if ( result == 0 ) {
02758                 *((uint16_t*)val) = hfa384x2host_16(*((uint16_t*)val));
02759         }
02760         return result;
02761 }
02762 
02763 static inline int
02764 hfa384x_drvr_getconfig32(hfa384x_t *hw, uint16_t rid, void *val)
02765 {
02766         int             result = 0;
02767 
02768         result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint32_t));
02769         if ( result == 0 ) {
02770                 *((uint32_t*)val) = hfa384x2host_32(*((uint32_t*)val));
02771         }
02772 
02773         return result;
02774 }
02775 
02776 static inline int
02777 hfa384x_drvr_setconfig16(hfa384x_t *hw, uint16_t rid, uint16_t val)
02778 {
02779         uint16_t value = host2hfa384x_16(val);
02780         return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
02781 }
02782 
02783 static inline int
02784 hfa384x_drvr_setconfig32(hfa384x_t *hw, uint16_t rid, uint32_t val)
02785 {
02786         uint32_t value = host2hfa384x_32(val);
02787         return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
02788 }
02789 
02790 #if (WLAN_HOSTIF == WLAN_USB)
02791 int
02792 hfa384x_drvr_getconfig_async(hfa384x_t     *hw,
02793                               uint16_t        rid,
02794                               ctlx_usercb_t usercb,
02795                               void          *usercb_data);
02796 
02797 int
02798 hfa384x_drvr_setconfig_async(hfa384x_t *hw,
02799                               uint16_t rid,
02800                               void *buf,
02801                               uint16_t len,
02802                               ctlx_usercb_t usercb,
02803                               void *usercb_data);
02804 #else
02805 static inline int
02806 hfa384x_drvr_setconfig_async(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len,
02807                              void *ptr1, void *ptr2)
02808 {
02809          (void)ptr1;
02810          (void)ptr2;
02811          return hfa384x_drvr_setconfig(hw, rid, buf, len);
02812 }
02813 #endif
02814 
02815 static inline int
02816 hfa384x_drvr_setconfig16_async(hfa384x_t *hw, uint16_t rid, uint16_t val)
02817 {
02818         uint16_t value = host2hfa384x_16(val);
02819         return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
02820                                             NULL , NULL);
02821 }
02822 
02823 static inline int
02824 hfa384x_drvr_setconfig32_async(hfa384x_t *hw, uint16_t rid, uint32_t val)
02825 {
02826         uint32_t value = host2hfa384x_32(val);
02827         return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
02828                                             NULL , NULL);
02829 }
02830 
02831 
02832 int
02833 hfa384x_drvr_start(hfa384x_t *hw);
02834 int
02835 hfa384x_drvr_stop(hfa384x_t *hw);
02836 int
02837 hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
02838 void
02839 hfa384x_tx_timeout(wlandevice_t *wlandev);
02840 
02841 int
02842 hfa384x_cmd_initialize(hfa384x_t *hw);
02843 int
02844 hfa384x_cmd_enable(hfa384x_t *hw, uint16_t macport);
02845 int
02846 hfa384x_cmd_disable(hfa384x_t *hw, uint16_t macport);
02847 int
02848 hfa384x_cmd_diagnose(hfa384x_t *hw);
02849 int
02850 hfa384x_cmd_allocate(hfa384x_t *hw, uint16_t len);
02851 int
02852 hfa384x_cmd_transmit(hfa384x_t *hw, uint16_t reclaim, uint16_t qos, uint16_t fid);
02853 int
02854 hfa384x_cmd_clearpersist(hfa384x_t *hw, uint16_t fid);
02855 int
02856 hfa384x_cmd_notify(hfa384x_t *hw, uint16_t reclaim, uint16_t fid, void *buf, uint16_t len);
02857 int
02858 hfa384x_cmd_inquire(hfa384x_t *hw, uint16_t fid);
02859 int
02860 hfa384x_cmd_access(hfa384x_t *hw, uint16_t write, uint16_t rid, void *buf, uint16_t len);
02861 int
02862 hfa384x_cmd_monitor(hfa384x_t *hw, uint16_t enable);
02863 int
02864 hfa384x_cmd_download(
02865         hfa384x_t *hw,
02866         uint16_t mode,
02867         uint16_t lowaddr,
02868         uint16_t highaddr,
02869         uint16_t codelen);
02870 int
02871 hfa384x_cmd_aux_enable(hfa384x_t *hw, int force);
02872 int
02873 hfa384x_cmd_aux_disable(hfa384x_t *hw);
02874 int
02875 hfa384x_copy_from_bap(
02876         hfa384x_t *hw,
02877         uint16_t        bap,
02878         uint16_t        id,
02879         uint16_t        offset,
02880         void    *buf,
02881         unsigned int    len);
02882 int
02883 hfa384x_copy_to_bap(
02884         hfa384x_t *hw,
02885         uint16_t        bap,
02886         uint16_t        id,
02887         uint16_t        offset,
02888         void    *buf,
02889         unsigned int    len);
02890 void
02891 hfa384x_copy_from_aux(
02892         hfa384x_t *hw,
02893         uint32_t        cardaddr,
02894         uint32_t        auxctl,
02895         void    *buf,
02896         unsigned int    len);
02897 void
02898 hfa384x_copy_to_aux(
02899         hfa384x_t *hw,
02900         uint32_t        cardaddr,
02901         uint32_t        auxctl,
02902         void    *buf,
02903         unsigned int    len);
02904 
02905 #if (WLAN_HOSTIF != WLAN_USB)
02906 
02907 /*
02908    HFA384x is a LITTLE ENDIAN part.
02909 
02910    the get/setreg functions implicitly byte-swap the data to LE.
02911    the _noswap variants do not perform a byte-swap on the data.
02912 */
02913 
02914 static inline uint16_t
02915 __hfa384x_getreg(hfa384x_t *hw, unsigned int reg);
02916 
02917 static inline void
02918 __hfa384x_setreg(hfa384x_t *hw, uint16_t val, unsigned int reg);
02919 
02920 static inline uint16_t
02921 __hfa384x_getreg_noswap(hfa384x_t *hw, unsigned int reg);
02922 
02923 static inline void
02924 __hfa384x_setreg_noswap(hfa384x_t *hw, uint16_t val, unsigned int reg);
02925 
02926 #ifdef REVERSE_ENDIAN
02927 #define hfa384x_getreg __hfa384x_getreg_noswap
02928 #define hfa384x_setreg __hfa384x_setreg_noswap
02929 #define hfa384x_getreg_noswap __hfa384x_getreg
02930 #define hfa384x_setreg_noswap __hfa384x_setreg
02931 #else
02932 #define hfa384x_getreg __hfa384x_getreg
02933 #define hfa384x_setreg __hfa384x_setreg
02934 #define hfa384x_getreg_noswap __hfa384x_getreg_noswap
02935 #define hfa384x_setreg_noswap __hfa384x_setreg_noswap
02936 #endif
02937 
02938 /*----------------------------------------------------------------
02939 * hfa384x_getreg
02940 *
02941 * Retrieve the value of one of the MAC registers.  Done here
02942 * because different PRISM2 MAC parts use different buses and such.
02943 * NOTE: This function returns the value in HOST ORDER!!!!!!
02944 *
02945 * Arguments:
02946 *       hw         MAC part structure
02947 *       reg        Register identifier (offset for I/O based i/f)
02948 *
02949 * Returns:
02950 *       Value from the register in HOST ORDER!!!!
02951 ----------------------------------------------------------------*/
02952 static inline uint16_t
02953 __hfa384x_getreg(hfa384x_t *hw, unsigned int reg)
02954 {
02955 /*      printk(KERN_DEBUG "Reading from 0x%0x\n", hw->membase + reg); */
02956 #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
02957         return wlan_inw_le16_to_cpu(hw->iobase+reg);
02958 #elif (WLAN_HOSTIF == WLAN_PCI)
02959         return __le16_to_cpu(readw(hw->membase + reg));
02960 #endif
02961 }
02962 
02963 /*----------------------------------------------------------------
02964 * hfa384x_setreg
02965 *
02966 * Set the value of one of the MAC registers.  Done here
02967 * because different PRISM2 MAC parts use different buses and such.
02968 * NOTE: This function assumes the value is in HOST ORDER!!!!!!
02969 *
02970 * Arguments:
02971 *       hw      MAC part structure
02972 *       val     Value, in HOST ORDER!!, to put in the register
02973 *       reg     Register identifier (offset for I/O based i/f)
02974 *
02975 * Returns:
02976 *       Nothing
02977 ----------------------------------------------------------------*/
02978 static inline void
02979 __hfa384x_setreg(hfa384x_t *hw, uint16_t val, unsigned int reg)
02980 {
02981 #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
02982         wlan_outw_cpu_to_le16( val, hw->iobase + reg);
02983         return;
02984 #elif (WLAN_HOSTIF == WLAN_PCI)
02985         writew(__cpu_to_le16(val), hw->membase + reg);
02986         return;
02987 #endif
02988 }
02989 
02990 
02991 /*----------------------------------------------------------------
02992 * hfa384x_getreg_noswap
02993 *
02994 * Retrieve the value of one of the MAC registers.  Done here
02995 * because different PRISM2 MAC parts use different buses and such.
02996 *
02997 * Arguments:
02998 *       hw         MAC part structure
02999 *       reg        Register identifier (offset for I/O based i/f)
03000 *
03001 * Returns:
03002 *       Value from the register.
03003 ----------------------------------------------------------------*/
03004 static inline uint16_t
03005 __hfa384x_getreg_noswap(hfa384x_t *hw, unsigned int reg)
03006 {
03007 #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
03008         return wlan_inw(hw->iobase+reg);
03009 #elif (WLAN_HOSTIF == WLAN_PCI)
03010         return readw(hw->membase + reg);
03011 #endif
03012 }
03013 
03014 
03015 /*----------------------------------------------------------------
03016 * hfa384x_setreg_noswap
03017 *
03018 * Set the value of one of the MAC registers.  Done here
03019 * because different PRISM2 MAC parts use different buses and such.
03020 *
03021 * Arguments:
03022 *       hw      MAC part structure
03023 *       val     Value to put in the register
03024 *       reg     Register identifier (offset for I/O based i/f)
03025 *
03026 * Returns:
03027 *       Nothing
03028 ----------------------------------------------------------------*/
03029 static inline void
03030 __hfa384x_setreg_noswap(hfa384x_t *hw, uint16_t val, unsigned int reg)
03031 {
03032 #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
03033         wlan_outw( val, hw->iobase + reg);
03034         return;
03035 #elif (WLAN_HOSTIF == WLAN_PCI)
03036         writew(val, hw->membase + reg);
03037         return;
03038 #endif
03039 }
03040 
03041 
03042 static inline void hfa384x_events_all(hfa384x_t *hw)
03043 {
03044         hfa384x_setreg(hw,
03045                        HFA384x_INT_NORMAL
03046 #ifdef CMD_IRQ
03047                        | HFA384x_INTEN_CMD_SET(1)
03048 #endif
03049                        ,
03050                        HFA384x_INTEN);
03051 
03052 }
03053 
03054 static inline void hfa384x_events_nobap(hfa384x_t *hw)
03055 {
03056         hfa384x_setreg(hw,
03057                         (HFA384x_INT_NORMAL & ~HFA384x_INT_BAP_OP)
03058 #ifdef CMD_IRQ
03059                        | HFA384x_INTEN_CMD_SET(1)
03060 #endif
03061                        ,
03062                        HFA384x_INTEN);
03063 
03064 }
03065 
03066 #endif /* WLAN_HOSTIF != WLAN_USB */
03067 #endif /* __KERNEL__ */
03068 
03069 #endif  /* _HFA384x_H */