Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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