Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

hfa384x.h 104KB

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