You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hfa384x.h 104KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069
  1. /* src/prism2/include/prism2/hfa384x.h
  2. *
  3. * Defines the constants and data structures for the hfa384x
  4. *
  5. * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
  6. * --------------------------------------------------------------------
  7. *
  8. * linux-wlan
  9. *
  10. * The contents of this file are subject to the Mozilla Public
  11. * License Version 1.1 (the "License"); you may not use this file
  12. * except in compliance with the License. You may obtain a copy of
  13. * the License at http://www.mozilla.org/MPL/
  14. *
  15. * Software distributed under the License is distributed on an "AS
  16. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  17. * implied. See the License for the specific language governing
  18. * rights and limitations under the License.
  19. *
  20. * Alternatively, the contents of this file may be used under the
  21. * terms of the GNU Public License version 2 (the "GPL"), in which
  22. * case the provisions of the GPL are applicable instead of the
  23. * above. If you wish to allow the use of your version of this file
  24. * only under the terms of the GPL and not to allow others to use
  25. * your version of this file under the MPL, indicate your decision
  26. * by deleting the provisions above and replace them with the notice
  27. * and other provisions required by the GPL. If you do not delete
  28. * the provisions above, a recipient may use your version of this
  29. * file under either the MPL or the GPL.
  30. *
  31. * --------------------------------------------------------------------
  32. *
  33. * Inquiries regarding the linux-wlan Open Source project can be
  34. * made directly to:
  35. *
  36. * AbsoluteValue Systems Inc.
  37. * info@linux-wlan.com
  38. * http://www.linux-wlan.com
  39. *
  40. * --------------------------------------------------------------------
  41. *
  42. * Portions of the development of this software were funded by
  43. * Intersil Corporation as part of PRISM(R) chipset product development.
  44. *
  45. * --------------------------------------------------------------------
  46. *
  47. * [Implementation and usage notes]
  48. *
  49. * [References]
  50. * CW10 Programmer's Manual v1.5
  51. * IEEE 802.11 D10.0
  52. *
  53. * --------------------------------------------------------------------
  54. */
  55. FILE_LICENCE ( GPL2_ONLY );
  56. #ifndef _HFA384x_H
  57. #define _HFA384x_H
  58. /*=============================================================*/
  59. #define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
  60. #define HFA384x_LEVEL_TO_dBm(v) (0x100 + (v) * 100 / 255 - 100)
  61. /*------ Constants --------------------------------------------*/
  62. /*--- Mins & Maxs -----------------------------------*/
  63. #define HFA384x_CMD_ALLOC_LEN_MIN ((UINT16)4)
  64. #define HFA384x_CMD_ALLOC_LEN_MAX ((UINT16)2400)
  65. #define HFA384x_BAP_DATALEN_MAX ((UINT16)4096)
  66. #define HFA384x_BAP_OFFSET_MAX ((UINT16)4096)
  67. #define HFA384x_PORTID_MAX ((UINT16)7)
  68. #define HFA384x_NUMPORTS_MAX ((UINT16)(HFA384x_PORTID_MAX+1))
  69. #define HFA384x_PDR_LEN_MAX ((UINT16)512) /* in bytes, from EK */
  70. #define HFA384x_PDA_RECS_MAX ((UINT16)200) /* a guess */
  71. #define HFA384x_PDA_LEN_MAX ((UINT16)1024) /* in bytes, from EK */
  72. #define HFA384x_SCANRESULT_MAX ((UINT16)31)
  73. #define HFA384x_HSCANRESULT_MAX ((UINT16)31)
  74. #define HFA384x_CHINFORESULT_MAX ((UINT16)16)
  75. #define HFA384x_DRVR_FIDSTACKLEN_MAX (10)
  76. #define HFA384x_DRVR_TXBUF_MAX (sizeof(hfa384x_tx_frame_t) + \
  77. WLAN_DATA_MAXLEN - \
  78. WLAN_WEP_IV_LEN - \
  79. WLAN_WEP_ICV_LEN + 2)
  80. #define HFA384x_DRVR_MAGIC (0x4a2d)
  81. #define HFA384x_INFODATA_MAXLEN (sizeof(hfa384x_infodata_t))
  82. #define HFA384x_INFOFRM_MAXLEN (sizeof(hfa384x_InfFrame_t))
  83. #define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */
  84. #define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN
  85. #define HFA384x_USB_RWMEM_MAXLEN 2048
  86. /*--- Support Constants -----------------------------*/
  87. #define HFA384x_BAP_PROC ((UINT16)0)
  88. #define HFA384x_BAP_INT ((UINT16)1)
  89. #define HFA384x_PORTTYPE_IBSS ((UINT16)0)
  90. #define HFA384x_PORTTYPE_BSS ((UINT16)1)
  91. #define HFA384x_PORTTYPE_WDS ((UINT16)2)
  92. #define HFA384x_PORTTYPE_PSUEDOIBSS ((UINT16)3)
  93. #define HFA384x_PORTTYPE_HOSTAP ((UINT16)6)
  94. #define HFA384x_WEPFLAGS_PRIVINVOKED ((UINT16)BIT0)
  95. #define HFA384x_WEPFLAGS_EXCLUDE ((UINT16)BIT1)
  96. #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((UINT16)BIT4)
  97. #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((UINT16)BIT7)
  98. #define HFA384x_WEPFLAGS_DISALLOW_MIXED ((UINT16)BIT11)
  99. #define HFA384x_WEPFLAGS_IV_INTERVAL1 ((UINT16)0)
  100. #define HFA384x_WEPFLAGS_IV_INTERVAL10 ((UINT16)BIT5)
  101. #define HFA384x_WEPFLAGS_IV_INTERVAL50 ((UINT16)BIT6)
  102. #define HFA384x_WEPFLAGS_IV_INTERVAL100 ((UINT16)(BIT5 | BIT6))
  103. #define HFA384x_WEPFLAGS_FIRMWARE_WPA ((UINT16)BIT8)
  104. #define HFA384x_WEPFLAGS_HOST_MIC ((UINT16)BIT9)
  105. #define HFA384x_ROAMMODE_FWSCAN_FWROAM ((UINT16)1)
  106. #define HFA384x_ROAMMODE_FWSCAN_HOSTROAM ((UINT16)2)
  107. #define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((UINT16)3)
  108. #define HFA384x_PORTSTATUS_DISABLED ((UINT16)1)
  109. #define HFA384x_PORTSTATUS_INITSRCH ((UINT16)2)
  110. #define HFA384x_PORTSTATUS_CONN_IBSS ((UINT16)3)
  111. #define HFA384x_PORTSTATUS_CONN_ESS ((UINT16)4)
  112. #define HFA384x_PORTSTATUS_OOR_ESS ((UINT16)5)
  113. #define HFA384x_PORTSTATUS_CONN_WDS ((UINT16)6)
  114. #define HFA384x_PORTSTATUS_HOSTAP ((UINT16)8)
  115. #define HFA384x_RATEBIT_1 ((UINT16)1)
  116. #define HFA384x_RATEBIT_2 ((UINT16)2)
  117. #define HFA384x_RATEBIT_5dot5 ((UINT16)4)
  118. #define HFA384x_RATEBIT_11 ((UINT16)8)
  119. /*--- Just some symbolic names for legibility -------*/
  120. #define HFA384x_TXCMD_NORECL ((UINT16)0)
  121. #define HFA384x_TXCMD_RECL ((UINT16)1)
  122. /*--- MAC Internal memory constants and macros ------*/
  123. /* masks and macros used to manipulate MAC internal memory addresses. */
  124. /* MAC internal memory addresses are 23 bit quantities. The MAC uses
  125. * a paged address space where the upper 16 bits are the page number
  126. * and the lower 7 bits are the offset. There are various Host API
  127. * elements that require two 16-bit quantities to specify a MAC
  128. * internal memory address. Unfortunately, some of the API's use a
  129. * page/offset format where the offset value is JUST the lower seven
  130. * bits and the page is the remaining 16 bits. Some of the API's
  131. * assume that the 23 bit address has been split at the 16th bit. We
  132. * refer to these two formats as AUX format and CMD format. The
  133. * macros below help handle some of this.
  134. */
  135. /* Handy constant */
  136. #define HFA384x_ADDR_AUX_OFF_MAX ((UINT16)0x007f)
  137. /* Mask bits for discarding unwanted pieces in a flat address */
  138. #define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80)
  139. #define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f)
  140. #define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000)
  141. #define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff)
  142. /* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */
  143. #define HFA384x_ADDR_AUX_PAGE_MASK (0xffff)
  144. #define HFA384x_ADDR_AUX_OFF_MASK (0x007f)
  145. /* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */
  146. #define HFA384x_ADDR_CMD_PAGE_MASK (0x007f)
  147. #define HFA384x_ADDR_CMD_OFF_MASK (0xffff)
  148. /* Make a 32-bit flat address from AUX format 16-bit page and offset */
  149. #define HFA384x_ADDR_AUX_MKFLAT(p,o) \
  150. (((UINT32)(((UINT16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \
  151. ((UINT32)(((UINT16)(o))&HFA384x_ADDR_AUX_OFF_MASK))
  152. /* Make a 32-bit flat address from CMD format 16-bit page and offset */
  153. #define HFA384x_ADDR_CMD_MKFLAT(p,o) \
  154. (((UINT32)(((UINT16)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \
  155. ((UINT32)(((UINT16)(o))&HFA384x_ADDR_CMD_OFF_MASK))
  156. /* Make AUX format offset and page from a 32-bit flat address */
  157. #define HFA384x_ADDR_AUX_MKPAGE(f) \
  158. ((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7))
  159. #define HFA384x_ADDR_AUX_MKOFF(f) \
  160. ((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_OFF_MASK))
  161. /* Make CMD format offset and page from a 32-bit flat address */
  162. #define HFA384x_ADDR_CMD_MKPAGE(f) \
  163. ((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))
  164. #define HFA384x_ADDR_CMD_MKOFF(f) \
  165. ((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))
  166. /*--- Aux register masks/tests ----------------------*/
  167. /* Some of the upper bits of the AUX offset register are used to */
  168. /* select address space. */
  169. #define HFA384x_AUX_CTL_EXTDS (0x00)
  170. #define HFA384x_AUX_CTL_NV (0x01)
  171. #define HFA384x_AUX_CTL_PHY (0x02)
  172. #define HFA384x_AUX_CTL_ICSRAM (0x03)
  173. /* Make AUX register offset and page values from a flat address */
  174. #define HFA384x_AUX_MKOFF(f, c) \
  175. (HFA384x_ADDR_AUX_MKOFF(f) | (((UINT16)(c))<<12))
  176. #define HFA384x_AUX_MKPAGE(f) HFA384x_ADDR_AUX_MKPAGE(f)
  177. /*--- Controller Memory addresses -------------------*/
  178. #define HFA3842_PDA_BASE (0x007f0000UL)
  179. #define HFA3841_PDA_BASE (0x003f0000UL)
  180. #define HFA3841_PDA_BOGUS_BASE (0x00390000UL)
  181. /*--- Driver Download states -----------------------*/
  182. #define HFA384x_DLSTATE_DISABLED 0
  183. #define HFA384x_DLSTATE_RAMENABLED 1
  184. #define HFA384x_DLSTATE_FLASHENABLED 2
  185. #define HFA384x_DLSTATE_FLASHWRITTEN 3
  186. #define HFA384x_DLSTATE_FLASHWRITEPENDING 4
  187. #define HFA384x_DLSTATE_GENESIS 5
  188. /*--- Register I/O offsets --------------------------*/
  189. #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
  190. #define HFA384x_CMD_OFF (0x00)
  191. #define HFA384x_PARAM0_OFF (0x02)
  192. #define HFA384x_PARAM1_OFF (0x04)
  193. #define HFA384x_PARAM2_OFF (0x06)
  194. #define HFA384x_STATUS_OFF (0x08)
  195. #define HFA384x_RESP0_OFF (0x0A)
  196. #define HFA384x_RESP1_OFF (0x0C)
  197. #define HFA384x_RESP2_OFF (0x0E)
  198. #define HFA384x_INFOFID_OFF (0x10)
  199. #define HFA384x_RXFID_OFF (0x20)
  200. #define HFA384x_ALLOCFID_OFF (0x22)
  201. #define HFA384x_TXCOMPLFID_OFF (0x24)
  202. #define HFA384x_SELECT0_OFF (0x18)
  203. #define HFA384x_OFFSET0_OFF (0x1C)
  204. #define HFA384x_DATA0_OFF (0x36)
  205. #define HFA384x_SELECT1_OFF (0x1A)
  206. #define HFA384x_OFFSET1_OFF (0x1E)
  207. #define HFA384x_DATA1_OFF (0x38)
  208. #define HFA384x_EVSTAT_OFF (0x30)
  209. #define HFA384x_INTEN_OFF (0x32)
  210. #define HFA384x_EVACK_OFF (0x34)
  211. #define HFA384x_CONTROL_OFF (0x14)
  212. #define HFA384x_SWSUPPORT0_OFF (0x28)
  213. #define HFA384x_SWSUPPORT1_OFF (0x2A)
  214. #define HFA384x_SWSUPPORT2_OFF (0x2C)
  215. #define HFA384x_AUXPAGE_OFF (0x3A)
  216. #define HFA384x_AUXOFFSET_OFF (0x3C)
  217. #define HFA384x_AUXDATA_OFF (0x3E)
  218. #elif (WLAN_HOSTIF == WLAN_PCI || WLAN_HOSTIF == WLAN_USB)
  219. #define HFA384x_CMD_OFF (0x00)
  220. #define HFA384x_PARAM0_OFF (0x04)
  221. #define HFA384x_PARAM1_OFF (0x08)
  222. #define HFA384x_PARAM2_OFF (0x0c)
  223. #define HFA384x_STATUS_OFF (0x10)
  224. #define HFA384x_RESP0_OFF (0x14)
  225. #define HFA384x_RESP1_OFF (0x18)
  226. #define HFA384x_RESP2_OFF (0x1c)
  227. #define HFA384x_INFOFID_OFF (0x20)
  228. #define HFA384x_RXFID_OFF (0x40)
  229. #define HFA384x_ALLOCFID_OFF (0x44)
  230. #define HFA384x_TXCOMPLFID_OFF (0x48)
  231. #define HFA384x_SELECT0_OFF (0x30)
  232. #define HFA384x_OFFSET0_OFF (0x38)
  233. #define HFA384x_DATA0_OFF (0x6c)
  234. #define HFA384x_SELECT1_OFF (0x34)
  235. #define HFA384x_OFFSET1_OFF (0x3c)
  236. #define HFA384x_DATA1_OFF (0x70)
  237. #define HFA384x_EVSTAT_OFF (0x60)
  238. #define HFA384x_INTEN_OFF (0x64)
  239. #define HFA384x_EVACK_OFF (0x68)
  240. #define HFA384x_CONTROL_OFF (0x28)
  241. #define HFA384x_SWSUPPORT0_OFF (0x50)
  242. #define HFA384x_SWSUPPORT1_OFF (0x54)
  243. #define HFA384x_SWSUPPORT2_OFF (0x58)
  244. #define HFA384x_AUXPAGE_OFF (0x74)
  245. #define HFA384x_AUXOFFSET_OFF (0x78)
  246. #define HFA384x_AUXDATA_OFF (0x7c)
  247. #define HFA384x_PCICOR_OFF (0x4c)
  248. #define HFA384x_PCIHCR_OFF (0x5c)
  249. #define HFA384x_PCI_M0_ADDRH_OFF (0x80)
  250. #define HFA384x_PCI_M0_ADDRL_OFF (0x84)
  251. #define HFA384x_PCI_M0_LEN_OFF (0x88)
  252. #define HFA384x_PCI_M0_CTL_OFF (0x8c)
  253. #define HFA384x_PCI_STATUS_OFF (0x98)
  254. #define HFA384x_PCI_M1_ADDRH_OFF (0xa0)
  255. #define HFA384x_PCI_M1_ADDRL_OFF (0xa4)
  256. #define HFA384x_PCI_M1_LEN_OFF (0xa8)
  257. #define HFA384x_PCI_M1_CTL_OFF (0xac)
  258. #endif
  259. /*--- Register Field Masks --------------------------*/
  260. #define HFA384x_CMD_BUSY ((UINT16)BIT15)
  261. #define HFA384x_CMD_AINFO ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
  262. #define HFA384x_CMD_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8))
  263. #define HFA384x_CMD_RECL ((UINT16)BIT8)
  264. #define HFA384x_CMD_WRITE ((UINT16)BIT8)
  265. #define HFA384x_CMD_PROGMODE ((UINT16)(BIT9 | BIT8))
  266. #define HFA384x_CMD_CMDCODE ((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
  267. #define HFA384x_STATUS_RESULT ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
  268. #define HFA384x_STATUS_CMDCODE ((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
  269. #define HFA384x_OFFSET_BUSY ((UINT16)BIT15)
  270. #define HFA384x_OFFSET_ERR ((UINT16)BIT14)
  271. #define HFA384x_OFFSET_DATAOFF ((UINT16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))
  272. #define HFA384x_EVSTAT_TICK ((UINT16)BIT15)
  273. #define HFA384x_EVSTAT_WTERR ((UINT16)BIT14)
  274. #define HFA384x_EVSTAT_INFDROP ((UINT16)BIT13)
  275. #define HFA384x_EVSTAT_INFO ((UINT16)BIT7)
  276. #define HFA384x_EVSTAT_DTIM ((UINT16)BIT5)
  277. #define HFA384x_EVSTAT_CMD ((UINT16)BIT4)
  278. #define HFA384x_EVSTAT_ALLOC ((UINT16)BIT3)
  279. #define HFA384x_EVSTAT_TXEXC ((UINT16)BIT2)
  280. #define HFA384x_EVSTAT_TX ((UINT16)BIT1)
  281. #define HFA384x_EVSTAT_RX ((UINT16)BIT0)
  282. #define HFA384x_INT_BAP_OP (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC)
  283. #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)
  284. #define HFA384x_INTEN_TICK ((UINT16)BIT15)
  285. #define HFA384x_INTEN_WTERR ((UINT16)BIT14)
  286. #define HFA384x_INTEN_INFDROP ((UINT16)BIT13)
  287. #define HFA384x_INTEN_INFO ((UINT16)BIT7)
  288. #define HFA384x_INTEN_DTIM ((UINT16)BIT5)
  289. #define HFA384x_INTEN_CMD ((UINT16)BIT4)
  290. #define HFA384x_INTEN_ALLOC ((UINT16)BIT3)
  291. #define HFA384x_INTEN_TXEXC ((UINT16)BIT2)
  292. #define HFA384x_INTEN_TX ((UINT16)BIT1)
  293. #define HFA384x_INTEN_RX ((UINT16)BIT0)
  294. #define HFA384x_EVACK_TICK ((UINT16)BIT15)
  295. #define HFA384x_EVACK_WTERR ((UINT16)BIT14)
  296. #define HFA384x_EVACK_INFDROP ((UINT16)BIT13)
  297. #define HFA384x_EVACK_INFO ((UINT16)BIT7)
  298. #define HFA384x_EVACK_DTIM ((UINT16)BIT5)
  299. #define HFA384x_EVACK_CMD ((UINT16)BIT4)
  300. #define HFA384x_EVACK_ALLOC ((UINT16)BIT3)
  301. #define HFA384x_EVACK_TXEXC ((UINT16)BIT2)
  302. #define HFA384x_EVACK_TX ((UINT16)BIT1)
  303. #define HFA384x_EVACK_RX ((UINT16)BIT0)
  304. #define HFA384x_CONTROL_AUXEN ((UINT16)(BIT15 | BIT14))
  305. /*--- Command Code Constants --------------------------*/
  306. /*--- Controller Commands --------------------------*/
  307. #define HFA384x_CMDCODE_INIT ((UINT16)0x00)
  308. #define HFA384x_CMDCODE_ENABLE ((UINT16)0x01)
  309. #define HFA384x_CMDCODE_DISABLE ((UINT16)0x02)
  310. #define HFA384x_CMDCODE_DIAG ((UINT16)0x03)
  311. /*--- Buffer Mgmt Commands --------------------------*/
  312. #define HFA384x_CMDCODE_ALLOC ((UINT16)0x0A)
  313. #define HFA384x_CMDCODE_TX ((UINT16)0x0B)
  314. #define HFA384x_CMDCODE_CLRPRST ((UINT16)0x12)
  315. /*--- Regulate Commands --------------------------*/
  316. #define HFA384x_CMDCODE_NOTIFY ((UINT16)0x10)
  317. #define HFA384x_CMDCODE_INQ ((UINT16)0x11)
  318. /*--- Configure Commands --------------------------*/
  319. #define HFA384x_CMDCODE_ACCESS ((UINT16)0x21)
  320. #define HFA384x_CMDCODE_DOWNLD ((UINT16)0x22)
  321. /*--- Debugging Commands -----------------------------*/
  322. #define HFA384x_CMDCODE_MONITOR ((UINT16)(0x38))
  323. #define HFA384x_MONITOR_ENABLE ((UINT16)(0x0b))
  324. #define HFA384x_MONITOR_DISABLE ((UINT16)(0x0f))
  325. /*--- Result Codes --------------------------*/
  326. #define HFA384x_SUCCESS ((UINT16)(0x00))
  327. #define HFA384x_CARD_FAIL ((UINT16)(0x01))
  328. #define HFA384x_NO_BUFF ((UINT16)(0x05))
  329. #define HFA384x_CMD_ERR ((UINT16)(0x7F))
  330. /*--- Programming Modes --------------------------
  331. MODE 0: Disable programming
  332. MODE 1: Enable volatile memory programming
  333. MODE 2: Enable non-volatile memory programming
  334. MODE 3: Program non-volatile memory section
  335. --------------------------------------------------*/
  336. #define HFA384x_PROGMODE_DISABLE ((UINT16)0x00)
  337. #define HFA384x_PROGMODE_RAM ((UINT16)0x01)
  338. #define HFA384x_PROGMODE_NV ((UINT16)0x02)
  339. #define HFA384x_PROGMODE_NVWRITE ((UINT16)0x03)
  340. /*--- AUX register enable --------------------------*/
  341. #define HFA384x_AUXPW0 ((UINT16)0xfe01)
  342. #define HFA384x_AUXPW1 ((UINT16)0xdc23)
  343. #define HFA384x_AUXPW2 ((UINT16)0xba45)
  344. #define HFA384x_CONTROL_AUX_ISDISABLED ((UINT16)0x0000)
  345. #define HFA384x_CONTROL_AUX_ISENABLED ((UINT16)0xc000)
  346. #define HFA384x_CONTROL_AUX_DOENABLE ((UINT16)0x8000)
  347. #define HFA384x_CONTROL_AUX_DODISABLE ((UINT16)0x4000)
  348. /*--- Record ID Constants --------------------------*/
  349. /*--------------------------------------------------------------------
  350. Configuration RIDs: Network Parameters, Static Configuration Entities
  351. --------------------------------------------------------------------*/
  352. #define HFA384x_RID_CNFPORTTYPE ((UINT16)0xFC00)
  353. #define HFA384x_RID_CNFOWNMACADDR ((UINT16)0xFC01)
  354. #define HFA384x_RID_CNFDESIREDSSID ((UINT16)0xFC02)
  355. #define HFA384x_RID_CNFOWNCHANNEL ((UINT16)0xFC03)
  356. #define HFA384x_RID_CNFOWNSSID ((UINT16)0xFC04)
  357. #define HFA384x_RID_CNFOWNATIMWIN ((UINT16)0xFC05)
  358. #define HFA384x_RID_CNFSYSSCALE ((UINT16)0xFC06)
  359. #define HFA384x_RID_CNFMAXDATALEN ((UINT16)0xFC07)
  360. #define HFA384x_RID_CNFWDSADDR ((UINT16)0xFC08)
  361. #define HFA384x_RID_CNFPMENABLED ((UINT16)0xFC09)
  362. #define HFA384x_RID_CNFPMEPS ((UINT16)0xFC0A)
  363. #define HFA384x_RID_CNFMULTICASTRX ((UINT16)0xFC0B)
  364. #define HFA384x_RID_CNFMAXSLEEPDUR ((UINT16)0xFC0C)
  365. #define HFA384x_RID_CNFPMHOLDDUR ((UINT16)0xFC0D)
  366. #define HFA384x_RID_CNFOWNNAME ((UINT16)0xFC0E)
  367. #define HFA384x_RID_CNFOWNDTIMPER ((UINT16)0xFC10)
  368. #define HFA384x_RID_CNFWDSADDR1 ((UINT16)0xFC11)
  369. #define HFA384x_RID_CNFWDSADDR2 ((UINT16)0xFC12)
  370. #define HFA384x_RID_CNFWDSADDR3 ((UINT16)0xFC13)
  371. #define HFA384x_RID_CNFWDSADDR4 ((UINT16)0xFC14)
  372. #define HFA384x_RID_CNFWDSADDR5 ((UINT16)0xFC15)
  373. #define HFA384x_RID_CNFWDSADDR6 ((UINT16)0xFC16)
  374. #define HFA384x_RID_CNFMCASTPMBUFF ((UINT16)0xFC17)
  375. /*--------------------------------------------------------------------
  376. Configuration RID lengths: Network Params, Static Config Entities
  377. This is the length of JUST the DATA part of the RID (does not
  378. include the len or code fields)
  379. --------------------------------------------------------------------*/
  380. /* TODO: fill in the rest of these */
  381. #define HFA384x_RID_CNFPORTTYPE_LEN ((UINT16)2)
  382. #define HFA384x_RID_CNFOWNMACADDR_LEN ((UINT16)6)
  383. #define HFA384x_RID_CNFDESIREDSSID_LEN ((UINT16)34)
  384. #define HFA384x_RID_CNFOWNCHANNEL_LEN ((UINT16)2)
  385. #define HFA384x_RID_CNFOWNSSID_LEN ((UINT16)34)
  386. #define HFA384x_RID_CNFOWNATIMWIN_LEN ((UINT16)2)
  387. #define HFA384x_RID_CNFSYSSCALE_LEN ((UINT16)0)
  388. #define HFA384x_RID_CNFMAXDATALEN_LEN ((UINT16)0)
  389. #define HFA384x_RID_CNFWDSADDR_LEN ((UINT16)6)
  390. #define HFA384x_RID_CNFPMENABLED_LEN ((UINT16)0)
  391. #define HFA384x_RID_CNFPMEPS_LEN ((UINT16)0)
  392. #define HFA384x_RID_CNFMULTICASTRX_LEN ((UINT16)0)
  393. #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0)
  394. #define HFA384x_RID_CNFPMHOLDDUR_LEN ((UINT16)0)
  395. #define HFA384x_RID_CNFOWNNAME_LEN ((UINT16)34)
  396. #define HFA384x_RID_CNFOWNDTIMPER_LEN ((UINT16)0)
  397. #define HFA384x_RID_CNFWDSADDR1_LEN ((UINT16)6)
  398. #define HFA384x_RID_CNFWDSADDR2_LEN ((UINT16)6)
  399. #define HFA384x_RID_CNFWDSADDR3_LEN ((UINT16)6)
  400. #define HFA384x_RID_CNFWDSADDR4_LEN ((UINT16)6)
  401. #define HFA384x_RID_CNFWDSADDR5_LEN ((UINT16)6)
  402. #define HFA384x_RID_CNFWDSADDR6_LEN ((UINT16)6)
  403. #define HFA384x_RID_CNFMCASTPMBUFF_LEN ((UINT16)0)
  404. #define HFA384x_RID_CNFAUTHENTICATION_LEN ((UINT16)sizeof(UINT16))
  405. #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0)
  406. /*--------------------------------------------------------------------
  407. Configuration RIDs: Network Parameters, Dynamic Configuration Entities
  408. --------------------------------------------------------------------*/
  409. #define HFA384x_RID_GROUPADDR ((UINT16)0xFC80)
  410. #define HFA384x_RID_CREATEIBSS ((UINT16)0xFC81)
  411. #define HFA384x_RID_FRAGTHRESH ((UINT16)0xFC82)
  412. #define HFA384x_RID_RTSTHRESH ((UINT16)0xFC83)
  413. #define HFA384x_RID_TXRATECNTL ((UINT16)0xFC84)
  414. #define HFA384x_RID_PROMISCMODE ((UINT16)0xFC85)
  415. #define HFA384x_RID_FRAGTHRESH0 ((UINT16)0xFC90)
  416. #define HFA384x_RID_FRAGTHRESH1 ((UINT16)0xFC91)
  417. #define HFA384x_RID_FRAGTHRESH2 ((UINT16)0xFC92)
  418. #define HFA384x_RID_FRAGTHRESH3 ((UINT16)0xFC93)
  419. #define HFA384x_RID_FRAGTHRESH4 ((UINT16)0xFC94)
  420. #define HFA384x_RID_FRAGTHRESH5 ((UINT16)0xFC95)
  421. #define HFA384x_RID_FRAGTHRESH6 ((UINT16)0xFC96)
  422. #define HFA384x_RID_RTSTHRESH0 ((UINT16)0xFC97)
  423. #define HFA384x_RID_RTSTHRESH1 ((UINT16)0xFC98)
  424. #define HFA384x_RID_RTSTHRESH2 ((UINT16)0xFC99)
  425. #define HFA384x_RID_RTSTHRESH3 ((UINT16)0xFC9A)
  426. #define HFA384x_RID_RTSTHRESH4 ((UINT16)0xFC9B)
  427. #define HFA384x_RID_RTSTHRESH5 ((UINT16)0xFC9C)
  428. #define HFA384x_RID_RTSTHRESH6 ((UINT16)0xFC9D)
  429. #define HFA384x_RID_TXRATECNTL0 ((UINT16)0xFC9E)
  430. #define HFA384x_RID_TXRATECNTL1 ((UINT16)0xFC9F)
  431. #define HFA384x_RID_TXRATECNTL2 ((UINT16)0xFCA0)
  432. #define HFA384x_RID_TXRATECNTL3 ((UINT16)0xFCA1)
  433. #define HFA384x_RID_TXRATECNTL4 ((UINT16)0xFCA2)
  434. #define HFA384x_RID_TXRATECNTL5 ((UINT16)0xFCA3)
  435. #define HFA384x_RID_TXRATECNTL6 ((UINT16)0xFCA4)
  436. /*--------------------------------------------------------------------
  437. Configuration RID Lengths: Network Param, Dynamic Config Entities
  438. This is the length of JUST the DATA part of the RID (does not
  439. include the len or code fields)
  440. --------------------------------------------------------------------*/
  441. /* TODO: fill in the rest of these */
  442. #define HFA384x_RID_GROUPADDR_LEN ((UINT16)16 * WLAN_ADDR_LEN)
  443. #define HFA384x_RID_CREATEIBSS_LEN ((UINT16)0)
  444. #define HFA384x_RID_FRAGTHRESH_LEN ((UINT16)0)
  445. #define HFA384x_RID_RTSTHRESH_LEN ((UINT16)0)
  446. #define HFA384x_RID_TXRATECNTL_LEN ((UINT16)4)
  447. #define HFA384x_RID_PROMISCMODE_LEN ((UINT16)2)
  448. #define HFA384x_RID_FRAGTHRESH0_LEN ((UINT16)0)
  449. #define HFA384x_RID_FRAGTHRESH1_LEN ((UINT16)0)
  450. #define HFA384x_RID_FRAGTHRESH2_LEN ((UINT16)0)
  451. #define HFA384x_RID_FRAGTHRESH3_LEN ((UINT16)0)
  452. #define HFA384x_RID_FRAGTHRESH4_LEN ((UINT16)0)
  453. #define HFA384x_RID_FRAGTHRESH5_LEN ((UINT16)0)
  454. #define HFA384x_RID_FRAGTHRESH6_LEN ((UINT16)0)
  455. #define HFA384x_RID_RTSTHRESH0_LEN ((UINT16)0)
  456. #define HFA384x_RID_RTSTHRESH1_LEN ((UINT16)0)
  457. #define HFA384x_RID_RTSTHRESH2_LEN ((UINT16)0)
  458. #define HFA384x_RID_RTSTHRESH3_LEN ((UINT16)0)
  459. #define HFA384x_RID_RTSTHRESH4_LEN ((UINT16)0)
  460. #define HFA384x_RID_RTSTHRESH5_LEN ((UINT16)0)
  461. #define HFA384x_RID_RTSTHRESH6_LEN ((UINT16)0)
  462. #define HFA384x_RID_TXRATECNTL0_LEN ((UINT16)0)
  463. #define HFA384x_RID_TXRATECNTL1_LEN ((UINT16)0)
  464. #define HFA384x_RID_TXRATECNTL2_LEN ((UINT16)0)
  465. #define HFA384x_RID_TXRATECNTL3_LEN ((UINT16)0)
  466. #define HFA384x_RID_TXRATECNTL4_LEN ((UINT16)0)
  467. #define HFA384x_RID_TXRATECNTL5_LEN ((UINT16)0)
  468. #define HFA384x_RID_TXRATECNTL6_LEN ((UINT16)0)
  469. /*--------------------------------------------------------------------
  470. Configuration RIDs: Behavior Parameters
  471. --------------------------------------------------------------------*/
  472. #define HFA384x_RID_ITICKTIME ((UINT16)0xFCE0)
  473. /*--------------------------------------------------------------------
  474. Configuration RID Lengths: Behavior Parameters
  475. This is the length of JUST the DATA part of the RID (does not
  476. include the len or code fields)
  477. --------------------------------------------------------------------*/
  478. #define HFA384x_RID_ITICKTIME_LEN ((UINT16)2)
  479. /*----------------------------------------------------------------------
  480. Information RIDs: NIC Information
  481. --------------------------------------------------------------------*/
  482. #define HFA384x_RID_MAXLOADTIME ((UINT16)0xFD00)
  483. #define HFA384x_RID_DOWNLOADBUFFER ((UINT16)0xFD01)
  484. #define HFA384x_RID_PRIIDENTITY ((UINT16)0xFD02)
  485. #define HFA384x_RID_PRISUPRANGE ((UINT16)0xFD03)
  486. #define HFA384x_RID_PRI_CFIACTRANGES ((UINT16)0xFD04)
  487. #define HFA384x_RID_NICSERIALNUMBER ((UINT16)0xFD0A)
  488. #define HFA384x_RID_NICIDENTITY ((UINT16)0xFD0B)
  489. #define HFA384x_RID_MFISUPRANGE ((UINT16)0xFD0C)
  490. #define HFA384x_RID_CFISUPRANGE ((UINT16)0xFD0D)
  491. #define HFA384x_RID_CHANNELLIST ((UINT16)0xFD10)
  492. #define HFA384x_RID_REGULATORYDOMAINS ((UINT16)0xFD11)
  493. #define HFA384x_RID_TEMPTYPE ((UINT16)0xFD12)
  494. #define HFA384x_RID_CIS ((UINT16)0xFD13)
  495. #define HFA384x_RID_STAIDENTITY ((UINT16)0xFD20)
  496. #define HFA384x_RID_STASUPRANGE ((UINT16)0xFD21)
  497. #define HFA384x_RID_STA_MFIACTRANGES ((UINT16)0xFD22)
  498. #define HFA384x_RID_STA_CFIACTRANGES ((UINT16)0xFD23)
  499. #define HFA384x_RID_BUILDSEQ ((UINT16)0xFFFE)
  500. #define HFA384x_RID_FWID ((UINT16)0xFFFF)
  501. /*----------------------------------------------------------------------
  502. Information RID Lengths: NIC Information
  503. This is the length of JUST the DATA part of the RID (does not
  504. include the len or code fields)
  505. --------------------------------------------------------------------*/
  506. #define HFA384x_RID_MAXLOADTIME_LEN ((UINT16)0)
  507. #define HFA384x_RID_DOWNLOADBUFFER_LEN ((UINT16)sizeof(hfa384x_downloadbuffer_t))
  508. #define HFA384x_RID_PRIIDENTITY_LEN ((UINT16)8)
  509. #define HFA384x_RID_PRISUPRANGE_LEN ((UINT16)10)
  510. #define HFA384x_RID_CFIACTRANGES_LEN ((UINT16)10)
  511. #define HFA384x_RID_NICSERIALNUMBER_LEN ((UINT16)12)
  512. #define HFA384x_RID_NICIDENTITY_LEN ((UINT16)8)
  513. #define HFA384x_RID_MFISUPRANGE_LEN ((UINT16)10)
  514. #define HFA384x_RID_CFISUPRANGE_LEN ((UINT16)10)
  515. #define HFA384x_RID_CHANNELLIST_LEN ((UINT16)0)
  516. #define HFA384x_RID_REGULATORYDOMAINS_LEN ((UINT16)12)
  517. #define HFA384x_RID_TEMPTYPE_LEN ((UINT16)0)
  518. #define HFA384x_RID_CIS_LEN ((UINT16)480)
  519. #define HFA384x_RID_STAIDENTITY_LEN ((UINT16)8)
  520. #define HFA384x_RID_STASUPRANGE_LEN ((UINT16)10)
  521. #define HFA384x_RID_MFIACTRANGES_LEN ((UINT16)10)
  522. #define HFA384x_RID_CFIACTRANGES2_LEN ((UINT16)10)
  523. #define HFA384x_RID_BUILDSEQ_LEN ((UINT16)sizeof(hfa384x_BuildSeq_t))
  524. #define HFA384x_RID_FWID_LEN ((UINT16)sizeof(hfa384x_FWID_t))
  525. /*--------------------------------------------------------------------
  526. Information RIDs: MAC Information
  527. --------------------------------------------------------------------*/
  528. #define HFA384x_RID_PORTSTATUS ((UINT16)0xFD40)
  529. #define HFA384x_RID_CURRENTSSID ((UINT16)0xFD41)
  530. #define HFA384x_RID_CURRENTBSSID ((UINT16)0xFD42)
  531. #define HFA384x_RID_COMMSQUALITY ((UINT16)0xFD43)
  532. #define HFA384x_RID_CURRENTTXRATE ((UINT16)0xFD44)
  533. #define HFA384x_RID_CURRENTBCNINT ((UINT16)0xFD45)
  534. #define HFA384x_RID_CURRENTSCALETHRESH ((UINT16)0xFD46)
  535. #define HFA384x_RID_PROTOCOLRSPTIME ((UINT16)0xFD47)
  536. #define HFA384x_RID_SHORTRETRYLIMIT ((UINT16)0xFD48)
  537. #define HFA384x_RID_LONGRETRYLIMIT ((UINT16)0xFD49)
  538. #define HFA384x_RID_MAXTXLIFETIME ((UINT16)0xFD4A)
  539. #define HFA384x_RID_MAXRXLIFETIME ((UINT16)0xFD4B)
  540. #define HFA384x_RID_CFPOLLABLE ((UINT16)0xFD4C)
  541. #define HFA384x_RID_AUTHALGORITHMS ((UINT16)0xFD4D)
  542. #define HFA384x_RID_PRIVACYOPTIMP ((UINT16)0xFD4F)
  543. #define HFA384x_RID_DBMCOMMSQUALITY ((UINT16)0xFD51)
  544. #define HFA384x_RID_CURRENTTXRATE1 ((UINT16)0xFD80)
  545. #define HFA384x_RID_CURRENTTXRATE2 ((UINT16)0xFD81)
  546. #define HFA384x_RID_CURRENTTXRATE3 ((UINT16)0xFD82)
  547. #define HFA384x_RID_CURRENTTXRATE4 ((UINT16)0xFD83)
  548. #define HFA384x_RID_CURRENTTXRATE5 ((UINT16)0xFD84)
  549. #define HFA384x_RID_CURRENTTXRATE6 ((UINT16)0xFD85)
  550. #define HFA384x_RID_OWNMACADDRESS ((UINT16)0xFD86)
  551. // #define HFA384x_RID_PCFINFO ((UINT16)0xFD87)
  552. #define HFA384x_RID_SCANRESULTS ((UINT16)0xFD88) // NEW
  553. #define HFA384x_RID_HOSTSCANRESULTS ((UINT16)0xFD89) // NEW
  554. #define HFA384x_RID_AUTHENTICATIONUSED ((UINT16)0xFD8A) // NEW
  555. #define HFA384x_RID_ASSOCIATEFAILURE ((UINT16)0xFD8D) // 1.8.0
  556. /*--------------------------------------------------------------------
  557. Information RID Lengths: MAC Information
  558. This is the length of JUST the DATA part of the RID (does not
  559. include the len or code fields)
  560. --------------------------------------------------------------------*/
  561. #define HFA384x_RID_PORTSTATUS_LEN ((UINT16)0)
  562. #define HFA384x_RID_CURRENTSSID_LEN ((UINT16)34)
  563. #define HFA384x_RID_CURRENTBSSID_LEN ((UINT16)WLAN_BSSID_LEN)
  564. #define HFA384x_RID_COMMSQUALITY_LEN ((UINT16)sizeof(hfa384x_commsquality_t))
  565. #define HFA384x_RID_DBMCOMMSQUALITY_LEN ((UINT16)sizeof(hfa384x_dbmcommsquality_t))
  566. #define HFA384x_RID_CURRENTTXRATE_LEN ((UINT16)0)
  567. #define HFA384x_RID_CURRENTBCNINT_LEN ((UINT16)0)
  568. #define HFA384x_RID_STACURSCALETHRESH_LEN ((UINT16)12)
  569. #define HFA384x_RID_APCURSCALETHRESH_LEN ((UINT16)6)
  570. #define HFA384x_RID_PROTOCOLRSPTIME_LEN ((UINT16)0)
  571. #define HFA384x_RID_SHORTRETRYLIMIT_LEN ((UINT16)0)
  572. #define HFA384x_RID_LONGRETRYLIMIT_LEN ((UINT16)0)
  573. #define HFA384x_RID_MAXTXLIFETIME_LEN ((UINT16)0)
  574. #define HFA384x_RID_MAXRXLIFETIME_LEN ((UINT16)0)
  575. #define HFA384x_RID_CFPOLLABLE_LEN ((UINT16)0)
  576. #define HFA384x_RID_AUTHALGORITHMS_LEN ((UINT16)4)
  577. #define HFA384x_RID_PRIVACYOPTIMP_LEN ((UINT16)0)
  578. #define HFA384x_RID_CURRENTTXRATE1_LEN ((UINT16)0)
  579. #define HFA384x_RID_CURRENTTXRATE2_LEN ((UINT16)0)
  580. #define HFA384x_RID_CURRENTTXRATE3_LEN ((UINT16)0)
  581. #define HFA384x_RID_CURRENTTXRATE4_LEN ((UINT16)0)
  582. #define HFA384x_RID_CURRENTTXRATE5_LEN ((UINT16)0)
  583. #define HFA384x_RID_CURRENTTXRATE6_LEN ((UINT16)0)
  584. #define HFA384x_RID_OWNMACADDRESS_LEN ((UINT16)6)
  585. #define HFA384x_RID_PCFINFO_LEN ((UINT16)6)
  586. #define HFA384x_RID_CNFAPPCFINFO_LEN ((UINT16)sizeof(hfa384x_PCFInfo_data_t))
  587. #define HFA384x_RID_SCANREQUEST_LEN ((UINT16)sizeof(hfa384x_ScanRequest_data_t))
  588. #define HFA384x_RID_JOINREQUEST_LEN ((UINT16)sizeof(hfa384x_JoinRequest_data_t))
  589. #define HFA384x_RID_AUTHENTICATESTA_LEN ((UINT16)sizeof(hfa384x_authenticateStation_data_t))
  590. #define HFA384x_RID_CHANNELINFOREQUEST_LEN ((UINT16)sizeof(hfa384x_ChannelInfoRequest_data_t))
  591. /*--------------------------------------------------------------------
  592. Information RIDs: Modem Information
  593. --------------------------------------------------------------------*/
  594. #define HFA384x_RID_PHYTYPE ((UINT16)0xFDC0)
  595. #define HFA384x_RID_CURRENTCHANNEL ((UINT16)0xFDC1)
  596. #define HFA384x_RID_CURRENTPOWERSTATE ((UINT16)0xFDC2)
  597. #define HFA384x_RID_CCAMODE ((UINT16)0xFDC3)
  598. #define HFA384x_RID_SUPPORTEDDATARATES ((UINT16)0xFDC6)
  599. #define HFA384x_RID_LFOSTATUS ((UINT16)0xFDC7) // 1.7.1
  600. /*--------------------------------------------------------------------
  601. Information RID Lengths: Modem Information
  602. This is the length of JUST the DATA part of the RID (does not
  603. include the len or code fields)
  604. --------------------------------------------------------------------*/
  605. #define HFA384x_RID_PHYTYPE_LEN ((UINT16)0)
  606. #define HFA384x_RID_CURRENTCHANNEL_LEN ((UINT16)0)
  607. #define HFA384x_RID_CURRENTPOWERSTATE_LEN ((UINT16)0)
  608. #define HFA384x_RID_CCAMODE_LEN ((UINT16)0)
  609. #define HFA384x_RID_SUPPORTEDDATARATES_LEN ((UINT16)10)
  610. /*--------------------------------------------------------------------
  611. API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
  612. --------------------------------------------------------------------*/
  613. #define HFA384x_RID_CNFWEPDEFAULTKEYID ((UINT16)0xFC23)
  614. #define HFA384x_RID_CNFWEPDEFAULTKEY0 ((UINT16)0xFC24)
  615. #define HFA384x_RID_CNFWEPDEFAULTKEY1 ((UINT16)0xFC25)
  616. #define HFA384x_RID_CNFWEPDEFAULTKEY2 ((UINT16)0xFC26)
  617. #define HFA384x_RID_CNFWEPDEFAULTKEY3 ((UINT16)0xFC27)
  618. #define HFA384x_RID_CNFWEPFLAGS ((UINT16)0xFC28)
  619. #define HFA384x_RID_CNFWEPKEYMAPTABLE ((UINT16)0xFC29)
  620. #define HFA384x_RID_CNFAUTHENTICATION ((UINT16)0xFC2A)
  621. #define HFA384x_RID_CNFMAXASSOCSTATIONS ((UINT16)0xFC2B)
  622. #define HFA384x_RID_CNFTXCONTROL ((UINT16)0xFC2C)
  623. #define HFA384x_RID_CNFROAMINGMODE ((UINT16)0xFC2D)
  624. #define HFA384x_RID_CNFHOSTAUTHASSOC ((UINT16)0xFC2E)
  625. #define HFA384x_RID_CNFRCVCRCERROR ((UINT16)0xFC30)
  626. // #define HFA384x_RID_CNFMMLIFE ((UINT16)0xFC31)
  627. #define HFA384x_RID_CNFALTRETRYCNT ((UINT16)0xFC32)
  628. #define HFA384x_RID_CNFAPBCNINT ((UINT16)0xFC33)
  629. #define HFA384x_RID_CNFAPPCFINFO ((UINT16)0xFC34)
  630. #define HFA384x_RID_CNFSTAPCFINFO ((UINT16)0xFC35)
  631. #define HFA384x_RID_CNFPRIORITYQUSAGE ((UINT16)0xFC37)
  632. #define HFA384x_RID_CNFTIMCTRL ((UINT16)0xFC40)
  633. #define HFA384x_RID_CNFTHIRTY2TALLY ((UINT16)0xFC42)
  634. #define HFA384x_RID_CNFENHSECURITY ((UINT16)0xFC43)
  635. #define HFA384x_RID_CNFDBMADJUST ((UINT16)0xFC46) // NEW
  636. #define HFA384x_RID_CNFWPADATA ((UINT16)0xFC48) // 1.7.0
  637. #define HFA384x_RID_CNFPROPOGATIONDELAY ((UINT16)0xFC49) // 1.7.6
  638. #define HFA384x_RID_CNFSHORTPREAMBLE ((UINT16)0xFCB0)
  639. #define HFA384x_RID_CNFEXCLONGPREAMBLE ((UINT16)0xFCB1)
  640. #define HFA384x_RID_CNFAUTHRSPTIMEOUT ((UINT16)0xFCB2)
  641. #define HFA384x_RID_CNFBASICRATES ((UINT16)0xFCB3)
  642. #define HFA384x_RID_CNFSUPPRATES ((UINT16)0xFCB4)
  643. #define HFA384x_RID_CNFFALLBACKCTRL ((UINT16)0xFCB5) // NEW
  644. #define HFA384x_RID_WEPKEYSTATUS ((UINT16)0xFCB6) // NEW
  645. #define HFA384x_RID_WEPKEYMAPINDEX ((UINT16)0xFCB7) // NEW
  646. #define HFA384x_RID_BROADCASTKEYID ((UINT16)0xFCB8) // NEW
  647. #define HFA384x_RID_ENTSECFLAGEYID ((UINT16)0xFCB9) // NEW
  648. #define HFA384x_RID_CNFPASSIVESCANCTRL ((UINT16)0xFCBA) // NEW STA
  649. #define HFA384x_RID_CNFWPAHANDLING ((UINT16)0xFCBB) // 1.7.0
  650. #define HFA384x_RID_MDCCONTROL ((UINT16)0xFCBC) // 1.7.0/1.4.0
  651. #define HFA384x_RID_MDCCOUNTRY ((UINT16)0xFCBD) // 1.7.0/1.4.0
  652. #define HFA384x_RID_TXPOWERMAX ((UINT16)0xFCBE) // 1.7.0/1.4.0
  653. #define HFA384x_RID_CNFLFOENBLED ((UINT16)0xFCBF) // 1.6.3
  654. #define HFA384x_RID_CAPINFO ((UINT16)0xFCC0) // 1.7.0/1.3.7
  655. #define HFA384x_RID_LISTENINTERVAL ((UINT16)0xFCC1) // 1.7.0/1.3.7
  656. #define HFA384x_RID_DIVERSITYENABLED ((UINT16)0xFCC2) // 1.7.0/1.3.7
  657. #define HFA384x_RID_LED_CONTROL ((UINT16)0xFCC4) // 1.7.6
  658. #define HFA384x_RID_HFO_DELAY ((UINT16)0xFCC5) // 1.7.6
  659. #define HFA384x_RID_DISSALOWEDBSSID ((UINT16)0xFCC6) // 1.8.0
  660. #define HFA384x_RID_SCANREQUEST ((UINT16)0xFCE1)
  661. #define HFA384x_RID_JOINREQUEST ((UINT16)0xFCE2)
  662. #define HFA384x_RID_AUTHENTICATESTA ((UINT16)0xFCE3)
  663. #define HFA384x_RID_CHANNELINFOREQUEST ((UINT16)0xFCE4)
  664. #define HFA384x_RID_HOSTSCAN ((UINT16)0xFCE5) // NEW STA
  665. #define HFA384x_RID_ASSOCIATESTA ((UINT16)0xFCE6)
  666. #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((UINT16)6)
  667. #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((UINT16)14)
  668. #define HFA384x_RID_CNFPRIOQUSAGE_LEN ((UINT16)4)
  669. /*--------------------------------------------------------------------
  670. PD Record codes
  671. --------------------------------------------------------------------*/
  672. #define HFA384x_PDR_PCB_PARTNUM ((UINT16)0x0001)
  673. #define HFA384x_PDR_PDAVER ((UINT16)0x0002)
  674. #define HFA384x_PDR_NIC_SERIAL ((UINT16)0x0003)
  675. #define HFA384x_PDR_MKK_MEASUREMENTS ((UINT16)0x0004)
  676. #define HFA384x_PDR_NIC_RAMSIZE ((UINT16)0x0005)
  677. #define HFA384x_PDR_MFISUPRANGE ((UINT16)0x0006)
  678. #define HFA384x_PDR_CFISUPRANGE ((UINT16)0x0007)
  679. #define HFA384x_PDR_NICID ((UINT16)0x0008)
  680. //#define HFA384x_PDR_REFDAC_MEASUREMENTS ((UINT16)0x0010)
  681. //#define HFA384x_PDR_VGDAC_MEASUREMENTS ((UINT16)0x0020)
  682. //#define HFA384x_PDR_LEVEL_COMP_MEASUREMENTS ((UINT16)0x0030)
  683. //#define HFA384x_PDR_MODEM_TRIMDAC_MEASUREMENTS ((UINT16)0x0040)
  684. //#define HFA384x_PDR_COREGA_HACK ((UINT16)0x00ff)
  685. #define HFA384x_PDR_MAC_ADDRESS ((UINT16)0x0101)
  686. //#define HFA384x_PDR_MKK_CALLNAME ((UINT16)0x0102)
  687. #define HFA384x_PDR_REGDOMAIN ((UINT16)0x0103)
  688. #define HFA384x_PDR_ALLOWED_CHANNEL ((UINT16)0x0104)
  689. #define HFA384x_PDR_DEFAULT_CHANNEL ((UINT16)0x0105)
  690. //#define HFA384x_PDR_PRIVACY_OPTION ((UINT16)0x0106)
  691. #define HFA384x_PDR_TEMPTYPE ((UINT16)0x0107)
  692. //#define HFA384x_PDR_REFDAC_SETUP ((UINT16)0x0110)
  693. //#define HFA384x_PDR_VGDAC_SETUP ((UINT16)0x0120)
  694. //#define HFA384x_PDR_LEVEL_COMP_SETUP ((UINT16)0x0130)
  695. //#define HFA384x_PDR_TRIMDAC_SETUP ((UINT16)0x0140)
  696. #define HFA384x_PDR_IFR_SETTING ((UINT16)0x0200)
  697. #define HFA384x_PDR_RFR_SETTING ((UINT16)0x0201)
  698. #define HFA384x_PDR_HFA3861_BASELINE ((UINT16)0x0202)
  699. #define HFA384x_PDR_HFA3861_SHADOW ((UINT16)0x0203)
  700. #define HFA384x_PDR_HFA3861_IFRF ((UINT16)0x0204)
  701. #define HFA384x_PDR_HFA3861_CHCALSP ((UINT16)0x0300)
  702. #define HFA384x_PDR_HFA3861_CHCALI ((UINT16)0x0301)
  703. #define HFA384x_PDR_MAX_TX_POWER ((UINT16)0x0302)
  704. #define HFA384x_PDR_MASTER_CHAN_LIST ((UINT16)0x0303)
  705. #define HFA384x_PDR_3842_NIC_CONFIG ((UINT16)0x0400)
  706. #define HFA384x_PDR_USB_ID ((UINT16)0x0401)
  707. #define HFA384x_PDR_PCI_ID ((UINT16)0x0402)
  708. #define HFA384x_PDR_PCI_IFCONF ((UINT16)0x0403)
  709. #define HFA384x_PDR_PCI_PMCONF ((UINT16)0x0404)
  710. #define HFA384x_PDR_RFENRGY ((UINT16)0x0406)
  711. #define HFA384x_PDR_USB_POWER_TYPE ((UINT16)0x0407)
  712. //#define HFA384x_PDR_UNKNOWN408 ((UINT16)0x0408)
  713. #define HFA384x_PDR_USB_MAX_POWER ((UINT16)0x0409)
  714. #define HFA384x_PDR_USB_MANUFACTURER ((UINT16)0x0410)
  715. #define HFA384x_PDR_USB_PRODUCT ((UINT16)0x0411)
  716. #define HFA384x_PDR_ANT_DIVERSITY ((UINT16)0x0412)
  717. #define HFA384x_PDR_HFO_DELAY ((UINT16)0x0413)
  718. #define HFA384x_PDR_SCALE_THRESH ((UINT16)0x0414)
  719. #define HFA384x_PDR_HFA3861_MANF_TESTSP ((UINT16)0x0900)
  720. #define HFA384x_PDR_HFA3861_MANF_TESTI ((UINT16)0x0901)
  721. #define HFA384x_PDR_END_OF_PDA ((UINT16)0x0000)
  722. /*=============================================================*/
  723. /*------ Macros -----------------------------------------------*/
  724. /*--- Register ID macros ------------------------*/
  725. #define HFA384x_CMD HFA384x_CMD_OFF
  726. #define HFA384x_PARAM0 HFA384x_PARAM0_OFF
  727. #define HFA384x_PARAM1 HFA384x_PARAM1_OFF
  728. #define HFA384x_PARAM2 HFA384x_PARAM2_OFF
  729. #define HFA384x_STATUS HFA384x_STATUS_OFF
  730. #define HFA384x_RESP0 HFA384x_RESP0_OFF
  731. #define HFA384x_RESP1 HFA384x_RESP1_OFF
  732. #define HFA384x_RESP2 HFA384x_RESP2_OFF
  733. #define HFA384x_INFOFID HFA384x_INFOFID_OFF
  734. #define HFA384x_RXFID HFA384x_RXFID_OFF
  735. #define HFA384x_ALLOCFID HFA384x_ALLOCFID_OFF
  736. #define HFA384x_TXCOMPLFID HFA384x_TXCOMPLFID_OFF
  737. #define HFA384x_SELECT0 HFA384x_SELECT0_OFF
  738. #define HFA384x_OFFSET0 HFA384x_OFFSET0_OFF
  739. #define HFA384x_DATA0 HFA384x_DATA0_OFF
  740. #define HFA384x_SELECT1 HFA384x_SELECT1_OFF
  741. #define HFA384x_OFFSET1 HFA384x_OFFSET1_OFF
  742. #define HFA384x_DATA1 HFA384x_DATA1_OFF
  743. #define HFA384x_EVSTAT HFA384x_EVSTAT_OFF
  744. #define HFA384x_INTEN HFA384x_INTEN_OFF
  745. #define HFA384x_EVACK HFA384x_EVACK_OFF
  746. #define HFA384x_CONTROL HFA384x_CONTROL_OFF
  747. #define HFA384x_SWSUPPORT0 HFA384x_SWSUPPORT0_OFF
  748. #define HFA384x_SWSUPPORT1 HFA384x_SWSUPPORT1_OFF
  749. #define HFA384x_SWSUPPORT2 HFA384x_SWSUPPORT2_OFF
  750. #define HFA384x_AUXPAGE HFA384x_AUXPAGE_OFF
  751. #define HFA384x_AUXOFFSET HFA384x_AUXOFFSET_OFF
  752. #define HFA384x_AUXDATA HFA384x_AUXDATA_OFF
  753. #define HFA384x_PCICOR HFA384x_PCICOR_OFF
  754. #define HFA384x_PCIHCR HFA384x_PCIHCR_OFF
  755. /*--- Register Test/Get/Set Field macros ------------------------*/
  756. #define HFA384x_CMD_ISBUSY(value) ((UINT16)(((UINT16)value) & HFA384x_CMD_BUSY))
  757. #define HFA384x_CMD_AINFO_GET(value) ((UINT16)(((UINT16)(value) & HFA384x_CMD_AINFO) >> 8))
  758. #define HFA384x_CMD_AINFO_SET(value) ((UINT16)((UINT16)(value) << 8))
  759. #define HFA384x_CMD_MACPORT_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_MACPORT)))
  760. #define HFA384x_CMD_MACPORT_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value))
  761. #define HFA384x_CMD_ISRECL(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_RECL)))
  762. #define HFA384x_CMD_RECL_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value))
  763. #define HFA384x_CMD_QOS_GET(value) ((UINT16((((UINT16)(value))&((UINT16)0x3000)) >> 12))
  764. #define HFA384x_CMD_QOS_SET(value) ((UINT16)((((UINT16)(value)) << 12) & 0x3000))
  765. #define HFA384x_CMD_ISWRITE(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_WRITE)))
  766. #define HFA384x_CMD_WRITE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value))
  767. #define HFA384x_CMD_PROGMODE_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_PROGMODE)))
  768. #define HFA384x_CMD_PROGMODE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value))
  769. #define HFA384x_CMD_CMDCODE_GET(value) ((UINT16)(((UINT16)(value)) & HFA384x_CMD_CMDCODE))
  770. #define HFA384x_CMD_CMDCODE_SET(value) ((UINT16)(value))
  771. #define HFA384x_STATUS_RESULT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_STATUS_RESULT) >> 8))
  772. #define HFA384x_STATUS_RESULT_SET(value) (((UINT16)(value)) << 8)
  773. #define HFA384x_STATUS_CMDCODE_GET(value) (((UINT16)(value)) & HFA384x_STATUS_CMDCODE)
  774. #define HFA384x_STATUS_CMDCODE_SET(value) ((UINT16)(value))
  775. #define HFA384x_OFFSET_ISBUSY(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_BUSY))
  776. #define HFA384x_OFFSET_ISERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_ERR))
  777. #define HFA384x_OFFSET_DATAOFF_GET(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_DATAOFF))
  778. #define HFA384x_OFFSET_DATAOFF_SET(value) ((UINT16)(value))
  779. #define HFA384x_EVSTAT_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TICK))
  780. #define HFA384x_EVSTAT_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_WTERR))
  781. #define HFA384x_EVSTAT_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_INFDROP))
  782. #define HFA384x_EVSTAT_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_INFO))
  783. #define HFA384x_EVSTAT_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_DTIM))
  784. #define HFA384x_EVSTAT_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_CMD))
  785. #define HFA384x_EVSTAT_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_ALLOC))
  786. #define HFA384x_EVSTAT_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TXEXC))
  787. #define HFA384x_EVSTAT_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TX))
  788. #define HFA384x_EVSTAT_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_RX))
  789. #define HFA384x_EVSTAT_ISBAP_OP(value) ((UINT16)(((UINT16)(value)) & HFA384x_INT_BAP_OP))
  790. #define HFA384x_INTEN_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TICK))
  791. #define HFA384x_INTEN_TICK_SET(value) ((UINT16)(((UINT16)(value)) << 15))
  792. #define HFA384x_INTEN_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_WTERR))
  793. #define HFA384x_INTEN_WTERR_SET(value) ((UINT16)(((UINT16)(value)) << 14))
  794. #define HFA384x_INTEN_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_INFDROP))
  795. #define HFA384x_INTEN_INFDROP_SET(value) ((UINT16)(((UINT16)(value)) << 13))
  796. #define HFA384x_INTEN_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_INFO))
  797. #define HFA384x_INTEN_INFO_SET(value) ((UINT16)(((UINT16)(value)) << 7))
  798. #define HFA384x_INTEN_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_DTIM))
  799. #define HFA384x_INTEN_DTIM_SET(value) ((UINT16)(((UINT16)(value)) << 5))
  800. #define HFA384x_INTEN_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_CMD))
  801. #define HFA384x_INTEN_CMD_SET(value) ((UINT16)(((UINT16)(value)) << 4))
  802. #define HFA384x_INTEN_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_ALLOC))
  803. #define HFA384x_INTEN_ALLOC_SET(value) ((UINT16)(((UINT16)(value)) << 3))
  804. #define HFA384x_INTEN_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TXEXC))
  805. #define HFA384x_INTEN_TXEXC_SET(value) ((UINT16)(((UINT16)(value)) << 2))
  806. #define HFA384x_INTEN_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TX))
  807. #define HFA384x_INTEN_TX_SET(value) ((UINT16)(((UINT16)(value)) << 1))
  808. #define HFA384x_INTEN_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_RX))
  809. #define HFA384x_INTEN_RX_SET(value) ((UINT16)(((UINT16)(value)) << 0))
  810. #define HFA384x_EVACK_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TICK))
  811. #define HFA384x_EVACK_TICK_SET(value) ((UINT16)(((UINT16)(value)) << 15))
  812. #define HFA384x_EVACK_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_WTERR))
  813. #define HFA384x_EVACK_WTERR_SET(value) ((UINT16)(((UINT16)(value)) << 14))
  814. #define HFA384x_EVACK_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_INFDROP))
  815. #define HFA384x_EVACK_INFDROP_SET(value) ((UINT16)(((UINT16)(value)) << 13))
  816. #define HFA384x_EVACK_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_INFO))
  817. #define HFA384x_EVACK_INFO_SET(value) ((UINT16)(((UINT16)(value)) << 7))
  818. #define HFA384x_EVACK_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_DTIM))
  819. #define HFA384x_EVACK_DTIM_SET(value) ((UINT16)(((UINT16)(value)) << 5))
  820. #define HFA384x_EVACK_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_CMD))
  821. #define HFA384x_EVACK_CMD_SET(value) ((UINT16)(((UINT16)(value)) << 4))
  822. #define HFA384x_EVACK_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_ALLOC))
  823. #define HFA384x_EVACK_ALLOC_SET(value) ((UINT16)(((UINT16)(value)) << 3))
  824. #define HFA384x_EVACK_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TXEXC))
  825. #define HFA384x_EVACK_TXEXC_SET(value) ((UINT16)(((UINT16)(value)) << 2))
  826. #define HFA384x_EVACK_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TX))
  827. #define HFA384x_EVACK_TX_SET(value) ((UINT16)(((UINT16)(value)) << 1))
  828. #define HFA384x_EVACK_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_RX))
  829. #define HFA384x_EVACK_RX_SET(value) ((UINT16)(((UINT16)(value)) << 0))
  830. #define HFA384x_CONTROL_AUXEN_SET(value) ((UINT16)(((UINT16)(value)) << 14))
  831. #define HFA384x_CONTROL_AUXEN_GET(value) ((UINT16)(((UINT16)(value)) >> 14))
  832. /* Byte Order */
  833. #ifdef __KERNEL__
  834. #define hfa384x2host_16(n) (__le16_to_cpu((UINT16)(n)))
  835. #define hfa384x2host_32(n) (__le32_to_cpu((UINT32)(n)))
  836. #define host2hfa384x_16(n) (__cpu_to_le16((UINT16)(n)))
  837. #define host2hfa384x_32(n) (__cpu_to_le32((UINT32)(n)))
  838. #endif
  839. /* Host Maintained State Info */
  840. #define HFA384x_STATE_PREINIT 0
  841. #define HFA384x_STATE_INIT 1
  842. #define HFA384x_STATE_RUNNING 2
  843. /*=============================================================*/
  844. /*------ Types and their related constants --------------------*/
  845. #define HFA384x_HOSTAUTHASSOC_HOSTAUTH BIT0
  846. #define HFA384x_HOSTAUTHASSOC_HOSTASSOC BIT1
  847. #define HFA384x_WHAHANDLING_DISABLED 0
  848. #define HFA384x_WHAHANDLING_PASSTHROUGH BIT1
  849. /*-------------------------------------------------------------*/
  850. /* Commonly used basic types */
  851. typedef struct hfa384x_bytestr
  852. {
  853. UINT16 len;
  854. UINT8 data[0];
  855. } __WLAN_ATTRIB_PACK__ hfa384x_bytestr_t;
  856. typedef struct hfa384x_bytestr32
  857. {
  858. UINT16 len;
  859. UINT8 data[32];
  860. } __WLAN_ATTRIB_PACK__ hfa384x_bytestr32_t;
  861. /*--------------------------------------------------------------------
  862. Configuration Record Structures:
  863. Network Parameters, Static Configuration Entities
  864. --------------------------------------------------------------------*/
  865. /* Prototype structure: all configuration record structures start with
  866. these members */
  867. typedef struct hfa384x_record
  868. {
  869. UINT16 reclen;
  870. UINT16 rid;
  871. } __WLAN_ATTRIB_PACK__ hfa384x_rec_t;
  872. typedef struct hfa384x_record16
  873. {
  874. UINT16 reclen;
  875. UINT16 rid;
  876. UINT16 val;
  877. } __WLAN_ATTRIB_PACK__ hfa384x_rec16_t;
  878. typedef struct hfa384x_record32
  879. {
  880. UINT16 reclen;
  881. UINT16 rid;
  882. UINT32 val;
  883. } __WLAN_ATTRIB_PACK__ hfa384x_rec32;
  884. /*-- Hardware/Firmware Component Information ----------*/
  885. typedef struct hfa384x_compident
  886. {
  887. UINT16 id;
  888. UINT16 variant;
  889. UINT16 major;
  890. UINT16 minor;
  891. } __WLAN_ATTRIB_PACK__ hfa384x_compident_t;
  892. typedef struct hfa384x_caplevel
  893. {
  894. UINT16 role;
  895. UINT16 id;
  896. UINT16 variant;
  897. UINT16 bottom;
  898. UINT16 top;
  899. } __WLAN_ATTRIB_PACK__ hfa384x_caplevel_t;
  900. /*-- Configuration Record: cnfPortType --*/
  901. typedef struct hfa384x_cnfPortType
  902. {
  903. UINT16 cnfPortType;
  904. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPortType_t;
  905. /*-- Configuration Record: cnfOwnMACAddress --*/
  906. typedef struct hfa384x_cnfOwnMACAddress
  907. {
  908. UINT8 cnfOwnMACAddress[6];
  909. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnMACAddress_t;
  910. /*-- Configuration Record: cnfDesiredSSID --*/
  911. typedef struct hfa384x_cnfDesiredSSID
  912. {
  913. UINT8 cnfDesiredSSID[34];
  914. } __WLAN_ATTRIB_PACK__ hfa384x_cnfDesiredSSID_t;
  915. /*-- Configuration Record: cnfOwnChannel --*/
  916. typedef struct hfa384x_cnfOwnChannel
  917. {
  918. UINT16 cnfOwnChannel;
  919. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnChannel_t;
  920. /*-- Configuration Record: cnfOwnSSID --*/
  921. typedef struct hfa384x_cnfOwnSSID
  922. {
  923. UINT8 cnfOwnSSID[34];
  924. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnSSID_t;
  925. /*-- Configuration Record: cnfOwnATIMWindow --*/
  926. typedef struct hfa384x_cnfOwnATIMWindow
  927. {
  928. UINT16 cnfOwnATIMWindow;
  929. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnATIMWindow_t;
  930. /*-- Configuration Record: cnfSystemScale --*/
  931. typedef struct hfa384x_cnfSystemScale
  932. {
  933. UINT16 cnfSystemScale;
  934. } __WLAN_ATTRIB_PACK__ hfa384x_cnfSystemScale_t;
  935. /*-- Configuration Record: cnfMaxDataLength --*/
  936. typedef struct hfa384x_cnfMaxDataLength
  937. {
  938. UINT16 cnfMaxDataLength;
  939. } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxDataLength_t;
  940. /*-- Configuration Record: cnfWDSAddress --*/
  941. typedef struct hfa384x_cnfWDSAddress
  942. {
  943. UINT8 cnfWDSAddress[6];
  944. } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddress_t;
  945. /*-- Configuration Record: cnfPMEnabled --*/
  946. typedef struct hfa384x_cnfPMEnabled
  947. {
  948. UINT16 cnfPMEnabled;
  949. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEnabled_t;
  950. /*-- Configuration Record: cnfPMEPS --*/
  951. typedef struct hfa384x_cnfPMEPS
  952. {
  953. UINT16 cnfPMEPS;
  954. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEPS_t;
  955. /*-- Configuration Record: cnfMulticastReceive --*/
  956. typedef struct hfa384x_cnfMulticastReceive
  957. {
  958. UINT16 cnfMulticastReceive;
  959. } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastReceive_t;
  960. /*-- Configuration Record: cnfAuthentication --*/
  961. #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001
  962. #define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002
  963. #define HFA384x_CNFAUTHENTICATION_LEAP 0x0004
  964. /*-- Configuration Record: cnfMaxSleepDuration --*/
  965. typedef struct hfa384x_cnfMaxSleepDuration
  966. {
  967. UINT16 cnfMaxSleepDuration;
  968. } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxSleepDuration_t;
  969. /*-- Configuration Record: cnfPMHoldoverDuration --*/
  970. typedef struct hfa384x_cnfPMHoldoverDuration
  971. {
  972. UINT16 cnfPMHoldoverDuration;
  973. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMHoldoverDuration_t;
  974. /*-- Configuration Record: cnfOwnName --*/
  975. typedef struct hfa384x_cnfOwnName
  976. {
  977. UINT8 cnfOwnName[34];
  978. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnName_t;
  979. /*-- Configuration Record: cnfOwnDTIMPeriod --*/
  980. typedef struct hfa384x_cnfOwnDTIMPeriod
  981. {
  982. UINT16 cnfOwnDTIMPeriod;
  983. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnDTIMPeriod_t;
  984. /*-- Configuration Record: cnfWDSAddress --*/
  985. typedef struct hfa384x_cnfWDSAddressN
  986. {
  987. UINT8 cnfWDSAddress[6];
  988. } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddressN_t;
  989. /*-- Configuration Record: cnfMulticastPMBuffering --*/
  990. typedef struct hfa384x_cnfMulticastPMBuffering
  991. {
  992. UINT16 cnfMulticastPMBuffering;
  993. } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastPMBuffering_t;
  994. /*--------------------------------------------------------------------
  995. Configuration Record Structures:
  996. Network Parameters, Dynamic Configuration Entities
  997. --------------------------------------------------------------------*/
  998. /*-- Configuration Record: GroupAddresses --*/
  999. typedef struct hfa384x_GroupAddresses
  1000. {
  1001. UINT8 MACAddress[16][6];
  1002. } __WLAN_ATTRIB_PACK__ hfa384x_GroupAddresses_t;
  1003. /*-- Configuration Record: CreateIBSS --*/
  1004. typedef struct hfa384x_CreateIBSS
  1005. {
  1006. UINT16 CreateIBSS;
  1007. } __WLAN_ATTRIB_PACK__ hfa384x_CreateIBSS_t;
  1008. #define HFA384x_CREATEIBSS_JOINCREATEIBSS 0
  1009. #define HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS 1
  1010. #define HFA384x_CREATEIBSS_JOINIBSS 2
  1011. #define HFA384x_CREATEIBSS_JOINESS_JOINIBSS 3
  1012. /*-- Configuration Record: FragmentationThreshold --*/
  1013. typedef struct hfa384x_FragmentationThreshold
  1014. {
  1015. UINT16 FragmentationThreshold;
  1016. } __WLAN_ATTRIB_PACK__ hfa384x_FragmentationThreshold_t;
  1017. /*-- Configuration Record: RTSThreshold --*/
  1018. typedef struct hfa384x_RTSThreshold
  1019. {
  1020. UINT16 RTSThreshold;
  1021. } __WLAN_ATTRIB_PACK__ hfa384x_RTSThreshold_t;
  1022. /*-- Configuration Record: TxRateControl --*/
  1023. typedef struct hfa384x_TxRateControl
  1024. {
  1025. UINT16 TxRateControl;
  1026. } __WLAN_ATTRIB_PACK__ hfa384x_TxRateControl_t;
  1027. /*-- Configuration Record: PromiscuousMode --*/
  1028. typedef struct hfa384x_PromiscuousMode
  1029. {
  1030. UINT16 PromiscuousMode;
  1031. } __WLAN_ATTRIB_PACK__ hfa384x_PromiscuousMode_t;
  1032. /*-- Configuration Record: ScanRequest (data portion only) --*/
  1033. typedef struct hfa384x_ScanRequest_data
  1034. {
  1035. UINT16 channelList;
  1036. UINT16 txRate;
  1037. } __WLAN_ATTRIB_PACK__ hfa384x_ScanRequest_data_t;
  1038. /*-- Configuration Record: HostScanRequest (data portion only) --*/
  1039. typedef struct hfa384x_HostScanRequest_data
  1040. {
  1041. UINT16 channelList;
  1042. UINT16 txRate;
  1043. hfa384x_bytestr32_t ssid;
  1044. } __WLAN_ATTRIB_PACK__ hfa384x_HostScanRequest_data_t;
  1045. /*-- Configuration Record: JoinRequest (data portion only) --*/
  1046. typedef struct hfa384x_JoinRequest_data
  1047. {
  1048. UINT8 bssid[WLAN_BSSID_LEN];
  1049. UINT16 channel;
  1050. } __WLAN_ATTRIB_PACK__ hfa384x_JoinRequest_data_t;
  1051. /*-- Configuration Record: authenticateStation (data portion only) --*/
  1052. typedef struct hfa384x_authenticateStation_data
  1053. {
  1054. UINT8 address[WLAN_ADDR_LEN];
  1055. UINT16 status;
  1056. UINT16 algorithm;
  1057. } __WLAN_ATTRIB_PACK__ hfa384x_authenticateStation_data_t;
  1058. /*-- Configuration Record: associateStation (data portion only) --*/
  1059. typedef struct hfa384x_associateStation_data
  1060. {
  1061. UINT8 address[WLAN_ADDR_LEN];
  1062. UINT16 status;
  1063. UINT16 type;
  1064. } __WLAN_ATTRIB_PACK__ hfa384x_associateStation_data_t;
  1065. /*-- Configuration Record: ChannelInfoRequest (data portion only) --*/
  1066. typedef struct hfa384x_ChannelInfoRequest_data
  1067. {
  1068. UINT16 channelList;
  1069. UINT16 channelDwellTime;
  1070. } __WLAN_ATTRIB_PACK__ hfa384x_ChannelInfoRequest_data_t;
  1071. /*-- Configuration Record: WEPKeyMapping (data portion only) --*/
  1072. typedef struct hfa384x_WEPKeyMapping
  1073. {
  1074. UINT8 address[WLAN_ADDR_LEN];
  1075. UINT16 key_index;
  1076. UINT8 key[16];
  1077. UINT8 mic_transmit_key[4];
  1078. UINT8 mic_receive_key[4];
  1079. } __WLAN_ATTRIB_PACK__ hfa384x_WEPKeyMapping_t;
  1080. /*-- Configuration Record: WPAData (data portion only) --*/
  1081. typedef struct hfa384x_WPAData
  1082. {
  1083. UINT16 datalen;
  1084. UINT8 data[0]; // max 80
  1085. } __WLAN_ATTRIB_PACK__ hfa384x_WPAData_t;
  1086. /*--------------------------------------------------------------------
  1087. Configuration Record Structures: Behavior Parameters
  1088. --------------------------------------------------------------------*/
  1089. /*-- Configuration Record: TickTime --*/
  1090. typedef struct hfa384x_TickTime
  1091. {
  1092. UINT16 TickTime;
  1093. } __WLAN_ATTRIB_PACK__ hfa384x_TickTime_t;
  1094. /*--------------------------------------------------------------------
  1095. Information Record Structures: NIC Information
  1096. --------------------------------------------------------------------*/
  1097. /*-- Information Record: MaxLoadTime --*/
  1098. typedef struct hfa384x_MaxLoadTime
  1099. {
  1100. UINT16 MaxLoadTime;
  1101. } __WLAN_ATTRIB_PACK__ hfa384x_MaxLoadTime_t;
  1102. /*-- Information Record: DownLoadBuffer --*/
  1103. /* NOTE: The page and offset are in AUX format */
  1104. typedef struct hfa384x_downloadbuffer
  1105. {
  1106. UINT16 page;
  1107. UINT16 offset;
  1108. UINT16 len;
  1109. } __WLAN_ATTRIB_PACK__ hfa384x_downloadbuffer_t;
  1110. /*-- Information Record: PRIIdentity --*/
  1111. typedef struct hfa384x_PRIIdentity
  1112. {
  1113. UINT16 PRICompID;
  1114. UINT16 PRIVariant;
  1115. UINT16 PRIMajorVersion;
  1116. UINT16 PRIMinorVersion;
  1117. } __WLAN_ATTRIB_PACK__ hfa384x_PRIIdentity_t;
  1118. /*-- Information Record: PRISupRange --*/
  1119. typedef struct hfa384x_PRISupRange
  1120. {
  1121. UINT16 PRIRole;
  1122. UINT16 PRIID;
  1123. UINT16 PRIVariant;
  1124. UINT16 PRIBottom;
  1125. UINT16 PRITop;
  1126. } __WLAN_ATTRIB_PACK__ hfa384x_PRISupRange_t;
  1127. /*-- Information Record: CFIActRanges --*/
  1128. typedef struct hfa384x_CFIActRanges
  1129. {
  1130. UINT16 CFIRole;
  1131. UINT16 CFIID;
  1132. UINT16 CFIVariant;
  1133. UINT16 CFIBottom;
  1134. UINT16 CFITop;
  1135. } __WLAN_ATTRIB_PACK__ hfa384x_CFIActRanges_t;
  1136. /*-- Information Record: NICSerialNumber --*/
  1137. typedef struct hfa384x_NICSerialNumber
  1138. {
  1139. UINT8 NICSerialNumber[12];
  1140. } __WLAN_ATTRIB_PACK__ hfa384x_NICSerialNumber_t;
  1141. /*-- Information Record: NICIdentity --*/
  1142. typedef struct hfa384x_NICIdentity
  1143. {
  1144. UINT16 NICCompID;
  1145. UINT16 NICVariant;
  1146. UINT16 NICMajorVersion;
  1147. UINT16 NICMinorVersion;
  1148. } __WLAN_ATTRIB_PACK__ hfa384x_NICIdentity_t;
  1149. /*-- Information Record: MFISupRange --*/
  1150. typedef struct hfa384x_MFISupRange
  1151. {
  1152. UINT16 MFIRole;
  1153. UINT16 MFIID;
  1154. UINT16 MFIVariant;
  1155. UINT16 MFIBottom;
  1156. UINT16 MFITop;
  1157. } __WLAN_ATTRIB_PACK__ hfa384x_MFISupRange_t;
  1158. /*-- Information Record: CFISupRange --*/
  1159. typedef struct hfa384x_CFISupRange
  1160. {
  1161. UINT16 CFIRole;
  1162. UINT16 CFIID;
  1163. UINT16 CFIVariant;
  1164. UINT16 CFIBottom;
  1165. UINT16 CFITop;
  1166. } __WLAN_ATTRIB_PACK__ hfa384x_CFISupRange_t;
  1167. /*-- Information Record: BUILDSEQ:BuildSeq --*/
  1168. typedef struct hfa384x_BuildSeq {
  1169. UINT16 primary;
  1170. UINT16 secondary;
  1171. } __WLAN_ATTRIB_PACK__ hfa384x_BuildSeq_t;
  1172. /*-- Information Record: FWID --*/
  1173. #define HFA384x_FWID_LEN 14
  1174. typedef struct hfa384x_FWID {
  1175. UINT8 primary[HFA384x_FWID_LEN];
  1176. UINT8 secondary[HFA384x_FWID_LEN];
  1177. } __WLAN_ATTRIB_PACK__ hfa384x_FWID_t;
  1178. /*-- Information Record: ChannelList --*/
  1179. typedef struct hfa384x_ChannelList
  1180. {
  1181. UINT16 ChannelList;
  1182. } __WLAN_ATTRIB_PACK__ hfa384x_ChannelList_t;
  1183. /*-- Information Record: RegulatoryDomains --*/
  1184. typedef struct hfa384x_RegulatoryDomains
  1185. {
  1186. UINT8 RegulatoryDomains[12];
  1187. } __WLAN_ATTRIB_PACK__ hfa384x_RegulatoryDomains_t;
  1188. /*-- Information Record: TempType --*/
  1189. typedef struct hfa384x_TempType
  1190. {
  1191. UINT16 TempType;
  1192. } __WLAN_ATTRIB_PACK__ hfa384x_TempType_t;
  1193. /*-- Information Record: CIS --*/
  1194. typedef struct hfa384x_CIS
  1195. {
  1196. UINT8 CIS[480];
  1197. } __WLAN_ATTRIB_PACK__ hfa384x_CIS_t;
  1198. /*-- Information Record: STAIdentity --*/
  1199. typedef struct hfa384x_STAIdentity
  1200. {
  1201. UINT16 STACompID;
  1202. UINT16 STAVariant;
  1203. UINT16 STAMajorVersion;
  1204. UINT16 STAMinorVersion;
  1205. } __WLAN_ATTRIB_PACK__ hfa384x_STAIdentity_t;
  1206. /*-- Information Record: STASupRange --*/
  1207. typedef struct hfa384x_STASupRange
  1208. {
  1209. UINT16 STARole;
  1210. UINT16 STAID;
  1211. UINT16 STAVariant;
  1212. UINT16 STABottom;
  1213. UINT16 STATop;
  1214. } __WLAN_ATTRIB_PACK__ hfa384x_STASupRange_t;
  1215. /*-- Information Record: MFIActRanges --*/
  1216. typedef struct hfa384x_MFIActRanges
  1217. {
  1218. UINT16 MFIRole;
  1219. UINT16 MFIID;
  1220. UINT16 MFIVariant;
  1221. UINT16 MFIBottom;
  1222. UINT16 MFITop;
  1223. } __WLAN_ATTRIB_PACK__ hfa384x_MFIActRanges_t;
  1224. /*--------------------------------------------------------------------
  1225. Information Record Structures: NIC Information
  1226. --------------------------------------------------------------------*/
  1227. /*-- Information Record: PortStatus --*/
  1228. typedef struct hfa384x_PortStatus
  1229. {
  1230. UINT16 PortStatus;
  1231. } __WLAN_ATTRIB_PACK__ hfa384x_PortStatus_t;
  1232. #define HFA384x_PSTATUS_DISABLED ((UINT16)1)
  1233. #define HFA384x_PSTATUS_SEARCHING ((UINT16)2)
  1234. #define HFA384x_PSTATUS_CONN_IBSS ((UINT16)3)
  1235. #define HFA384x_PSTATUS_CONN_ESS ((UINT16)4)
  1236. #define HFA384x_PSTATUS_OUTOFRANGE ((UINT16)5)
  1237. #define HFA384x_PSTATUS_CONN_WDS ((UINT16)6)
  1238. /*-- Information Record: CurrentSSID --*/
  1239. typedef struct hfa384x_CurrentSSID
  1240. {
  1241. UINT8 CurrentSSID[34];
  1242. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentSSID_t;
  1243. /*-- Information Record: CurrentBSSID --*/
  1244. typedef struct hfa384x_CurrentBSSID
  1245. {
  1246. UINT8 CurrentBSSID[6];
  1247. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBSSID_t;
  1248. /*-- Information Record: commsquality --*/
  1249. typedef struct hfa384x_commsquality
  1250. {
  1251. UINT16 CQ_currBSS;
  1252. UINT16 ASL_currBSS;
  1253. UINT16 ANL_currFC;
  1254. } __WLAN_ATTRIB_PACK__ hfa384x_commsquality_t;
  1255. /*-- Information Record: dmbcommsquality --*/
  1256. typedef struct hfa384x_dbmcommsquality
  1257. {
  1258. UINT16 CQdbm_currBSS;
  1259. UINT16 ASLdbm_currBSS;
  1260. UINT16 ANLdbm_currFC;
  1261. } __WLAN_ATTRIB_PACK__ hfa384x_dbmcommsquality_t;
  1262. /*-- Information Record: CurrentTxRate --*/
  1263. typedef struct hfa384x_CurrentTxRate
  1264. {
  1265. UINT16 CurrentTxRate;
  1266. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentTxRate_t;
  1267. /*-- Information Record: CurrentBeaconInterval --*/
  1268. typedef struct hfa384x_CurrentBeaconInterval
  1269. {
  1270. UINT16 CurrentBeaconInterval;
  1271. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBeaconInterval_t;
  1272. /*-- Information Record: CurrentScaleThresholds --*/
  1273. typedef struct hfa384x_CurrentScaleThresholds
  1274. {
  1275. UINT16 EnergyDetectThreshold;
  1276. UINT16 CarrierDetectThreshold;
  1277. UINT16 DeferDetectThreshold;
  1278. UINT16 CellSearchThreshold; /* Stations only */
  1279. UINT16 DeadSpotThreshold; /* Stations only */
  1280. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentScaleThresholds_t;
  1281. /*-- Information Record: ProtocolRspTime --*/
  1282. typedef struct hfa384x_ProtocolRspTime
  1283. {
  1284. UINT16 ProtocolRspTime;
  1285. } __WLAN_ATTRIB_PACK__ hfa384x_ProtocolRspTime_t;
  1286. /*-- Information Record: ShortRetryLimit --*/
  1287. typedef struct hfa384x_ShortRetryLimit
  1288. {
  1289. UINT16 ShortRetryLimit;
  1290. } __WLAN_ATTRIB_PACK__ hfa384x_ShortRetryLimit_t;
  1291. /*-- Information Record: LongRetryLimit --*/
  1292. typedef struct hfa384x_LongRetryLimit
  1293. {
  1294. UINT16 LongRetryLimit;
  1295. } __WLAN_ATTRIB_PACK__ hfa384x_LongRetryLimit_t;
  1296. /*-- Information Record: MaxTransmitLifetime --*/
  1297. typedef struct hfa384x_MaxTransmitLifetime
  1298. {
  1299. UINT16 MaxTransmitLifetime;
  1300. } __WLAN_ATTRIB_PACK__ hfa384x_MaxTransmitLifetime_t;
  1301. /*-- Information Record: MaxReceiveLifetime --*/
  1302. typedef struct hfa384x_MaxReceiveLifetime
  1303. {
  1304. UINT16 MaxReceiveLifetime;
  1305. } __WLAN_ATTRIB_PACK__ hfa384x_MaxReceiveLifetime_t;
  1306. /*-- Information Record: CFPollable --*/
  1307. typedef struct hfa384x_CFPollable
  1308. {
  1309. UINT16 CFPollable;
  1310. } __WLAN_ATTRIB_PACK__ hfa384x_CFPollable_t;
  1311. /*-- Information Record: AuthenticationAlgorithms --*/
  1312. typedef struct hfa384x_AuthenticationAlgorithms
  1313. {
  1314. UINT16 AuthenticationType;
  1315. UINT16 TypeEnabled;
  1316. } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_t;
  1317. /*-- Information Record: AuthenticationAlgorithms
  1318. (data only --*/
  1319. typedef struct hfa384x_AuthenticationAlgorithms_data
  1320. {
  1321. UINT16 AuthenticationType;
  1322. UINT16 TypeEnabled;
  1323. } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_data_t;
  1324. /*-- Information Record: PrivacyOptionImplemented --*/
  1325. typedef struct hfa384x_PrivacyOptionImplemented
  1326. {
  1327. UINT16 PrivacyOptionImplemented;
  1328. } __WLAN_ATTRIB_PACK__ hfa384x_PrivacyOptionImplemented_t;
  1329. /*-- Information Record: OwnMACAddress --*/
  1330. typedef struct hfa384x_OwnMACAddress
  1331. {
  1332. UINT8 OwnMACAddress[6];
  1333. } __WLAN_ATTRIB_PACK__ hfa384x_OwnMACAddress_t;
  1334. /*-- Information Record: PCFInfo --*/
  1335. typedef struct hfa384x_PCFInfo
  1336. {
  1337. UINT16 MediumOccupancyLimit;
  1338. UINT16 CFPPeriod;
  1339. UINT16 CFPMaxDuration;
  1340. UINT16 CFPFlags;
  1341. } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_t;
  1342. /*-- Information Record: PCFInfo (data portion only) --*/
  1343. typedef struct hfa384x_PCFInfo_data
  1344. {
  1345. UINT16 MediumOccupancyLimit;
  1346. UINT16 CFPPeriod;
  1347. UINT16 CFPMaxDuration;
  1348. UINT16 CFPFlags;
  1349. } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_data_t;
  1350. /*--------------------------------------------------------------------
  1351. Information Record Structures: Modem Information Records
  1352. --------------------------------------------------------------------*/
  1353. /*-- Information Record: PHYType --*/
  1354. typedef struct hfa384x_PHYType
  1355. {
  1356. UINT16 PHYType;
  1357. } __WLAN_ATTRIB_PACK__ hfa384x_PHYType_t;
  1358. /*-- Information Record: CurrentChannel --*/
  1359. typedef struct hfa384x_CurrentChannel
  1360. {
  1361. UINT16 CurrentChannel;
  1362. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentChannel_t;
  1363. /*-- Information Record: CurrentPowerState --*/
  1364. typedef struct hfa384x_CurrentPowerState
  1365. {
  1366. UINT16 CurrentPowerState;
  1367. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentPowerState_t;
  1368. /*-- Information Record: CCAMode --*/
  1369. typedef struct hfa384x_CCAMode
  1370. {
  1371. UINT16 CCAMode;
  1372. } __WLAN_ATTRIB_PACK__ hfa384x_CCAMode_t;
  1373. /*-- Information Record: SupportedDataRates --*/
  1374. typedef struct hfa384x_SupportedDataRates
  1375. {
  1376. UINT8 SupportedDataRates[10];
  1377. } __WLAN_ATTRIB_PACK__ hfa384x_SupportedDataRates_t;
  1378. /*-- Information Record: LFOStatus --*/
  1379. typedef struct hfa384x_LFOStatus
  1380. {
  1381. UINT16 TestResults;
  1382. UINT16 LFOResult;
  1383. UINT16 VRHFOResult;
  1384. } __WLAN_ATTRIB_PACK__ hfa384x_LFOStatus_t;
  1385. #define HFA384x_TESTRESULT_ALLPASSED BIT0
  1386. #define HFA384x_TESTRESULT_LFO_FAIL BIT1
  1387. #define HFA384x_TESTRESULT_VR_HF0_FAIL BIT2
  1388. #define HFA384x_HOST_FIRM_COORDINATE BIT7
  1389. #define HFA384x_TESTRESULT_COORDINATE BIT15
  1390. /*-- Information Record: LEDControl --*/
  1391. typedef struct hfa384x_LEDControl
  1392. {
  1393. UINT16 searching_on;
  1394. UINT16 searching_off;
  1395. UINT16 assoc_on;
  1396. UINT16 assoc_off;
  1397. UINT16 activity;
  1398. } __WLAN_ATTRIB_PACK__ hfa384x_LEDControl_t;
  1399. /*--------------------------------------------------------------------
  1400. FRAME DESCRIPTORS AND FRAME STRUCTURES
  1401. FRAME DESCRIPTORS: Offsets
  1402. ----------------------------------------------------------------------
  1403. Control Info (offset 44-51)
  1404. --------------------------------------------------------------------*/
  1405. #define HFA384x_FD_STATUS_OFF ((UINT16)0x44)
  1406. #define HFA384x_FD_TIME_OFF ((UINT16)0x46)
  1407. #define HFA384x_FD_SWSUPPORT_OFF ((UINT16)0x4A)
  1408. #define HFA384x_FD_SILENCE_OFF ((UINT16)0x4A)
  1409. #define HFA384x_FD_SIGNAL_OFF ((UINT16)0x4B)
  1410. #define HFA384x_FD_RATE_OFF ((UINT16)0x4C)
  1411. #define HFA384x_FD_RXFLOW_OFF ((UINT16)0x4D)
  1412. #define HFA384x_FD_RESERVED_OFF ((UINT16)0x4E)
  1413. #define HFA384x_FD_TXCONTROL_OFF ((UINT16)0x50)
  1414. /*--------------------------------------------------------------------
  1415. 802.11 Header (offset 52-6B)
  1416. --------------------------------------------------------------------*/
  1417. #define HFA384x_FD_FRAMECONTROL_OFF ((UINT16)0x52)
  1418. #define HFA384x_FD_DURATIONID_OFF ((UINT16)0x54)
  1419. #define HFA384x_FD_ADDRESS1_OFF ((UINT16)0x56)
  1420. #define HFA384x_FD_ADDRESS2_OFF ((UINT16)0x5C)
  1421. #define HFA384x_FD_ADDRESS3_OFF ((UINT16)0x62)
  1422. #define HFA384x_FD_SEQCONTROL_OFF ((UINT16)0x68)
  1423. #define HFA384x_FD_ADDRESS4_OFF ((UINT16)0x6A)
  1424. #define HFA384x_FD_DATALEN_OFF ((UINT16)0x70)
  1425. /*--------------------------------------------------------------------
  1426. 802.3 Header (offset 72-7F)
  1427. --------------------------------------------------------------------*/
  1428. #define HFA384x_FD_DESTADDRESS_OFF ((UINT16)0x72)
  1429. #define HFA384x_FD_SRCADDRESS_OFF ((UINT16)0x78)
  1430. #define HFA384x_FD_DATALENGTH_OFF ((UINT16)0x7E)
  1431. /*--------------------------------------------------------------------
  1432. FRAME STRUCTURES: Communication Frames
  1433. ----------------------------------------------------------------------
  1434. Communication Frames: Transmit Frames
  1435. --------------------------------------------------------------------*/
  1436. /*-- Communication Frame: Transmit Frame Structure --*/
  1437. typedef struct hfa384x_tx_frame
  1438. {
  1439. UINT16 status;
  1440. UINT16 reserved1;
  1441. UINT16 reserved2;
  1442. UINT32 sw_support;
  1443. UINT8 tx_retrycount;
  1444. UINT8 tx_rate;
  1445. UINT16 tx_control;
  1446. /*-- 802.11 Header Information --*/
  1447. UINT16 frame_control;
  1448. UINT16 duration_id;
  1449. UINT8 address1[6];
  1450. UINT8 address2[6];
  1451. UINT8 address3[6];
  1452. UINT16 sequence_control;
  1453. UINT8 address4[6];
  1454. UINT16 data_len; /* little endian format */
  1455. /*-- 802.3 Header Information --*/
  1456. UINT8 dest_addr[6];
  1457. UINT8 src_addr[6];
  1458. UINT16 data_length; /* big endian format */
  1459. } __WLAN_ATTRIB_PACK__ hfa384x_tx_frame_t;
  1460. /*--------------------------------------------------------------------
  1461. Communication Frames: Field Masks for Transmit Frames
  1462. --------------------------------------------------------------------*/
  1463. /*-- Status Field --*/
  1464. #define HFA384x_TXSTATUS_ACKERR ((UINT16)BIT5)
  1465. #define HFA384x_TXSTATUS_FORMERR ((UINT16)BIT3)
  1466. #define HFA384x_TXSTATUS_DISCON ((UINT16)BIT2)
  1467. #define HFA384x_TXSTATUS_AGEDERR ((UINT16)BIT1)
  1468. #define HFA384x_TXSTATUS_RETRYERR ((UINT16)BIT0)
  1469. /*-- Transmit Control Field --*/
  1470. #define HFA384x_TX_CFPOLL ((UINT16)BIT12)
  1471. #define HFA384x_TX_PRST ((UINT16)BIT11)
  1472. #define HFA384x_TX_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8))
  1473. #define HFA384x_TX_NOENCRYPT ((UINT16)BIT7)
  1474. #define HFA384x_TX_RETRYSTRAT ((UINT16)(BIT6 | BIT5))
  1475. #define HFA384x_TX_STRUCTYPE ((UINT16)(BIT4 | BIT3))
  1476. #define HFA384x_TX_TXEX ((UINT16)BIT2)
  1477. #define HFA384x_TX_TXOK ((UINT16)BIT1)
  1478. /*--------------------------------------------------------------------
  1479. Communication Frames: Test/Get/Set Field Values for Transmit Frames
  1480. --------------------------------------------------------------------*/
  1481. /*-- Status Field --*/
  1482. #define HFA384x_TXSTATUS_ISERROR(v) \
  1483. (((UINT16)(v))&\
  1484. (HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\
  1485. HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\
  1486. HFA384x_TXSTATUS_RETRYERR))
  1487. #define HFA384x_TXSTATUS_ISACKERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_ACKERR))
  1488. #define HFA384x_TXSTATUS_ISFORMERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_FORMERR))
  1489. #define HFA384x_TXSTATUS_ISDISCON(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_DISCON))
  1490. #define HFA384x_TXSTATUS_ISAGEDERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_AGEDERR))
  1491. #define HFA384x_TXSTATUS_ISRETRYERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_RETRYERR))
  1492. #define HFA384x_TX_GET(v,m,s) ((((UINT16)(v))&((UINT16)(m)))>>((UINT16)(s)))
  1493. #define HFA384x_TX_SET(v,m,s) ((((UINT16)(v))<<((UINT16)(s)))&((UINT16)(m)))
  1494. #define HFA384x_TX_CFPOLL_GET(v) HFA384x_TX_GET(v, HFA384x_TX_CFPOLL,12)
  1495. #define HFA384x_TX_CFPOLL_SET(v) HFA384x_TX_SET(v, HFA384x_TX_CFPOLL,12)
  1496. #define HFA384x_TX_PRST_GET(v) HFA384x_TX_GET(v, HFA384x_TX_PRST,11)
  1497. #define HFA384x_TX_PRST_SET(v) HFA384x_TX_SET(v, HFA384x_TX_PRST,11)
  1498. #define HFA384x_TX_MACPORT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_MACPORT, 8)
  1499. #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
  1500. #define HFA384x_TX_NOENCRYPT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_NOENCRYPT, 7)
  1501. #define HFA384x_TX_NOENCRYPT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_NOENCRYPT, 7)
  1502. #define HFA384x_TX_RETRYSTRAT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_RETRYSTRAT, 5)
  1503. #define HFA384x_TX_RETRYSTRAT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_RETRYSTRAT, 5)
  1504. #define HFA384x_TX_STRUCTYPE_GET(v) HFA384x_TX_GET(v, HFA384x_TX_STRUCTYPE, 3)
  1505. #define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3)
  1506. #define HFA384x_TX_TXEX_GET(v) HFA384x_TX_GET(v, HFA384x_TX_TXEX, 2)
  1507. #define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2)
  1508. #define HFA384x_TX_TXOK_GET(v) HFA384x_TX_GET(v, HFA384x_TX_TXOK, 1)
  1509. #define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)
  1510. /*--------------------------------------------------------------------
  1511. Communication Frames: Receive Frames
  1512. --------------------------------------------------------------------*/
  1513. /*-- Communication Frame: Receive Frame Structure --*/
  1514. typedef struct hfa384x_rx_frame
  1515. {
  1516. /*-- MAC rx descriptor (hfa384x byte order) --*/
  1517. UINT16 status;
  1518. UINT32 time;
  1519. UINT8 silence;
  1520. UINT8 signal;
  1521. UINT8 rate;
  1522. UINT8 rx_flow;
  1523. UINT16 reserved1;
  1524. UINT16 reserved2;
  1525. /*-- 802.11 Header Information (802.11 byte order) --*/
  1526. UINT16 frame_control;
  1527. UINT16 duration_id;
  1528. UINT8 address1[6];
  1529. UINT8 address2[6];
  1530. UINT8 address3[6];
  1531. UINT16 sequence_control;
  1532. UINT8 address4[6];
  1533. UINT16 data_len; /* hfa384x (little endian) format */
  1534. /*-- 802.3 Header Information --*/
  1535. UINT8 dest_addr[6];
  1536. UINT8 src_addr[6];
  1537. UINT16 data_length; /* IEEE? (big endian) format */
  1538. } __WLAN_ATTRIB_PACK__ hfa384x_rx_frame_t;
  1539. /*--------------------------------------------------------------------
  1540. Communication Frames: Field Masks for Receive Frames
  1541. --------------------------------------------------------------------*/
  1542. /*-- Offsets --------*/
  1543. #define HFA384x_RX_DATA_LEN_OFF ((UINT16)44)
  1544. #define HFA384x_RX_80211HDR_OFF ((UINT16)14)
  1545. #define HFA384x_RX_DATA_OFF ((UINT16)60)
  1546. /*-- Status Fields --*/
  1547. #define HFA384x_RXSTATUS_MSGTYPE ((UINT16)(BIT15 | BIT14 | BIT13))
  1548. #define HFA384x_RXSTATUS_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8))
  1549. #define HFA384x_RXSTATUS_UNDECR ((UINT16)BIT1)
  1550. #define HFA384x_RXSTATUS_FCSERR ((UINT16)BIT0)
  1551. /*--------------------------------------------------------------------
  1552. Communication Frames: Test/Get/Set Field Values for Receive Frames
  1553. --------------------------------------------------------------------*/
  1554. #define HFA384x_RXSTATUS_MSGTYPE_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13))
  1555. #define HFA384x_RXSTATUS_MSGTYPE_SET(value) ((UINT16)(((UINT16)(value)) << 13))
  1556. #define HFA384x_RXSTATUS_MACPORT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8))
  1557. #define HFA384x_RXSTATUS_MACPORT_SET(value) ((UINT16)(((UINT16)(value)) << 8))
  1558. #define HFA384x_RXSTATUS_ISUNDECR(value) ((UINT16)(((UINT16)(value)) & HFA384x_RXSTATUS_UNDECR))
  1559. #define HFA384x_RXSTATUS_ISFCSERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_RXSTATUS_FCSERR))
  1560. /*--------------------------------------------------------------------
  1561. FRAME STRUCTURES: Information Types and Information Frame Structures
  1562. ----------------------------------------------------------------------
  1563. Information Types
  1564. --------------------------------------------------------------------*/
  1565. #define HFA384x_IT_HANDOVERADDR ((UINT16)0xF000UL)
  1566. #define HFA384x_IT_HANDOVERDEAUTHADDRESS ((UINT16)0xF001UL)//AP 1.3.7
  1567. #define HFA384x_IT_COMMTALLIES ((UINT16)0xF100UL)
  1568. #define HFA384x_IT_SCANRESULTS ((UINT16)0xF101UL)
  1569. #define HFA384x_IT_CHINFORESULTS ((UINT16)0xF102UL)
  1570. #define HFA384x_IT_HOSTSCANRESULTS ((UINT16)0xF103UL)
  1571. #define HFA384x_IT_LINKSTATUS ((UINT16)0xF200UL)
  1572. #define HFA384x_IT_ASSOCSTATUS ((UINT16)0xF201UL)
  1573. #define HFA384x_IT_AUTHREQ ((UINT16)0xF202UL)
  1574. #define HFA384x_IT_PSUSERCNT ((UINT16)0xF203UL)
  1575. #define HFA384x_IT_KEYIDCHANGED ((UINT16)0xF204UL)
  1576. #define HFA384x_IT_ASSOCREQ ((UINT16)0xF205UL)
  1577. #define HFA384x_IT_MICFAILURE ((UINT16)0xF206UL)
  1578. /*--------------------------------------------------------------------
  1579. Information Frames Structures
  1580. ----------------------------------------------------------------------
  1581. Information Frames: Notification Frame Structures
  1582. --------------------------------------------------------------------*/
  1583. /*-- Notification Frame,MAC Mgmt: Handover Address --*/
  1584. typedef struct hfa384x_HandoverAddr
  1585. {
  1586. UINT16 framelen;
  1587. UINT16 infotype;
  1588. UINT8 handover_addr[WLAN_BSSID_LEN];
  1589. } __WLAN_ATTRIB_PACK__ hfa384x_HandoverAddr_t;
  1590. /*-- Inquiry Frame, Diagnose: Communication Tallies --*/
  1591. typedef struct hfa384x_CommTallies16
  1592. {
  1593. UINT16 txunicastframes;
  1594. UINT16 txmulticastframes;
  1595. UINT16 txfragments;
  1596. UINT16 txunicastoctets;
  1597. UINT16 txmulticastoctets;
  1598. UINT16 txdeferredtrans;
  1599. UINT16 txsingleretryframes;
  1600. UINT16 txmultipleretryframes;
  1601. UINT16 txretrylimitexceeded;
  1602. UINT16 txdiscards;
  1603. UINT16 rxunicastframes;
  1604. UINT16 rxmulticastframes;
  1605. UINT16 rxfragments;
  1606. UINT16 rxunicastoctets;
  1607. UINT16 rxmulticastoctets;
  1608. UINT16 rxfcserrors;
  1609. UINT16 rxdiscardsnobuffer;
  1610. UINT16 txdiscardswrongsa;
  1611. UINT16 rxdiscardswepundecr;
  1612. UINT16 rxmsginmsgfrag;
  1613. UINT16 rxmsginbadmsgfrag;
  1614. } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies16_t;
  1615. typedef struct hfa384x_CommTallies32
  1616. {
  1617. UINT32 txunicastframes;
  1618. UINT32 txmulticastframes;
  1619. UINT32 txfragments;
  1620. UINT32 txunicastoctets;
  1621. UINT32 txmulticastoctets;
  1622. UINT32 txdeferredtrans;
  1623. UINT32 txsingleretryframes;
  1624. UINT32 txmultipleretryframes;
  1625. UINT32 txretrylimitexceeded;
  1626. UINT32 txdiscards;
  1627. UINT32 rxunicastframes;
  1628. UINT32 rxmulticastframes;
  1629. UINT32 rxfragments;
  1630. UINT32 rxunicastoctets;
  1631. UINT32 rxmulticastoctets;
  1632. UINT32 rxfcserrors;
  1633. UINT32 rxdiscardsnobuffer;
  1634. UINT32 txdiscardswrongsa;
  1635. UINT32 rxdiscardswepundecr;
  1636. UINT32 rxmsginmsgfrag;
  1637. UINT32 rxmsginbadmsgfrag;
  1638. } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies32_t;
  1639. /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/
  1640. typedef struct hfa384x_ScanResultSub
  1641. {
  1642. UINT16 chid;
  1643. UINT16 anl;
  1644. UINT16 sl;
  1645. UINT8 bssid[WLAN_BSSID_LEN];
  1646. UINT16 bcnint;
  1647. UINT16 capinfo;
  1648. hfa384x_bytestr32_t ssid;
  1649. UINT8 supprates[10]; /* 802.11 info element */
  1650. UINT16 proberesp_rate;
  1651. } __WLAN_ATTRIB_PACK__ hfa384x_ScanResultSub_t;
  1652. typedef struct hfa384x_ScanResult
  1653. {
  1654. UINT16 rsvd;
  1655. UINT16 scanreason;
  1656. hfa384x_ScanResultSub_t
  1657. result[HFA384x_SCANRESULT_MAX];
  1658. } __WLAN_ATTRIB_PACK__ hfa384x_ScanResult_t;
  1659. /*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
  1660. typedef struct hfa384x_ChInfoResultSub
  1661. {
  1662. UINT16 chid;
  1663. UINT16 anl;
  1664. UINT16 pnl;
  1665. UINT16 active;
  1666. } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResultSub_t;
  1667. #define HFA384x_CHINFORESULT_BSSACTIVE BIT0
  1668. #define HFA384x_CHINFORESULT_PCFACTIVE BIT1
  1669. typedef struct hfa384x_ChInfoResult
  1670. {
  1671. UINT16 scanchannels;
  1672. hfa384x_ChInfoResultSub_t
  1673. result[HFA384x_CHINFORESULT_MAX];
  1674. } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResult_t;
  1675. /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
  1676. typedef struct hfa384x_HScanResultSub
  1677. {
  1678. UINT16 chid;
  1679. UINT16 anl;
  1680. UINT16 sl;
  1681. UINT8 bssid[WLAN_BSSID_LEN];
  1682. UINT16 bcnint;
  1683. UINT16 capinfo;
  1684. hfa384x_bytestr32_t ssid;
  1685. UINT8 supprates[10]; /* 802.11 info element */
  1686. UINT16 proberesp_rate;
  1687. UINT16 atim;
  1688. } __WLAN_ATTRIB_PACK__ hfa384x_HScanResultSub_t;
  1689. typedef struct hfa384x_HScanResult
  1690. {
  1691. UINT16 nresult;
  1692. UINT16 rsvd;
  1693. hfa384x_HScanResultSub_t
  1694. result[HFA384x_HSCANRESULT_MAX];
  1695. } __WLAN_ATTRIB_PACK__ hfa384x_HScanResult_t;
  1696. /*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/
  1697. #define HFA384x_LINK_NOTCONNECTED ((UINT16)0)
  1698. #define HFA384x_LINK_CONNECTED ((UINT16)1)
  1699. #define HFA384x_LINK_DISCONNECTED ((UINT16)2)
  1700. #define HFA384x_LINK_AP_CHANGE ((UINT16)3)
  1701. #define HFA384x_LINK_AP_OUTOFRANGE ((UINT16)4)
  1702. #define HFA384x_LINK_AP_INRANGE ((UINT16)5)
  1703. #define HFA384x_LINK_ASSOCFAIL ((UINT16)6)
  1704. typedef struct hfa384x_LinkStatus
  1705. {
  1706. UINT16 linkstatus;
  1707. } __WLAN_ATTRIB_PACK__ hfa384x_LinkStatus_t;
  1708. /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
  1709. #define HFA384x_ASSOCSTATUS_STAASSOC ((UINT16)1)
  1710. #define HFA384x_ASSOCSTATUS_REASSOC ((UINT16)2)
  1711. #define HFA384x_ASSOCSTATUS_DISASSOC ((UINT16)3)
  1712. #define HFA384x_ASSOCSTATUS_ASSOCFAIL ((UINT16)4)
  1713. #define HFA384x_ASSOCSTATUS_AUTHFAIL ((UINT16)5)
  1714. typedef struct hfa384x_AssocStatus
  1715. {
  1716. UINT16 assocstatus;
  1717. UINT8 sta_addr[WLAN_ADDR_LEN];
  1718. /* old_ap_addr is only valid if assocstatus == 2 */
  1719. UINT8 old_ap_addr[WLAN_ADDR_LEN];
  1720. UINT16 reason;
  1721. UINT16 reserved;
  1722. } __WLAN_ATTRIB_PACK__ hfa384x_AssocStatus_t;
  1723. /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
  1724. typedef struct hfa384x_AuthRequest
  1725. {
  1726. UINT8 sta_addr[WLAN_ADDR_LEN];
  1727. UINT16 algorithm;
  1728. } __WLAN_ATTRIB_PACK__ hfa384x_AuthReq_t;
  1729. /*-- Unsolicited Frame, MAC Mgmt: AssocRequest (AP Only) --*/
  1730. typedef struct hfa384x_AssocRequest
  1731. {
  1732. UINT8 sta_addr[WLAN_ADDR_LEN];
  1733. UINT16 type;
  1734. UINT8 wpa_data[80];
  1735. } __WLAN_ATTRIB_PACK__ hfa384x_AssocReq_t;
  1736. #define HFA384x_ASSOCREQ_TYPE_ASSOC 0
  1737. #define HFA384x_ASSOCREQ_TYPE_REASSOC 1
  1738. /*-- Unsolicited Frame, MAC Mgmt: MIC Failure (AP Only) --*/
  1739. typedef struct hfa384x_MicFailure
  1740. {
  1741. UINT8 sender[WLAN_ADDR_LEN];
  1742. UINT8 dest[WLAN_ADDR_LEN];
  1743. } __WLAN_ATTRIB_PACK__ hfa384x_MicFailure_t;
  1744. /*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
  1745. typedef struct hfa384x_PSUserCount
  1746. {
  1747. UINT16 usercnt;
  1748. } __WLAN_ATTRIB_PACK__ hfa384x_PSUserCount_t;
  1749. typedef struct hfa384x_KeyIDChanged
  1750. {
  1751. UINT8 sta_addr[WLAN_ADDR_LEN];
  1752. UINT16 keyid;
  1753. } __WLAN_ATTRIB_PACK__ hfa384x_KeyIDChanged_t;
  1754. /*-- Collection of all Inf frames ---------------*/
  1755. typedef union hfa384x_infodata {
  1756. hfa384x_CommTallies16_t commtallies16;
  1757. hfa384x_CommTallies32_t commtallies32;
  1758. hfa384x_ScanResult_t scanresult;
  1759. hfa384x_ChInfoResult_t chinforesult;
  1760. hfa384x_HScanResult_t hscanresult;
  1761. hfa384x_LinkStatus_t linkstatus;
  1762. hfa384x_AssocStatus_t assocstatus;
  1763. hfa384x_AuthReq_t authreq;
  1764. hfa384x_PSUserCount_t psusercnt;
  1765. hfa384x_KeyIDChanged_t keyidchanged;
  1766. } __WLAN_ATTRIB_PACK__ hfa384x_infodata_t;
  1767. typedef struct hfa384x_InfFrame
  1768. {
  1769. UINT16 framelen;
  1770. UINT16 infotype;
  1771. hfa384x_infodata_t info;
  1772. } __WLAN_ATTRIB_PACK__ hfa384x_InfFrame_t;
  1773. #if (WLAN_HOSTIF == WLAN_USB)
  1774. /*--------------------------------------------------------------------
  1775. USB Packet structures and constants.
  1776. --------------------------------------------------------------------*/
  1777. /* Should be sent to the ctrlout endpoint */
  1778. #define HFA384x_USB_ENBULKIN 6
  1779. /* Should be sent to the bulkout endpoint */
  1780. #define HFA384x_USB_TXFRM 0
  1781. #define HFA384x_USB_CMDREQ 1
  1782. #define HFA384x_USB_WRIDREQ 2
  1783. #define HFA384x_USB_RRIDREQ 3
  1784. #define HFA384x_USB_WMEMREQ 4
  1785. #define HFA384x_USB_RMEMREQ 5
  1786. /* Received from the bulkin endpoint */
  1787. #define HFA384x_USB_ISFRM(a) (!((a) & 0x8000))
  1788. #define HFA384x_USB_ISTXFRM(a) (((a) & 0x9000) == 0x1000)
  1789. #define HFA384x_USB_ISRXFRM(a) (!((a) & 0x9000))
  1790. #define HFA384x_USB_INFOFRM 0x8000
  1791. #define HFA384x_USB_CMDRESP 0x8001
  1792. #define HFA384x_USB_WRIDRESP 0x8002
  1793. #define HFA384x_USB_RRIDRESP 0x8003
  1794. #define HFA384x_USB_WMEMRESP 0x8004
  1795. #define HFA384x_USB_RMEMRESP 0x8005
  1796. #define HFA384x_USB_BUFAVAIL 0x8006
  1797. #define HFA384x_USB_ERROR 0x8007
  1798. /*------------------------------------*/
  1799. /* Request (bulk OUT) packet contents */
  1800. typedef struct hfa384x_usb_txfrm {
  1801. hfa384x_tx_frame_t desc;
  1802. UINT8 data[WLAN_DATA_MAXLEN];
  1803. } __WLAN_ATTRIB_PACK__ hfa384x_usb_txfrm_t;
  1804. typedef struct hfa384x_usb_cmdreq {
  1805. UINT16 type;
  1806. UINT16 cmd;
  1807. UINT16 parm0;
  1808. UINT16 parm1;
  1809. UINT16 parm2;
  1810. UINT8 pad[54];
  1811. } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdreq_t;
  1812. typedef struct hfa384x_usb_wridreq {
  1813. UINT16 type;
  1814. UINT16 frmlen;
  1815. UINT16 rid;
  1816. UINT8 data[HFA384x_RIDDATA_MAXLEN];
  1817. } __WLAN_ATTRIB_PACK__ hfa384x_usb_wridreq_t;
  1818. typedef struct hfa384x_usb_rridreq {
  1819. UINT16 type;
  1820. UINT16 frmlen;
  1821. UINT16 rid;
  1822. UINT8 pad[58];
  1823. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridreq_t;
  1824. typedef struct hfa384x_usb_wmemreq {
  1825. UINT16 type;
  1826. UINT16 frmlen;
  1827. UINT16 offset;
  1828. UINT16 page;
  1829. UINT8 data[HFA384x_USB_RWMEM_MAXLEN];
  1830. } __WLAN_ATTRIB_PACK__ hfa384x_usb_wmemreq_t;
  1831. typedef struct hfa384x_usb_rmemreq {
  1832. UINT16 type;
  1833. UINT16 frmlen;
  1834. UINT16 offset;
  1835. UINT16 page;
  1836. UINT8 pad[56];
  1837. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemreq_t;
  1838. /*------------------------------------*/
  1839. /* Response (bulk IN) packet contents */
  1840. typedef struct hfa384x_usb_rxfrm {
  1841. hfa384x_rx_frame_t desc;
  1842. UINT8 data[WLAN_DATA_MAXLEN];
  1843. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rxfrm_t;
  1844. typedef struct hfa384x_usb_infofrm {
  1845. UINT16 type;
  1846. hfa384x_InfFrame_t info;
  1847. } __WLAN_ATTRIB_PACK__ hfa384x_usb_infofrm_t;
  1848. typedef struct hfa384x_usb_statusresp {
  1849. UINT16 type;
  1850. UINT16 status;
  1851. UINT16 resp0;
  1852. UINT16 resp1;
  1853. UINT16 resp2;
  1854. } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdresp_t;
  1855. typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t;
  1856. typedef struct hfa384x_usb_rridresp {
  1857. UINT16 type;
  1858. UINT16 frmlen;
  1859. UINT16 rid;
  1860. UINT8 data[HFA384x_RIDDATA_MAXLEN];
  1861. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridresp_t;
  1862. typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t;
  1863. typedef struct hfa384x_usb_rmemresp {
  1864. UINT16 type;
  1865. UINT16 frmlen;
  1866. UINT8 data[HFA384x_USB_RWMEM_MAXLEN];
  1867. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemresp_t;
  1868. typedef struct hfa384x_usb_bufavail {
  1869. UINT16 type;
  1870. UINT16 frmlen;
  1871. } __WLAN_ATTRIB_PACK__ hfa384x_usb_bufavail_t;
  1872. typedef struct hfa384x_usb_error {
  1873. UINT16 type;
  1874. UINT16 errortype;
  1875. } __WLAN_ATTRIB_PACK__ hfa384x_usb_error_t;
  1876. /*----------------------------------------------------------*/
  1877. /* Unions for packaging all the known packet types together */
  1878. typedef union hfa384x_usbout {
  1879. UINT16 type;
  1880. hfa384x_usb_txfrm_t txfrm;
  1881. hfa384x_usb_cmdreq_t cmdreq;
  1882. hfa384x_usb_wridreq_t wridreq;
  1883. hfa384x_usb_rridreq_t rridreq;
  1884. hfa384x_usb_wmemreq_t wmemreq;
  1885. hfa384x_usb_rmemreq_t rmemreq;
  1886. } __WLAN_ATTRIB_PACK__ hfa384x_usbout_t;
  1887. typedef union hfa384x_usbin {
  1888. UINT16 type;
  1889. hfa384x_usb_rxfrm_t rxfrm;
  1890. hfa384x_usb_txfrm_t txfrm;
  1891. hfa384x_usb_infofrm_t infofrm;
  1892. hfa384x_usb_cmdresp_t cmdresp;
  1893. hfa384x_usb_wridresp_t wridresp;
  1894. hfa384x_usb_rridresp_t rridresp;
  1895. hfa384x_usb_wmemresp_t wmemresp;
  1896. hfa384x_usb_rmemresp_t rmemresp;
  1897. hfa384x_usb_bufavail_t bufavail;
  1898. hfa384x_usb_error_t usberror;
  1899. UINT8 boguspad[3000];
  1900. } __WLAN_ATTRIB_PACK__ hfa384x_usbin_t;
  1901. #endif /* WLAN_USB */
  1902. /*--------------------------------------------------------------------
  1903. PD record structures.
  1904. --------------------------------------------------------------------*/
  1905. typedef struct hfa384x_pdr_pcb_partnum
  1906. {
  1907. UINT8 num[8];
  1908. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_partnum_t;
  1909. typedef struct hfa384x_pdr_pcb_tracenum
  1910. {
  1911. UINT8 num[8];
  1912. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_tracenum_t;
  1913. typedef struct hfa384x_pdr_nic_serial
  1914. {
  1915. UINT8 num[12];
  1916. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_serial_t;
  1917. typedef struct hfa384x_pdr_mkk_measurements
  1918. {
  1919. double carrier_freq;
  1920. double occupied_band;
  1921. double power_density;
  1922. double tx_spur_f1;
  1923. double tx_spur_f2;
  1924. double tx_spur_f3;
  1925. double tx_spur_f4;
  1926. double tx_spur_l1;
  1927. double tx_spur_l2;
  1928. double tx_spur_l3;
  1929. double tx_spur_l4;
  1930. double rx_spur_f1;
  1931. double rx_spur_f2;
  1932. double rx_spur_l1;
  1933. double rx_spur_l2;
  1934. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_measurements_t;
  1935. typedef struct hfa384x_pdr_nic_ramsize
  1936. {
  1937. UINT8 size[12]; /* units of KB */
  1938. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_ramsize_t;
  1939. typedef struct hfa384x_pdr_mfisuprange
  1940. {
  1941. UINT16 id;
  1942. UINT16 variant;
  1943. UINT16 bottom;
  1944. UINT16 top;
  1945. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mfisuprange_t;
  1946. typedef struct hfa384x_pdr_cfisuprange
  1947. {
  1948. UINT16 id;
  1949. UINT16 variant;
  1950. UINT16 bottom;
  1951. UINT16 top;
  1952. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_cfisuprange_t;
  1953. typedef struct hfa384x_pdr_nicid
  1954. {
  1955. UINT16 id;
  1956. UINT16 variant;
  1957. UINT16 major;
  1958. UINT16 minor;
  1959. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nicid_t;
  1960. typedef struct hfa384x_pdr_refdac_measurements
  1961. {
  1962. UINT16 value[0];
  1963. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_measurements_t;
  1964. typedef struct hfa384x_pdr_vgdac_measurements
  1965. {
  1966. UINT16 value[0];
  1967. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_measurements_t;
  1968. typedef struct hfa384x_pdr_level_comp_measurements
  1969. {
  1970. UINT16 value[0];
  1971. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_compc_measurements_t;
  1972. typedef struct hfa384x_pdr_mac_address
  1973. {
  1974. UINT8 addr[6];
  1975. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mac_address_t;
  1976. typedef struct hfa384x_pdr_mkk_callname
  1977. {
  1978. UINT8 callname[8];
  1979. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_callname_t;
  1980. typedef struct hfa384x_pdr_regdomain
  1981. {
  1982. UINT16 numdomains;
  1983. UINT16 domain[5];
  1984. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_regdomain_t;
  1985. typedef struct hfa384x_pdr_allowed_channel
  1986. {
  1987. UINT16 ch_bitmap;
  1988. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_allowed_channel_t;
  1989. typedef struct hfa384x_pdr_default_channel
  1990. {
  1991. UINT16 channel;
  1992. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_default_channel_t;
  1993. typedef struct hfa384x_pdr_privacy_option
  1994. {
  1995. UINT16 available;
  1996. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_privacy_option_t;
  1997. typedef struct hfa384x_pdr_temptype
  1998. {
  1999. UINT16 type;
  2000. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_temptype_t;
  2001. typedef struct hfa384x_pdr_refdac_setup
  2002. {
  2003. UINT16 ch_value[14];
  2004. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_setup_t;
  2005. typedef struct hfa384x_pdr_vgdac_setup
  2006. {
  2007. UINT16 ch_value[14];
  2008. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_setup_t;
  2009. typedef struct hfa384x_pdr_level_comp_setup
  2010. {
  2011. UINT16 ch_value[14];
  2012. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_comp_setup_t;
  2013. typedef struct hfa384x_pdr_trimdac_setup
  2014. {
  2015. UINT16 trimidac;
  2016. UINT16 trimqdac;
  2017. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_trimdac_setup_t;
  2018. typedef struct hfa384x_pdr_ifr_setting
  2019. {
  2020. UINT16 value[3];
  2021. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_ifr_setting_t;
  2022. typedef struct hfa384x_pdr_rfr_setting
  2023. {
  2024. UINT16 value[3];
  2025. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_rfr_setting_t;
  2026. typedef struct hfa384x_pdr_hfa3861_baseline
  2027. {
  2028. UINT16 value[50];
  2029. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_baseline_t;
  2030. typedef struct hfa384x_pdr_hfa3861_shadow
  2031. {
  2032. UINT32 value[32];
  2033. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_shadow_t;
  2034. typedef struct hfa384x_pdr_hfa3861_ifrf
  2035. {
  2036. UINT32 value[20];
  2037. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_ifrf_t;
  2038. typedef struct hfa384x_pdr_hfa3861_chcalsp
  2039. {
  2040. UINT16 value[14];
  2041. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcalsp_t;
  2042. typedef struct hfa384x_pdr_hfa3861_chcali
  2043. {
  2044. UINT16 value[17];
  2045. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcali_t;
  2046. typedef struct hfa384x_pdr_hfa3861_nic_config
  2047. {
  2048. UINT16 config_bitmap;
  2049. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_config_t;
  2050. typedef struct hfa384x_pdr_hfo_delay
  2051. {
  2052. UINT8 hfo_delay;
  2053. } __WLAN_ATTRIB_PACK__ hfa384x_hfo_delay_t;
  2054. typedef struct hfa384x_pdr_hfa3861_manf_testsp
  2055. {
  2056. UINT16 value[30];
  2057. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testsp_t;
  2058. typedef struct hfa384x_pdr_hfa3861_manf_testi
  2059. {
  2060. UINT16 value[30];
  2061. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testi_t;
  2062. typedef struct hfa384x_end_of_pda
  2063. {
  2064. UINT16 crc;
  2065. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_end_of_pda_t;
  2066. typedef struct hfa384x_pdrec
  2067. {
  2068. UINT16 len; /* in words */
  2069. UINT16 code;
  2070. union pdr {
  2071. hfa384x_pdr_pcb_partnum_t pcb_partnum;
  2072. hfa384x_pdr_pcb_tracenum_t pcb_tracenum;
  2073. hfa384x_pdr_nic_serial_t nic_serial;
  2074. hfa384x_pdr_mkk_measurements_t mkk_measurements;
  2075. hfa384x_pdr_nic_ramsize_t nic_ramsize;
  2076. hfa384x_pdr_mfisuprange_t mfisuprange;
  2077. hfa384x_pdr_cfisuprange_t cfisuprange;
  2078. hfa384x_pdr_nicid_t nicid;
  2079. hfa384x_pdr_refdac_measurements_t refdac_measurements;
  2080. hfa384x_pdr_vgdac_measurements_t vgdac_measurements;
  2081. hfa384x_pdr_level_compc_measurements_t level_compc_measurements;
  2082. hfa384x_pdr_mac_address_t mac_address;
  2083. hfa384x_pdr_mkk_callname_t mkk_callname;
  2084. hfa384x_pdr_regdomain_t regdomain;
  2085. hfa384x_pdr_allowed_channel_t allowed_channel;
  2086. hfa384x_pdr_default_channel_t default_channel;
  2087. hfa384x_pdr_privacy_option_t privacy_option;
  2088. hfa384x_pdr_temptype_t temptype;
  2089. hfa384x_pdr_refdac_setup_t refdac_setup;
  2090. hfa384x_pdr_vgdac_setup_t vgdac_setup;
  2091. hfa384x_pdr_level_comp_setup_t level_comp_setup;
  2092. hfa384x_pdr_trimdac_setup_t trimdac_setup;
  2093. hfa384x_pdr_ifr_setting_t ifr_setting;
  2094. hfa384x_pdr_rfr_setting_t rfr_setting;
  2095. hfa384x_pdr_hfa3861_baseline_t hfa3861_baseline;
  2096. hfa384x_pdr_hfa3861_shadow_t hfa3861_shadow;
  2097. hfa384x_pdr_hfa3861_ifrf_t hfa3861_ifrf;
  2098. hfa384x_pdr_hfa3861_chcalsp_t hfa3861_chcalsp;
  2099. hfa384x_pdr_hfa3861_chcali_t hfa3861_chcali;
  2100. hfa384x_pdr_nic_config_t nic_config;
  2101. hfa384x_hfo_delay_t hfo_delay;
  2102. hfa384x_pdr_hfa3861_manf_testsp_t hfa3861_manf_testsp;
  2103. hfa384x_pdr_hfa3861_manf_testi_t hfa3861_manf_testi;
  2104. hfa384x_pdr_end_of_pda_t end_of_pda;
  2105. } data;
  2106. } __WLAN_ATTRIB_PACK__ hfa384x_pdrec_t;
  2107. #ifdef __KERNEL__
  2108. /*--------------------------------------------------------------------
  2109. --- MAC state structure, argument to all functions --
  2110. --- Also, a collection of support types --
  2111. --------------------------------------------------------------------*/
  2112. typedef struct hfa384x_statusresult
  2113. {
  2114. UINT16 status;
  2115. UINT16 resp0;
  2116. UINT16 resp1;
  2117. UINT16 resp2;
  2118. } hfa384x_cmdresult_t;
  2119. #if (WLAN_HOSTIF == WLAN_USB)
  2120. /* USB Control Exchange (CTLX):
  2121. * A queue of the structure below is maintained for all of the
  2122. * Request/Response type USB packets supported by Prism2.
  2123. */
  2124. /* The following hfa384x_* structures are arguments to
  2125. * the usercb() for the different CTLX types.
  2126. */
  2127. typedef hfa384x_cmdresult_t hfa384x_wridresult_t;
  2128. typedef hfa384x_cmdresult_t hfa384x_wmemresult_t;
  2129. typedef struct hfa384x_rridresult
  2130. {
  2131. UINT16 rid;
  2132. const void *riddata;
  2133. UINT riddata_len;
  2134. } hfa384x_rridresult_t;
  2135. enum ctlx_state {
  2136. CTLX_START = 0, /* Start state, not queued */
  2137. CTLX_COMPLETE, /* CTLX successfully completed */
  2138. CTLX_REQ_FAILED, /* OUT URB completed w/ error */
  2139. CTLX_PENDING, /* Queued, data valid */
  2140. CTLX_REQ_SUBMITTED, /* OUT URB submitted */
  2141. CTLX_REQ_COMPLETE, /* OUT URB complete */
  2142. CTLX_RESP_COMPLETE /* IN URB received */
  2143. };
  2144. typedef enum ctlx_state CTLX_STATE;
  2145. struct hfa384x_usbctlx;
  2146. struct hfa384x;
  2147. typedef void (*ctlx_cmdcb_t)( struct hfa384x*, const struct hfa384x_usbctlx* );
  2148. typedef void (*ctlx_usercb_t)(
  2149. struct hfa384x *hw,
  2150. void *ctlxresult,
  2151. void *usercb_data);
  2152. typedef struct hfa384x_usbctlx
  2153. {
  2154. struct list_head list;
  2155. size_t outbufsize;
  2156. hfa384x_usbout_t outbuf; /* pkt buf for OUT */
  2157. hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */
  2158. CTLX_STATE state; /* Tracks running state */
  2159. struct completion done;
  2160. volatile int reapable; /* Food for the reaper task */
  2161. ctlx_cmdcb_t cmdcb; /* Async command callback */
  2162. ctlx_usercb_t usercb; /* Async user callback, */
  2163. void *usercb_data; /* at CTLX completion */
  2164. int variant; /* Identifies cmd variant */
  2165. } hfa384x_usbctlx_t;
  2166. typedef struct hfa384x_usbctlxq
  2167. {
  2168. spinlock_t lock;
  2169. struct list_head pending;
  2170. struct list_head active;
  2171. struct list_head completing;
  2172. struct list_head reapable;
  2173. } hfa384x_usbctlxq_t;
  2174. #endif
  2175. typedef struct hfa484x_metacmd
  2176. {
  2177. UINT16 cmd;
  2178. UINT16 parm0;
  2179. UINT16 parm1;
  2180. UINT16 parm2;
  2181. #if 0 //XXX cmd irq stuff
  2182. UINT16 bulkid; /* what RID/FID to copy down. */
  2183. int bulklen; /* how much to copy from BAP */
  2184. char *bulkdata; /* And to where? */
  2185. #endif
  2186. hfa384x_cmdresult_t result;
  2187. } hfa384x_metacmd_t;
  2188. #define MAX_PRISM2_GRP_ADDR 16
  2189. #define MAX_GRP_ADDR 32
  2190. #define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */
  2191. #define MM_SAT_PCF (BIT14)
  2192. #define MM_GCSD_PCF (BIT15)
  2193. #define MM_GCSD_PCF_EB (BIT14 | BIT15)
  2194. #define WLAN_STATE_STOPPED 0 /* Network is not active. */
  2195. #define WLAN_STATE_STARTED 1 /* Network has been started. */
  2196. #define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */
  2197. #define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */
  2198. #define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */
  2199. #define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */
  2200. #define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */
  2201. #define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */
  2202. /* XXX These are going away ASAP */
  2203. typedef struct prism2sta_authlist
  2204. {
  2205. UINT cnt;
  2206. UINT8 addr[WLAN_AUTH_MAX][WLAN_ADDR_LEN];
  2207. UINT8 assoc[WLAN_AUTH_MAX];
  2208. } prism2sta_authlist_t;
  2209. typedef struct prism2sta_accesslist
  2210. {
  2211. UINT modify;
  2212. UINT cnt;
  2213. UINT8 addr[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
  2214. UINT cnt1;
  2215. UINT8 addr1[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
  2216. } prism2sta_accesslist_t;
  2217. typedef struct hfa384x
  2218. {
  2219. #if (WLAN_HOSTIF != WLAN_USB)
  2220. /* Resource config */
  2221. UINT32 iobase;
  2222. char __iomem *membase;
  2223. UINT32 irq;
  2224. #else
  2225. /* USB support data */
  2226. struct usb_device *usb;
  2227. struct urb rx_urb;
  2228. struct sk_buff *rx_urb_skb;
  2229. struct urb tx_urb;
  2230. struct urb ctlx_urb;
  2231. hfa384x_usbout_t txbuff;
  2232. hfa384x_usbctlxq_t ctlxq;
  2233. struct timer_list reqtimer;
  2234. struct timer_list resptimer;
  2235. struct timer_list throttle;
  2236. struct tasklet_struct reaper_bh;
  2237. struct tasklet_struct completion_bh;
  2238. struct work_struct usb_work;
  2239. unsigned long usb_flags;
  2240. #define THROTTLE_RX 0
  2241. #define THROTTLE_TX 1
  2242. #define WORK_RX_HALT 2
  2243. #define WORK_TX_HALT 3
  2244. #define WORK_RX_RESUME 4
  2245. #define WORK_TX_RESUME 5
  2246. unsigned short req_timer_done:1;
  2247. unsigned short resp_timer_done:1;
  2248. int endp_in;
  2249. int endp_out;
  2250. #endif /* !USB */
  2251. #if (WLAN_HOSTIF == WLAN_PCMCIA)
  2252. #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)
  2253. struct pcmcia_device *pdev;
  2254. #else
  2255. dev_link_t *link;
  2256. #endif
  2257. dev_node_t node;
  2258. #endif
  2259. int sniff_fcs;
  2260. int sniff_channel;
  2261. int sniff_truncate;
  2262. int sniffhdr;
  2263. wait_queue_head_t cmdq; /* wait queue itself */
  2264. /* Controller state */
  2265. UINT32 state;
  2266. UINT32 isap;
  2267. UINT8 port_enabled[HFA384x_NUMPORTS_MAX];
  2268. #if (WLAN_HOSTIF != WLAN_USB)
  2269. UINT auxen;
  2270. UINT isram16;
  2271. #endif /* !USB */
  2272. /* Download support */
  2273. UINT dlstate;
  2274. hfa384x_downloadbuffer_t bufinfo;
  2275. UINT16 dltimeout;
  2276. #if (WLAN_HOSTIF != WLAN_USB)
  2277. spinlock_t cmdlock;
  2278. volatile int cmdflag; /* wait queue flag */
  2279. hfa384x_metacmd_t *cmddata; /* for our async callback */
  2280. /* BAP support */
  2281. spinlock_t baplock;
  2282. struct tasklet_struct bap_tasklet;
  2283. /* MAC buffer ids */
  2284. UINT16 txfid_head;
  2285. UINT16 txfid_tail;
  2286. UINT txfid_N;
  2287. UINT16 txfid_queue[HFA384x_DRVR_FIDSTACKLEN_MAX];
  2288. UINT16 infofid;
  2289. struct semaphore infofid_sem;
  2290. #endif /* !USB */
  2291. int scanflag; /* to signal scan comlete */
  2292. int join_ap; /* are we joined to a specific ap */
  2293. int join_retries; /* number of join retries till we fail */
  2294. hfa384x_JoinRequest_data_t joinreq; /* join request saved data */
  2295. wlandevice_t *wlandev;
  2296. /* Timer to allow for the deferred processing of linkstatus messages */
  2297. struct work_struct link_bh;
  2298. struct work_struct commsqual_bh;
  2299. hfa384x_commsquality_t qual;
  2300. struct timer_list commsqual_timer;
  2301. UINT16 link_status;
  2302. UINT16 link_status_new;
  2303. struct sk_buff_head authq;
  2304. /* And here we have stuff that used to be in priv */
  2305. /* State variables */
  2306. UINT presniff_port_type;
  2307. UINT16 presniff_wepflags;
  2308. UINT32 dot11_desired_bss_type;
  2309. int ap; /* AP flag: 0 - Station, 1 - Access Point. */
  2310. int dbmadjust;
  2311. /* Group Addresses - right now, there are up to a total
  2312. of MAX_GRP_ADDR group addresses */
  2313. UINT8 dot11_grp_addr[MAX_GRP_ADDR][WLAN_ADDR_LEN];
  2314. UINT dot11_grpcnt;
  2315. /* Component Identities */
  2316. hfa384x_compident_t ident_nic;
  2317. hfa384x_compident_t ident_pri_fw;
  2318. hfa384x_compident_t ident_sta_fw;
  2319. hfa384x_compident_t ident_ap_fw;
  2320. UINT16 mm_mods;
  2321. /* Supplier compatibility ranges */
  2322. hfa384x_caplevel_t cap_sup_mfi;
  2323. hfa384x_caplevel_t cap_sup_cfi;
  2324. hfa384x_caplevel_t cap_sup_pri;
  2325. hfa384x_caplevel_t cap_sup_sta;
  2326. hfa384x_caplevel_t cap_sup_ap;
  2327. /* Actor compatibility ranges */
  2328. hfa384x_caplevel_t cap_act_pri_cfi; /* pri f/w to controller interface */
  2329. hfa384x_caplevel_t cap_act_sta_cfi; /* sta f/w to controller interface */
  2330. hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */
  2331. hfa384x_caplevel_t cap_act_ap_cfi; /* ap f/w to controller interface */
  2332. hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */
  2333. UINT32 psusercount; /* Power save user count. */
  2334. hfa384x_CommTallies32_t tallies; /* Communication tallies. */
  2335. UINT8 comment[WLAN_COMMENT_MAX+1]; /* User comment */
  2336. /* Channel Info request results (AP only) */
  2337. struct {
  2338. atomic_t done;
  2339. UINT8 count;
  2340. hfa384x_ChInfoResult_t results;
  2341. } channel_info;
  2342. hfa384x_InfFrame_t *scanresults;
  2343. prism2sta_authlist_t authlist; /* Authenticated station list. */
  2344. UINT accessmode; /* Access mode. */
  2345. prism2sta_accesslist_t allow; /* Allowed station list. */
  2346. prism2sta_accesslist_t deny; /* Denied station list. */
  2347. } hfa384x_t;
  2348. /*=============================================================*/
  2349. /*--- Function Declarations -----------------------------------*/
  2350. /*=============================================================*/
  2351. #if (WLAN_HOSTIF == WLAN_USB)
  2352. void
  2353. hfa384x_create(
  2354. hfa384x_t *hw,
  2355. struct usb_device *usb);
  2356. #else
  2357. void
  2358. hfa384x_create(
  2359. hfa384x_t *hw,
  2360. UINT irq,
  2361. UINT32 iobase,
  2362. UINT8 __iomem *membase);
  2363. #endif
  2364. void hfa384x_destroy(hfa384x_t *hw);
  2365. irqreturn_t
  2366. hfa384x_interrupt(int irq, void *dev_id PT_REGS);
  2367. int
  2368. hfa384x_corereset( hfa384x_t *hw, int holdtime, int settletime, int genesis);
  2369. int
  2370. hfa384x_drvr_chinforesults( hfa384x_t *hw);
  2371. int
  2372. hfa384x_drvr_commtallies( hfa384x_t *hw);
  2373. int
  2374. hfa384x_drvr_disable(hfa384x_t *hw, UINT16 macport);
  2375. int
  2376. hfa384x_drvr_enable(hfa384x_t *hw, UINT16 macport);
  2377. int
  2378. hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
  2379. int
  2380. hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
  2381. int
  2382. hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len);
  2383. int
  2384. hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len);
  2385. int
  2386. hfa384x_drvr_handover( hfa384x_t *hw, UINT8 *addr);
  2387. int
  2388. hfa384x_drvr_hostscanresults( hfa384x_t *hw);
  2389. int
  2390. hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd);
  2391. int
  2392. hfa384x_drvr_mmi_read(hfa384x_t *hw, UINT32 address, UINT32 *result);
  2393. int
  2394. hfa384x_drvr_mmi_write(hfa384x_t *hw, UINT32 address, UINT32 data);
  2395. int
  2396. hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr);
  2397. int
  2398. hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
  2399. int
  2400. hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len);
  2401. int
  2402. hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, UINT len);
  2403. int
  2404. hfa384x_drvr_scanresults( hfa384x_t *hw);
  2405. int
  2406. hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len);
  2407. static inline int
  2408. hfa384x_drvr_getconfig16(hfa384x_t *hw, UINT16 rid, void *val)
  2409. {
  2410. int result = 0;
  2411. result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT16));
  2412. if ( result == 0 ) {
  2413. *((UINT16*)val) = hfa384x2host_16(*((UINT16*)val));
  2414. }
  2415. return result;
  2416. }
  2417. static inline int
  2418. hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val)
  2419. {
  2420. int result = 0;
  2421. result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT32));
  2422. if ( result == 0 ) {
  2423. *((UINT32*)val) = hfa384x2host_32(*((UINT32*)val));
  2424. }
  2425. return result;
  2426. }
  2427. static inline int
  2428. hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 val)
  2429. {
  2430. UINT16 value = host2hfa384x_16(val);
  2431. return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
  2432. }
  2433. static inline int
  2434. hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 val)
  2435. {
  2436. UINT32 value = host2hfa384x_32(val);
  2437. return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
  2438. }
  2439. #if (WLAN_HOSTIF == WLAN_USB)
  2440. int
  2441. hfa384x_drvr_getconfig_async(hfa384x_t *hw,
  2442. UINT16 rid,
  2443. ctlx_usercb_t usercb,
  2444. void *usercb_data);
  2445. int
  2446. hfa384x_drvr_setconfig_async(hfa384x_t *hw,
  2447. UINT16 rid,
  2448. void *buf,
  2449. UINT16 len,
  2450. ctlx_usercb_t usercb,
  2451. void *usercb_data);
  2452. #else
  2453. static inline int
  2454. hfa384x_drvr_setconfig_async(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len,
  2455. void *ptr1, void *ptr2)
  2456. {
  2457. (void)ptr1;
  2458. (void)ptr2;
  2459. return hfa384x_drvr_setconfig(hw, rid, buf, len);
  2460. }
  2461. #endif
  2462. static inline int
  2463. hfa384x_drvr_setconfig16_async(hfa384x_t *hw, UINT16 rid, UINT16 val)
  2464. {
  2465. UINT16 value = host2hfa384x_16(val);
  2466. return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
  2467. NULL , NULL);
  2468. }
  2469. static inline int
  2470. hfa384x_drvr_setconfig32_async(hfa384x_t *hw, UINT16 rid, UINT32 val)
  2471. {
  2472. UINT32 value = host2hfa384x_32(val);
  2473. return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
  2474. NULL , NULL);
  2475. }
  2476. int
  2477. hfa384x_drvr_start(hfa384x_t *hw);
  2478. int
  2479. hfa384x_drvr_stop(hfa384x_t *hw);
  2480. int
  2481. hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
  2482. void
  2483. hfa384x_tx_timeout(wlandevice_t *wlandev);
  2484. int
  2485. hfa384x_cmd_initialize(hfa384x_t *hw);
  2486. int
  2487. hfa384x_cmd_enable(hfa384x_t *hw, UINT16 macport);
  2488. int
  2489. hfa384x_cmd_disable(hfa384x_t *hw, UINT16 macport);
  2490. int
  2491. hfa384x_cmd_diagnose(hfa384x_t *hw);
  2492. int
  2493. hfa384x_cmd_allocate(hfa384x_t *hw, UINT16 len);
  2494. int
  2495. hfa384x_cmd_transmit(hfa384x_t *hw, UINT16 reclaim, UINT16 qos, UINT16 fid);
  2496. int
  2497. hfa384x_cmd_clearpersist(hfa384x_t *hw, UINT16 fid);
  2498. int
  2499. hfa384x_cmd_notify(hfa384x_t *hw, UINT16 reclaim, UINT16 fid, void *buf, UINT16 len);
  2500. int
  2501. hfa384x_cmd_inquire(hfa384x_t *hw, UINT16 fid);
  2502. int
  2503. hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid, void *buf, UINT16 len);
  2504. int
  2505. hfa384x_cmd_monitor(hfa384x_t *hw, UINT16 enable);
  2506. int
  2507. hfa384x_cmd_download(
  2508. hfa384x_t *hw,
  2509. UINT16 mode,
  2510. UINT16 lowaddr,
  2511. UINT16 highaddr,
  2512. UINT16 codelen);
  2513. int
  2514. hfa384x_cmd_aux_enable(hfa384x_t *hw, int force);
  2515. int
  2516. hfa384x_cmd_aux_disable(hfa384x_t *hw);
  2517. int
  2518. hfa384x_copy_from_bap(
  2519. hfa384x_t *hw,
  2520. UINT16 bap,
  2521. UINT16 id,
  2522. UINT16 offset,
  2523. void *buf,
  2524. UINT len);
  2525. int
  2526. hfa384x_copy_to_bap(
  2527. hfa384x_t *hw,
  2528. UINT16 bap,
  2529. UINT16 id,
  2530. UINT16 offset,
  2531. void *buf,
  2532. UINT len);
  2533. void
  2534. hfa384x_copy_from_aux(
  2535. hfa384x_t *hw,
  2536. UINT32 cardaddr,
  2537. UINT32 auxctl,
  2538. void *buf,
  2539. UINT len);
  2540. void
  2541. hfa384x_copy_to_aux(
  2542. hfa384x_t *hw,
  2543. UINT32 cardaddr,
  2544. UINT32 auxctl,
  2545. void *buf,
  2546. UINT len);
  2547. #if (WLAN_HOSTIF != WLAN_USB)
  2548. /*
  2549. HFA384x is a LITTLE ENDIAN part.
  2550. the get/setreg functions implicitly byte-swap the data to LE.
  2551. the _noswap variants do not perform a byte-swap on the data.
  2552. */
  2553. static inline UINT16
  2554. __hfa384x_getreg(hfa384x_t *hw, UINT reg);
  2555. static inline void
  2556. __hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg);
  2557. static inline UINT16
  2558. __hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg);
  2559. static inline void
  2560. __hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg);
  2561. #ifdef REVERSE_ENDIAN
  2562. #define hfa384x_getreg __hfa384x_getreg_noswap
  2563. #define hfa384x_setreg __hfa384x_setreg_noswap
  2564. #define hfa384x_getreg_noswap __hfa384x_getreg
  2565. #define hfa384x_setreg_noswap __hfa384x_setreg
  2566. #else
  2567. #define hfa384x_getreg __hfa384x_getreg
  2568. #define hfa384x_setreg __hfa384x_setreg
  2569. #define hfa384x_getreg_noswap __hfa384x_getreg_noswap
  2570. #define hfa384x_setreg_noswap __hfa384x_setreg_noswap
  2571. #endif
  2572. /*----------------------------------------------------------------
  2573. * hfa384x_getreg
  2574. *
  2575. * Retrieve the value of one of the MAC registers. Done here
  2576. * because different PRISM2 MAC parts use different buses and such.
  2577. * NOTE: This function returns the value in HOST ORDER!!!!!!
  2578. *
  2579. * Arguments:
  2580. * hw MAC part structure
  2581. * reg Register identifier (offset for I/O based i/f)
  2582. *
  2583. * Returns:
  2584. * Value from the register in HOST ORDER!!!!
  2585. ----------------------------------------------------------------*/
  2586. static inline UINT16
  2587. __hfa384x_getreg(hfa384x_t *hw, UINT reg)
  2588. {
  2589. /* printk(KERN_DEBUG "Reading from 0x%0x\n", hw->membase + reg); */
  2590. #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
  2591. return wlan_inw_le16_to_cpu(hw->iobase+reg);
  2592. #elif (WLAN_HOSTIF == WLAN_PCI)
  2593. return __le16_to_cpu(readw(hw->membase + reg));
  2594. #endif
  2595. }
  2596. /*----------------------------------------------------------------
  2597. * hfa384x_setreg
  2598. *
  2599. * Set the value of one of the MAC registers. Done here
  2600. * because different PRISM2 MAC parts use different buses and such.
  2601. * NOTE: This function assumes the value is in HOST ORDER!!!!!!
  2602. *
  2603. * Arguments:
  2604. * hw MAC part structure
  2605. * val Value, in HOST ORDER!!, to put in the register
  2606. * reg Register identifier (offset for I/O based i/f)
  2607. *
  2608. * Returns:
  2609. * Nothing
  2610. ----------------------------------------------------------------*/
  2611. static inline void
  2612. __hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg)
  2613. {
  2614. #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
  2615. wlan_outw_cpu_to_le16( val, hw->iobase + reg);
  2616. return;
  2617. #elif (WLAN_HOSTIF == WLAN_PCI)
  2618. writew(__cpu_to_le16(val), hw->membase + reg);
  2619. return;
  2620. #endif
  2621. }
  2622. /*----------------------------------------------------------------
  2623. * hfa384x_getreg_noswap
  2624. *
  2625. * Retrieve the value of one of the MAC registers. Done here
  2626. * because different PRISM2 MAC parts use different buses and such.
  2627. *
  2628. * Arguments:
  2629. * hw MAC part structure
  2630. * reg Register identifier (offset for I/O based i/f)
  2631. *
  2632. * Returns:
  2633. * Value from the register.
  2634. ----------------------------------------------------------------*/
  2635. static inline UINT16
  2636. __hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg)
  2637. {
  2638. #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
  2639. return wlan_inw(hw->iobase+reg);
  2640. #elif (WLAN_HOSTIF == WLAN_PCI)
  2641. return readw(hw->membase + reg);
  2642. #endif
  2643. }
  2644. /*----------------------------------------------------------------
  2645. * hfa384x_setreg_noswap
  2646. *
  2647. * Set the value of one of the MAC registers. Done here
  2648. * because different PRISM2 MAC parts use different buses and such.
  2649. *
  2650. * Arguments:
  2651. * hw MAC part structure
  2652. * val Value to put in the register
  2653. * reg Register identifier (offset for I/O based i/f)
  2654. *
  2655. * Returns:
  2656. * Nothing
  2657. ----------------------------------------------------------------*/
  2658. static inline void
  2659. __hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg)
  2660. {
  2661. #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))
  2662. wlan_outw( val, hw->iobase + reg);
  2663. return;
  2664. #elif (WLAN_HOSTIF == WLAN_PCI)
  2665. writew(val, hw->membase + reg);
  2666. return;
  2667. #endif
  2668. }
  2669. static inline void hfa384x_events_all(hfa384x_t *hw)
  2670. {
  2671. hfa384x_setreg(hw,
  2672. HFA384x_INT_NORMAL
  2673. #ifdef CMD_IRQ
  2674. | HFA384x_INTEN_CMD_SET(1)
  2675. #endif
  2676. ,
  2677. HFA384x_INTEN);
  2678. }
  2679. static inline void hfa384x_events_nobap(hfa384x_t *hw)
  2680. {
  2681. hfa384x_setreg(hw,
  2682. (HFA384x_INT_NORMAL & ~HFA384x_INT_BAP_OP)
  2683. #ifdef CMD_IRQ
  2684. | HFA384x_INTEN_CMD_SET(1)
  2685. #endif
  2686. ,
  2687. HFA384x_INTEN);
  2688. }
  2689. #endif /* WLAN_HOSTIF != WLAN_USB */
  2690. #endif /* __KERNEL__ */
  2691. #endif /* _HFA384x_H */