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 107KB

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_t)4)
  64. #define HFA384x_CMD_ALLOC_LEN_MAX ((uint16_t)2400)
  65. #define HFA384x_BAP_DATALEN_MAX ((uint16_t)4096)
  66. #define HFA384x_BAP_OFFSET_MAX ((uint16_t)4096)
  67. #define HFA384x_PORTID_MAX ((uint16_t)7)
  68. #define HFA384x_NUMPORTS_MAX ((uint16_t)(HFA384x_PORTID_MAX+1))
  69. #define HFA384x_PDR_LEN_MAX ((uint16_t)512) /* in bytes, from EK */
  70. #define HFA384x_PDA_RECS_MAX ((uint16_t)200) /* a guess */
  71. #define HFA384x_PDA_LEN_MAX ((uint16_t)1024) /* in bytes, from EK */
  72. #define HFA384x_SCANRESULT_MAX ((uint16_t)31)
  73. #define HFA384x_HSCANRESULT_MAX ((uint16_t)31)
  74. #define HFA384x_CHINFORESULT_MAX ((uint16_t)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_t)0)
  88. #define HFA384x_BAP_int ((uint16_t)1)
  89. #define HFA384x_PORTTYPE_IBSS ((uint16_t)0)
  90. #define HFA384x_PORTTYPE_BSS ((uint16_t)1)
  91. #define HFA384x_PORTTYPE_WDS ((uint16_t)2)
  92. #define HFA384x_PORTTYPE_PSUEDOIBSS ((uint16_t)3)
  93. #define HFA384x_PORTTYPE_HOSTAP ((uint16_t)6)
  94. #define HFA384x_WEPFLAGS_PRIVINVOKED ((uint16_t)BIT0)
  95. #define HFA384x_WEPFLAGS_EXCLUDE ((uint16_t)BIT1)
  96. #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((uint16_t)BIT4)
  97. #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((uint16_t)BIT7)
  98. #define HFA384x_WEPFLAGS_DISALLOW_MIXED ((uint16_t)BIT11)
  99. #define HFA384x_WEPFLAGS_IV_INTERVAL1 ((uint16_t)0)
  100. #define HFA384x_WEPFLAGS_IV_INTERVAL10 ((uint16_t)BIT5)
  101. #define HFA384x_WEPFLAGS_IV_INTERVAL50 ((uint16_t)BIT6)
  102. #define HFA384x_WEPFLAGS_IV_INTERVAL100 ((uint16_t)(BIT5 | BIT6))
  103. #define HFA384x_WEPFLAGS_FIRMWARE_WPA ((uint16_t)BIT8)
  104. #define HFA384x_WEPFLAGS_HOST_MIC ((uint16_t)BIT9)
  105. #define HFA384x_ROAMMODE_FWSCAN_FWROAM ((uint16_t)1)
  106. #define HFA384x_ROAMMODE_FWSCAN_HOSTROAM ((uint16_t)2)
  107. #define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((uint16_t)3)
  108. #define HFA384x_PORTSTATUS_DISABLED ((uint16_t)1)
  109. #define HFA384x_PORTSTATUS_INITSRCH ((uint16_t)2)
  110. #define HFA384x_PORTSTATUS_CONN_IBSS ((uint16_t)3)
  111. #define HFA384x_PORTSTATUS_CONN_ESS ((uint16_t)4)
  112. #define HFA384x_PORTSTATUS_OOR_ESS ((uint16_t)5)
  113. #define HFA384x_PORTSTATUS_CONN_WDS ((uint16_t)6)
  114. #define HFA384x_PORTSTATUS_HOSTAP ((uint16_t)8)
  115. #define HFA384x_RATEBIT_1 ((uint16_t)1)
  116. #define HFA384x_RATEBIT_2 ((uint16_t)2)
  117. #define HFA384x_RATEBIT_5dot5 ((uint16_t)4)
  118. #define HFA384x_RATEBIT_11 ((uint16_t)8)
  119. /*--- Just some symbolic names for legibility -------*/
  120. #define HFA384x_TXCMD_NORECL ((uint16_t)0)
  121. #define HFA384x_TXCMD_RECL ((uint16_t)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_t)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_t)(((uint16_t)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \
  151. ((uint32_t)(((uint16_t)(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_t)(((uint16_t)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \
  155. ((uint32_t)(((uint16_t)(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_t)((((uint32_t)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7))
  159. #define HFA384x_ADDR_AUX_MKOFF(f) \
  160. ((uint16_t)(((uint32_t)(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_t)((((uint32_t)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))
  164. #define HFA384x_ADDR_CMD_MKOFF(f) \
  165. ((uint16_t)(((uint32_t)(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_t)(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_t)BIT15)
  261. #define HFA384x_CMD_AINFO ((uint16_t)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
  262. #define HFA384x_CMD_MACPORT ((uint16_t)(BIT10 | BIT9 | BIT8))
  263. #define HFA384x_CMD_RECL ((uint16_t)BIT8)
  264. #define HFA384x_CMD_WRITE ((uint16_t)BIT8)
  265. #define HFA384x_CMD_PROGMODE ((uint16_t)(BIT9 | BIT8))
  266. #define HFA384x_CMD_CMDCODE ((uint16_t)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
  267. #define HFA384x_STATUS_RESULT ((uint16_t)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
  268. #define HFA384x_STATUS_CMDCODE ((uint16_t)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
  269. #define HFA384x_OFFSET_BUSY ((uint16_t)BIT15)
  270. #define HFA384x_OFFSET_ERR ((uint16_t)BIT14)
  271. #define HFA384x_OFFSET_DATAOFF ((uint16_t)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))
  272. #define HFA384x_EVSTAT_TICK ((uint16_t)BIT15)
  273. #define HFA384x_EVSTAT_WTERR ((uint16_t)BIT14)
  274. #define HFA384x_EVSTAT_INFDROP ((uint16_t)BIT13)
  275. #define HFA384x_EVSTAT_INFO ((uint16_t)BIT7)
  276. #define HFA384x_EVSTAT_DTIM ((uint16_t)BIT5)
  277. #define HFA384x_EVSTAT_CMD ((uint16_t)BIT4)
  278. #define HFA384x_EVSTAT_ALLOC ((uint16_t)BIT3)
  279. #define HFA384x_EVSTAT_TXEXC ((uint16_t)BIT2)
  280. #define HFA384x_EVSTAT_TX ((uint16_t)BIT1)
  281. #define HFA384x_EVSTAT_RX ((uint16_t)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_t)BIT15)
  285. #define HFA384x_INTEN_WTERR ((uint16_t)BIT14)
  286. #define HFA384x_INTEN_INFDROP ((uint16_t)BIT13)
  287. #define HFA384x_INTEN_INFO ((uint16_t)BIT7)
  288. #define HFA384x_INTEN_DTIM ((uint16_t)BIT5)
  289. #define HFA384x_INTEN_CMD ((uint16_t)BIT4)
  290. #define HFA384x_INTEN_ALLOC ((uint16_t)BIT3)
  291. #define HFA384x_INTEN_TXEXC ((uint16_t)BIT2)
  292. #define HFA384x_INTEN_TX ((uint16_t)BIT1)
  293. #define HFA384x_INTEN_RX ((uint16_t)BIT0)
  294. #define HFA384x_EVACK_TICK ((uint16_t)BIT15)
  295. #define HFA384x_EVACK_WTERR ((uint16_t)BIT14)
  296. #define HFA384x_EVACK_INFDROP ((uint16_t)BIT13)
  297. #define HFA384x_EVACK_INFO ((uint16_t)BIT7)
  298. #define HFA384x_EVACK_DTIM ((uint16_t)BIT5)
  299. #define HFA384x_EVACK_CMD ((uint16_t)BIT4)
  300. #define HFA384x_EVACK_ALLOC ((uint16_t)BIT3)
  301. #define HFA384x_EVACK_TXEXC ((uint16_t)BIT2)
  302. #define HFA384x_EVACK_TX ((uint16_t)BIT1)
  303. #define HFA384x_EVACK_RX ((uint16_t)BIT0)
  304. #define HFA384x_CONTROL_AUXEN ((uint16_t)(BIT15 | BIT14))
  305. /*--- Command Code Constants --------------------------*/
  306. /*--- Controller Commands --------------------------*/
  307. #define HFA384x_CMDCODE_INIT ((uint16_t)0x00)
  308. #define HFA384x_CMDCODE_ENABLE ((uint16_t)0x01)
  309. #define HFA384x_CMDCODE_DISABLE ((uint16_t)0x02)
  310. #define HFA384x_CMDCODE_DIAG ((uint16_t)0x03)
  311. /*--- Buffer Mgmt Commands --------------------------*/
  312. #define HFA384x_CMDCODE_ALLOC ((uint16_t)0x0A)
  313. #define HFA384x_CMDCODE_TX ((uint16_t)0x0B)
  314. #define HFA384x_CMDCODE_CLRPRST ((uint16_t)0x12)
  315. /*--- Regulate Commands --------------------------*/
  316. #define HFA384x_CMDCODE_NOTIFY ((uint16_t)0x10)
  317. #define HFA384x_CMDCODE_INQ ((uint16_t)0x11)
  318. /*--- Configure Commands --------------------------*/
  319. #define HFA384x_CMDCODE_ACCESS ((uint16_t)0x21)
  320. #define HFA384x_CMDCODE_DOWNLD ((uint16_t)0x22)
  321. /*--- Debugging Commands -----------------------------*/
  322. #define HFA384x_CMDCODE_MONITOR ((uint16_t)(0x38))
  323. #define HFA384x_MONITOR_ENABLE ((uint16_t)(0x0b))
  324. #define HFA384x_MONITOR_DISABLE ((uint16_t)(0x0f))
  325. /*--- Result Codes --------------------------*/
  326. #define HFA384x_SUCCESS ((uint16_t)(0x00))
  327. #define HFA384x_CARD_FAIL ((uint16_t)(0x01))
  328. #define HFA384x_NO_BUFF ((uint16_t)(0x05))
  329. #define HFA384x_CMD_ERR ((uint16_t)(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_t)0x00)
  337. #define HFA384x_PROGMODE_RAM ((uint16_t)0x01)
  338. #define HFA384x_PROGMODE_NV ((uint16_t)0x02)
  339. #define HFA384x_PROGMODE_NVWRITE ((uint16_t)0x03)
  340. /*--- AUX register enable --------------------------*/
  341. #define HFA384x_AUXPW0 ((uint16_t)0xfe01)
  342. #define HFA384x_AUXPW1 ((uint16_t)0xdc23)
  343. #define HFA384x_AUXPW2 ((uint16_t)0xba45)
  344. #define HFA384x_CONTROL_AUX_ISDISABLED ((uint16_t)0x0000)
  345. #define HFA384x_CONTROL_AUX_ISENABLED ((uint16_t)0xc000)
  346. #define HFA384x_CONTROL_AUX_DOENABLE ((uint16_t)0x8000)
  347. #define HFA384x_CONTROL_AUX_DODISABLE ((uint16_t)0x4000)
  348. /*--- Record ID Constants --------------------------*/
  349. /*--------------------------------------------------------------------
  350. Configuration RIDs: Network Parameters, Static Configuration Entities
  351. --------------------------------------------------------------------*/
  352. #define HFA384x_RID_CNFPORTTYPE ((uint16_t)0xFC00)
  353. #define HFA384x_RID_CNFOWNMACADDR ((uint16_t)0xFC01)
  354. #define HFA384x_RID_CNFDESIREDSSID ((uint16_t)0xFC02)
  355. #define HFA384x_RID_CNFOWNCHANNEL ((uint16_t)0xFC03)
  356. #define HFA384x_RID_CNFOWNSSID ((uint16_t)0xFC04)
  357. #define HFA384x_RID_CNFOWNATIMWIN ((uint16_t)0xFC05)
  358. #define HFA384x_RID_CNFSYSSCALE ((uint16_t)0xFC06)
  359. #define HFA384x_RID_CNFMAXDATALEN ((uint16_t)0xFC07)
  360. #define HFA384x_RID_CNFWDSADDR ((uint16_t)0xFC08)
  361. #define HFA384x_RID_CNFPMENABLED ((uint16_t)0xFC09)
  362. #define HFA384x_RID_CNFPMEPS ((uint16_t)0xFC0A)
  363. #define HFA384x_RID_CNFMULTICASTRX ((uint16_t)0xFC0B)
  364. #define HFA384x_RID_CNFMAXSLEEPDUR ((uint16_t)0xFC0C)
  365. #define HFA384x_RID_CNFPMHOLDDUR ((uint16_t)0xFC0D)
  366. #define HFA384x_RID_CNFOWNNAME ((uint16_t)0xFC0E)
  367. #define HFA384x_RID_CNFOWNDTIMPER ((uint16_t)0xFC10)
  368. #define HFA384x_RID_CNFWDSADDR1 ((uint16_t)0xFC11)
  369. #define HFA384x_RID_CNFWDSADDR2 ((uint16_t)0xFC12)
  370. #define HFA384x_RID_CNFWDSADDR3 ((uint16_t)0xFC13)
  371. #define HFA384x_RID_CNFWDSADDR4 ((uint16_t)0xFC14)
  372. #define HFA384x_RID_CNFWDSADDR5 ((uint16_t)0xFC15)
  373. #define HFA384x_RID_CNFWDSADDR6 ((uint16_t)0xFC16)
  374. #define HFA384x_RID_CNFMCASTPMBUFF ((uint16_t)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_t)2)
  382. #define HFA384x_RID_CNFOWNMACADDR_LEN ((uint16_t)6)
  383. #define HFA384x_RID_CNFDESIREDSSID_LEN ((uint16_t)34)
  384. #define HFA384x_RID_CNFOWNCHANNEL_LEN ((uint16_t)2)
  385. #define HFA384x_RID_CNFOWNSSID_LEN ((uint16_t)34)
  386. #define HFA384x_RID_CNFOWNATIMWIN_LEN ((uint16_t)2)
  387. #define HFA384x_RID_CNFSYSSCALE_LEN ((uint16_t)0)
  388. #define HFA384x_RID_CNFMAXDATALEN_LEN ((uint16_t)0)
  389. #define HFA384x_RID_CNFWDSADDR_LEN ((uint16_t)6)
  390. #define HFA384x_RID_CNFPMENABLED_LEN ((uint16_t)0)
  391. #define HFA384x_RID_CNFPMEPS_LEN ((uint16_t)0)
  392. #define HFA384x_RID_CNFMULTICASTRX_LEN ((uint16_t)0)
  393. #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((uint16_t)0)
  394. #define HFA384x_RID_CNFPMHOLDDUR_LEN ((uint16_t)0)
  395. #define HFA384x_RID_CNFOWNNAME_LEN ((uint16_t)34)
  396. #define HFA384x_RID_CNFOWNDTIMPER_LEN ((uint16_t)0)
  397. #define HFA384x_RID_CNFWDSADDR1_LEN ((uint16_t)6)
  398. #define HFA384x_RID_CNFWDSADDR2_LEN ((uint16_t)6)
  399. #define HFA384x_RID_CNFWDSADDR3_LEN ((uint16_t)6)
  400. #define HFA384x_RID_CNFWDSADDR4_LEN ((uint16_t)6)
  401. #define HFA384x_RID_CNFWDSADDR5_LEN ((uint16_t)6)
  402. #define HFA384x_RID_CNFWDSADDR6_LEN ((uint16_t)6)
  403. #define HFA384x_RID_CNFMCASTPMBUFF_LEN ((uint16_t)0)
  404. #define HFA384x_RID_CNFAUTHENTICATION_LEN ((uint16_t)sizeof(uint16_t))
  405. #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((uint16_t)0)
  406. /*--------------------------------------------------------------------
  407. Configuration RIDs: Network Parameters, Dynamic Configuration Entities
  408. --------------------------------------------------------------------*/
  409. #define HFA384x_RID_GROUPADDR ((uint16_t)0xFC80)
  410. #define HFA384x_RID_CREATEIBSS ((uint16_t)0xFC81)
  411. #define HFA384x_RID_FRAGTHRESH ((uint16_t)0xFC82)
  412. #define HFA384x_RID_RTSTHRESH ((uint16_t)0xFC83)
  413. #define HFA384x_RID_TXRATECNTL ((uint16_t)0xFC84)
  414. #define HFA384x_RID_PROMISCMODE ((uint16_t)0xFC85)
  415. #define HFA384x_RID_FRAGTHRESH0 ((uint16_t)0xFC90)
  416. #define HFA384x_RID_FRAGTHRESH1 ((uint16_t)0xFC91)
  417. #define HFA384x_RID_FRAGTHRESH2 ((uint16_t)0xFC92)
  418. #define HFA384x_RID_FRAGTHRESH3 ((uint16_t)0xFC93)
  419. #define HFA384x_RID_FRAGTHRESH4 ((uint16_t)0xFC94)
  420. #define HFA384x_RID_FRAGTHRESH5 ((uint16_t)0xFC95)
  421. #define HFA384x_RID_FRAGTHRESH6 ((uint16_t)0xFC96)
  422. #define HFA384x_RID_RTSTHRESH0 ((uint16_t)0xFC97)
  423. #define HFA384x_RID_RTSTHRESH1 ((uint16_t)0xFC98)
  424. #define HFA384x_RID_RTSTHRESH2 ((uint16_t)0xFC99)
  425. #define HFA384x_RID_RTSTHRESH3 ((uint16_t)0xFC9A)
  426. #define HFA384x_RID_RTSTHRESH4 ((uint16_t)0xFC9B)
  427. #define HFA384x_RID_RTSTHRESH5 ((uint16_t)0xFC9C)
  428. #define HFA384x_RID_RTSTHRESH6 ((uint16_t)0xFC9D)
  429. #define HFA384x_RID_TXRATECNTL0 ((uint16_t)0xFC9E)
  430. #define HFA384x_RID_TXRATECNTL1 ((uint16_t)0xFC9F)
  431. #define HFA384x_RID_TXRATECNTL2 ((uint16_t)0xFCA0)
  432. #define HFA384x_RID_TXRATECNTL3 ((uint16_t)0xFCA1)
  433. #define HFA384x_RID_TXRATECNTL4 ((uint16_t)0xFCA2)
  434. #define HFA384x_RID_TXRATECNTL5 ((uint16_t)0xFCA3)
  435. #define HFA384x_RID_TXRATECNTL6 ((uint16_t)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_t)16 * WLAN_ADDR_LEN)
  443. #define HFA384x_RID_CREATEIBSS_LEN ((uint16_t)0)
  444. #define HFA384x_RID_FRAGTHRESH_LEN ((uint16_t)0)
  445. #define HFA384x_RID_RTSTHRESH_LEN ((uint16_t)0)
  446. #define HFA384x_RID_TXRATECNTL_LEN ((uint16_t)4)
  447. #define HFA384x_RID_PROMISCMODE_LEN ((uint16_t)2)
  448. #define HFA384x_RID_FRAGTHRESH0_LEN ((uint16_t)0)
  449. #define HFA384x_RID_FRAGTHRESH1_LEN ((uint16_t)0)
  450. #define HFA384x_RID_FRAGTHRESH2_LEN ((uint16_t)0)
  451. #define HFA384x_RID_FRAGTHRESH3_LEN ((uint16_t)0)
  452. #define HFA384x_RID_FRAGTHRESH4_LEN ((uint16_t)0)
  453. #define HFA384x_RID_FRAGTHRESH5_LEN ((uint16_t)0)
  454. #define HFA384x_RID_FRAGTHRESH6_LEN ((uint16_t)0)
  455. #define HFA384x_RID_RTSTHRESH0_LEN ((uint16_t)0)
  456. #define HFA384x_RID_RTSTHRESH1_LEN ((uint16_t)0)
  457. #define HFA384x_RID_RTSTHRESH2_LEN ((uint16_t)0)
  458. #define HFA384x_RID_RTSTHRESH3_LEN ((uint16_t)0)
  459. #define HFA384x_RID_RTSTHRESH4_LEN ((uint16_t)0)
  460. #define HFA384x_RID_RTSTHRESH5_LEN ((uint16_t)0)
  461. #define HFA384x_RID_RTSTHRESH6_LEN ((uint16_t)0)
  462. #define HFA384x_RID_TXRATECNTL0_LEN ((uint16_t)0)
  463. #define HFA384x_RID_TXRATECNTL1_LEN ((uint16_t)0)
  464. #define HFA384x_RID_TXRATECNTL2_LEN ((uint16_t)0)
  465. #define HFA384x_RID_TXRATECNTL3_LEN ((uint16_t)0)
  466. #define HFA384x_RID_TXRATECNTL4_LEN ((uint16_t)0)
  467. #define HFA384x_RID_TXRATECNTL5_LEN ((uint16_t)0)
  468. #define HFA384x_RID_TXRATECNTL6_LEN ((uint16_t)0)
  469. /*--------------------------------------------------------------------
  470. Configuration RIDs: Behavior Parameters
  471. --------------------------------------------------------------------*/
  472. #define HFA384x_RID_ITICKTIME ((uint16_t)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_t)2)
  479. /*----------------------------------------------------------------------
  480. Information RIDs: NIC Information
  481. --------------------------------------------------------------------*/
  482. #define HFA384x_RID_MAXLOADTIME ((uint16_t)0xFD00)
  483. #define HFA384x_RID_DOWNLOADBUFFER ((uint16_t)0xFD01)
  484. #define HFA384x_RID_PRIIDENTITY ((uint16_t)0xFD02)
  485. #define HFA384x_RID_PRISUPRANGE ((uint16_t)0xFD03)
  486. #define HFA384x_RID_PRI_CFIACTRANGES ((uint16_t)0xFD04)
  487. #define HFA384x_RID_NICSERIALNUMBER ((uint16_t)0xFD0A)
  488. #define HFA384x_RID_NICIDENTITY ((uint16_t)0xFD0B)
  489. #define HFA384x_RID_MFISUPRANGE ((uint16_t)0xFD0C)
  490. #define HFA384x_RID_CFISUPRANGE ((uint16_t)0xFD0D)
  491. #define HFA384x_RID_CHANNELLIST ((uint16_t)0xFD10)
  492. #define HFA384x_RID_REGULATORYDOMAINS ((uint16_t)0xFD11)
  493. #define HFA384x_RID_TEMPTYPE ((uint16_t)0xFD12)
  494. #define HFA384x_RID_CIS ((uint16_t)0xFD13)
  495. #define HFA384x_RID_STAIDENTITY ((uint16_t)0xFD20)
  496. #define HFA384x_RID_STASUPRANGE ((uint16_t)0xFD21)
  497. #define HFA384x_RID_STA_MFIACTRANGES ((uint16_t)0xFD22)
  498. #define HFA384x_RID_STA_CFIACTRANGES ((uint16_t)0xFD23)
  499. #define HFA384x_RID_BUILDSEQ ((uint16_t)0xFFFE)
  500. #define HFA384x_RID_FWID ((uint16_t)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_t)0)
  507. #define HFA384x_RID_DOWNLOADBUFFER_LEN ((uint16_t)sizeof(hfa384x_downloadbuffer_t))
  508. #define HFA384x_RID_PRIIDENTITY_LEN ((uint16_t)8)
  509. #define HFA384x_RID_PRISUPRANGE_LEN ((uint16_t)10)
  510. #define HFA384x_RID_CFIACTRANGES_LEN ((uint16_t)10)
  511. #define HFA384x_RID_NICSERIALNUMBER_LEN ((uint16_t)12)
  512. #define HFA384x_RID_NICIDENTITY_LEN ((uint16_t)8)
  513. #define HFA384x_RID_MFISUPRANGE_LEN ((uint16_t)10)
  514. #define HFA384x_RID_CFISUPRANGE_LEN ((uint16_t)10)
  515. #define HFA384x_RID_CHANNELLIST_LEN ((uint16_t)0)
  516. #define HFA384x_RID_REGULATORYDOMAINS_LEN ((uint16_t)12)
  517. #define HFA384x_RID_TEMPTYPE_LEN ((uint16_t)0)
  518. #define HFA384x_RID_CIS_LEN ((uint16_t)480)
  519. #define HFA384x_RID_STAIDENTITY_LEN ((uint16_t)8)
  520. #define HFA384x_RID_STASUPRANGE_LEN ((uint16_t)10)
  521. #define HFA384x_RID_MFIACTRANGES_LEN ((uint16_t)10)
  522. #define HFA384x_RID_CFIACTRANGES2_LEN ((uint16_t)10)
  523. #define HFA384x_RID_BUILDSEQ_LEN ((uint16_t)sizeof(hfa384x_BuildSeq_t))
  524. #define HFA384x_RID_FWID_LEN ((uint16_t)sizeof(hfa384x_FWID_t))
  525. /*--------------------------------------------------------------------
  526. Information RIDs: MAC Information
  527. --------------------------------------------------------------------*/
  528. #define HFA384x_RID_PORTSTATUS ((uint16_t)0xFD40)
  529. #define HFA384x_RID_CURRENTSSID ((uint16_t)0xFD41)
  530. #define HFA384x_RID_CURRENTBSSID ((uint16_t)0xFD42)
  531. #define HFA384x_RID_COMMSQUALITY ((uint16_t)0xFD43)
  532. #define HFA384x_RID_CURRENTTXRATE ((uint16_t)0xFD44)
  533. #define HFA384x_RID_CURRENTBCNint ((uint16_t)0xFD45)
  534. #define HFA384x_RID_CURRENTSCALETHRESH ((uint16_t)0xFD46)
  535. #define HFA384x_RID_PROTOCOLRSPTIME ((uint16_t)0xFD47)
  536. #define HFA384x_RID_SHORTRETRYLIMIT ((uint16_t)0xFD48)
  537. #define HFA384x_RID_LONGRETRYLIMIT ((uint16_t)0xFD49)
  538. #define HFA384x_RID_MAXTXLIFETIME ((uint16_t)0xFD4A)
  539. #define HFA384x_RID_MAXRXLIFETIME ((uint16_t)0xFD4B)
  540. #define HFA384x_RID_CFPOLLABLE ((uint16_t)0xFD4C)
  541. #define HFA384x_RID_AUTHALGORITHMS ((uint16_t)0xFD4D)
  542. #define HFA384x_RID_PRIVACYOPTIMP ((uint16_t)0xFD4F)
  543. #define HFA384x_RID_DBMCOMMSQUALITY ((uint16_t)0xFD51)
  544. #define HFA384x_RID_CURRENTTXRATE1 ((uint16_t)0xFD80)
  545. #define HFA384x_RID_CURRENTTXRATE2 ((uint16_t)0xFD81)
  546. #define HFA384x_RID_CURRENTTXRATE3 ((uint16_t)0xFD82)
  547. #define HFA384x_RID_CURRENTTXRATE4 ((uint16_t)0xFD83)
  548. #define HFA384x_RID_CURRENTTXRATE5 ((uint16_t)0xFD84)
  549. #define HFA384x_RID_CURRENTTXRATE6 ((uint16_t)0xFD85)
  550. #define HFA384x_RID_OWNMACADDRESS ((uint16_t)0xFD86)
  551. // #define HFA384x_RID_PCFINFO ((uint16_t)0xFD87)
  552. #define HFA384x_RID_SCANRESULTS ((uint16_t)0xFD88) // NEW
  553. #define HFA384x_RID_HOSTSCANRESULTS ((uint16_t)0xFD89) // NEW
  554. #define HFA384x_RID_AUTHENTICATIONUSED ((uint16_t)0xFD8A) // NEW
  555. #define HFA384x_RID_ASSOCIATEFAILURE ((uint16_t)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_t)0)
  562. #define HFA384x_RID_CURRENTSSID_LEN ((uint16_t)34)
  563. #define HFA384x_RID_CURRENTBSSID_LEN ((uint16_t)WLAN_BSSID_LEN)
  564. #define HFA384x_RID_COMMSQUALITY_LEN ((uint16_t)sizeof(hfa384x_commsquality_t))
  565. #define HFA384x_RID_DBMCOMMSQUALITY_LEN ((uint16_t)sizeof(hfa384x_dbmcommsquality_t))
  566. #define HFA384x_RID_CURRENTTXRATE_LEN ((uint16_t)0)
  567. #define HFA384x_RID_CURRENTBCNINT_LEN ((uint16_t)0)
  568. #define HFA384x_RID_STACURSCALETHRESH_LEN ((uint16_t)12)
  569. #define HFA384x_RID_APCURSCALETHRESH_LEN ((uint16_t)6)
  570. #define HFA384x_RID_PROTOCOLRSPTIME_LEN ((uint16_t)0)
  571. #define HFA384x_RID_SHORTRETRYLIMIT_LEN ((uint16_t)0)
  572. #define HFA384x_RID_LONGRETRYLIMIT_LEN ((uint16_t)0)
  573. #define HFA384x_RID_MAXTXLIFETIME_LEN ((uint16_t)0)
  574. #define HFA384x_RID_MAXRXLIFETIME_LEN ((uint16_t)0)
  575. #define HFA384x_RID_CFPOLLABLE_LEN ((uint16_t)0)
  576. #define HFA384x_RID_AUTHALGORITHMS_LEN ((uint16_t)4)
  577. #define HFA384x_RID_PRIVACYOPTIMP_LEN ((uint16_t)0)
  578. #define HFA384x_RID_CURRENTTXRATE1_LEN ((uint16_t)0)
  579. #define HFA384x_RID_CURRENTTXRATE2_LEN ((uint16_t)0)
  580. #define HFA384x_RID_CURRENTTXRATE3_LEN ((uint16_t)0)
  581. #define HFA384x_RID_CURRENTTXRATE4_LEN ((uint16_t)0)
  582. #define HFA384x_RID_CURRENTTXRATE5_LEN ((uint16_t)0)
  583. #define HFA384x_RID_CURRENTTXRATE6_LEN ((uint16_t)0)
  584. #define HFA384x_RID_OWNMACADDRESS_LEN ((uint16_t)6)
  585. #define HFA384x_RID_PCFINFO_LEN ((uint16_t)6)
  586. #define HFA384x_RID_CNFAPPCFINFO_LEN ((uint16_t)sizeof(hfa384x_PCFInfo_data_t))
  587. #define HFA384x_RID_SCANREQUEST_LEN ((uint16_t)sizeof(hfa384x_ScanRequest_data_t))
  588. #define HFA384x_RID_JOINREQUEST_LEN ((uint16_t)sizeof(hfa384x_JoinRequest_data_t))
  589. #define HFA384x_RID_AUTHENTICATESTA_LEN ((uint16_t)sizeof(hfa384x_authenticateStation_data_t))
  590. #define HFA384x_RID_CHANNELINFOREQUEST_LEN ((uint16_t)sizeof(hfa384x_ChannelInfoRequest_data_t))
  591. /*--------------------------------------------------------------------
  592. Information RIDs: Modem Information
  593. --------------------------------------------------------------------*/
  594. #define HFA384x_RID_PHYTYPE ((uint16_t)0xFDC0)
  595. #define HFA384x_RID_CURRENTCHANNEL ((uint16_t)0xFDC1)
  596. #define HFA384x_RID_CURRENTPOWERSTATE ((uint16_t)0xFDC2)
  597. #define HFA384x_RID_CCAMODE ((uint16_t)0xFDC3)
  598. #define HFA384x_RID_SUPPORTEDDATARATES ((uint16_t)0xFDC6)
  599. #define HFA384x_RID_LFOSTATUS ((uint16_t)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_t)0)
  606. #define HFA384x_RID_CURRENTCHANNEL_LEN ((uint16_t)0)
  607. #define HFA384x_RID_CURRENTPOWERSTATE_LEN ((uint16_t)0)
  608. #define HFA384x_RID_CCAMODE_LEN ((uint16_t)0)
  609. #define HFA384x_RID_SUPPORTEDDATARATES_LEN ((uint16_t)10)
  610. /*--------------------------------------------------------------------
  611. API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
  612. --------------------------------------------------------------------*/
  613. #define HFA384x_RID_CNFWEPDEFAULTKEYID ((uint16_t)0xFC23)
  614. #define HFA384x_RID_CNFWEPDEFAULTKEY0 ((uint16_t)0xFC24)
  615. #define HFA384x_RID_CNFWEPDEFAULTKEY1 ((uint16_t)0xFC25)
  616. #define HFA384x_RID_CNFWEPDEFAULTKEY2 ((uint16_t)0xFC26)
  617. #define HFA384x_RID_CNFWEPDEFAULTKEY3 ((uint16_t)0xFC27)
  618. #define HFA384x_RID_CNFWEPFLAGS ((uint16_t)0xFC28)
  619. #define HFA384x_RID_CNFWEPKEYMAPTABLE ((uint16_t)0xFC29)
  620. #define HFA384x_RID_CNFAUTHENTICATION ((uint16_t)0xFC2A)
  621. #define HFA384x_RID_CNFMAXASSOCSTATIONS ((uint16_t)0xFC2B)
  622. #define HFA384x_RID_CNFTXCONTROL ((uint16_t)0xFC2C)
  623. #define HFA384x_RID_CNFROAMINGMODE ((uint16_t)0xFC2D)
  624. #define HFA384x_RID_CNFHOSTAUTHASSOC ((uint16_t)0xFC2E)
  625. #define HFA384x_RID_CNFRCVCRCERROR ((uint16_t)0xFC30)
  626. // #define HFA384x_RID_CNFMMLIFE ((uint16_t)0xFC31)
  627. #define HFA384x_RID_CNFALTRETRYCNT ((uint16_t)0xFC32)
  628. #define HFA384x_RID_CNFAPBCNint ((uint16_t)0xFC33)
  629. #define HFA384x_RID_CNFAPPCFINFO ((uint16_t)0xFC34)
  630. #define HFA384x_RID_CNFSTAPCFINFO ((uint16_t)0xFC35)
  631. #define HFA384x_RID_CNFPRIORITYQUSAGE ((uint16_t)0xFC37)
  632. #define HFA384x_RID_CNFTIMCTRL ((uint16_t)0xFC40)
  633. #define HFA384x_RID_CNFTHIRTY2TALLY ((uint16_t)0xFC42)
  634. #define HFA384x_RID_CNFENHSECURITY ((uint16_t)0xFC43)
  635. #define HFA384x_RID_CNFDBMADJUST ((uint16_t)0xFC46) // NEW
  636. #define HFA384x_RID_CNFWPADATA ((uint16_t)0xFC48) // 1.7.0
  637. #define HFA384x_RID_CNFPROPOGATIONDELAY ((uint16_t)0xFC49) // 1.7.6
  638. #define HFA384x_RID_CNFSHORTPREAMBLE ((uint16_t)0xFCB0)
  639. #define HFA384x_RID_CNFEXCLONGPREAMBLE ((uint16_t)0xFCB1)
  640. #define HFA384x_RID_CNFAUTHRSPTIMEOUT ((uint16_t)0xFCB2)
  641. #define HFA384x_RID_CNFBASICRATES ((uint16_t)0xFCB3)
  642. #define HFA384x_RID_CNFSUPPRATES ((uint16_t)0xFCB4)
  643. #define HFA384x_RID_CNFFALLBACKCTRL ((uint16_t)0xFCB5) // NEW
  644. #define HFA384x_RID_WEPKEYSTATUS ((uint16_t)0xFCB6) // NEW
  645. #define HFA384x_RID_WEPKEYMAPINDEX ((uint16_t)0xFCB7) // NEW
  646. #define HFA384x_RID_BROADCASTKEYID ((uint16_t)0xFCB8) // NEW
  647. #define HFA384x_RID_ENTSECFLAGEYID ((uint16_t)0xFCB9) // NEW
  648. #define HFA384x_RID_CNFPASSIVESCANCTRL ((uint16_t)0xFCBA) // NEW STA
  649. #define HFA384x_RID_CNFWPAHANDLING ((uint16_t)0xFCBB) // 1.7.0
  650. #define HFA384x_RID_MDCCONTROL ((uint16_t)0xFCBC) // 1.7.0/1.4.0
  651. #define HFA384x_RID_MDCCOUNTRY ((uint16_t)0xFCBD) // 1.7.0/1.4.0
  652. #define HFA384x_RID_TXPOWERMAX ((uint16_t)0xFCBE) // 1.7.0/1.4.0
  653. #define HFA384x_RID_CNFLFOENBLED ((uint16_t)0xFCBF) // 1.6.3
  654. #define HFA384x_RID_CAPINFO ((uint16_t)0xFCC0) // 1.7.0/1.3.7
  655. #define HFA384x_RID_LISTENINTERVAL ((uint16_t)0xFCC1) // 1.7.0/1.3.7
  656. #define HFA384x_RID_DIVERSITYENABLED ((uint16_t)0xFCC2) // 1.7.0/1.3.7
  657. #define HFA384x_RID_LED_CONTROL ((uint16_t)0xFCC4) // 1.7.6
  658. #define HFA384x_RID_HFO_DELAY ((uint16_t)0xFCC5) // 1.7.6
  659. #define HFA384x_RID_DISSALOWEDBSSID ((uint16_t)0xFCC6) // 1.8.0
  660. #define HFA384x_RID_SCANREQUEST ((uint16_t)0xFCE1)
  661. #define HFA384x_RID_JOINREQUEST ((uint16_t)0xFCE2)
  662. #define HFA384x_RID_AUTHENTICATESTA ((uint16_t)0xFCE3)
  663. #define HFA384x_RID_CHANNELINFOREQUEST ((uint16_t)0xFCE4)
  664. #define HFA384x_RID_HOSTSCAN ((uint16_t)0xFCE5) // NEW STA
  665. #define HFA384x_RID_ASSOCIATESTA ((uint16_t)0xFCE6)
  666. #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((uint16_t)6)
  667. #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((uint16_t)14)
  668. #define HFA384x_RID_CNFPRIOQUSAGE_LEN ((uint16_t)4)
  669. /*--------------------------------------------------------------------
  670. PD Record codes
  671. --------------------------------------------------------------------*/
  672. #define HFA384x_PDR_PCB_PARTNUM ((uint16_t)0x0001)
  673. #define HFA384x_PDR_PDAVER ((uint16_t)0x0002)
  674. #define HFA384x_PDR_NIC_SERIAL ((uint16_t)0x0003)
  675. #define HFA384x_PDR_MKK_MEASUREMENTS ((uint16_t)0x0004)
  676. #define HFA384x_PDR_NIC_RAMSIZE ((uint16_t)0x0005)
  677. #define HFA384x_PDR_MFISUPRANGE ((uint16_t)0x0006)
  678. #define HFA384x_PDR_CFISUPRANGE ((uint16_t)0x0007)
  679. #define HFA384x_PDR_NICID ((uint16_t)0x0008)
  680. //#define HFA384x_PDR_REFDAC_MEASUREMENTS ((uint16_t)0x0010)
  681. //#define HFA384x_PDR_VGDAC_MEASUREMENTS ((uint16_t)0x0020)
  682. //#define HFA384x_PDR_LEVEL_COMP_MEASUREMENTS ((uint16_t)0x0030)
  683. //#define HFA384x_PDR_MODEM_TRIMDAC_MEASUREMENTS ((uint16_t)0x0040)
  684. //#define HFA384x_PDR_COREGA_HACK ((uint16_t)0x00ff)
  685. #define HFA384x_PDR_MAC_ADDRESS ((uint16_t)0x0101)
  686. //#define HFA384x_PDR_MKK_CALLNAME ((uint16_t)0x0102)
  687. #define HFA384x_PDR_REGDOMAIN ((uint16_t)0x0103)
  688. #define HFA384x_PDR_ALLOWED_CHANNEL ((uint16_t)0x0104)
  689. #define HFA384x_PDR_DEFAULT_CHANNEL ((uint16_t)0x0105)
  690. //#define HFA384x_PDR_PRIVACY_OPTION ((uint16_t)0x0106)
  691. #define HFA384x_PDR_TEMPTYPE ((uint16_t)0x0107)
  692. //#define HFA384x_PDR_REFDAC_SETUP ((uint16_t)0x0110)
  693. //#define HFA384x_PDR_VGDAC_SETUP ((uint16_t)0x0120)
  694. //#define HFA384x_PDR_LEVEL_COMP_SETUP ((uint16_t)0x0130)
  695. //#define HFA384x_PDR_TRIMDAC_SETUP ((uint16_t)0x0140)
  696. #define HFA384x_PDR_IFR_SETTING ((uint16_t)0x0200)
  697. #define HFA384x_PDR_RFR_SETTING ((uint16_t)0x0201)
  698. #define HFA384x_PDR_HFA3861_BASELINE ((uint16_t)0x0202)
  699. #define HFA384x_PDR_HFA3861_SHADOW ((uint16_t)0x0203)
  700. #define HFA384x_PDR_HFA3861_IFRF ((uint16_t)0x0204)
  701. #define HFA384x_PDR_HFA3861_CHCALSP ((uint16_t)0x0300)
  702. #define HFA384x_PDR_HFA3861_CHCALI ((uint16_t)0x0301)
  703. #define HFA384x_PDR_MAX_TX_POWER ((uint16_t)0x0302)
  704. #define HFA384x_PDR_MASTER_CHAN_LIST ((uint16_t)0x0303)
  705. #define HFA384x_PDR_3842_NIC_CONFIG ((uint16_t)0x0400)
  706. #define HFA384x_PDR_USB_ID ((uint16_t)0x0401)
  707. #define HFA384x_PDR_PCI_ID ((uint16_t)0x0402)
  708. #define HFA384x_PDR_PCI_IFCONF ((uint16_t)0x0403)
  709. #define HFA384x_PDR_PCI_PMCONF ((uint16_t)0x0404)
  710. #define HFA384x_PDR_RFENRGY ((uint16_t)0x0406)
  711. #define HFA384x_PDR_USB_POWER_TYPE ((uint16_t)0x0407)
  712. //#define HFA384x_PDR_UNKNOWN408 ((uint16_t)0x0408)
  713. #define HFA384x_PDR_USB_MAX_POWER ((uint16_t)0x0409)
  714. #define HFA384x_PDR_USB_MANUFACTURER ((uint16_t)0x0410)
  715. #define HFA384x_PDR_USB_PRODUCT ((uint16_t)0x0411)
  716. #define HFA384x_PDR_ANT_DIVERSITY ((uint16_t)0x0412)
  717. #define HFA384x_PDR_HFO_DELAY ((uint16_t)0x0413)
  718. #define HFA384x_PDR_SCALE_THRESH ((uint16_t)0x0414)
  719. #define HFA384x_PDR_HFA3861_MANF_TESTSP ((uint16_t)0x0900)
  720. #define HFA384x_PDR_HFA3861_MANF_TESTI ((uint16_t)0x0901)
  721. #define HFA384x_PDR_END_OF_PDA ((uint16_t)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_t)(((uint16_t)value) & HFA384x_CMD_BUSY))
  757. #define HFA384x_CMD_AINFO_GET(value) ((uint16_t)(((uint16_t)(value) & HFA384x_CMD_AINFO) >> 8))
  758. #define HFA384x_CMD_AINFO_SET(value) ((uint16_t)((uint16_t)(value) << 8))
  759. #define HFA384x_CMD_MACPORT_GET(value) ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_MACPORT)))
  760. #define HFA384x_CMD_MACPORT_SET(value) ((uint16_t)HFA384x_CMD_AINFO_SET(value))
  761. #define HFA384x_CMD_ISRECL(value) ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_RECL)))
  762. #define HFA384x_CMD_RECL_SET(value) ((uint16_t)HFA384x_CMD_AINFO_SET(value))
  763. #define HFA384x_CMD_QOS_GET(value) ((uint16_t((((uint16_t)(value))&((uint16_t)0x3000)) >> 12))
  764. #define HFA384x_CMD_QOS_SET(value) ((uint16_t)((((uint16_t)(value)) << 12) & 0x3000))
  765. #define HFA384x_CMD_ISWRITE(value) ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_WRITE)))
  766. #define HFA384x_CMD_WRITE_SET(value) ((uint16_t)HFA384x_CMD_AINFO_SET((uint16_t)value))
  767. #define HFA384x_CMD_PROGMODE_GET(value) ((uint16_t)(HFA384x_CMD_AINFO_GET((uint16_t)(value) & HFA384x_CMD_PROGMODE)))
  768. #define HFA384x_CMD_PROGMODE_SET(value) ((uint16_t)HFA384x_CMD_AINFO_SET((uint16_t)value))
  769. #define HFA384x_CMD_CMDCODE_GET(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_CMD_CMDCODE))
  770. #define HFA384x_CMD_CMDCODE_SET(value) ((uint16_t)(value))
  771. #define HFA384x_STATUS_RESULT_GET(value) ((uint16_t)((((uint16_t)(value)) & HFA384x_STATUS_RESULT) >> 8))
  772. #define HFA384x_STATUS_RESULT_SET(value) (((uint16_t)(value)) << 8)
  773. #define HFA384x_STATUS_CMDCODE_GET(value) (((uint16_t)(value)) & HFA384x_STATUS_CMDCODE)
  774. #define HFA384x_STATUS_CMDCODE_SET(value) ((uint16_t)(value))
  775. #define HFA384x_OFFSET_ISBUSY(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_OFFSET_BUSY))
  776. #define HFA384x_OFFSET_ISERR(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_OFFSET_ERR))
  777. #define HFA384x_OFFSET_DATAOFF_GET(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_OFFSET_DATAOFF))
  778. #define HFA384x_OFFSET_DATAOFF_SET(value) ((uint16_t)(value))
  779. #define HFA384x_EVSTAT_ISTICK(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_TICK))
  780. #define HFA384x_EVSTAT_ISWTERR(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_WTERR))
  781. #define HFA384x_EVSTAT_ISINFDROP(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_INFDROP))
  782. #define HFA384x_EVSTAT_ISINFO(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_INFO))
  783. #define HFA384x_EVSTAT_ISDTIM(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_DTIM))
  784. #define HFA384x_EVSTAT_ISCMD(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_CMD))
  785. #define HFA384x_EVSTAT_ISALLOC(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_ALLOC))
  786. #define HFA384x_EVSTAT_ISTXEXC(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_TXEXC))
  787. #define HFA384x_EVSTAT_ISTX(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_TX))
  788. #define HFA384x_EVSTAT_ISRX(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVSTAT_RX))
  789. #define HFA384x_EVSTAT_ISBAP_OP(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INT_BAP_OP))
  790. #define HFA384x_INTEN_ISTICK(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_TICK))
  791. #define HFA384x_INTEN_TICK_SET(value) ((uint16_t)(((uint16_t)(value)) << 15))
  792. #define HFA384x_INTEN_ISWTERR(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_WTERR))
  793. #define HFA384x_INTEN_WTERR_SET(value) ((uint16_t)(((uint16_t)(value)) << 14))
  794. #define HFA384x_INTEN_ISINFDROP(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_INFDROP))
  795. #define HFA384x_INTEN_INFDROP_SET(value) ((uint16_t)(((uint16_t)(value)) << 13))
  796. #define HFA384x_INTEN_ISINFO(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_INFO))
  797. #define HFA384x_INTEN_INFO_SET(value) ((uint16_t)(((uint16_t)(value)) << 7))
  798. #define HFA384x_INTEN_ISDTIM(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_DTIM))
  799. #define HFA384x_INTEN_DTIM_SET(value) ((uint16_t)(((uint16_t)(value)) << 5))
  800. #define HFA384x_INTEN_ISCMD(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_CMD))
  801. #define HFA384x_INTEN_CMD_SET(value) ((uint16_t)(((uint16_t)(value)) << 4))
  802. #define HFA384x_INTEN_ISALLOC(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_ALLOC))
  803. #define HFA384x_INTEN_ALLOC_SET(value) ((uint16_t)(((uint16_t)(value)) << 3))
  804. #define HFA384x_INTEN_ISTXEXC(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_TXEXC))
  805. #define HFA384x_INTEN_TXEXC_SET(value) ((uint16_t)(((uint16_t)(value)) << 2))
  806. #define HFA384x_INTEN_ISTX(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_TX))
  807. #define HFA384x_INTEN_TX_SET(value) ((uint16_t)(((uint16_t)(value)) << 1))
  808. #define HFA384x_INTEN_ISRX(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_INTEN_RX))
  809. #define HFA384x_INTEN_RX_SET(value) ((uint16_t)(((uint16_t)(value)) << 0))
  810. #define HFA384x_EVACK_ISTICK(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_TICK))
  811. #define HFA384x_EVACK_TICK_SET(value) ((uint16_t)(((uint16_t)(value)) << 15))
  812. #define HFA384x_EVACK_ISWTERR(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_WTERR))
  813. #define HFA384x_EVACK_WTERR_SET(value) ((uint16_t)(((uint16_t)(value)) << 14))
  814. #define HFA384x_EVACK_ISINFDROP(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_INFDROP))
  815. #define HFA384x_EVACK_INFDROP_SET(value) ((uint16_t)(((uint16_t)(value)) << 13))
  816. #define HFA384x_EVACK_ISINFO(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_INFO))
  817. #define HFA384x_EVACK_INFO_SET(value) ((uint16_t)(((uint16_t)(value)) << 7))
  818. #define HFA384x_EVACK_ISDTIM(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_DTIM))
  819. #define HFA384x_EVACK_DTIM_SET(value) ((uint16_t)(((uint16_t)(value)) << 5))
  820. #define HFA384x_EVACK_ISCMD(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_CMD))
  821. #define HFA384x_EVACK_CMD_SET(value) ((uint16_t)(((uint16_t)(value)) << 4))
  822. #define HFA384x_EVACK_ISALLOC(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_ALLOC))
  823. #define HFA384x_EVACK_ALLOC_SET(value) ((uint16_t)(((uint16_t)(value)) << 3))
  824. #define HFA384x_EVACK_ISTXEXC(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_TXEXC))
  825. #define HFA384x_EVACK_TXEXC_SET(value) ((uint16_t)(((uint16_t)(value)) << 2))
  826. #define HFA384x_EVACK_ISTX(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_TX))
  827. #define HFA384x_EVACK_TX_SET(value) ((uint16_t)(((uint16_t)(value)) << 1))
  828. #define HFA384x_EVACK_ISRX(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_EVACK_RX))
  829. #define HFA384x_EVACK_RX_SET(value) ((uint16_t)(((uint16_t)(value)) << 0))
  830. #define HFA384x_CONTROL_AUXEN_SET(value) ((uint16_t)(((uint16_t)(value)) << 14))
  831. #define HFA384x_CONTROL_AUXEN_GET(value) ((uint16_t)(((uint16_t)(value)) >> 14))
  832. /* Byte Order */
  833. #ifdef __KERNEL__
  834. #define hfa384x2host_16(n) (__le16_to_cpu((uint16_t)(n)))
  835. #define hfa384x2host_32(n) (__le32_to_cpu((uint32_t)(n)))
  836. #define host2hfa384x_16(n) (__cpu_to_le16((uint16_t)(n)))
  837. #define host2hfa384x_32(n) (__cpu_to_le32((uint32_t)(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_t len;
  854. uint8_t data[0];
  855. } __WLAN_ATTRIB_PACK__ hfa384x_bytestr_t;
  856. typedef struct hfa384x_bytestr32
  857. {
  858. uint16_t len;
  859. uint8_t 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_t reclen;
  870. uint16_t rid;
  871. } __WLAN_ATTRIB_PACK__ hfa384x_rec_t;
  872. typedef struct hfa384x_record16
  873. {
  874. uint16_t reclen;
  875. uint16_t rid;
  876. uint16_t val;
  877. } __WLAN_ATTRIB_PACK__ hfa384x_rec16_t;
  878. typedef struct hfa384x_record32
  879. {
  880. uint16_t reclen;
  881. uint16_t rid;
  882. uint32_t val;
  883. } __WLAN_ATTRIB_PACK__ hfa384x_rec32;
  884. /*-- Hardware/Firmware Component Information ----------*/
  885. typedef struct hfa384x_compident
  886. {
  887. uint16_t id;
  888. uint16_t variant;
  889. uint16_t major;
  890. uint16_t minor;
  891. } __WLAN_ATTRIB_PACK__ hfa384x_compident_t;
  892. typedef struct hfa384x_caplevel
  893. {
  894. uint16_t role;
  895. uint16_t id;
  896. uint16_t variant;
  897. uint16_t bottom;
  898. uint16_t top;
  899. } __WLAN_ATTRIB_PACK__ hfa384x_caplevel_t;
  900. /*-- Configuration Record: cnfPortType --*/
  901. typedef struct hfa384x_cnfPortType
  902. {
  903. uint16_t cnfPortType;
  904. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPortType_t;
  905. /*-- Configuration Record: cnfOwnMACAddress --*/
  906. typedef struct hfa384x_cnfOwnMACAddress
  907. {
  908. uint8_t cnfOwnMACAddress[6];
  909. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnMACAddress_t;
  910. /*-- Configuration Record: cnfDesiredSSID --*/
  911. typedef struct hfa384x_cnfDesiredSSID
  912. {
  913. uint8_t cnfDesiredSSID[34];
  914. } __WLAN_ATTRIB_PACK__ hfa384x_cnfDesiredSSID_t;
  915. /*-- Configuration Record: cnfOwnChannel --*/
  916. typedef struct hfa384x_cnfOwnChannel
  917. {
  918. uint16_t cnfOwnChannel;
  919. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnChannel_t;
  920. /*-- Configuration Record: cnfOwnSSID --*/
  921. typedef struct hfa384x_cnfOwnSSID
  922. {
  923. uint8_t cnfOwnSSID[34];
  924. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnSSID_t;
  925. /*-- Configuration Record: cnfOwnATIMWindow --*/
  926. typedef struct hfa384x_cnfOwnATIMWindow
  927. {
  928. uint16_t cnfOwnATIMWindow;
  929. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnATIMWindow_t;
  930. /*-- Configuration Record: cnfSystemScale --*/
  931. typedef struct hfa384x_cnfSystemScale
  932. {
  933. uint16_t cnfSystemScale;
  934. } __WLAN_ATTRIB_PACK__ hfa384x_cnfSystemScale_t;
  935. /*-- Configuration Record: cnfMaxDataLength --*/
  936. typedef struct hfa384x_cnfMaxDataLength
  937. {
  938. uint16_t cnfMaxDataLength;
  939. } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxDataLength_t;
  940. /*-- Configuration Record: cnfWDSAddress --*/
  941. typedef struct hfa384x_cnfWDSAddress
  942. {
  943. uint8_t cnfWDSAddress[6];
  944. } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddress_t;
  945. /*-- Configuration Record: cnfPMEnabled --*/
  946. typedef struct hfa384x_cnfPMEnabled
  947. {
  948. uint16_t cnfPMEnabled;
  949. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEnabled_t;
  950. /*-- Configuration Record: cnfPMEPS --*/
  951. typedef struct hfa384x_cnfPMEPS
  952. {
  953. uint16_t cnfPMEPS;
  954. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEPS_t;
  955. /*-- Configuration Record: cnfMulticastReceive --*/
  956. typedef struct hfa384x_cnfMulticastReceive
  957. {
  958. uint16_t 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_t cnfMaxSleepDuration;
  968. } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxSleepDuration_t;
  969. /*-- Configuration Record: cnfPMHoldoverDuration --*/
  970. typedef struct hfa384x_cnfPMHoldoverDuration
  971. {
  972. uint16_t cnfPMHoldoverDuration;
  973. } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMHoldoverDuration_t;
  974. /*-- Configuration Record: cnfOwnName --*/
  975. typedef struct hfa384x_cnfOwnName
  976. {
  977. uint8_t cnfOwnName[34];
  978. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnName_t;
  979. /*-- Configuration Record: cnfOwnDTIMPeriod --*/
  980. typedef struct hfa384x_cnfOwnDTIMPeriod
  981. {
  982. uint16_t cnfOwnDTIMPeriod;
  983. } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnDTIMPeriod_t;
  984. /*-- Configuration Record: cnfWDSAddress --*/
  985. typedef struct hfa384x_cnfWDSAddressN
  986. {
  987. uint8_t cnfWDSAddress[6];
  988. } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddressN_t;
  989. /*-- Configuration Record: cnfMulticastPMBuffering --*/
  990. typedef struct hfa384x_cnfMulticastPMBuffering
  991. {
  992. uint16_t 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_t MACAddress[16][6];
  1002. } __WLAN_ATTRIB_PACK__ hfa384x_GroupAddresses_t;
  1003. /*-- Configuration Record: CreateIBSS --*/
  1004. typedef struct hfa384x_CreateIBSS
  1005. {
  1006. uint16_t 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_t FragmentationThreshold;
  1016. } __WLAN_ATTRIB_PACK__ hfa384x_FragmentationThreshold_t;
  1017. /*-- Configuration Record: RTSThreshold --*/
  1018. typedef struct hfa384x_RTSThreshold
  1019. {
  1020. uint16_t RTSThreshold;
  1021. } __WLAN_ATTRIB_PACK__ hfa384x_RTSThreshold_t;
  1022. /*-- Configuration Record: TxRateControl --*/
  1023. typedef struct hfa384x_TxRateControl
  1024. {
  1025. uint16_t TxRateControl;
  1026. } __WLAN_ATTRIB_PACK__ hfa384x_TxRateControl_t;
  1027. /*-- Configuration Record: PromiscuousMode --*/
  1028. typedef struct hfa384x_PromiscuousMode
  1029. {
  1030. uint16_t PromiscuousMode;
  1031. } __WLAN_ATTRIB_PACK__ hfa384x_PromiscuousMode_t;
  1032. /*-- Configuration Record: ScanRequest (data portion only) --*/
  1033. typedef struct hfa384x_ScanRequest_data
  1034. {
  1035. uint16_t channelList;
  1036. uint16_t 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_t channelList;
  1042. uint16_t 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_t bssid[WLAN_BSSID_LEN];
  1049. uint16_t 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_t address[WLAN_ADDR_LEN];
  1055. uint16_t status;
  1056. uint16_t 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_t address[WLAN_ADDR_LEN];
  1062. uint16_t status;
  1063. uint16_t 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_t channelList;
  1069. uint16_t channelDwellTime;
  1070. } __WLAN_ATTRIB_PACK__ hfa384x_ChannelInfoRequest_data_t;
  1071. /*-- Configuration Record: WEPKeyMapping (data portion only) --*/
  1072. typedef struct hfa384x_WEPKeyMapping
  1073. {
  1074. uint8_t address[WLAN_ADDR_LEN];
  1075. uint16_t key_index;
  1076. uint8_t key[16];
  1077. uint8_t mic_transmit_key[4];
  1078. uint8_t 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_t datalen;
  1084. uint8_t 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_t 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_t 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_t page;
  1107. uint16_t offset;
  1108. uint16_t len;
  1109. } __WLAN_ATTRIB_PACK__ hfa384x_downloadbuffer_t;
  1110. /*-- Information Record: PRIIdentity --*/
  1111. typedef struct hfa384x_PRIIdentity
  1112. {
  1113. uint16_t PRICompID;
  1114. uint16_t PRIVariant;
  1115. uint16_t PRIMajorVersion;
  1116. uint16_t PRIMinorVersion;
  1117. } __WLAN_ATTRIB_PACK__ hfa384x_PRIIdentity_t;
  1118. /*-- Information Record: PRISupRange --*/
  1119. typedef struct hfa384x_PRISupRange
  1120. {
  1121. uint16_t PRIRole;
  1122. uint16_t PRIID;
  1123. uint16_t PRIVariant;
  1124. uint16_t PRIBottom;
  1125. uint16_t PRITop;
  1126. } __WLAN_ATTRIB_PACK__ hfa384x_PRISupRange_t;
  1127. /*-- Information Record: CFIActRanges --*/
  1128. typedef struct hfa384x_CFIActRanges
  1129. {
  1130. uint16_t CFIRole;
  1131. uint16_t CFIID;
  1132. uint16_t CFIVariant;
  1133. uint16_t CFIBottom;
  1134. uint16_t CFITop;
  1135. } __WLAN_ATTRIB_PACK__ hfa384x_CFIActRanges_t;
  1136. /*-- Information Record: NICSerialNumber --*/
  1137. typedef struct hfa384x_NICSerialNumber
  1138. {
  1139. uint8_t NICSerialNumber[12];
  1140. } __WLAN_ATTRIB_PACK__ hfa384x_NICSerialNumber_t;
  1141. /*-- Information Record: NICIdentity --*/
  1142. typedef struct hfa384x_NICIdentity
  1143. {
  1144. uint16_t NICCompID;
  1145. uint16_t NICVariant;
  1146. uint16_t NICMajorVersion;
  1147. uint16_t NICMinorVersion;
  1148. } __WLAN_ATTRIB_PACK__ hfa384x_NICIdentity_t;
  1149. /*-- Information Record: MFISupRange --*/
  1150. typedef struct hfa384x_MFISupRange
  1151. {
  1152. uint16_t MFIRole;
  1153. uint16_t MFIID;
  1154. uint16_t MFIVariant;
  1155. uint16_t MFIBottom;
  1156. uint16_t MFITop;
  1157. } __WLAN_ATTRIB_PACK__ hfa384x_MFISupRange_t;
  1158. /*-- Information Record: CFISupRange --*/
  1159. typedef struct hfa384x_CFISupRange
  1160. {
  1161. uint16_t CFIRole;
  1162. uint16_t CFIID;
  1163. uint16_t CFIVariant;
  1164. uint16_t CFIBottom;
  1165. uint16_t CFITop;
  1166. } __WLAN_ATTRIB_PACK__ hfa384x_CFISupRange_t;
  1167. /*-- Information Record: BUILDSEQ:BuildSeq --*/
  1168. typedef struct hfa384x_BuildSeq {
  1169. uint16_t primary;
  1170. uint16_t 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_t primary[HFA384x_FWID_LEN];
  1176. uint8_t secondary[HFA384x_FWID_LEN];
  1177. } __WLAN_ATTRIB_PACK__ hfa384x_FWID_t;
  1178. /*-- Information Record: ChannelList --*/
  1179. typedef struct hfa384x_ChannelList
  1180. {
  1181. uint16_t ChannelList;
  1182. } __WLAN_ATTRIB_PACK__ hfa384x_ChannelList_t;
  1183. /*-- Information Record: RegulatoryDomains --*/
  1184. typedef struct hfa384x_RegulatoryDomains
  1185. {
  1186. uint8_t RegulatoryDomains[12];
  1187. } __WLAN_ATTRIB_PACK__ hfa384x_RegulatoryDomains_t;
  1188. /*-- Information Record: TempType --*/
  1189. typedef struct hfa384x_TempType
  1190. {
  1191. uint16_t TempType;
  1192. } __WLAN_ATTRIB_PACK__ hfa384x_TempType_t;
  1193. /*-- Information Record: CIS --*/
  1194. typedef struct hfa384x_CIS
  1195. {
  1196. uint8_t CIS[480];
  1197. } __WLAN_ATTRIB_PACK__ hfa384x_CIS_t;
  1198. /*-- Information Record: STAIdentity --*/
  1199. typedef struct hfa384x_STAIdentity
  1200. {
  1201. uint16_t STACompID;
  1202. uint16_t STAVariant;
  1203. uint16_t STAMajorVersion;
  1204. uint16_t STAMinorVersion;
  1205. } __WLAN_ATTRIB_PACK__ hfa384x_STAIdentity_t;
  1206. /*-- Information Record: STASupRange --*/
  1207. typedef struct hfa384x_STASupRange
  1208. {
  1209. uint16_t STARole;
  1210. uint16_t STAID;
  1211. uint16_t STAVariant;
  1212. uint16_t STABottom;
  1213. uint16_t STATop;
  1214. } __WLAN_ATTRIB_PACK__ hfa384x_STASupRange_t;
  1215. /*-- Information Record: MFIActRanges --*/
  1216. typedef struct hfa384x_MFIActRanges
  1217. {
  1218. uint16_t MFIRole;
  1219. uint16_t MFIID;
  1220. uint16_t MFIVariant;
  1221. uint16_t MFIBottom;
  1222. uint16_t 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_t PortStatus;
  1231. } __WLAN_ATTRIB_PACK__ hfa384x_PortStatus_t;
  1232. #define HFA384x_PSTATUS_DISABLED ((uint16_t)1)
  1233. #define HFA384x_PSTATUS_SEARCHING ((uint16_t)2)
  1234. #define HFA384x_PSTATUS_CONN_IBSS ((uint16_t)3)
  1235. #define HFA384x_PSTATUS_CONN_ESS ((uint16_t)4)
  1236. #define HFA384x_PSTATUS_OUTOFRANGE ((uint16_t)5)
  1237. #define HFA384x_PSTATUS_CONN_WDS ((uint16_t)6)
  1238. /*-- Information Record: CurrentSSID --*/
  1239. typedef struct hfa384x_CurrentSSID
  1240. {
  1241. uint8_t CurrentSSID[34];
  1242. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentSSID_t;
  1243. /*-- Information Record: CurrentBSSID --*/
  1244. typedef struct hfa384x_CurrentBSSID
  1245. {
  1246. uint8_t CurrentBSSID[6];
  1247. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBSSID_t;
  1248. /*-- Information Record: commsquality --*/
  1249. typedef struct hfa384x_commsquality
  1250. {
  1251. uint16_t CQ_currBSS;
  1252. uint16_t ASL_currBSS;
  1253. uint16_t ANL_currFC;
  1254. } __WLAN_ATTRIB_PACK__ hfa384x_commsquality_t;
  1255. /*-- Information Record: dmbcommsquality --*/
  1256. typedef struct hfa384x_dbmcommsquality
  1257. {
  1258. uint16_t CQdbm_currBSS;
  1259. uint16_t ASLdbm_currBSS;
  1260. uint16_t ANLdbm_currFC;
  1261. } __WLAN_ATTRIB_PACK__ hfa384x_dbmcommsquality_t;
  1262. /*-- Information Record: CurrentTxRate --*/
  1263. typedef struct hfa384x_CurrentTxRate
  1264. {
  1265. uint16_t CurrentTxRate;
  1266. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentTxRate_t;
  1267. /*-- Information Record: CurrentBeaconInterval --*/
  1268. typedef struct hfa384x_CurrentBeaconInterval
  1269. {
  1270. uint16_t CurrentBeaconInterval;
  1271. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBeaconInterval_t;
  1272. /*-- Information Record: CurrentScaleThresholds --*/
  1273. typedef struct hfa384x_CurrentScaleThresholds
  1274. {
  1275. uint16_t EnergyDetectThreshold;
  1276. uint16_t CarrierDetectThreshold;
  1277. uint16_t DeferDetectThreshold;
  1278. uint16_t CellSearchThreshold; /* Stations only */
  1279. uint16_t DeadSpotThreshold; /* Stations only */
  1280. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentScaleThresholds_t;
  1281. /*-- Information Record: ProtocolRspTime --*/
  1282. typedef struct hfa384x_ProtocolRspTime
  1283. {
  1284. uint16_t ProtocolRspTime;
  1285. } __WLAN_ATTRIB_PACK__ hfa384x_ProtocolRspTime_t;
  1286. /*-- Information Record: ShortRetryLimit --*/
  1287. typedef struct hfa384x_ShortRetryLimit
  1288. {
  1289. uint16_t ShortRetryLimit;
  1290. } __WLAN_ATTRIB_PACK__ hfa384x_ShortRetryLimit_t;
  1291. /*-- Information Record: LongRetryLimit --*/
  1292. typedef struct hfa384x_LongRetryLimit
  1293. {
  1294. uint16_t LongRetryLimit;
  1295. } __WLAN_ATTRIB_PACK__ hfa384x_LongRetryLimit_t;
  1296. /*-- Information Record: MaxTransmitLifetime --*/
  1297. typedef struct hfa384x_MaxTransmitLifetime
  1298. {
  1299. uint16_t MaxTransmitLifetime;
  1300. } __WLAN_ATTRIB_PACK__ hfa384x_MaxTransmitLifetime_t;
  1301. /*-- Information Record: MaxReceiveLifetime --*/
  1302. typedef struct hfa384x_MaxReceiveLifetime
  1303. {
  1304. uint16_t MaxReceiveLifetime;
  1305. } __WLAN_ATTRIB_PACK__ hfa384x_MaxReceiveLifetime_t;
  1306. /*-- Information Record: CFPollable --*/
  1307. typedef struct hfa384x_CFPollable
  1308. {
  1309. uint16_t CFPollable;
  1310. } __WLAN_ATTRIB_PACK__ hfa384x_CFPollable_t;
  1311. /*-- Information Record: AuthenticationAlgorithms --*/
  1312. typedef struct hfa384x_AuthenticationAlgorithms
  1313. {
  1314. uint16_t AuthenticationType;
  1315. uint16_t TypeEnabled;
  1316. } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_t;
  1317. /*-- Information Record: AuthenticationAlgorithms
  1318. (data only --*/
  1319. typedef struct hfa384x_AuthenticationAlgorithms_data
  1320. {
  1321. uint16_t AuthenticationType;
  1322. uint16_t TypeEnabled;
  1323. } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_data_t;
  1324. /*-- Information Record: PrivacyOptionImplemented --*/
  1325. typedef struct hfa384x_PrivacyOptionImplemented
  1326. {
  1327. uint16_t PrivacyOptionImplemented;
  1328. } __WLAN_ATTRIB_PACK__ hfa384x_PrivacyOptionImplemented_t;
  1329. /*-- Information Record: OwnMACAddress --*/
  1330. typedef struct hfa384x_OwnMACAddress
  1331. {
  1332. uint8_t OwnMACAddress[6];
  1333. } __WLAN_ATTRIB_PACK__ hfa384x_OwnMACAddress_t;
  1334. /*-- Information Record: PCFInfo --*/
  1335. typedef struct hfa384x_PCFInfo
  1336. {
  1337. uint16_t MediumOccupancyLimit;
  1338. uint16_t CFPPeriod;
  1339. uint16_t CFPMaxDuration;
  1340. uint16_t CFPFlags;
  1341. } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_t;
  1342. /*-- Information Record: PCFInfo (data portion only) --*/
  1343. typedef struct hfa384x_PCFInfo_data
  1344. {
  1345. uint16_t MediumOccupancyLimit;
  1346. uint16_t CFPPeriod;
  1347. uint16_t CFPMaxDuration;
  1348. uint16_t 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_t PHYType;
  1357. } __WLAN_ATTRIB_PACK__ hfa384x_PHYType_t;
  1358. /*-- Information Record: CurrentChannel --*/
  1359. typedef struct hfa384x_CurrentChannel
  1360. {
  1361. uint16_t CurrentChannel;
  1362. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentChannel_t;
  1363. /*-- Information Record: CurrentPowerState --*/
  1364. typedef struct hfa384x_CurrentPowerState
  1365. {
  1366. uint16_t CurrentPowerState;
  1367. } __WLAN_ATTRIB_PACK__ hfa384x_CurrentPowerState_t;
  1368. /*-- Information Record: CCAMode --*/
  1369. typedef struct hfa384x_CCAMode
  1370. {
  1371. uint16_t CCAMode;
  1372. } __WLAN_ATTRIB_PACK__ hfa384x_CCAMode_t;
  1373. /*-- Information Record: SupportedDataRates --*/
  1374. typedef struct hfa384x_SupportedDataRates
  1375. {
  1376. uint8_t SupportedDataRates[10];
  1377. } __WLAN_ATTRIB_PACK__ hfa384x_SupportedDataRates_t;
  1378. /*-- Information Record: LFOStatus --*/
  1379. typedef struct hfa384x_LFOStatus
  1380. {
  1381. uint16_t TestResults;
  1382. uint16_t LFOResult;
  1383. uint16_t 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_t searching_on;
  1394. uint16_t searching_off;
  1395. uint16_t assoc_on;
  1396. uint16_t assoc_off;
  1397. uint16_t 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_t)0x44)
  1406. #define HFA384x_FD_TIME_OFF ((uint16_t)0x46)
  1407. #define HFA384x_FD_SWSUPPORT_OFF ((uint16_t)0x4A)
  1408. #define HFA384x_FD_SILENCE_OFF ((uint16_t)0x4A)
  1409. #define HFA384x_FD_SIGNAL_OFF ((uint16_t)0x4B)
  1410. #define HFA384x_FD_RATE_OFF ((uint16_t)0x4C)
  1411. #define HFA384x_FD_RXFLOW_OFF ((uint16_t)0x4D)
  1412. #define HFA384x_FD_RESERVED_OFF ((uint16_t)0x4E)
  1413. #define HFA384x_FD_TXCONTROL_OFF ((uint16_t)0x50)
  1414. /*--------------------------------------------------------------------
  1415. 802.11 Header (offset 52-6B)
  1416. --------------------------------------------------------------------*/
  1417. #define HFA384x_FD_FRAMECONTROL_OFF ((uint16_t)0x52)
  1418. #define HFA384x_FD_DURATIONID_OFF ((uint16_t)0x54)
  1419. #define HFA384x_FD_ADDRESS1_OFF ((uint16_t)0x56)
  1420. #define HFA384x_FD_ADDRESS2_OFF ((uint16_t)0x5C)
  1421. #define HFA384x_FD_ADDRESS3_OFF ((uint16_t)0x62)
  1422. #define HFA384x_FD_SEQCONTROL_OFF ((uint16_t)0x68)
  1423. #define HFA384x_FD_ADDRESS4_OFF ((uint16_t)0x6A)
  1424. #define HFA384x_FD_DATALEN_OFF ((uint16_t)0x70)
  1425. /*--------------------------------------------------------------------
  1426. 802.3 Header (offset 72-7F)
  1427. --------------------------------------------------------------------*/
  1428. #define HFA384x_FD_DESTADDRESS_OFF ((uint16_t)0x72)
  1429. #define HFA384x_FD_SRCADDRESS_OFF ((uint16_t)0x78)
  1430. #define HFA384x_FD_DATALENGTH_OFF ((uint16_t)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_t status;
  1440. uint16_t reserved1;
  1441. uint16_t reserved2;
  1442. uint32_t sw_support;
  1443. uint8_t tx_retrycount;
  1444. uint8_t tx_rate;
  1445. uint16_t tx_control;
  1446. /*-- 802.11 Header Information --*/
  1447. uint16_t frame_control;
  1448. uint16_t duration_id;
  1449. uint8_t address1[6];
  1450. uint8_t address2[6];
  1451. uint8_t address3[6];
  1452. uint16_t sequence_control;
  1453. uint8_t address4[6];
  1454. uint16_t data_len; /* little endian format */
  1455. /*-- 802.3 Header Information --*/
  1456. uint8_t dest_addr[6];
  1457. uint8_t src_addr[6];
  1458. uint16_t 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_t)BIT5)
  1465. #define HFA384x_TXSTATUS_FORMERR ((uint16_t)BIT3)
  1466. #define HFA384x_TXSTATUS_DISCON ((uint16_t)BIT2)
  1467. #define HFA384x_TXSTATUS_AGEDERR ((uint16_t)BIT1)
  1468. #define HFA384x_TXSTATUS_RETRYERR ((uint16_t)BIT0)
  1469. /*-- Transmit Control Field --*/
  1470. #define HFA384x_TX_CFPOLL ((uint16_t)BIT12)
  1471. #define HFA384x_TX_PRST ((uint16_t)BIT11)
  1472. #define HFA384x_TX_MACPORT ((uint16_t)(BIT10 | BIT9 | BIT8))
  1473. #define HFA384x_TX_NOENCRYPT ((uint16_t)BIT7)
  1474. #define HFA384x_TX_RETRYSTRAT ((uint16_t)(BIT6 | BIT5))
  1475. #define HFA384x_TX_STRUCTYPE ((uint16_t)(BIT4 | BIT3))
  1476. #define HFA384x_TX_TXEX ((uint16_t)BIT2)
  1477. #define HFA384x_TX_TXOK ((uint16_t)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_t)(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_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_ACKERR))
  1488. #define HFA384x_TXSTATUS_ISFORMERR(v) ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_FORMERR))
  1489. #define HFA384x_TXSTATUS_ISDISCON(v) ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_DISCON))
  1490. #define HFA384x_TXSTATUS_ISAGEDERR(v) ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_AGEDERR))
  1491. #define HFA384x_TXSTATUS_ISRETRYERR(v) ((uint16_t)(((uint16_t)(v)) & HFA384x_TXSTATUS_RETRYERR))
  1492. #define HFA384x_TX_GET(v,m,s) ((((uint16_t)(v))&((uint16_t)(m)))>>((uint16_t)(s)))
  1493. #define HFA384x_TX_SET(v,m,s) ((((uint16_t)(v))<<((uint16_t)(s)))&((uint16_t)(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_t status;
  1518. uint32_t time;
  1519. uint8_t silence;
  1520. uint8_t signal;
  1521. uint8_t rate;
  1522. uint8_t rx_flow;
  1523. uint16_t reserved1;
  1524. uint16_t reserved2;
  1525. /*-- 802.11 Header Information (802.11 byte order) --*/
  1526. uint16_t frame_control;
  1527. uint16_t duration_id;
  1528. uint8_t address1[6];
  1529. uint8_t address2[6];
  1530. uint8_t address3[6];
  1531. uint16_t sequence_control;
  1532. uint8_t address4[6];
  1533. uint16_t data_len; /* hfa384x (little endian) format */
  1534. /*-- 802.3 Header Information --*/
  1535. uint8_t dest_addr[6];
  1536. uint8_t src_addr[6];
  1537. uint16_t 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_t)44)
  1544. #define HFA384x_RX_80211HDR_OFF ((uint16_t)14)
  1545. #define HFA384x_RX_DATA_OFF ((uint16_t)60)
  1546. /*-- Status Fields --*/
  1547. #define HFA384x_RXSTATUS_MSGTYPE ((uint16_t)(BIT15 | BIT14 | BIT13))
  1548. #define HFA384x_RXSTATUS_MACPORT ((uint16_t)(BIT10 | BIT9 | BIT8))
  1549. #define HFA384x_RXSTATUS_UNDECR ((uint16_t)BIT1)
  1550. #define HFA384x_RXSTATUS_FCSERR ((uint16_t)BIT0)
  1551. /*--------------------------------------------------------------------
  1552. Communication Frames: Test/Get/Set Field Values for Receive Frames
  1553. --------------------------------------------------------------------*/
  1554. #define HFA384x_RXSTATUS_MSGTYPE_GET(value) ((uint16_t)((((uint16_t)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13))
  1555. #define HFA384x_RXSTATUS_MSGTYPE_SET(value) ((uint16_t)(((uint16_t)(value)) << 13))
  1556. #define HFA384x_RXSTATUS_MACPORT_GET(value) ((uint16_t)((((uint16_t)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8))
  1557. #define HFA384x_RXSTATUS_MACPORT_SET(value) ((uint16_t)(((uint16_t)(value)) << 8))
  1558. #define HFA384x_RXSTATUS_ISUNDECR(value) ((uint16_t)(((uint16_t)(value)) & HFA384x_RXSTATUS_UNDECR))
  1559. #define HFA384x_RXSTATUS_ISFCSERR(value) ((uint16_t)(((uint16_t)(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_t)0xF000UL)
  1566. #define HFA384x_IT_HANDOVERDEAUTHADDRESS ((uint16_t)0xF001UL)//AP 1.3.7
  1567. #define HFA384x_IT_COMMTALLIES ((uint16_t)0xF100UL)
  1568. #define HFA384x_IT_SCANRESULTS ((uint16_t)0xF101UL)
  1569. #define HFA384x_IT_CHINFORESULTS ((uint16_t)0xF102UL)
  1570. #define HFA384x_IT_HOSTSCANRESULTS ((uint16_t)0xF103UL)
  1571. #define HFA384x_IT_LINKSTATUS ((uint16_t)0xF200UL)
  1572. #define HFA384x_IT_ASSOCSTATUS ((uint16_t)0xF201UL)
  1573. #define HFA384x_IT_AUTHREQ ((uint16_t)0xF202UL)
  1574. #define HFA384x_IT_PSUSERCNT ((uint16_t)0xF203UL)
  1575. #define HFA384x_IT_KEYIDCHANGED ((uint16_t)0xF204UL)
  1576. #define HFA384x_IT_ASSOCREQ ((uint16_t)0xF205UL)
  1577. #define HFA384x_IT_MICFAILURE ((uint16_t)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_t framelen;
  1587. uint16_t infotype;
  1588. uint8_t 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_t txunicastframes;
  1594. uint16_t txmulticastframes;
  1595. uint16_t txfragments;
  1596. uint16_t txunicastoctets;
  1597. uint16_t txmulticastoctets;
  1598. uint16_t txdeferredtrans;
  1599. uint16_t txsingleretryframes;
  1600. uint16_t txmultipleretryframes;
  1601. uint16_t txretrylimitexceeded;
  1602. uint16_t txdiscards;
  1603. uint16_t rxunicastframes;
  1604. uint16_t rxmulticastframes;
  1605. uint16_t rxfragments;
  1606. uint16_t rxunicastoctets;
  1607. uint16_t rxmulticastoctets;
  1608. uint16_t rxfcserrors;
  1609. uint16_t rxdiscardsnobuffer;
  1610. uint16_t txdiscardswrongsa;
  1611. uint16_t rxdiscardswepundecr;
  1612. uint16_t rxmsginmsgfrag;
  1613. uint16_t rxmsginbadmsgfrag;
  1614. } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies16_t;
  1615. typedef struct hfa384x_CommTallies32
  1616. {
  1617. uint32_t txunicastframes;
  1618. uint32_t txmulticastframes;
  1619. uint32_t txfragments;
  1620. uint32_t txunicastoctets;
  1621. uint32_t txmulticastoctets;
  1622. uint32_t txdeferredtrans;
  1623. uint32_t txsingleretryframes;
  1624. uint32_t txmultipleretryframes;
  1625. uint32_t txretrylimitexceeded;
  1626. uint32_t txdiscards;
  1627. uint32_t rxunicastframes;
  1628. uint32_t rxmulticastframes;
  1629. uint32_t rxfragments;
  1630. uint32_t rxunicastoctets;
  1631. uint32_t rxmulticastoctets;
  1632. uint32_t rxfcserrors;
  1633. uint32_t rxdiscardsnobuffer;
  1634. uint32_t txdiscardswrongsa;
  1635. uint32_t rxdiscardswepundecr;
  1636. uint32_t rxmsginmsgfrag;
  1637. uint32_t rxmsginbadmsgfrag;
  1638. } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies32_t;
  1639. /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/
  1640. typedef struct hfa384x_ScanResultSub
  1641. {
  1642. uint16_t chid;
  1643. uint16_t anl;
  1644. uint16_t sl;
  1645. uint8_t bssid[WLAN_BSSID_LEN];
  1646. uint16_t bcnint;
  1647. uint16_t capinfo;
  1648. hfa384x_bytestr32_t ssid;
  1649. uint8_t supprates[10]; /* 802.11 info element */
  1650. uint16_t proberesp_rate;
  1651. } __WLAN_ATTRIB_PACK__ hfa384x_ScanResultSub_t;
  1652. typedef struct hfa384x_ScanResult
  1653. {
  1654. uint16_t rsvd;
  1655. uint16_t 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_t chid;
  1663. uint16_t anl;
  1664. uint16_t pnl;
  1665. uint16_t 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_t 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_t chid;
  1679. uint16_t anl;
  1680. uint16_t sl;
  1681. uint8_t bssid[WLAN_BSSID_LEN];
  1682. uint16_t bcnint;
  1683. uint16_t capinfo;
  1684. hfa384x_bytestr32_t ssid;
  1685. uint8_t supprates[10]; /* 802.11 info element */
  1686. uint16_t proberesp_rate;
  1687. uint16_t atim;
  1688. } __WLAN_ATTRIB_PACK__ hfa384x_HScanResultSub_t;
  1689. typedef struct hfa384x_HScanResult
  1690. {
  1691. uint16_t nresult;
  1692. uint16_t 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_t)0)
  1698. #define HFA384x_LINK_CONNECTED ((uint16_t)1)
  1699. #define HFA384x_LINK_DISCONNECTED ((uint16_t)2)
  1700. #define HFA384x_LINK_AP_CHANGE ((uint16_t)3)
  1701. #define HFA384x_LINK_AP_OUTOFRANGE ((uint16_t)4)
  1702. #define HFA384x_LINK_AP_INRANGE ((uint16_t)5)
  1703. #define HFA384x_LINK_ASSOCFAIL ((uint16_t)6)
  1704. typedef struct hfa384x_LinkStatus
  1705. {
  1706. uint16_t linkstatus;
  1707. } __WLAN_ATTRIB_PACK__ hfa384x_LinkStatus_t;
  1708. /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
  1709. #define HFA384x_ASSOCSTATUS_STAASSOC ((uint16_t)1)
  1710. #define HFA384x_ASSOCSTATUS_REASSOC ((uint16_t)2)
  1711. #define HFA384x_ASSOCSTATUS_DISASSOC ((uint16_t)3)
  1712. #define HFA384x_ASSOCSTATUS_ASSOCFAIL ((uint16_t)4)
  1713. #define HFA384x_ASSOCSTATUS_AUTHFAIL ((uint16_t)5)
  1714. typedef struct hfa384x_AssocStatus
  1715. {
  1716. uint16_t assocstatus;
  1717. uint8_t sta_addr[WLAN_ADDR_LEN];
  1718. /* old_ap_addr is only valid if assocstatus == 2 */
  1719. uint8_t old_ap_addr[WLAN_ADDR_LEN];
  1720. uint16_t reason;
  1721. uint16_t reserved;
  1722. } __WLAN_ATTRIB_PACK__ hfa384x_AssocStatus_t;
  1723. /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
  1724. typedef struct hfa384x_AuthRequest
  1725. {
  1726. uint8_t sta_addr[WLAN_ADDR_LEN];
  1727. uint16_t algorithm;
  1728. } __WLAN_ATTRIB_PACK__ hfa384x_AuthReq_t;
  1729. /*-- Unsolicited Frame, MAC Mgmt: AssocRequest (AP Only) --*/
  1730. typedef struct hfa384x_AssocRequest
  1731. {
  1732. uint8_t sta_addr[WLAN_ADDR_LEN];
  1733. uint16_t type;
  1734. uint8_t 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_t sender[WLAN_ADDR_LEN];
  1742. uint8_t 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_t usercnt;
  1748. } __WLAN_ATTRIB_PACK__ hfa384x_PSUserCount_t;
  1749. typedef struct hfa384x_KeyIDChanged
  1750. {
  1751. uint8_t sta_addr[WLAN_ADDR_LEN];
  1752. uint16_t 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_t framelen;
  1770. uint16_t 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_t data[WLAN_DATA_MAXLEN];
  1803. } __WLAN_ATTRIB_PACK__ hfa384x_usb_txfrm_t;
  1804. typedef struct hfa384x_usb_cmdreq {
  1805. uint16_t type;
  1806. uint16_t cmd;
  1807. uint16_t parm0;
  1808. uint16_t parm1;
  1809. uint16_t parm2;
  1810. uint8_t pad[54];
  1811. } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdreq_t;
  1812. typedef struct hfa384x_usb_wridreq {
  1813. uint16_t type;
  1814. uint16_t frmlen;
  1815. uint16_t rid;
  1816. uint8_t data[HFA384x_RIDDATA_MAXLEN];
  1817. } __WLAN_ATTRIB_PACK__ hfa384x_usb_wridreq_t;
  1818. typedef struct hfa384x_usb_rridreq {
  1819. uint16_t type;
  1820. uint16_t frmlen;
  1821. uint16_t rid;
  1822. uint8_t pad[58];
  1823. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridreq_t;
  1824. typedef struct hfa384x_usb_wmemreq {
  1825. uint16_t type;
  1826. uint16_t frmlen;
  1827. uint16_t offset;
  1828. uint16_t page;
  1829. uint8_t data[HFA384x_USB_RWMEM_MAXLEN];
  1830. } __WLAN_ATTRIB_PACK__ hfa384x_usb_wmemreq_t;
  1831. typedef struct hfa384x_usb_rmemreq {
  1832. uint16_t type;
  1833. uint16_t frmlen;
  1834. uint16_t offset;
  1835. uint16_t page;
  1836. uint8_t 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_t data[WLAN_DATA_MAXLEN];
  1843. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rxfrm_t;
  1844. typedef struct hfa384x_usb_infofrm {
  1845. uint16_t type;
  1846. hfa384x_InfFrame_t info;
  1847. } __WLAN_ATTRIB_PACK__ hfa384x_usb_infofrm_t;
  1848. typedef struct hfa384x_usb_statusresp {
  1849. uint16_t type;
  1850. uint16_t status;
  1851. uint16_t resp0;
  1852. uint16_t resp1;
  1853. uint16_t 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_t type;
  1858. uint16_t frmlen;
  1859. uint16_t rid;
  1860. uint8_t 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_t type;
  1865. uint16_t frmlen;
  1866. uint8_t data[HFA384x_USB_RWMEM_MAXLEN];
  1867. } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemresp_t;
  1868. typedef struct hfa384x_usb_bufavail {
  1869. uint16_t type;
  1870. uint16_t frmlen;
  1871. } __WLAN_ATTRIB_PACK__ hfa384x_usb_bufavail_t;
  1872. typedef struct hfa384x_usb_error {
  1873. uint16_t type;
  1874. uint16_t 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_t 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_t 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_t 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_t num[8];
  1908. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_partnum_t;
  1909. typedef struct hfa384x_pdr_pcb_tracenum
  1910. {
  1911. uint8_t num[8];
  1912. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_tracenum_t;
  1913. typedef struct hfa384x_pdr_nic_serial
  1914. {
  1915. uint8_t 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_t size[12]; /* units of KB */
  1938. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_ramsize_t;
  1939. typedef struct hfa384x_pdr_mfisuprange
  1940. {
  1941. uint16_t id;
  1942. uint16_t variant;
  1943. uint16_t bottom;
  1944. uint16_t top;
  1945. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mfisuprange_t;
  1946. typedef struct hfa384x_pdr_cfisuprange
  1947. {
  1948. uint16_t id;
  1949. uint16_t variant;
  1950. uint16_t bottom;
  1951. uint16_t top;
  1952. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_cfisuprange_t;
  1953. typedef struct hfa384x_pdr_nicid
  1954. {
  1955. uint16_t id;
  1956. uint16_t variant;
  1957. uint16_t major;
  1958. uint16_t minor;
  1959. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nicid_t;
  1960. typedef struct hfa384x_pdr_refdac_measurements
  1961. {
  1962. uint16_t value[0];
  1963. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_measurements_t;
  1964. typedef struct hfa384x_pdr_vgdac_measurements
  1965. {
  1966. uint16_t value[0];
  1967. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_measurements_t;
  1968. typedef struct hfa384x_pdr_level_comp_measurements
  1969. {
  1970. uint16_t value[0];
  1971. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_compc_measurements_t;
  1972. typedef struct hfa384x_pdr_mac_address
  1973. {
  1974. uint8_t addr[6];
  1975. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mac_address_t;
  1976. typedef struct hfa384x_pdr_mkk_callname
  1977. {
  1978. uint8_t callname[8];
  1979. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_callname_t;
  1980. typedef struct hfa384x_pdr_regdomain
  1981. {
  1982. uint16_t numdomains;
  1983. uint16_t domain[5];
  1984. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_regdomain_t;
  1985. typedef struct hfa384x_pdr_allowed_channel
  1986. {
  1987. uint16_t ch_bitmap;
  1988. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_allowed_channel_t;
  1989. typedef struct hfa384x_pdr_default_channel
  1990. {
  1991. uint16_t channel;
  1992. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_default_channel_t;
  1993. typedef struct hfa384x_pdr_privacy_option
  1994. {
  1995. uint16_t available;
  1996. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_privacy_option_t;
  1997. typedef struct hfa384x_pdr_temptype
  1998. {
  1999. uint16_t type;
  2000. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_temptype_t;
  2001. typedef struct hfa384x_pdr_refdac_setup
  2002. {
  2003. uint16_t ch_value[14];
  2004. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_setup_t;
  2005. typedef struct hfa384x_pdr_vgdac_setup
  2006. {
  2007. uint16_t ch_value[14];
  2008. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_setup_t;
  2009. typedef struct hfa384x_pdr_level_comp_setup
  2010. {
  2011. uint16_t ch_value[14];
  2012. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_comp_setup_t;
  2013. typedef struct hfa384x_pdr_trimdac_setup
  2014. {
  2015. uint16_t trimidac;
  2016. uint16_t trimqdac;
  2017. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_trimdac_setup_t;
  2018. typedef struct hfa384x_pdr_ifr_setting
  2019. {
  2020. uint16_t value[3];
  2021. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_ifr_setting_t;
  2022. typedef struct hfa384x_pdr_rfr_setting
  2023. {
  2024. uint16_t value[3];
  2025. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_rfr_setting_t;
  2026. typedef struct hfa384x_pdr_hfa3861_baseline
  2027. {
  2028. uint16_t value[50];
  2029. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_baseline_t;
  2030. typedef struct hfa384x_pdr_hfa3861_shadow
  2031. {
  2032. uint32_t value[32];
  2033. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_shadow_t;
  2034. typedef struct hfa384x_pdr_hfa3861_ifrf
  2035. {
  2036. uint32_t value[20];
  2037. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_ifrf_t;
  2038. typedef struct hfa384x_pdr_hfa3861_chcalsp
  2039. {
  2040. uint16_t value[14];
  2041. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcalsp_t;
  2042. typedef struct hfa384x_pdr_hfa3861_chcali
  2043. {
  2044. uint16_t value[17];
  2045. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcali_t;
  2046. typedef struct hfa384x_pdr_hfa3861_nic_config
  2047. {
  2048. uint16_t config_bitmap;
  2049. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_config_t;
  2050. typedef struct hfa384x_pdr_hfo_delay
  2051. {
  2052. uint8_t hfo_delay;
  2053. } __WLAN_ATTRIB_PACK__ hfa384x_hfo_delay_t;
  2054. typedef struct hfa384x_pdr_hfa3861_manf_testsp
  2055. {
  2056. uint16_t value[30];
  2057. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testsp_t;
  2058. typedef struct hfa384x_pdr_hfa3861_manf_testi
  2059. {
  2060. uint16_t value[30];
  2061. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testi_t;
  2062. typedef struct hfa384x_end_of_pda
  2063. {
  2064. uint16_t crc;
  2065. } __WLAN_ATTRIB_PACK__ hfa384x_pdr_end_of_pda_t;
  2066. typedef struct hfa384x_pdrec
  2067. {
  2068. uint16_t len; /* in words */
  2069. uint16_t 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_t status;
  2115. uint16_t resp0;
  2116. uint16_t resp1;
  2117. uint16_t 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_t rid;
  2132. const void *riddata;
  2133. unsigned int 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_t cmd;
  2178. uint16_t parm0;
  2179. uint16_t parm1;
  2180. uint16_t parm2;
  2181. #if 0 //XXX cmd irq stuff
  2182. uint16_t 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. unsigned int cnt;
  2206. uint8_t addr[WLAN_AUTH_MAX][WLAN_ADDR_LEN];
  2207. uint8_t assoc[WLAN_AUTH_MAX];
  2208. } prism2sta_authlist_t;
  2209. typedef struct prism2sta_accesslist
  2210. {
  2211. unsigned int modify;
  2212. unsigned int cnt;
  2213. uint8_t addr[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
  2214. unsigned int cnt1;
  2215. uint8_t 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_t iobase;
  2222. char __iomem *membase;
  2223. uint32_t 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_t state;
  2266. uint32_t isap;
  2267. uint8_t port_enabled[HFA384x_NUMPORTS_MAX];
  2268. #if (WLAN_HOSTIF != WLAN_USB)
  2269. unsigned int auxen;
  2270. unsigned int isram16;
  2271. #endif /* !USB */
  2272. /* Download support */
  2273. unsigned int dlstate;
  2274. hfa384x_downloadbuffer_t bufinfo;
  2275. uint16_t 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_t txfid_head;
  2285. uint16_t txfid_tail;
  2286. unsigned int txfid_N;
  2287. uint16_t txfid_queue[HFA384x_DRVR_FIDSTACKLEN_MAX];
  2288. uint16_t 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_t link_status;
  2302. uint16_t 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. unsigned int presniff_port_type;
  2307. uint16_t presniff_wepflags;
  2308. uint32_t 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_t dot11_grp_addr[MAX_GRP_ADDR][WLAN_ADDR_LEN];
  2314. unsigned int 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_t 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_t psusercount; /* Power save user count. */
  2334. hfa384x_CommTallies32_t tallies; /* Communication tallies. */
  2335. uint8_t comment[WLAN_COMMENT_MAX+1]; /* User comment */
  2336. /* Channel Info request results (AP only) */
  2337. struct {
  2338. atomic_t done;
  2339. uint8_t count;
  2340. hfa384x_ChInfoResult_t results;
  2341. } channel_info;
  2342. hfa384x_InfFrame_t *scanresults;
  2343. prism2sta_authlist_t authlist; /* Authenticated station list. */
  2344. unsigned int 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. unsigned int irq,
  2361. uint32_t iobase,
  2362. uint8_t __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_t macport);
  2375. int
  2376. hfa384x_drvr_enable(hfa384x_t *hw, uint16_t 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_t daddr, void* buf, uint32_t len);
  2383. int
  2384. hfa384x_drvr_getconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len);
  2385. int
  2386. hfa384x_drvr_handover( hfa384x_t *hw, uint8_t *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_t address, uint32_t *result);
  2393. int
  2394. hfa384x_drvr_mmi_write(hfa384x_t *hw, uint32_t address, uint32_t data);
  2395. int
  2396. hfa384x_drvr_ramdl_enable(hfa384x_t *hw, uint32_t exeaddr);
  2397. int
  2398. hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
  2399. int
  2400. hfa384x_drvr_ramdl_write(hfa384x_t *hw, uint32_t daddr, void* buf, uint32_t len);
  2401. int
  2402. hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
  2403. int
  2404. hfa384x_drvr_scanresults( hfa384x_t *hw);
  2405. int
  2406. hfa384x_drvr_setconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len);
  2407. static inline int
  2408. hfa384x_drvr_getconfig16(hfa384x_t *hw, uint16_t rid, void *val)
  2409. {
  2410. int result = 0;
  2411. result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint16_t));
  2412. if ( result == 0 ) {
  2413. *((uint16_t*)val) = hfa384x2host_16(*((uint16_t*)val));
  2414. }
  2415. return result;
  2416. }
  2417. static inline int
  2418. hfa384x_drvr_getconfig32(hfa384x_t *hw, uint16_t rid, void *val)
  2419. {
  2420. int result = 0;
  2421. result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint32_t));
  2422. if ( result == 0 ) {
  2423. *((uint32_t*)val) = hfa384x2host_32(*((uint32_t*)val));
  2424. }
  2425. return result;
  2426. }
  2427. static inline int
  2428. hfa384x_drvr_setconfig16(hfa384x_t *hw, uint16_t rid, uint16_t val)
  2429. {
  2430. uint16_t 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_t rid, uint32_t val)
  2435. {
  2436. uint32_t 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_t rid,
  2443. ctlx_usercb_t usercb,
  2444. void *usercb_data);
  2445. int
  2446. hfa384x_drvr_setconfig_async(hfa384x_t *hw,
  2447. uint16_t rid,
  2448. void *buf,
  2449. uint16_t 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_t rid, void *buf, uint16_t 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_t rid, uint16_t val)
  2464. {
  2465. uint16_t 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_t rid, uint32_t val)
  2471. {
  2472. uint32_t 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_t macport);
  2488. int
  2489. hfa384x_cmd_disable(hfa384x_t *hw, uint16_t macport);
  2490. int
  2491. hfa384x_cmd_diagnose(hfa384x_t *hw);
  2492. int
  2493. hfa384x_cmd_allocate(hfa384x_t *hw, uint16_t len);
  2494. int
  2495. hfa384x_cmd_transmit(hfa384x_t *hw, uint16_t reclaim, uint16_t qos, uint16_t fid);
  2496. int
  2497. hfa384x_cmd_clearpersist(hfa384x_t *hw, uint16_t fid);
  2498. int
  2499. hfa384x_cmd_notify(hfa384x_t *hw, uint16_t reclaim, uint16_t fid, void *buf, uint16_t len);
  2500. int
  2501. hfa384x_cmd_inquire(hfa384x_t *hw, uint16_t fid);
  2502. int
  2503. hfa384x_cmd_access(hfa384x_t *hw, uint16_t write, uint16_t rid, void *buf, uint16_t len);
  2504. int
  2505. hfa384x_cmd_monitor(hfa384x_t *hw, uint16_t enable);
  2506. int
  2507. hfa384x_cmd_download(
  2508. hfa384x_t *hw,
  2509. uint16_t mode,
  2510. uint16_t lowaddr,
  2511. uint16_t highaddr,
  2512. uint16_t 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_t bap,
  2521. uint16_t id,
  2522. uint16_t offset,
  2523. void *buf,
  2524. unsigned int len);
  2525. int
  2526. hfa384x_copy_to_bap(
  2527. hfa384x_t *hw,
  2528. uint16_t bap,
  2529. uint16_t id,
  2530. uint16_t offset,
  2531. void *buf,
  2532. unsigned int len);
  2533. void
  2534. hfa384x_copy_from_aux(
  2535. hfa384x_t *hw,
  2536. uint32_t cardaddr,
  2537. uint32_t auxctl,
  2538. void *buf,
  2539. unsigned int len);
  2540. void
  2541. hfa384x_copy_to_aux(
  2542. hfa384x_t *hw,
  2543. uint32_t cardaddr,
  2544. uint32_t auxctl,
  2545. void *buf,
  2546. unsigned int 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_t
  2554. __hfa384x_getreg(hfa384x_t *hw, unsigned int reg);
  2555. static inline void
  2556. __hfa384x_setreg(hfa384x_t *hw, uint16_t val, unsigned int reg);
  2557. static inline uint16_t
  2558. __hfa384x_getreg_noswap(hfa384x_t *hw, unsigned int reg);
  2559. static inline void
  2560. __hfa384x_setreg_noswap(hfa384x_t *hw, uint16_t val, unsigned int 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_t
  2587. __hfa384x_getreg(hfa384x_t *hw, unsigned int 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_t val, unsigned int 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_t
  2636. __hfa384x_getreg_noswap(hfa384x_t *hw, unsigned int 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_t val, unsigned int 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 */