ipw2200.h 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /******************************************************************************
  3. Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved.
  4. Contact Information:
  5. Intel Linux Wireless <[email protected]>
  6. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  7. ******************************************************************************/
  8. #ifndef __ipw2200_h__
  9. #define __ipw2200_h__
  10. #include <linux/module.h>
  11. #include <linux/moduleparam.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/mutex.h>
  14. #include <linux/pci.h>
  15. #include <linux/netdevice.h>
  16. #include <linux/ethtool.h>
  17. #include <linux/skbuff.h>
  18. #include <linux/etherdevice.h>
  19. #include <linux/delay.h>
  20. #include <linux/random.h>
  21. #include <linux/dma-mapping.h>
  22. #include <linux/firmware.h>
  23. #include <linux/wireless.h>
  24. #include <linux/jiffies.h>
  25. #include <asm/io.h>
  26. #include <net/lib80211.h>
  27. #include <net/ieee80211_radiotap.h>
  28. #define DRV_NAME "ipw2200"
  29. #include <linux/workqueue.h>
  30. #include "libipw.h"
  31. /* Authentication and Association States */
  32. enum connection_manager_assoc_states {
  33. CMAS_INIT = 0,
  34. CMAS_TX_AUTH_SEQ_1,
  35. CMAS_RX_AUTH_SEQ_2,
  36. CMAS_AUTH_SEQ_1_PASS,
  37. CMAS_AUTH_SEQ_1_FAIL,
  38. CMAS_TX_AUTH_SEQ_3,
  39. CMAS_RX_AUTH_SEQ_4,
  40. CMAS_AUTH_SEQ_2_PASS,
  41. CMAS_AUTH_SEQ_2_FAIL,
  42. CMAS_AUTHENTICATED,
  43. CMAS_TX_ASSOC,
  44. CMAS_RX_ASSOC_RESP,
  45. CMAS_ASSOCIATED,
  46. CMAS_LAST
  47. };
  48. #define IPW_WAIT (1<<0)
  49. #define IPW_QUIET (1<<1)
  50. #define IPW_ROAMING (1<<2)
  51. #define IPW_POWER_MODE_CAM 0x00 //(always on)
  52. #define IPW_POWER_INDEX_1 0x01
  53. #define IPW_POWER_INDEX_2 0x02
  54. #define IPW_POWER_INDEX_3 0x03
  55. #define IPW_POWER_INDEX_4 0x04
  56. #define IPW_POWER_INDEX_5 0x05
  57. #define IPW_POWER_AC 0x06
  58. #define IPW_POWER_BATTERY 0x07
  59. #define IPW_POWER_LIMIT 0x07
  60. #define IPW_POWER_MASK 0x0F
  61. #define IPW_POWER_ENABLED 0x10
  62. #define IPW_POWER_LEVEL(x) ((x) & IPW_POWER_MASK)
  63. #define IPW_CMD_HOST_COMPLETE 2
  64. #define IPW_CMD_POWER_DOWN 4
  65. #define IPW_CMD_SYSTEM_CONFIG 6
  66. #define IPW_CMD_MULTICAST_ADDRESS 7
  67. #define IPW_CMD_SSID 8
  68. #define IPW_CMD_ADAPTER_ADDRESS 11
  69. #define IPW_CMD_PORT_TYPE 12
  70. #define IPW_CMD_RTS_THRESHOLD 15
  71. #define IPW_CMD_FRAG_THRESHOLD 16
  72. #define IPW_CMD_POWER_MODE 17
  73. #define IPW_CMD_WEP_KEY 18
  74. #define IPW_CMD_TGI_TX_KEY 19
  75. #define IPW_CMD_SCAN_REQUEST 20
  76. #define IPW_CMD_ASSOCIATE 21
  77. #define IPW_CMD_SUPPORTED_RATES 22
  78. #define IPW_CMD_SCAN_ABORT 23
  79. #define IPW_CMD_TX_FLUSH 24
  80. #define IPW_CMD_QOS_PARAMETERS 25
  81. #define IPW_CMD_SCAN_REQUEST_EXT 26
  82. #define IPW_CMD_DINO_CONFIG 30
  83. #define IPW_CMD_RSN_CAPABILITIES 31
  84. #define IPW_CMD_RX_KEY 32
  85. #define IPW_CMD_CARD_DISABLE 33
  86. #define IPW_CMD_SEED_NUMBER 34
  87. #define IPW_CMD_TX_POWER 35
  88. #define IPW_CMD_COUNTRY_INFO 36
  89. #define IPW_CMD_AIRONET_INFO 37
  90. #define IPW_CMD_AP_TX_POWER 38
  91. #define IPW_CMD_CCKM_INFO 39
  92. #define IPW_CMD_CCX_VER_INFO 40
  93. #define IPW_CMD_SET_CALIBRATION 41
  94. #define IPW_CMD_SENSITIVITY_CALIB 42
  95. #define IPW_CMD_RETRY_LIMIT 51
  96. #define IPW_CMD_IPW_PRE_POWER_DOWN 58
  97. #define IPW_CMD_VAP_BEACON_TEMPLATE 60
  98. #define IPW_CMD_VAP_DTIM_PERIOD 61
  99. #define IPW_CMD_EXT_SUPPORTED_RATES 62
  100. #define IPW_CMD_VAP_LOCAL_TX_PWR_CONSTRAINT 63
  101. #define IPW_CMD_VAP_QUIET_INTERVALS 64
  102. #define IPW_CMD_VAP_CHANNEL_SWITCH 65
  103. #define IPW_CMD_VAP_MANDATORY_CHANNELS 66
  104. #define IPW_CMD_VAP_CELL_PWR_LIMIT 67
  105. #define IPW_CMD_VAP_CF_PARAM_SET 68
  106. #define IPW_CMD_VAP_SET_BEACONING_STATE 69
  107. #define IPW_CMD_MEASUREMENT 80
  108. #define IPW_CMD_POWER_CAPABILITY 81
  109. #define IPW_CMD_SUPPORTED_CHANNELS 82
  110. #define IPW_CMD_TPC_REPORT 83
  111. #define IPW_CMD_WME_INFO 84
  112. #define IPW_CMD_PRODUCTION_COMMAND 85
  113. #define IPW_CMD_LINKSYS_EOU_INFO 90
  114. #define RFD_SIZE 4
  115. #define NUM_TFD_CHUNKS 6
  116. #define TX_QUEUE_SIZE 32
  117. #define RX_QUEUE_SIZE 32
  118. #define DINO_CMD_WEP_KEY 0x08
  119. #define DINO_CMD_TX 0x0B
  120. #define DCT_ANTENNA_A 0x01
  121. #define DCT_ANTENNA_B 0x02
  122. #define IPW_A_MODE 0
  123. #define IPW_B_MODE 1
  124. #define IPW_G_MODE 2
  125. /*
  126. * TX Queue Flag Definitions
  127. */
  128. /* tx wep key definition */
  129. #define DCT_WEP_KEY_NOT_IMMIDIATE 0x00
  130. #define DCT_WEP_KEY_64Bit 0x40
  131. #define DCT_WEP_KEY_128Bit 0x80
  132. #define DCT_WEP_KEY_128bitIV 0xC0
  133. #define DCT_WEP_KEY_SIZE_MASK 0xC0
  134. #define DCT_WEP_KEY_INDEX_MASK 0x0F
  135. #define DCT_WEP_INDEX_USE_IMMEDIATE 0x20
  136. /* abort attempt if mgmt frame is rx'd */
  137. #define DCT_FLAG_ABORT_MGMT 0x01
  138. /* require CTS */
  139. #define DCT_FLAG_CTS_REQUIRED 0x02
  140. /* use short preamble */
  141. #define DCT_FLAG_LONG_PREAMBLE 0x00
  142. #define DCT_FLAG_SHORT_PREAMBLE 0x04
  143. /* RTS/CTS first */
  144. #define DCT_FLAG_RTS_REQD 0x08
  145. /* dont calculate duration field */
  146. #define DCT_FLAG_DUR_SET 0x10
  147. /* even if MAC WEP set (allows pre-encrypt) */
  148. #define DCT_FLAG_NO_WEP 0x20
  149. /* overwrite TSF field */
  150. #define DCT_FLAG_TSF_REQD 0x40
  151. /* ACK rx is expected to follow */
  152. #define DCT_FLAG_ACK_REQD 0x80
  153. /* TX flags extension */
  154. #define DCT_FLAG_EXT_MODE_CCK 0x01
  155. #define DCT_FLAG_EXT_MODE_OFDM 0x00
  156. #define DCT_FLAG_EXT_SECURITY_WEP 0x00
  157. #define DCT_FLAG_EXT_SECURITY_NO DCT_FLAG_EXT_SECURITY_WEP
  158. #define DCT_FLAG_EXT_SECURITY_CKIP 0x04
  159. #define DCT_FLAG_EXT_SECURITY_CCM 0x08
  160. #define DCT_FLAG_EXT_SECURITY_TKIP 0x0C
  161. #define DCT_FLAG_EXT_SECURITY_MASK 0x0C
  162. #define DCT_FLAG_EXT_QOS_ENABLED 0x10
  163. #define DCT_FLAG_EXT_HC_NO_SIFS_PIFS 0x00
  164. #define DCT_FLAG_EXT_HC_SIFS 0x20
  165. #define DCT_FLAG_EXT_HC_PIFS 0x40
  166. #define TX_RX_TYPE_MASK 0xFF
  167. #define TX_FRAME_TYPE 0x00
  168. #define TX_HOST_COMMAND_TYPE 0x01
  169. #define RX_FRAME_TYPE 0x09
  170. #define RX_HOST_NOTIFICATION_TYPE 0x03
  171. #define RX_HOST_CMD_RESPONSE_TYPE 0x04
  172. #define RX_TX_FRAME_RESPONSE_TYPE 0x05
  173. #define TFD_NEED_IRQ_MASK 0x04
  174. #define HOST_CMD_DINO_CONFIG 30
  175. #define HOST_NOTIFICATION_STATUS_ASSOCIATED 10
  176. #define HOST_NOTIFICATION_STATUS_AUTHENTICATE 11
  177. #define HOST_NOTIFICATION_STATUS_SCAN_CHANNEL_RESULT 12
  178. #define HOST_NOTIFICATION_STATUS_SCAN_COMPLETED 13
  179. #define HOST_NOTIFICATION_STATUS_FRAG_LENGTH 14
  180. #define HOST_NOTIFICATION_STATUS_LINK_DETERIORATION 15
  181. #define HOST_NOTIFICATION_DINO_CONFIG_RESPONSE 16
  182. #define HOST_NOTIFICATION_STATUS_BEACON_STATE 17
  183. #define HOST_NOTIFICATION_STATUS_TGI_TX_KEY 18
  184. #define HOST_NOTIFICATION_TX_STATUS 19
  185. #define HOST_NOTIFICATION_CALIB_KEEP_RESULTS 20
  186. #define HOST_NOTIFICATION_MEASUREMENT_STARTED 21
  187. #define HOST_NOTIFICATION_MEASUREMENT_ENDED 22
  188. #define HOST_NOTIFICATION_CHANNEL_SWITCHED 23
  189. #define HOST_NOTIFICATION_RX_DURING_QUIET_PERIOD 24
  190. #define HOST_NOTIFICATION_NOISE_STATS 25
  191. #define HOST_NOTIFICATION_S36_MEASUREMENT_ACCEPTED 30
  192. #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31
  193. #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1
  194. #define IPW_MB_SCAN_CANCEL_THRESHOLD 3
  195. #define IPW_MB_ROAMING_THRESHOLD_MIN 1
  196. #define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8
  197. #define IPW_MB_ROAMING_THRESHOLD_MAX 30
  198. #define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 3*IPW_MB_ROAMING_THRESHOLD_DEFAULT
  199. #define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300
  200. #define MACADRR_BYTE_LEN 6
  201. #define DCR_TYPE_AP 0x01
  202. #define DCR_TYPE_WLAP 0x02
  203. #define DCR_TYPE_MU_ESS 0x03
  204. #define DCR_TYPE_MU_IBSS 0x04
  205. #define DCR_TYPE_MU_PIBSS 0x05
  206. #define DCR_TYPE_SNIFFER 0x06
  207. #define DCR_TYPE_MU_BSS DCR_TYPE_MU_ESS
  208. /* QoS definitions */
  209. #define CW_MIN_OFDM 15
  210. #define CW_MAX_OFDM 1023
  211. #define CW_MIN_CCK 31
  212. #define CW_MAX_CCK 1023
  213. #define QOS_TX0_CW_MIN_OFDM cpu_to_le16(CW_MIN_OFDM)
  214. #define QOS_TX1_CW_MIN_OFDM cpu_to_le16(CW_MIN_OFDM)
  215. #define QOS_TX2_CW_MIN_OFDM cpu_to_le16((CW_MIN_OFDM + 1)/2 - 1)
  216. #define QOS_TX3_CW_MIN_OFDM cpu_to_le16((CW_MIN_OFDM + 1)/4 - 1)
  217. #define QOS_TX0_CW_MIN_CCK cpu_to_le16(CW_MIN_CCK)
  218. #define QOS_TX1_CW_MIN_CCK cpu_to_le16(CW_MIN_CCK)
  219. #define QOS_TX2_CW_MIN_CCK cpu_to_le16((CW_MIN_CCK + 1)/2 - 1)
  220. #define QOS_TX3_CW_MIN_CCK cpu_to_le16((CW_MIN_CCK + 1)/4 - 1)
  221. #define QOS_TX0_CW_MAX_OFDM cpu_to_le16(CW_MAX_OFDM)
  222. #define QOS_TX1_CW_MAX_OFDM cpu_to_le16(CW_MAX_OFDM)
  223. #define QOS_TX2_CW_MAX_OFDM cpu_to_le16(CW_MIN_OFDM)
  224. #define QOS_TX3_CW_MAX_OFDM cpu_to_le16((CW_MIN_OFDM + 1)/2 - 1)
  225. #define QOS_TX0_CW_MAX_CCK cpu_to_le16(CW_MAX_CCK)
  226. #define QOS_TX1_CW_MAX_CCK cpu_to_le16(CW_MAX_CCK)
  227. #define QOS_TX2_CW_MAX_CCK cpu_to_le16(CW_MIN_CCK)
  228. #define QOS_TX3_CW_MAX_CCK cpu_to_le16((CW_MIN_CCK + 1)/2 - 1)
  229. #define QOS_TX0_AIFS (3 - QOS_AIFSN_MIN_VALUE)
  230. #define QOS_TX1_AIFS (7 - QOS_AIFSN_MIN_VALUE)
  231. #define QOS_TX2_AIFS (2 - QOS_AIFSN_MIN_VALUE)
  232. #define QOS_TX3_AIFS (2 - QOS_AIFSN_MIN_VALUE)
  233. #define QOS_TX0_ACM 0
  234. #define QOS_TX1_ACM 0
  235. #define QOS_TX2_ACM 0
  236. #define QOS_TX3_ACM 0
  237. #define QOS_TX0_TXOP_LIMIT_CCK 0
  238. #define QOS_TX1_TXOP_LIMIT_CCK 0
  239. #define QOS_TX2_TXOP_LIMIT_CCK cpu_to_le16(6016)
  240. #define QOS_TX3_TXOP_LIMIT_CCK cpu_to_le16(3264)
  241. #define QOS_TX0_TXOP_LIMIT_OFDM 0
  242. #define QOS_TX1_TXOP_LIMIT_OFDM 0
  243. #define QOS_TX2_TXOP_LIMIT_OFDM cpu_to_le16(3008)
  244. #define QOS_TX3_TXOP_LIMIT_OFDM cpu_to_le16(1504)
  245. #define DEF_TX0_CW_MIN_OFDM cpu_to_le16(CW_MIN_OFDM)
  246. #define DEF_TX1_CW_MIN_OFDM cpu_to_le16(CW_MIN_OFDM)
  247. #define DEF_TX2_CW_MIN_OFDM cpu_to_le16(CW_MIN_OFDM)
  248. #define DEF_TX3_CW_MIN_OFDM cpu_to_le16(CW_MIN_OFDM)
  249. #define DEF_TX0_CW_MIN_CCK cpu_to_le16(CW_MIN_CCK)
  250. #define DEF_TX1_CW_MIN_CCK cpu_to_le16(CW_MIN_CCK)
  251. #define DEF_TX2_CW_MIN_CCK cpu_to_le16(CW_MIN_CCK)
  252. #define DEF_TX3_CW_MIN_CCK cpu_to_le16(CW_MIN_CCK)
  253. #define DEF_TX0_CW_MAX_OFDM cpu_to_le16(CW_MAX_OFDM)
  254. #define DEF_TX1_CW_MAX_OFDM cpu_to_le16(CW_MAX_OFDM)
  255. #define DEF_TX2_CW_MAX_OFDM cpu_to_le16(CW_MAX_OFDM)
  256. #define DEF_TX3_CW_MAX_OFDM cpu_to_le16(CW_MAX_OFDM)
  257. #define DEF_TX0_CW_MAX_CCK cpu_to_le16(CW_MAX_CCK)
  258. #define DEF_TX1_CW_MAX_CCK cpu_to_le16(CW_MAX_CCK)
  259. #define DEF_TX2_CW_MAX_CCK cpu_to_le16(CW_MAX_CCK)
  260. #define DEF_TX3_CW_MAX_CCK cpu_to_le16(CW_MAX_CCK)
  261. #define DEF_TX0_AIFS 0
  262. #define DEF_TX1_AIFS 0
  263. #define DEF_TX2_AIFS 0
  264. #define DEF_TX3_AIFS 0
  265. #define DEF_TX0_ACM 0
  266. #define DEF_TX1_ACM 0
  267. #define DEF_TX2_ACM 0
  268. #define DEF_TX3_ACM 0
  269. #define DEF_TX0_TXOP_LIMIT_CCK 0
  270. #define DEF_TX1_TXOP_LIMIT_CCK 0
  271. #define DEF_TX2_TXOP_LIMIT_CCK 0
  272. #define DEF_TX3_TXOP_LIMIT_CCK 0
  273. #define DEF_TX0_TXOP_LIMIT_OFDM 0
  274. #define DEF_TX1_TXOP_LIMIT_OFDM 0
  275. #define DEF_TX2_TXOP_LIMIT_OFDM 0
  276. #define DEF_TX3_TXOP_LIMIT_OFDM 0
  277. #define QOS_QOS_SETS 3
  278. #define QOS_PARAM_SET_ACTIVE 0
  279. #define QOS_PARAM_SET_DEF_CCK 1
  280. #define QOS_PARAM_SET_DEF_OFDM 2
  281. #define CTRL_QOS_NO_ACK (0x0020)
  282. #define IPW_TX_QUEUE_1 1
  283. #define IPW_TX_QUEUE_2 2
  284. #define IPW_TX_QUEUE_3 3
  285. #define IPW_TX_QUEUE_4 4
  286. /* QoS sturctures */
  287. struct ipw_qos_info {
  288. int qos_enable;
  289. struct libipw_qos_parameters *def_qos_parm_OFDM;
  290. struct libipw_qos_parameters *def_qos_parm_CCK;
  291. u32 burst_duration_CCK;
  292. u32 burst_duration_OFDM;
  293. u16 qos_no_ack_mask;
  294. int burst_enable;
  295. };
  296. /**************************************************************/
  297. /**
  298. * Generic queue structure
  299. *
  300. * Contains common data for Rx and Tx queues
  301. */
  302. struct clx2_queue {
  303. int n_bd; /**< number of BDs in this queue */
  304. int first_empty; /**< 1-st empty entry (index) */
  305. int last_used; /**< last used entry (index) */
  306. u32 reg_w; /**< 'write' reg (queue head), addr in domain 1 */
  307. u32 reg_r; /**< 'read' reg (queue tail), addr in domain 1 */
  308. dma_addr_t dma_addr; /**< physical addr for BD's */
  309. int low_mark; /**< low watermark, resume queue if free space more than this */
  310. int high_mark; /**< high watermark, stop queue if free space less than this */
  311. } __packed; /* XXX */
  312. struct machdr32 {
  313. __le16 frame_ctl;
  314. __le16 duration; // watch out for endians!
  315. u8 addr1[MACADRR_BYTE_LEN];
  316. u8 addr2[MACADRR_BYTE_LEN];
  317. u8 addr3[MACADRR_BYTE_LEN];
  318. __le16 seq_ctrl; // more endians!
  319. u8 addr4[MACADRR_BYTE_LEN];
  320. __le16 qos_ctrl;
  321. } __packed;
  322. struct machdr30 {
  323. __le16 frame_ctl;
  324. __le16 duration; // watch out for endians!
  325. u8 addr1[MACADRR_BYTE_LEN];
  326. u8 addr2[MACADRR_BYTE_LEN];
  327. u8 addr3[MACADRR_BYTE_LEN];
  328. __le16 seq_ctrl; // more endians!
  329. u8 addr4[MACADRR_BYTE_LEN];
  330. } __packed;
  331. struct machdr26 {
  332. __le16 frame_ctl;
  333. __le16 duration; // watch out for endians!
  334. u8 addr1[MACADRR_BYTE_LEN];
  335. u8 addr2[MACADRR_BYTE_LEN];
  336. u8 addr3[MACADRR_BYTE_LEN];
  337. __le16 seq_ctrl; // more endians!
  338. __le16 qos_ctrl;
  339. } __packed;
  340. struct machdr24 {
  341. __le16 frame_ctl;
  342. __le16 duration; // watch out for endians!
  343. u8 addr1[MACADRR_BYTE_LEN];
  344. u8 addr2[MACADRR_BYTE_LEN];
  345. u8 addr3[MACADRR_BYTE_LEN];
  346. __le16 seq_ctrl; // more endians!
  347. } __packed;
  348. // TX TFD with 32 byte MAC Header
  349. struct tx_tfd_32 {
  350. struct machdr32 mchdr; // 32
  351. __le32 uivplaceholder[2]; // 8
  352. } __packed;
  353. // TX TFD with 30 byte MAC Header
  354. struct tx_tfd_30 {
  355. struct machdr30 mchdr; // 30
  356. u8 reserved[2]; // 2
  357. __le32 uivplaceholder[2]; // 8
  358. } __packed;
  359. // tx tfd with 26 byte mac header
  360. struct tx_tfd_26 {
  361. struct machdr26 mchdr; // 26
  362. u8 reserved1[2]; // 2
  363. __le32 uivplaceholder[2]; // 8
  364. u8 reserved2[4]; // 4
  365. } __packed;
  366. // tx tfd with 24 byte mac header
  367. struct tx_tfd_24 {
  368. struct machdr24 mchdr; // 24
  369. __le32 uivplaceholder[2]; // 8
  370. u8 reserved[8]; // 8
  371. } __packed;
  372. #define DCT_WEP_KEY_FIELD_LENGTH 16
  373. struct tfd_command {
  374. u8 index;
  375. u8 length;
  376. __le16 reserved;
  377. u8 payload[];
  378. } __packed;
  379. struct tfd_data {
  380. /* Header */
  381. __le32 work_area_ptr;
  382. u8 station_number; /* 0 for BSS */
  383. u8 reserved1;
  384. __le16 reserved2;
  385. /* Tx Parameters */
  386. u8 cmd_id;
  387. u8 seq_num;
  388. __le16 len;
  389. u8 priority;
  390. u8 tx_flags;
  391. u8 tx_flags_ext;
  392. u8 key_index;
  393. u8 wepkey[DCT_WEP_KEY_FIELD_LENGTH];
  394. u8 rate;
  395. u8 antenna;
  396. __le16 next_packet_duration;
  397. __le16 next_frag_len;
  398. __le16 back_off_counter; //////txop;
  399. u8 retrylimit;
  400. __le16 cwcurrent;
  401. u8 reserved3;
  402. /* 802.11 MAC Header */
  403. union {
  404. struct tx_tfd_24 tfd_24;
  405. struct tx_tfd_26 tfd_26;
  406. struct tx_tfd_30 tfd_30;
  407. struct tx_tfd_32 tfd_32;
  408. } tfd;
  409. /* Payload DMA info */
  410. __le32 num_chunks;
  411. __le32 chunk_ptr[NUM_TFD_CHUNKS];
  412. __le16 chunk_len[NUM_TFD_CHUNKS];
  413. } __packed;
  414. struct txrx_control_flags {
  415. u8 message_type;
  416. u8 rx_seq_num;
  417. u8 control_bits;
  418. u8 reserved;
  419. } __packed;
  420. #define TFD_SIZE 128
  421. #define TFD_CMD_IMMEDIATE_PAYLOAD_LENGTH (TFD_SIZE - sizeof(struct txrx_control_flags))
  422. struct tfd_frame {
  423. struct txrx_control_flags control_flags;
  424. union {
  425. struct tfd_data data;
  426. struct tfd_command cmd;
  427. u8 raw[TFD_CMD_IMMEDIATE_PAYLOAD_LENGTH];
  428. } u;
  429. } __packed;
  430. typedef void destructor_func(const void *);
  431. /**
  432. * Tx Queue for DMA. Queue consists of circular buffer of
  433. * BD's and required locking structures.
  434. */
  435. struct clx2_tx_queue {
  436. struct clx2_queue q;
  437. struct tfd_frame *bd;
  438. struct libipw_txb **txb;
  439. };
  440. /*
  441. * RX related structures and functions
  442. */
  443. #define RX_FREE_BUFFERS 32
  444. #define RX_LOW_WATERMARK 8
  445. #define SUP_RATE_11A_MAX_NUM_CHANNELS 8
  446. #define SUP_RATE_11B_MAX_NUM_CHANNELS 4
  447. #define SUP_RATE_11G_MAX_NUM_CHANNELS 12
  448. // Used for passing to driver number of successes and failures per rate
  449. struct rate_histogram {
  450. union {
  451. __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS];
  452. __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS];
  453. __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS];
  454. } success;
  455. union {
  456. __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS];
  457. __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS];
  458. __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS];
  459. } failed;
  460. } __packed;
  461. /* statistics command response */
  462. struct ipw_cmd_stats {
  463. u8 cmd_id;
  464. u8 seq_num;
  465. __le16 good_sfd;
  466. __le16 bad_plcp;
  467. __le16 wrong_bssid;
  468. __le16 valid_mpdu;
  469. __le16 bad_mac_header;
  470. __le16 reserved_frame_types;
  471. __le16 rx_ina;
  472. __le16 bad_crc32;
  473. __le16 invalid_cts;
  474. __le16 invalid_acks;
  475. __le16 long_distance_ina_fina;
  476. __le16 dsp_silence_unreachable;
  477. __le16 accumulated_rssi;
  478. __le16 rx_ovfl_frame_tossed;
  479. __le16 rssi_silence_threshold;
  480. __le16 rx_ovfl_frame_supplied;
  481. __le16 last_rx_frame_signal;
  482. __le16 last_rx_frame_noise;
  483. __le16 rx_autodetec_no_ofdm;
  484. __le16 rx_autodetec_no_barker;
  485. __le16 reserved;
  486. } __packed;
  487. struct notif_channel_result {
  488. u8 channel_num;
  489. struct ipw_cmd_stats stats;
  490. u8 uReserved;
  491. } __packed;
  492. #define SCAN_COMPLETED_STATUS_COMPLETE 1
  493. #define SCAN_COMPLETED_STATUS_ABORTED 2
  494. struct notif_scan_complete {
  495. u8 scan_type;
  496. u8 num_channels;
  497. u8 status;
  498. u8 reserved;
  499. } __packed;
  500. struct notif_frag_length {
  501. __le16 frag_length;
  502. __le16 reserved;
  503. } __packed;
  504. struct notif_beacon_state {
  505. __le32 state;
  506. __le32 number;
  507. } __packed;
  508. struct notif_tgi_tx_key {
  509. u8 key_state;
  510. u8 security_type;
  511. u8 station_index;
  512. u8 reserved;
  513. } __packed;
  514. #define SILENCE_OVER_THRESH (1)
  515. #define SILENCE_UNDER_THRESH (2)
  516. struct notif_link_deterioration {
  517. struct ipw_cmd_stats stats;
  518. u8 rate;
  519. u8 modulation;
  520. struct rate_histogram histogram;
  521. u8 silence_notification_type; /* SILENCE_OVER/UNDER_THRESH */
  522. __le16 silence_count;
  523. } __packed;
  524. struct notif_association {
  525. u8 state;
  526. } __packed;
  527. struct notif_authenticate {
  528. u8 state;
  529. struct machdr24 addr;
  530. __le16 status;
  531. } __packed;
  532. struct notif_calibration {
  533. u8 data[104];
  534. } __packed;
  535. struct notif_noise {
  536. __le32 value;
  537. } __packed;
  538. struct ipw_rx_notification {
  539. u8 reserved[8];
  540. u8 subtype;
  541. u8 flags;
  542. __le16 size;
  543. union {
  544. struct notif_association assoc;
  545. struct notif_authenticate auth;
  546. struct notif_channel_result channel_result;
  547. struct notif_scan_complete scan_complete;
  548. struct notif_frag_length frag_len;
  549. struct notif_beacon_state beacon_state;
  550. struct notif_tgi_tx_key tgi_tx_key;
  551. struct notif_link_deterioration link_deterioration;
  552. struct notif_calibration calibration;
  553. struct notif_noise noise;
  554. DECLARE_FLEX_ARRAY(u8, raw);
  555. } u;
  556. } __packed;
  557. struct ipw_rx_frame {
  558. __le32 reserved1;
  559. u8 parent_tsf[4]; // fw_use[0] is boolean for OUR_TSF_IS_GREATER
  560. u8 received_channel; // The channel that this frame was received on.
  561. // Note that for .11b this does not have to be
  562. // the same as the channel that it was sent.
  563. // Filled by LMAC
  564. u8 frameStatus;
  565. u8 rate;
  566. u8 rssi;
  567. u8 agc;
  568. u8 rssi_dbm;
  569. __le16 signal;
  570. __le16 noise;
  571. u8 antennaAndPhy;
  572. u8 control; // control bit should be on in bg
  573. u8 rtscts_rate; // rate of rts or cts (in rts cts sequence rate
  574. // is identical)
  575. u8 rtscts_seen; // 0x1 RTS seen ; 0x2 CTS seen
  576. __le16 length;
  577. u8 data[];
  578. } __packed;
  579. struct ipw_rx_header {
  580. u8 message_type;
  581. u8 rx_seq_num;
  582. u8 control_bits;
  583. u8 reserved;
  584. } __packed;
  585. struct ipw_rx_packet {
  586. struct ipw_rx_header header;
  587. union {
  588. struct ipw_rx_frame frame;
  589. struct ipw_rx_notification notification;
  590. } u;
  591. } __packed;
  592. #define IPW_RX_NOTIFICATION_SIZE sizeof(struct ipw_rx_header) + 12
  593. #define IPW_RX_FRAME_SIZE (unsigned int)(sizeof(struct ipw_rx_header) + \
  594. sizeof(struct ipw_rx_frame))
  595. struct ipw_rx_mem_buffer {
  596. dma_addr_t dma_addr;
  597. struct sk_buff *skb;
  598. struct list_head list;
  599. }; /* Not transferred over network, so not __packed */
  600. struct ipw_rx_queue {
  601. struct ipw_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
  602. struct ipw_rx_mem_buffer *queue[RX_QUEUE_SIZE];
  603. u32 processed; /* Internal index to last handled Rx packet */
  604. u32 read; /* Shared index to newest available Rx buffer */
  605. u32 write; /* Shared index to oldest written Rx packet */
  606. u32 free_count; /* Number of pre-allocated buffers in rx_free */
  607. /* Each of these lists is used as a FIFO for ipw_rx_mem_buffers */
  608. struct list_head rx_free; /* Own an SKBs */
  609. struct list_head rx_used; /* No SKB allocated */
  610. spinlock_t lock;
  611. }; /* Not transferred over network, so not __packed */
  612. struct alive_command_responce {
  613. u8 alive_command;
  614. u8 sequence_number;
  615. __le16 software_revision;
  616. u8 device_identifier;
  617. u8 reserved1[5];
  618. __le16 reserved2;
  619. __le16 reserved3;
  620. __le16 clock_settle_time;
  621. __le16 powerup_settle_time;
  622. __le16 reserved4;
  623. u8 time_stamp[5]; /* month, day, year, hours, minutes */
  624. u8 ucode_valid;
  625. } __packed;
  626. #define IPW_MAX_RATES 12
  627. struct ipw_rates {
  628. u8 num_rates;
  629. u8 rates[IPW_MAX_RATES];
  630. } __packed;
  631. struct command_block {
  632. unsigned int control;
  633. u32 source_addr;
  634. u32 dest_addr;
  635. unsigned int status;
  636. } __packed;
  637. #define CB_NUMBER_OF_ELEMENTS_SMALL 64
  638. struct fw_image_desc {
  639. unsigned long last_cb_index;
  640. unsigned long current_cb_index;
  641. struct command_block cb_list[CB_NUMBER_OF_ELEMENTS_SMALL];
  642. void *v_addr;
  643. unsigned long p_addr;
  644. unsigned long len;
  645. };
  646. struct ipw_sys_config {
  647. u8 bt_coexistence;
  648. u8 reserved1;
  649. u8 answer_broadcast_ssid_probe;
  650. u8 accept_all_data_frames;
  651. u8 accept_non_directed_frames;
  652. u8 exclude_unicast_unencrypted;
  653. u8 disable_unicast_decryption;
  654. u8 exclude_multicast_unencrypted;
  655. u8 disable_multicast_decryption;
  656. u8 antenna_diversity;
  657. u8 pass_crc_to_host;
  658. u8 dot11g_auto_detection;
  659. u8 enable_cts_to_self;
  660. u8 enable_multicast_filtering;
  661. u8 bt_coexist_collision_thr;
  662. u8 silence_threshold;
  663. u8 accept_all_mgmt_bcpr;
  664. u8 accept_all_mgmt_frames;
  665. u8 pass_noise_stats_to_host;
  666. u8 reserved3;
  667. } __packed;
  668. struct ipw_multicast_addr {
  669. u8 num_of_multicast_addresses;
  670. u8 reserved[3];
  671. u8 mac1[6];
  672. u8 mac2[6];
  673. u8 mac3[6];
  674. u8 mac4[6];
  675. } __packed;
  676. #define DCW_WEP_KEY_INDEX_MASK 0x03 /* bits [0:1] */
  677. #define DCW_WEP_KEY_SEC_TYPE_MASK 0x30 /* bits [4:5] */
  678. #define DCW_WEP_KEY_SEC_TYPE_WEP 0x00
  679. #define DCW_WEP_KEY_SEC_TYPE_CCM 0x20
  680. #define DCW_WEP_KEY_SEC_TYPE_TKIP 0x30
  681. #define DCW_WEP_KEY_INVALID_SIZE 0x00 /* 0 = Invalid key */
  682. #define DCW_WEP_KEY64Bit_SIZE 0x05 /* 64-bit encryption */
  683. #define DCW_WEP_KEY128Bit_SIZE 0x0D /* 128-bit encryption */
  684. #define DCW_CCM_KEY128Bit_SIZE 0x10 /* 128-bit key */
  685. //#define DCW_WEP_KEY128BitIV_SIZE 0x10 /* 128-bit key and 128-bit IV */
  686. struct ipw_wep_key {
  687. u8 cmd_id;
  688. u8 seq_num;
  689. u8 key_index;
  690. u8 key_size;
  691. u8 key[16];
  692. } __packed;
  693. struct ipw_tgi_tx_key {
  694. u8 key_id;
  695. u8 security_type;
  696. u8 station_index;
  697. u8 flags;
  698. u8 key[16];
  699. __le32 tx_counter[2];
  700. } __packed;
  701. #define IPW_SCAN_CHANNELS 54
  702. struct ipw_scan_request {
  703. u8 scan_type;
  704. __le16 dwell_time;
  705. u8 channels_list[IPW_SCAN_CHANNELS];
  706. u8 channels_reserved[3];
  707. } __packed;
  708. enum {
  709. IPW_SCAN_PASSIVE_TILL_FIRST_BEACON_SCAN = 0,
  710. IPW_SCAN_PASSIVE_FULL_DWELL_SCAN,
  711. IPW_SCAN_ACTIVE_DIRECT_SCAN,
  712. IPW_SCAN_ACTIVE_BROADCAST_SCAN,
  713. IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN,
  714. IPW_SCAN_TYPES
  715. };
  716. struct ipw_scan_request_ext {
  717. __le32 full_scan_index;
  718. u8 channels_list[IPW_SCAN_CHANNELS];
  719. u8 scan_type[IPW_SCAN_CHANNELS / 2];
  720. u8 reserved;
  721. __le16 dwell_time[IPW_SCAN_TYPES];
  722. } __packed;
  723. static inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index)
  724. {
  725. if (index % 2)
  726. return scan->scan_type[index / 2] & 0x0F;
  727. else
  728. return (scan->scan_type[index / 2] & 0xF0) >> 4;
  729. }
  730. static inline void ipw_set_scan_type(struct ipw_scan_request_ext *scan,
  731. u8 index, u8 scan_type)
  732. {
  733. if (index % 2)
  734. scan->scan_type[index / 2] =
  735. (scan->scan_type[index / 2] & 0xF0) | (scan_type & 0x0F);
  736. else
  737. scan->scan_type[index / 2] =
  738. (scan->scan_type[index / 2] & 0x0F) |
  739. ((scan_type & 0x0F) << 4);
  740. }
  741. struct ipw_associate {
  742. u8 channel;
  743. #ifdef __LITTLE_ENDIAN_BITFIELD
  744. u8 auth_type:4, auth_key:4;
  745. #else
  746. u8 auth_key:4, auth_type:4;
  747. #endif
  748. u8 assoc_type;
  749. u8 reserved;
  750. __le16 policy_support;
  751. u8 preamble_length;
  752. u8 ieee_mode;
  753. u8 bssid[ETH_ALEN];
  754. __le32 assoc_tsf_msw;
  755. __le32 assoc_tsf_lsw;
  756. __le16 capability;
  757. __le16 listen_interval;
  758. __le16 beacon_interval;
  759. u8 dest[ETH_ALEN];
  760. __le16 atim_window;
  761. u8 smr;
  762. u8 reserved1;
  763. __le16 reserved2;
  764. } __packed;
  765. struct ipw_supported_rates {
  766. u8 ieee_mode;
  767. u8 num_rates;
  768. u8 purpose;
  769. u8 reserved;
  770. u8 supported_rates[IPW_MAX_RATES];
  771. } __packed;
  772. struct ipw_rts_threshold {
  773. __le16 rts_threshold;
  774. __le16 reserved;
  775. } __packed;
  776. struct ipw_frag_threshold {
  777. __le16 frag_threshold;
  778. __le16 reserved;
  779. } __packed;
  780. struct ipw_retry_limit {
  781. u8 short_retry_limit;
  782. u8 long_retry_limit;
  783. __le16 reserved;
  784. } __packed;
  785. struct ipw_dino_config {
  786. __le32 dino_config_addr;
  787. __le16 dino_config_size;
  788. u8 dino_response;
  789. u8 reserved;
  790. } __packed;
  791. struct ipw_aironet_info {
  792. u8 id;
  793. u8 length;
  794. __le16 reserved;
  795. } __packed;
  796. struct ipw_rx_key {
  797. u8 station_index;
  798. u8 key_type;
  799. u8 key_id;
  800. u8 key_flag;
  801. u8 key[16];
  802. u8 station_address[6];
  803. u8 key_index;
  804. u8 reserved;
  805. } __packed;
  806. struct ipw_country_channel_info {
  807. u8 first_channel;
  808. u8 no_channels;
  809. s8 max_tx_power;
  810. } __packed;
  811. struct ipw_country_info {
  812. u8 id;
  813. u8 length;
  814. u8 country_str[IEEE80211_COUNTRY_STRING_LEN];
  815. struct ipw_country_channel_info groups[7];
  816. } __packed;
  817. struct ipw_channel_tx_power {
  818. u8 channel_number;
  819. s8 tx_power;
  820. } __packed;
  821. #define SCAN_ASSOCIATED_INTERVAL (HZ)
  822. #define SCAN_INTERVAL (HZ / 10)
  823. #define MAX_A_CHANNELS 37
  824. #define MAX_B_CHANNELS 14
  825. struct ipw_tx_power {
  826. u8 num_channels;
  827. u8 ieee_mode;
  828. struct ipw_channel_tx_power channels_tx_power[MAX_A_CHANNELS];
  829. } __packed;
  830. struct ipw_rsn_capabilities {
  831. u8 id;
  832. u8 length;
  833. __le16 version;
  834. } __packed;
  835. struct ipw_sensitivity_calib {
  836. __le16 beacon_rssi_raw;
  837. __le16 reserved;
  838. } __packed;
  839. /**
  840. * Host command structure.
  841. *
  842. * On input, the following fields should be filled:
  843. * - cmd
  844. * - len
  845. * - status_len
  846. * - param (if needed)
  847. *
  848. * On output,
  849. * - \a status contains status;
  850. * - \a param filled with status parameters.
  851. */
  852. struct ipw_cmd { /* XXX */
  853. u32 cmd; /**< Host command */
  854. u32 status;/**< Status */
  855. u32 status_len;
  856. /**< How many 32 bit parameters in the status */
  857. u32 len; /**< incoming parameters length, bytes */
  858. /**
  859. * command parameters.
  860. * There should be enough space for incoming and
  861. * outcoming parameters.
  862. * Incoming parameters listed 1-st, followed by outcoming params.
  863. * nParams=(len+3)/4+status_len
  864. */
  865. u32 param[];
  866. } __packed;
  867. #define STATUS_HCMD_ACTIVE (1<<0) /**< host command in progress */
  868. #define STATUS_INT_ENABLED (1<<1)
  869. #define STATUS_RF_KILL_HW (1<<2)
  870. #define STATUS_RF_KILL_SW (1<<3)
  871. #define STATUS_RF_KILL_MASK (STATUS_RF_KILL_HW | STATUS_RF_KILL_SW)
  872. #define STATUS_INIT (1<<5)
  873. #define STATUS_AUTH (1<<6)
  874. #define STATUS_ASSOCIATED (1<<7)
  875. #define STATUS_STATE_MASK (STATUS_INIT | STATUS_AUTH | STATUS_ASSOCIATED)
  876. #define STATUS_ASSOCIATING (1<<8)
  877. #define STATUS_DISASSOCIATING (1<<9)
  878. #define STATUS_ROAMING (1<<10)
  879. #define STATUS_EXIT_PENDING (1<<11)
  880. #define STATUS_DISASSOC_PENDING (1<<12)
  881. #define STATUS_STATE_PENDING (1<<13)
  882. #define STATUS_DIRECT_SCAN_PENDING (1<<19)
  883. #define STATUS_SCAN_PENDING (1<<20)
  884. #define STATUS_SCANNING (1<<21)
  885. #define STATUS_SCAN_ABORTING (1<<22)
  886. #define STATUS_SCAN_FORCED (1<<23)
  887. #define STATUS_LED_LINK_ON (1<<24)
  888. #define STATUS_LED_ACT_ON (1<<25)
  889. #define STATUS_INDIRECT_BYTE (1<<28) /* sysfs entry configured for access */
  890. #define STATUS_INDIRECT_DWORD (1<<29) /* sysfs entry configured for access */
  891. #define STATUS_DIRECT_DWORD (1<<30) /* sysfs entry configured for access */
  892. #define STATUS_SECURITY_UPDATED (1<<31) /* Security sync needed */
  893. #define CFG_STATIC_CHANNEL (1<<0) /* Restrict assoc. to single channel */
  894. #define CFG_STATIC_ESSID (1<<1) /* Restrict assoc. to single SSID */
  895. #define CFG_STATIC_BSSID (1<<2) /* Restrict assoc. to single BSSID */
  896. #define CFG_CUSTOM_MAC (1<<3)
  897. #define CFG_PREAMBLE_LONG (1<<4)
  898. #define CFG_ADHOC_PERSIST (1<<5)
  899. #define CFG_ASSOCIATE (1<<6)
  900. #define CFG_FIXED_RATE (1<<7)
  901. #define CFG_ADHOC_CREATE (1<<8)
  902. #define CFG_NO_LED (1<<9)
  903. #define CFG_BACKGROUND_SCAN (1<<10)
  904. #define CFG_SPEED_SCAN (1<<11)
  905. #define CFG_NET_STATS (1<<12)
  906. #define CAP_SHARED_KEY (1<<0) /* Off = OPEN */
  907. #define CAP_PRIVACY_ON (1<<1) /* Off = No privacy */
  908. #define MAX_STATIONS 32
  909. #define IPW_INVALID_STATION (0xff)
  910. struct ipw_station_entry {
  911. u8 mac_addr[ETH_ALEN];
  912. u8 reserved;
  913. u8 support_mode;
  914. };
  915. #define AVG_ENTRIES 8
  916. struct average {
  917. s16 entries[AVG_ENTRIES];
  918. u8 pos;
  919. u8 init;
  920. s32 sum;
  921. };
  922. #define MAX_SPEED_SCAN 100
  923. #define IPW_IBSS_MAC_HASH_SIZE 31
  924. struct ipw_ibss_seq {
  925. u8 mac[ETH_ALEN];
  926. u16 seq_num;
  927. u16 frag_num;
  928. unsigned long packet_time;
  929. struct list_head list;
  930. };
  931. struct ipw_error_elem { /* XXX */
  932. u32 desc;
  933. u32 time;
  934. u32 blink1;
  935. u32 blink2;
  936. u32 link1;
  937. u32 link2;
  938. u32 data;
  939. };
  940. struct ipw_event { /* XXX */
  941. u32 event;
  942. u32 time;
  943. u32 data;
  944. } __packed;
  945. struct ipw_fw_error { /* XXX */
  946. unsigned long jiffies;
  947. u32 status;
  948. u32 config;
  949. u32 elem_len;
  950. u32 log_len;
  951. struct ipw_error_elem *elem;
  952. struct ipw_event *log;
  953. u8 payload[];
  954. } __packed;
  955. #ifdef CONFIG_IPW2200_PROMISCUOUS
  956. enum ipw_prom_filter {
  957. IPW_PROM_CTL_HEADER_ONLY = (1 << 0),
  958. IPW_PROM_MGMT_HEADER_ONLY = (1 << 1),
  959. IPW_PROM_DATA_HEADER_ONLY = (1 << 2),
  960. IPW_PROM_ALL_HEADER_ONLY = 0xf, /* bits 0..3 */
  961. IPW_PROM_NO_TX = (1 << 4),
  962. IPW_PROM_NO_RX = (1 << 5),
  963. IPW_PROM_NO_CTL = (1 << 6),
  964. IPW_PROM_NO_MGMT = (1 << 7),
  965. IPW_PROM_NO_DATA = (1 << 8),
  966. };
  967. struct ipw_priv;
  968. struct ipw_prom_priv {
  969. struct ipw_priv *priv;
  970. struct libipw_device *ieee;
  971. enum ipw_prom_filter filter;
  972. int tx_packets;
  973. int rx_packets;
  974. };
  975. #endif
  976. #if defined(CONFIG_IPW2200_RADIOTAP) || defined(CONFIG_IPW2200_PROMISCUOUS)
  977. /* Magic struct that slots into the radiotap header -- no reason
  978. * to build this manually element by element, we can write it much
  979. * more efficiently than we can parse it. ORDER MATTERS HERE
  980. *
  981. * When sent to us via the simulated Rx interface in sysfs, the entire
  982. * structure is provided regardless of any bits unset.
  983. */
  984. struct ipw_rt_hdr {
  985. struct ieee80211_radiotap_header rt_hdr;
  986. u64 rt_tsf; /* TSF */ /* XXX */
  987. u8 rt_flags; /* radiotap packet flags */
  988. u8 rt_rate; /* rate in 500kb/s */
  989. __le16 rt_channel; /* channel in mhz */
  990. __le16 rt_chbitmask; /* channel bitfield */
  991. s8 rt_dbmsignal; /* signal in dbM, kluged to signed */
  992. s8 rt_dbmnoise;
  993. u8 rt_antenna; /* antenna number */
  994. u8 payload[]; /* payload... */
  995. } __packed;
  996. #endif
  997. struct ipw_priv {
  998. /* ieee device used by generic ieee processing code */
  999. struct libipw_device *ieee;
  1000. spinlock_t lock;
  1001. spinlock_t irq_lock;
  1002. struct mutex mutex;
  1003. /* basic pci-network driver stuff */
  1004. struct pci_dev *pci_dev;
  1005. struct net_device *net_dev;
  1006. #ifdef CONFIG_IPW2200_PROMISCUOUS
  1007. /* Promiscuous mode */
  1008. struct ipw_prom_priv *prom_priv;
  1009. struct net_device *prom_net_dev;
  1010. #endif
  1011. /* pci hardware address support */
  1012. void __iomem *hw_base;
  1013. unsigned long hw_len;
  1014. struct fw_image_desc sram_desc;
  1015. /* result of ucode download */
  1016. struct alive_command_responce dino_alive;
  1017. wait_queue_head_t wait_command_queue;
  1018. wait_queue_head_t wait_state;
  1019. /* Rx and Tx DMA processing queues */
  1020. struct ipw_rx_queue *rxq;
  1021. struct clx2_tx_queue txq_cmd;
  1022. struct clx2_tx_queue txq[4];
  1023. u32 status;
  1024. u32 config;
  1025. u32 capability;
  1026. struct average average_missed_beacons;
  1027. s16 exp_avg_rssi;
  1028. s16 exp_avg_noise;
  1029. u32 port_type;
  1030. int rx_bufs_min; /**< minimum number of bufs in Rx queue */
  1031. int rx_pend_max; /**< maximum pending buffers for one IRQ */
  1032. u32 hcmd_seq; /**< sequence number for hcmd */
  1033. u32 disassociate_threshold;
  1034. u32 roaming_threshold;
  1035. struct ipw_associate assoc_request;
  1036. struct libipw_network *assoc_network;
  1037. unsigned long ts_scan_abort;
  1038. struct ipw_supported_rates rates;
  1039. struct ipw_rates phy[3]; /**< PHY restrictions, per band */
  1040. struct ipw_rates supp; /**< software defined */
  1041. struct ipw_rates extended; /**< use for corresp. IE, AP only */
  1042. struct notif_link_deterioration last_link_deterioration; /** for statistics */
  1043. struct ipw_cmd *hcmd; /**< host command currently executed */
  1044. wait_queue_head_t hcmd_wq; /**< host command waits for execution */
  1045. u32 tsf_bcn[2]; /**< TSF from latest beacon */
  1046. struct notif_calibration calib; /**< last calibration */
  1047. /* ordinal interface with firmware */
  1048. u32 table0_addr;
  1049. u32 table0_len;
  1050. u32 table1_addr;
  1051. u32 table1_len;
  1052. u32 table2_addr;
  1053. u32 table2_len;
  1054. /* context information */
  1055. u8 essid[IW_ESSID_MAX_SIZE];
  1056. u8 essid_len;
  1057. u8 nick[IW_ESSID_MAX_SIZE];
  1058. u16 rates_mask;
  1059. u8 channel;
  1060. struct ipw_sys_config sys_config;
  1061. u32 power_mode;
  1062. u8 bssid[ETH_ALEN];
  1063. u16 rts_threshold;
  1064. u8 mac_addr[ETH_ALEN];
  1065. u8 num_stations;
  1066. u8 stations[MAX_STATIONS][ETH_ALEN];
  1067. u8 short_retry_limit;
  1068. u8 long_retry_limit;
  1069. u32 notif_missed_beacons;
  1070. /* Statistics and counters normalized with each association */
  1071. u32 last_missed_beacons;
  1072. u32 last_tx_packets;
  1073. u32 last_rx_packets;
  1074. u32 last_tx_failures;
  1075. u32 last_rx_err;
  1076. u32 last_rate;
  1077. u32 missed_adhoc_beacons;
  1078. u32 missed_beacons;
  1079. u32 rx_packets;
  1080. u32 tx_packets;
  1081. u32 quality;
  1082. u8 speed_scan[MAX_SPEED_SCAN];
  1083. u8 speed_scan_pos;
  1084. u16 last_seq_num;
  1085. u16 last_frag_num;
  1086. unsigned long last_packet_time;
  1087. struct list_head ibss_mac_hash[IPW_IBSS_MAC_HASH_SIZE];
  1088. /* eeprom */
  1089. u8 eeprom[0x100]; /* 256 bytes of eeprom */
  1090. u8 country[4];
  1091. int eeprom_delay;
  1092. struct iw_statistics wstats;
  1093. struct iw_public_data wireless_data;
  1094. int user_requested_scan;
  1095. u8 direct_scan_ssid[IW_ESSID_MAX_SIZE];
  1096. u8 direct_scan_ssid_len;
  1097. struct delayed_work adhoc_check;
  1098. struct work_struct associate;
  1099. struct work_struct disassociate;
  1100. struct work_struct system_config;
  1101. struct work_struct rx_replenish;
  1102. struct delayed_work request_scan;
  1103. struct delayed_work request_direct_scan;
  1104. struct delayed_work request_passive_scan;
  1105. struct delayed_work scan_event;
  1106. struct work_struct adapter_restart;
  1107. struct delayed_work rf_kill;
  1108. struct work_struct up;
  1109. struct work_struct down;
  1110. struct delayed_work gather_stats;
  1111. struct work_struct abort_scan;
  1112. struct work_struct roam;
  1113. struct delayed_work scan_check;
  1114. struct work_struct link_up;
  1115. struct work_struct link_down;
  1116. struct tasklet_struct irq_tasklet;
  1117. /* LED related variables and work_struct */
  1118. u8 nic_type;
  1119. u32 led_activity_on;
  1120. u32 led_activity_off;
  1121. u32 led_association_on;
  1122. u32 led_association_off;
  1123. u32 led_ofdm_on;
  1124. u32 led_ofdm_off;
  1125. struct delayed_work led_link_on;
  1126. struct delayed_work led_link_off;
  1127. struct delayed_work led_act_off;
  1128. struct work_struct merge_networks;
  1129. struct ipw_cmd_log *cmdlog;
  1130. int cmdlog_len;
  1131. int cmdlog_pos;
  1132. #define IPW_2200BG 1
  1133. #define IPW_2915ABG 2
  1134. u8 adapter;
  1135. s8 tx_power;
  1136. /* Track time in suspend using CLOCK_BOOTTIME */
  1137. time64_t suspend_at;
  1138. time64_t suspend_time;
  1139. #ifdef CONFIG_PM
  1140. u32 pm_state[16];
  1141. #endif
  1142. struct ipw_fw_error *error;
  1143. /* network state */
  1144. /* Used to pass the current INTA value from ISR to Tasklet */
  1145. u32 isr_inta;
  1146. /* QoS */
  1147. struct ipw_qos_info qos_data;
  1148. struct work_struct qos_activate;
  1149. /*********************************/
  1150. /* debugging info */
  1151. u32 indirect_dword;
  1152. u32 direct_dword;
  1153. u32 indirect_byte;
  1154. }; /*ipw_priv */
  1155. /* debug macros */
  1156. /* Debug and printf string expansion helpers for printing bitfields */
  1157. #define BIT_FMT8 "%c%c%c%c-%c%c%c%c"
  1158. #define BIT_FMT16 BIT_FMT8 ":" BIT_FMT8
  1159. #define BIT_FMT32 BIT_FMT16 " " BIT_FMT16
  1160. #define BITC(x,y) (((x>>y)&1)?'1':'0')
  1161. #define BIT_ARG8(x) \
  1162. BITC(x,7),BITC(x,6),BITC(x,5),BITC(x,4),\
  1163. BITC(x,3),BITC(x,2),BITC(x,1),BITC(x,0)
  1164. #define BIT_ARG16(x) \
  1165. BITC(x,15),BITC(x,14),BITC(x,13),BITC(x,12),\
  1166. BITC(x,11),BITC(x,10),BITC(x,9),BITC(x,8),\
  1167. BIT_ARG8(x)
  1168. #define BIT_ARG32(x) \
  1169. BITC(x,31),BITC(x,30),BITC(x,29),BITC(x,28),\
  1170. BITC(x,27),BITC(x,26),BITC(x,25),BITC(x,24),\
  1171. BITC(x,23),BITC(x,22),BITC(x,21),BITC(x,20),\
  1172. BITC(x,19),BITC(x,18),BITC(x,17),BITC(x,16),\
  1173. BIT_ARG16(x)
  1174. #define IPW_DEBUG(level, fmt, args...) \
  1175. do { if (ipw_debug_level & (level)) \
  1176. printk(KERN_DEBUG DRV_NAME": %s " fmt, __func__ , ## args); } while (0)
  1177. #ifdef CONFIG_IPW2200_DEBUG
  1178. #define IPW_LL_DEBUG(level, fmt, args...) \
  1179. do { if (ipw_debug_level & (level)) \
  1180. printk(KERN_DEBUG DRV_NAME": %s " fmt, __func__ , ## args); } while (0)
  1181. #else
  1182. #define IPW_LL_DEBUG(level, fmt, args...) do {} while (0)
  1183. #endif /* CONFIG_IPW2200_DEBUG */
  1184. /*
  1185. * To use the debug system;
  1186. *
  1187. * If you are defining a new debug classification, simply add it to the #define
  1188. * list here in the form of:
  1189. *
  1190. * #define IPW_DL_xxxx VALUE
  1191. *
  1192. * shifting value to the left one bit from the previous entry. xxxx should be
  1193. * the name of the classification (for example, WEP)
  1194. *
  1195. * You then need to either add a IPW_xxxx_DEBUG() macro definition for your
  1196. * classification, or use IPW_DEBUG(IPW_DL_xxxx, ...) whenever you want
  1197. * to send output to that classification.
  1198. *
  1199. * To add your debug level to the list of levels seen when you perform
  1200. *
  1201. * % cat /proc/net/ipw/debug_level
  1202. *
  1203. * you simply need to add your entry to the ipw_debug_levels array.
  1204. *
  1205. * If you do not see debug_level in /proc/net/ipw then you do not have
  1206. * CONFIG_IPW2200_DEBUG defined in your kernel configuration
  1207. *
  1208. */
  1209. #define IPW_DL_ERROR (1<<0)
  1210. #define IPW_DL_WARNING (1<<1)
  1211. #define IPW_DL_INFO (1<<2)
  1212. #define IPW_DL_WX (1<<3)
  1213. #define IPW_DL_HOST_COMMAND (1<<5)
  1214. #define IPW_DL_STATE (1<<6)
  1215. #define IPW_DL_NOTIF (1<<10)
  1216. #define IPW_DL_SCAN (1<<11)
  1217. #define IPW_DL_ASSOC (1<<12)
  1218. #define IPW_DL_DROP (1<<13)
  1219. #define IPW_DL_IOCTL (1<<14)
  1220. #define IPW_DL_MANAGE (1<<15)
  1221. #define IPW_DL_FW (1<<16)
  1222. #define IPW_DL_RF_KILL (1<<17)
  1223. #define IPW_DL_FW_ERRORS (1<<18)
  1224. #define IPW_DL_LED (1<<19)
  1225. #define IPW_DL_ORD (1<<20)
  1226. #define IPW_DL_FRAG (1<<21)
  1227. #define IPW_DL_WEP (1<<22)
  1228. #define IPW_DL_TX (1<<23)
  1229. #define IPW_DL_RX (1<<24)
  1230. #define IPW_DL_ISR (1<<25)
  1231. #define IPW_DL_FW_INFO (1<<26)
  1232. #define IPW_DL_IO (1<<27)
  1233. #define IPW_DL_TRACE (1<<28)
  1234. #define IPW_DL_STATS (1<<29)
  1235. #define IPW_DL_MERGE (1<<30)
  1236. #define IPW_DL_QOS (1<<31)
  1237. #define IPW_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a)
  1238. #define IPW_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a)
  1239. #define IPW_DEBUG_INFO(f, a...) IPW_DEBUG(IPW_DL_INFO, f, ## a)
  1240. #define IPW_DEBUG_WX(f, a...) IPW_DEBUG(IPW_DL_WX, f, ## a)
  1241. #define IPW_DEBUG_SCAN(f, a...) IPW_DEBUG(IPW_DL_SCAN, f, ## a)
  1242. #define IPW_DEBUG_TRACE(f, a...) IPW_LL_DEBUG(IPW_DL_TRACE, f, ## a)
  1243. #define IPW_DEBUG_RX(f, a...) IPW_LL_DEBUG(IPW_DL_RX, f, ## a)
  1244. #define IPW_DEBUG_TX(f, a...) IPW_LL_DEBUG(IPW_DL_TX, f, ## a)
  1245. #define IPW_DEBUG_ISR(f, a...) IPW_LL_DEBUG(IPW_DL_ISR, f, ## a)
  1246. #define IPW_DEBUG_MANAGEMENT(f, a...) IPW_DEBUG(IPW_DL_MANAGE, f, ## a)
  1247. #define IPW_DEBUG_LED(f, a...) IPW_LL_DEBUG(IPW_DL_LED, f, ## a)
  1248. #define IPW_DEBUG_WEP(f, a...) IPW_LL_DEBUG(IPW_DL_WEP, f, ## a)
  1249. #define IPW_DEBUG_HC(f, a...) IPW_LL_DEBUG(IPW_DL_HOST_COMMAND, f, ## a)
  1250. #define IPW_DEBUG_FRAG(f, a...) IPW_LL_DEBUG(IPW_DL_FRAG, f, ## a)
  1251. #define IPW_DEBUG_FW(f, a...) IPW_LL_DEBUG(IPW_DL_FW, f, ## a)
  1252. #define IPW_DEBUG_RF_KILL(f, a...) IPW_DEBUG(IPW_DL_RF_KILL, f, ## a)
  1253. #define IPW_DEBUG_DROP(f, a...) IPW_DEBUG(IPW_DL_DROP, f, ## a)
  1254. #define IPW_DEBUG_IO(f, a...) IPW_LL_DEBUG(IPW_DL_IO, f, ## a)
  1255. #define IPW_DEBUG_ORD(f, a...) IPW_LL_DEBUG(IPW_DL_ORD, f, ## a)
  1256. #define IPW_DEBUG_FW_INFO(f, a...) IPW_LL_DEBUG(IPW_DL_FW_INFO, f, ## a)
  1257. #define IPW_DEBUG_NOTIF(f, a...) IPW_DEBUG(IPW_DL_NOTIF, f, ## a)
  1258. #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a)
  1259. #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a)
  1260. #define IPW_DEBUG_STATS(f, a...) IPW_LL_DEBUG(IPW_DL_STATS, f, ## a)
  1261. #define IPW_DEBUG_MERGE(f, a...) IPW_LL_DEBUG(IPW_DL_MERGE, f, ## a)
  1262. #define IPW_DEBUG_QOS(f, a...) IPW_LL_DEBUG(IPW_DL_QOS, f, ## a)
  1263. #include <linux/ctype.h>
  1264. /*
  1265. * Register bit definitions
  1266. */
  1267. #define IPW_INTA_RW 0x00000008
  1268. #define IPW_INTA_MASK_R 0x0000000C
  1269. #define IPW_INDIRECT_ADDR 0x00000010
  1270. #define IPW_INDIRECT_DATA 0x00000014
  1271. #define IPW_AUTOINC_ADDR 0x00000018
  1272. #define IPW_AUTOINC_DATA 0x0000001C
  1273. #define IPW_RESET_REG 0x00000020
  1274. #define IPW_GP_CNTRL_RW 0x00000024
  1275. #define IPW_READ_INT_REGISTER 0xFF4
  1276. #define IPW_GP_CNTRL_BIT_INIT_DONE 0x00000004
  1277. #define IPW_REGISTER_DOMAIN1_END 0x00001000
  1278. #define IPW_SRAM_READ_INT_REGISTER 0x00000ff4
  1279. #define IPW_SHARED_LOWER_BOUND 0x00000200
  1280. #define IPW_INTERRUPT_AREA_LOWER_BOUND 0x00000f80
  1281. #define IPW_NIC_SRAM_LOWER_BOUND 0x00000000
  1282. #define IPW_NIC_SRAM_UPPER_BOUND 0x00030000
  1283. #define IPW_BIT_INT_HOST_SRAM_READ_INT_REGISTER (1 << 29)
  1284. #define IPW_GP_CNTRL_BIT_CLOCK_READY 0x00000001
  1285. #define IPW_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY 0x00000002
  1286. /*
  1287. * RESET Register Bit Indexes
  1288. */
  1289. #define CBD_RESET_REG_PRINCETON_RESET (1<<0)
  1290. #define IPW_START_STANDBY (1<<2)
  1291. #define IPW_ACTIVITY_LED (1<<4)
  1292. #define IPW_ASSOCIATED_LED (1<<5)
  1293. #define IPW_OFDM_LED (1<<6)
  1294. #define IPW_RESET_REG_SW_RESET (1<<7)
  1295. #define IPW_RESET_REG_MASTER_DISABLED (1<<8)
  1296. #define IPW_RESET_REG_STOP_MASTER (1<<9)
  1297. #define IPW_GATE_ODMA (1<<25)
  1298. #define IPW_GATE_IDMA (1<<26)
  1299. #define IPW_ARC_KESHET_CONFIG (1<<27)
  1300. #define IPW_GATE_ADMA (1<<29)
  1301. #define IPW_CSR_CIS_UPPER_BOUND 0x00000200
  1302. #define IPW_DOMAIN_0_END 0x1000
  1303. #define CLX_MEM_BAR_SIZE 0x1000
  1304. /* Dino/baseband control registers bits */
  1305. #define DINO_ENABLE_SYSTEM 0x80 /* 1 = baseband processor on, 0 = reset */
  1306. #define DINO_ENABLE_CS 0x40 /* 1 = enable ucode load */
  1307. #define DINO_RXFIFO_DATA 0x01 /* 1 = data available */
  1308. #define IPW_BASEBAND_CONTROL_STATUS 0X00200000
  1309. #define IPW_BASEBAND_TX_FIFO_WRITE 0X00200004
  1310. #define IPW_BASEBAND_RX_FIFO_READ 0X00200004
  1311. #define IPW_BASEBAND_CONTROL_STORE 0X00200010
  1312. #define IPW_INTERNAL_CMD_EVENT 0X00300004
  1313. #define IPW_BASEBAND_POWER_DOWN 0x00000001
  1314. #define IPW_MEM_HALT_AND_RESET 0x003000e0
  1315. /* defgroup bits_halt_reset MEM_HALT_AND_RESET register bits */
  1316. #define IPW_BIT_HALT_RESET_ON 0x80000000
  1317. #define IPW_BIT_HALT_RESET_OFF 0x00000000
  1318. #define CB_LAST_VALID 0x20000000
  1319. #define CB_INT_ENABLED 0x40000000
  1320. #define CB_VALID 0x80000000
  1321. #define CB_SRC_LE 0x08000000
  1322. #define CB_DEST_LE 0x04000000
  1323. #define CB_SRC_AUTOINC 0x00800000
  1324. #define CB_SRC_IO_GATED 0x00400000
  1325. #define CB_DEST_AUTOINC 0x00080000
  1326. #define CB_SRC_SIZE_LONG 0x00200000
  1327. #define CB_DEST_SIZE_LONG 0x00020000
  1328. /* DMA DEFINES */
  1329. #define DMA_CONTROL_SMALL_CB_CONST_VALUE 0x00540000
  1330. #define DMA_CB_STOP_AND_ABORT 0x00000C00
  1331. #define DMA_CB_START 0x00000100
  1332. #define IPW_SHARED_SRAM_SIZE 0x00030000
  1333. #define IPW_SHARED_SRAM_DMA_CONTROL 0x00027000
  1334. #define CB_MAX_LENGTH 0x1FFF
  1335. #define IPW_HOST_EEPROM_DATA_SRAM_SIZE 0xA18
  1336. #define IPW_EEPROM_IMAGE_SIZE 0x100
  1337. /* DMA defs */
  1338. #define IPW_DMA_I_CURRENT_CB 0x003000D0
  1339. #define IPW_DMA_O_CURRENT_CB 0x003000D4
  1340. #define IPW_DMA_I_DMA_CONTROL 0x003000A4
  1341. #define IPW_DMA_I_CB_BASE 0x003000A0
  1342. #define IPW_TX_CMD_QUEUE_BD_BASE 0x00000200
  1343. #define IPW_TX_CMD_QUEUE_BD_SIZE 0x00000204
  1344. #define IPW_TX_QUEUE_0_BD_BASE 0x00000208
  1345. #define IPW_TX_QUEUE_0_BD_SIZE (0x0000020C)
  1346. #define IPW_TX_QUEUE_1_BD_BASE 0x00000210
  1347. #define IPW_TX_QUEUE_1_BD_SIZE 0x00000214
  1348. #define IPW_TX_QUEUE_2_BD_BASE 0x00000218
  1349. #define IPW_TX_QUEUE_2_BD_SIZE (0x0000021C)
  1350. #define IPW_TX_QUEUE_3_BD_BASE 0x00000220
  1351. #define IPW_TX_QUEUE_3_BD_SIZE 0x00000224
  1352. #define IPW_RX_BD_BASE 0x00000240
  1353. #define IPW_RX_BD_SIZE 0x00000244
  1354. #define IPW_RFDS_TABLE_LOWER 0x00000500
  1355. #define IPW_TX_CMD_QUEUE_READ_INDEX 0x00000280
  1356. #define IPW_TX_QUEUE_0_READ_INDEX 0x00000284
  1357. #define IPW_TX_QUEUE_1_READ_INDEX 0x00000288
  1358. #define IPW_TX_QUEUE_2_READ_INDEX (0x0000028C)
  1359. #define IPW_TX_QUEUE_3_READ_INDEX 0x00000290
  1360. #define IPW_RX_READ_INDEX (0x000002A0)
  1361. #define IPW_TX_CMD_QUEUE_WRITE_INDEX (0x00000F80)
  1362. #define IPW_TX_QUEUE_0_WRITE_INDEX (0x00000F84)
  1363. #define IPW_TX_QUEUE_1_WRITE_INDEX (0x00000F88)
  1364. #define IPW_TX_QUEUE_2_WRITE_INDEX (0x00000F8C)
  1365. #define IPW_TX_QUEUE_3_WRITE_INDEX (0x00000F90)
  1366. #define IPW_RX_WRITE_INDEX (0x00000FA0)
  1367. /*
  1368. * EEPROM Related Definitions
  1369. */
  1370. #define IPW_EEPROM_DATA_SRAM_ADDRESS (IPW_SHARED_LOWER_BOUND + 0x814)
  1371. #define IPW_EEPROM_DATA_SRAM_SIZE (IPW_SHARED_LOWER_BOUND + 0x818)
  1372. #define IPW_EEPROM_LOAD_DISABLE (IPW_SHARED_LOWER_BOUND + 0x81C)
  1373. #define IPW_EEPROM_DATA (IPW_SHARED_LOWER_BOUND + 0x820)
  1374. #define IPW_EEPROM_UPPER_ADDRESS (IPW_SHARED_LOWER_BOUND + 0x9E0)
  1375. #define IPW_STATION_TABLE_LOWER (IPW_SHARED_LOWER_BOUND + 0xA0C)
  1376. #define IPW_STATION_TABLE_UPPER (IPW_SHARED_LOWER_BOUND + 0xB0C)
  1377. #define IPW_REQUEST_ATIM (IPW_SHARED_LOWER_BOUND + 0xB0C)
  1378. #define IPW_ATIM_SENT (IPW_SHARED_LOWER_BOUND + 0xB10)
  1379. #define IPW_WHO_IS_AWAKE (IPW_SHARED_LOWER_BOUND + 0xB14)
  1380. #define IPW_DURING_ATIM_WINDOW (IPW_SHARED_LOWER_BOUND + 0xB18)
  1381. #define MSB 1
  1382. #define LSB 0
  1383. #define WORD_TO_BYTE(_word) ((_word) * sizeof(u16))
  1384. #define GET_EEPROM_ADDR(_wordoffset,_byteoffset) \
  1385. ( WORD_TO_BYTE(_wordoffset) + (_byteoffset) )
  1386. /* EEPROM access by BYTE */
  1387. #define EEPROM_PME_CAPABILITY (GET_EEPROM_ADDR(0x09,MSB)) /* 1 byte */
  1388. #define EEPROM_MAC_ADDRESS (GET_EEPROM_ADDR(0x21,LSB)) /* 6 byte */
  1389. #define EEPROM_VERSION (GET_EEPROM_ADDR(0x24,MSB)) /* 1 byte */
  1390. #define EEPROM_NIC_TYPE (GET_EEPROM_ADDR(0x25,LSB)) /* 1 byte */
  1391. #define EEPROM_SKU_CAPABILITY (GET_EEPROM_ADDR(0x25,MSB)) /* 1 byte */
  1392. #define EEPROM_COUNTRY_CODE (GET_EEPROM_ADDR(0x26,LSB)) /* 3 bytes */
  1393. #define EEPROM_IBSS_CHANNELS_BG (GET_EEPROM_ADDR(0x28,LSB)) /* 2 bytes */
  1394. #define EEPROM_IBSS_CHANNELS_A (GET_EEPROM_ADDR(0x29,MSB)) /* 5 bytes */
  1395. #define EEPROM_BSS_CHANNELS_BG (GET_EEPROM_ADDR(0x2c,LSB)) /* 2 bytes */
  1396. #define EEPROM_HW_VERSION (GET_EEPROM_ADDR(0x72,LSB)) /* 2 bytes */
  1397. /* NIC type as found in the one byte EEPROM_NIC_TYPE offset */
  1398. #define EEPROM_NIC_TYPE_0 0
  1399. #define EEPROM_NIC_TYPE_1 1
  1400. #define EEPROM_NIC_TYPE_2 2
  1401. #define EEPROM_NIC_TYPE_3 3
  1402. #define EEPROM_NIC_TYPE_4 4
  1403. /* Bluetooth Coexistence capabilities as found in EEPROM_SKU_CAPABILITY */
  1404. #define EEPROM_SKU_CAP_BT_CHANNEL_SIG 0x01 /* we can tell BT our channel # */
  1405. #define EEPROM_SKU_CAP_BT_PRIORITY 0x02 /* BT can take priority over us */
  1406. #define EEPROM_SKU_CAP_BT_OOB 0x04 /* we can signal BT out-of-band */
  1407. #define FW_MEM_REG_LOWER_BOUND 0x00300000
  1408. #define FW_MEM_REG_EEPROM_ACCESS (FW_MEM_REG_LOWER_BOUND + 0x40)
  1409. #define IPW_EVENT_REG (FW_MEM_REG_LOWER_BOUND + 0x04)
  1410. #define EEPROM_BIT_SK (1<<0)
  1411. #define EEPROM_BIT_CS (1<<1)
  1412. #define EEPROM_BIT_DI (1<<2)
  1413. #define EEPROM_BIT_DO (1<<4)
  1414. #define EEPROM_CMD_READ 0x2
  1415. /* Interrupts masks */
  1416. #define IPW_INTA_NONE 0x00000000
  1417. #define IPW_INTA_BIT_RX_TRANSFER 0x00000002
  1418. #define IPW_INTA_BIT_STATUS_CHANGE 0x00000010
  1419. #define IPW_INTA_BIT_BEACON_PERIOD_EXPIRED 0x00000020
  1420. //Inta Bits for CF
  1421. #define IPW_INTA_BIT_TX_CMD_QUEUE 0x00000800
  1422. #define IPW_INTA_BIT_TX_QUEUE_1 0x00001000
  1423. #define IPW_INTA_BIT_TX_QUEUE_2 0x00002000
  1424. #define IPW_INTA_BIT_TX_QUEUE_3 0x00004000
  1425. #define IPW_INTA_BIT_TX_QUEUE_4 0x00008000
  1426. #define IPW_INTA_BIT_SLAVE_MODE_HOST_CMD_DONE 0x00010000
  1427. #define IPW_INTA_BIT_PREPARE_FOR_POWER_DOWN 0x00100000
  1428. #define IPW_INTA_BIT_POWER_DOWN 0x00200000
  1429. #define IPW_INTA_BIT_FW_INITIALIZATION_DONE 0x01000000
  1430. #define IPW_INTA_BIT_FW_CARD_DISABLE_PHY_OFF_DONE 0x02000000
  1431. #define IPW_INTA_BIT_RF_KILL_DONE 0x04000000
  1432. #define IPW_INTA_BIT_FATAL_ERROR 0x40000000
  1433. #define IPW_INTA_BIT_PARITY_ERROR 0x80000000
  1434. /* Interrupts enabled at init time. */
  1435. #define IPW_INTA_MASK_ALL \
  1436. (IPW_INTA_BIT_TX_QUEUE_1 | \
  1437. IPW_INTA_BIT_TX_QUEUE_2 | \
  1438. IPW_INTA_BIT_TX_QUEUE_3 | \
  1439. IPW_INTA_BIT_TX_QUEUE_4 | \
  1440. IPW_INTA_BIT_TX_CMD_QUEUE | \
  1441. IPW_INTA_BIT_RX_TRANSFER | \
  1442. IPW_INTA_BIT_FATAL_ERROR | \
  1443. IPW_INTA_BIT_PARITY_ERROR | \
  1444. IPW_INTA_BIT_STATUS_CHANGE | \
  1445. IPW_INTA_BIT_FW_INITIALIZATION_DONE | \
  1446. IPW_INTA_BIT_BEACON_PERIOD_EXPIRED | \
  1447. IPW_INTA_BIT_SLAVE_MODE_HOST_CMD_DONE | \
  1448. IPW_INTA_BIT_PREPARE_FOR_POWER_DOWN | \
  1449. IPW_INTA_BIT_POWER_DOWN | \
  1450. IPW_INTA_BIT_RF_KILL_DONE )
  1451. /* FW event log definitions */
  1452. #define EVENT_ELEM_SIZE (3 * sizeof(u32))
  1453. #define EVENT_START_OFFSET (1 * sizeof(u32) + 2 * sizeof(u16))
  1454. /* FW error log definitions */
  1455. #define ERROR_ELEM_SIZE (7 * sizeof(u32))
  1456. #define ERROR_START_OFFSET (1 * sizeof(u32))
  1457. /* TX power level (dbm) */
  1458. #define IPW_TX_POWER_MIN -12
  1459. #define IPW_TX_POWER_MAX 20
  1460. #define IPW_TX_POWER_DEFAULT IPW_TX_POWER_MAX
  1461. enum {
  1462. IPW_FW_ERROR_OK = 0,
  1463. IPW_FW_ERROR_FAIL,
  1464. IPW_FW_ERROR_MEMORY_UNDERFLOW,
  1465. IPW_FW_ERROR_MEMORY_OVERFLOW,
  1466. IPW_FW_ERROR_BAD_PARAM,
  1467. IPW_FW_ERROR_BAD_CHECKSUM,
  1468. IPW_FW_ERROR_NMI_INTERRUPT,
  1469. IPW_FW_ERROR_BAD_DATABASE,
  1470. IPW_FW_ERROR_ALLOC_FAIL,
  1471. IPW_FW_ERROR_DMA_UNDERRUN,
  1472. IPW_FW_ERROR_DMA_STATUS,
  1473. IPW_FW_ERROR_DINO_ERROR,
  1474. IPW_FW_ERROR_EEPROM_ERROR,
  1475. IPW_FW_ERROR_SYSASSERT,
  1476. IPW_FW_ERROR_FATAL_ERROR
  1477. };
  1478. #define AUTH_OPEN 0
  1479. #define AUTH_SHARED_KEY 1
  1480. #define AUTH_LEAP 2
  1481. #define AUTH_IGNORE 3
  1482. #define HC_ASSOCIATE 0
  1483. #define HC_REASSOCIATE 1
  1484. #define HC_DISASSOCIATE 2
  1485. #define HC_IBSS_START 3
  1486. #define HC_IBSS_RECONF 4
  1487. #define HC_DISASSOC_QUIET 5
  1488. #define HC_QOS_SUPPORT_ASSOC cpu_to_le16(0x01)
  1489. #define IPW_RATE_CAPABILITIES 1
  1490. #define IPW_RATE_CONNECT 0
  1491. /*
  1492. * Rate values and masks
  1493. */
  1494. #define IPW_TX_RATE_1MB 0x0A
  1495. #define IPW_TX_RATE_2MB 0x14
  1496. #define IPW_TX_RATE_5MB 0x37
  1497. #define IPW_TX_RATE_6MB 0x0D
  1498. #define IPW_TX_RATE_9MB 0x0F
  1499. #define IPW_TX_RATE_11MB 0x6E
  1500. #define IPW_TX_RATE_12MB 0x05
  1501. #define IPW_TX_RATE_18MB 0x07
  1502. #define IPW_TX_RATE_24MB 0x09
  1503. #define IPW_TX_RATE_36MB 0x0B
  1504. #define IPW_TX_RATE_48MB 0x01
  1505. #define IPW_TX_RATE_54MB 0x03
  1506. #define IPW_ORD_TABLE_ID_MASK 0x0000FF00
  1507. #define IPW_ORD_TABLE_VALUE_MASK 0x000000FF
  1508. #define IPW_ORD_TABLE_0_MASK 0x0000F000
  1509. #define IPW_ORD_TABLE_1_MASK 0x0000F100
  1510. #define IPW_ORD_TABLE_2_MASK 0x0000F200
  1511. #define IPW_ORD_TABLE_3_MASK 0x0000F300
  1512. #define IPW_ORD_TABLE_4_MASK 0x0000F400
  1513. #define IPW_ORD_TABLE_5_MASK 0x0000F500
  1514. #define IPW_ORD_TABLE_6_MASK 0x0000F600
  1515. #define IPW_ORD_TABLE_7_MASK 0x0000F700
  1516. /*
  1517. * Table 0 Entries (all entries are 32 bits)
  1518. */
  1519. enum {
  1520. IPW_ORD_STAT_TX_CURR_RATE = IPW_ORD_TABLE_0_MASK + 1,
  1521. IPW_ORD_STAT_FRAG_TRESHOLD,
  1522. IPW_ORD_STAT_RTS_THRESHOLD,
  1523. IPW_ORD_STAT_TX_HOST_REQUESTS,
  1524. IPW_ORD_STAT_TX_HOST_COMPLETE,
  1525. IPW_ORD_STAT_TX_DIR_DATA,
  1526. IPW_ORD_STAT_TX_DIR_DATA_B_1,
  1527. IPW_ORD_STAT_TX_DIR_DATA_B_2,
  1528. IPW_ORD_STAT_TX_DIR_DATA_B_5_5,
  1529. IPW_ORD_STAT_TX_DIR_DATA_B_11,
  1530. /* Hole */
  1531. IPW_ORD_STAT_TX_DIR_DATA_G_1 = IPW_ORD_TABLE_0_MASK + 19,
  1532. IPW_ORD_STAT_TX_DIR_DATA_G_2,
  1533. IPW_ORD_STAT_TX_DIR_DATA_G_5_5,
  1534. IPW_ORD_STAT_TX_DIR_DATA_G_6,
  1535. IPW_ORD_STAT_TX_DIR_DATA_G_9,
  1536. IPW_ORD_STAT_TX_DIR_DATA_G_11,
  1537. IPW_ORD_STAT_TX_DIR_DATA_G_12,
  1538. IPW_ORD_STAT_TX_DIR_DATA_G_18,
  1539. IPW_ORD_STAT_TX_DIR_DATA_G_24,
  1540. IPW_ORD_STAT_TX_DIR_DATA_G_36,
  1541. IPW_ORD_STAT_TX_DIR_DATA_G_48,
  1542. IPW_ORD_STAT_TX_DIR_DATA_G_54,
  1543. IPW_ORD_STAT_TX_NON_DIR_DATA,
  1544. IPW_ORD_STAT_TX_NON_DIR_DATA_B_1,
  1545. IPW_ORD_STAT_TX_NON_DIR_DATA_B_2,
  1546. IPW_ORD_STAT_TX_NON_DIR_DATA_B_5_5,
  1547. IPW_ORD_STAT_TX_NON_DIR_DATA_B_11,
  1548. /* Hole */
  1549. IPW_ORD_STAT_TX_NON_DIR_DATA_G_1 = IPW_ORD_TABLE_0_MASK + 44,
  1550. IPW_ORD_STAT_TX_NON_DIR_DATA_G_2,
  1551. IPW_ORD_STAT_TX_NON_DIR_DATA_G_5_5,
  1552. IPW_ORD_STAT_TX_NON_DIR_DATA_G_6,
  1553. IPW_ORD_STAT_TX_NON_DIR_DATA_G_9,
  1554. IPW_ORD_STAT_TX_NON_DIR_DATA_G_11,
  1555. IPW_ORD_STAT_TX_NON_DIR_DATA_G_12,
  1556. IPW_ORD_STAT_TX_NON_DIR_DATA_G_18,
  1557. IPW_ORD_STAT_TX_NON_DIR_DATA_G_24,
  1558. IPW_ORD_STAT_TX_NON_DIR_DATA_G_36,
  1559. IPW_ORD_STAT_TX_NON_DIR_DATA_G_48,
  1560. IPW_ORD_STAT_TX_NON_DIR_DATA_G_54,
  1561. IPW_ORD_STAT_TX_RETRY,
  1562. IPW_ORD_STAT_TX_FAILURE,
  1563. IPW_ORD_STAT_RX_ERR_CRC,
  1564. IPW_ORD_STAT_RX_ERR_ICV,
  1565. IPW_ORD_STAT_RX_NO_BUFFER,
  1566. IPW_ORD_STAT_FULL_SCANS,
  1567. IPW_ORD_STAT_PARTIAL_SCANS,
  1568. IPW_ORD_STAT_TGH_ABORTED_SCANS,
  1569. IPW_ORD_STAT_TX_TOTAL_BYTES,
  1570. IPW_ORD_STAT_CURR_RSSI_RAW,
  1571. IPW_ORD_STAT_RX_BEACON,
  1572. IPW_ORD_STAT_MISSED_BEACONS,
  1573. IPW_ORD_TABLE_0_LAST
  1574. };
  1575. #define IPW_RSSI_TO_DBM 112
  1576. /* Table 1 Entries
  1577. */
  1578. enum {
  1579. IPW_ORD_TABLE_1_LAST = IPW_ORD_TABLE_1_MASK | 1,
  1580. };
  1581. /*
  1582. * Table 2 Entries
  1583. *
  1584. * FW_VERSION: 16 byte string
  1585. * FW_DATE: 16 byte string (only 14 bytes used)
  1586. * UCODE_VERSION: 4 byte version code
  1587. * UCODE_DATE: 5 bytes code code
  1588. * ADDAPTER_MAC: 6 byte MAC address
  1589. * RTC: 4 byte clock
  1590. */
  1591. enum {
  1592. IPW_ORD_STAT_FW_VERSION = IPW_ORD_TABLE_2_MASK | 1,
  1593. IPW_ORD_STAT_FW_DATE,
  1594. IPW_ORD_STAT_UCODE_VERSION,
  1595. IPW_ORD_STAT_UCODE_DATE,
  1596. IPW_ORD_STAT_ADAPTER_MAC,
  1597. IPW_ORD_STAT_RTC,
  1598. IPW_ORD_TABLE_2_LAST
  1599. };
  1600. /* Table 3 */
  1601. enum {
  1602. IPW_ORD_STAT_TX_PACKET = IPW_ORD_TABLE_3_MASK | 0,
  1603. IPW_ORD_STAT_TX_PACKET_FAILURE,
  1604. IPW_ORD_STAT_TX_PACKET_SUCCESS,
  1605. IPW_ORD_STAT_TX_PACKET_ABORTED,
  1606. IPW_ORD_TABLE_3_LAST
  1607. };
  1608. /* Table 4 */
  1609. enum {
  1610. IPW_ORD_TABLE_4_LAST = IPW_ORD_TABLE_4_MASK
  1611. };
  1612. /* Table 5 */
  1613. enum {
  1614. IPW_ORD_STAT_AVAILABLE_AP_COUNT = IPW_ORD_TABLE_5_MASK,
  1615. IPW_ORD_STAT_AP_ASSNS,
  1616. IPW_ORD_STAT_ROAM,
  1617. IPW_ORD_STAT_ROAM_CAUSE_MISSED_BEACONS,
  1618. IPW_ORD_STAT_ROAM_CAUSE_UNASSOC,
  1619. IPW_ORD_STAT_ROAM_CAUSE_RSSI,
  1620. IPW_ORD_STAT_ROAM_CAUSE_LINK_QUALITY,
  1621. IPW_ORD_STAT_ROAM_CAUSE_AP_LOAD_BALANCE,
  1622. IPW_ORD_STAT_ROAM_CAUSE_AP_NO_TX,
  1623. IPW_ORD_STAT_LINK_UP,
  1624. IPW_ORD_STAT_LINK_DOWN,
  1625. IPW_ORD_ANTENNA_DIVERSITY,
  1626. IPW_ORD_CURR_FREQ,
  1627. IPW_ORD_TABLE_5_LAST
  1628. };
  1629. /* Table 6 */
  1630. enum {
  1631. IPW_ORD_COUNTRY_CODE = IPW_ORD_TABLE_6_MASK,
  1632. IPW_ORD_CURR_BSSID,
  1633. IPW_ORD_CURR_SSID,
  1634. IPW_ORD_TABLE_6_LAST
  1635. };
  1636. /* Table 7 */
  1637. enum {
  1638. IPW_ORD_STAT_PERCENT_MISSED_BEACONS = IPW_ORD_TABLE_7_MASK,
  1639. IPW_ORD_STAT_PERCENT_TX_RETRIES,
  1640. IPW_ORD_STAT_PERCENT_LINK_QUALITY,
  1641. IPW_ORD_STAT_CURR_RSSI_DBM,
  1642. IPW_ORD_TABLE_7_LAST
  1643. };
  1644. #define IPW_ERROR_LOG (IPW_SHARED_LOWER_BOUND + 0x410)
  1645. #define IPW_EVENT_LOG (IPW_SHARED_LOWER_BOUND + 0x414)
  1646. #define IPW_ORDINALS_TABLE_LOWER (IPW_SHARED_LOWER_BOUND + 0x500)
  1647. #define IPW_ORDINALS_TABLE_0 (IPW_SHARED_LOWER_BOUND + 0x180)
  1648. #define IPW_ORDINALS_TABLE_1 (IPW_SHARED_LOWER_BOUND + 0x184)
  1649. #define IPW_ORDINALS_TABLE_2 (IPW_SHARED_LOWER_BOUND + 0x188)
  1650. #define IPW_MEM_FIXED_OVERRIDE (IPW_SHARED_LOWER_BOUND + 0x41C)
  1651. struct ipw_fixed_rate {
  1652. __le16 tx_rates;
  1653. __le16 reserved;
  1654. } __packed;
  1655. #define IPW_INDIRECT_ADDR_MASK (~0x3ul)
  1656. struct host_cmd {
  1657. u8 cmd;
  1658. u8 len;
  1659. u16 reserved;
  1660. const u32 *param;
  1661. } __packed; /* XXX */
  1662. struct cmdlog_host_cmd {
  1663. u8 cmd;
  1664. u8 len;
  1665. __le16 reserved;
  1666. char param[124];
  1667. } __packed;
  1668. struct ipw_cmd_log {
  1669. unsigned long jiffies;
  1670. int retcode;
  1671. struct cmdlog_host_cmd cmd;
  1672. };
  1673. /* SysConfig command parameters ... */
  1674. /* bt_coexistence param */
  1675. #define CFG_BT_COEXISTENCE_SIGNAL_CHNL 0x01 /* tell BT our chnl # */
  1676. #define CFG_BT_COEXISTENCE_DEFER 0x02 /* defer our Tx if BT traffic */
  1677. #define CFG_BT_COEXISTENCE_KILL 0x04 /* kill our Tx if BT traffic */
  1678. #define CFG_BT_COEXISTENCE_WME_OVER_BT 0x08 /* multimedia extensions */
  1679. #define CFG_BT_COEXISTENCE_OOB 0x10 /* signal BT via out-of-band */
  1680. /* clear-to-send to self param */
  1681. #define CFG_CTS_TO_ITSELF_ENABLED_MIN 0x00
  1682. #define CFG_CTS_TO_ITSELF_ENABLED_MAX 0x01
  1683. #define CFG_CTS_TO_ITSELF_ENABLED_DEF CFG_CTS_TO_ITSELF_ENABLED_MIN
  1684. /* Antenna diversity param (h/w can select best antenna, based on signal) */
  1685. #define CFG_SYS_ANTENNA_BOTH 0x00 /* NIC selects best antenna */
  1686. #define CFG_SYS_ANTENNA_A 0x01 /* force antenna A */
  1687. #define CFG_SYS_ANTENNA_B 0x03 /* force antenna B */
  1688. #define CFG_SYS_ANTENNA_SLOW_DIV 0x02 /* consider background noise */
  1689. #define IPW_MAX_CONFIG_RETRIES 10
  1690. #endif /* __ipw2200_h__ */