ipw2200.h 58 KB

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