reg.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (c) 1998-2007 Texas Instruments Incorporated
  5. * Copyright (C) 2008 Nokia Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. *
  21. */
  22. #ifndef __REG_H__
  23. #define __REG_H__
  24. #include <linux/bitops.h>
  25. #define REGISTERS_BASE 0x00300000
  26. #define DRPW_BASE 0x00310000
  27. #define REGISTERS_DOWN_SIZE 0x00008800
  28. #define REGISTERS_WORK_SIZE 0x0000b000
  29. #define HW_ACCESS_ELP_CTRL_REG_ADDR 0x1FFFC
  30. /* ELP register commands */
  31. #define ELPCTRL_WAKE_UP 0x1
  32. #define ELPCTRL_WAKE_UP_WLAN_READY 0x5
  33. #define ELPCTRL_SLEEP 0x0
  34. /* ELP WLAN_READY bit */
  35. #define ELPCTRL_WLAN_READY 0x2
  36. /* Device Configuration registers*/
  37. #define SOR_CFG (REGISTERS_BASE + 0x0800)
  38. #define ECPU_CTRL (REGISTERS_BASE + 0x0804)
  39. #define HI_CFG (REGISTERS_BASE + 0x0808)
  40. /* EEPROM registers */
  41. #define EE_START (REGISTERS_BASE + 0x080C)
  42. #define EE_CTL (REGISTERS_BASE + 0x2000)
  43. #define EE_DATA (REGISTERS_BASE + 0x2004)
  44. #define EE_ADDR (REGISTERS_BASE + 0x2008)
  45. #define EE_CTL_READ 2
  46. #define CHIP_ID_B (REGISTERS_BASE + 0x5674)
  47. #define CHIP_ID_1251_PG10 (0x7010101)
  48. #define CHIP_ID_1251_PG11 (0x7020101)
  49. #define CHIP_ID_1251_PG12 (0x7030101)
  50. #define ENABLE (REGISTERS_BASE + 0x5450)
  51. /* Power Management registers */
  52. #define ELP_CFG_MODE (REGISTERS_BASE + 0x5804)
  53. #define ELP_CMD (REGISTERS_BASE + 0x5808)
  54. #define PLL_CAL_TIME (REGISTERS_BASE + 0x5810)
  55. #define CLK_REQ_TIME (REGISTERS_BASE + 0x5814)
  56. #define CLK_BUF_TIME (REGISTERS_BASE + 0x5818)
  57. #define CFG_PLL_SYNC_CNT (REGISTERS_BASE + 0x5820)
  58. /* Scratch Pad registers*/
  59. #define SCR_PAD0 (REGISTERS_BASE + 0x5608)
  60. #define SCR_PAD1 (REGISTERS_BASE + 0x560C)
  61. #define SCR_PAD2 (REGISTERS_BASE + 0x5610)
  62. #define SCR_PAD3 (REGISTERS_BASE + 0x5614)
  63. #define SCR_PAD4 (REGISTERS_BASE + 0x5618)
  64. #define SCR_PAD4_SET (REGISTERS_BASE + 0x561C)
  65. #define SCR_PAD4_CLR (REGISTERS_BASE + 0x5620)
  66. #define SCR_PAD5 (REGISTERS_BASE + 0x5624)
  67. #define SCR_PAD5_SET (REGISTERS_BASE + 0x5628)
  68. #define SCR_PAD5_CLR (REGISTERS_BASE + 0x562C)
  69. #define SCR_PAD6 (REGISTERS_BASE + 0x5630)
  70. #define SCR_PAD7 (REGISTERS_BASE + 0x5634)
  71. #define SCR_PAD8 (REGISTERS_BASE + 0x5638)
  72. #define SCR_PAD9 (REGISTERS_BASE + 0x563C)
  73. /* Spare registers*/
  74. #define SPARE_A1 (REGISTERS_BASE + 0x0994)
  75. #define SPARE_A2 (REGISTERS_BASE + 0x0998)
  76. #define SPARE_A3 (REGISTERS_BASE + 0x099C)
  77. #define SPARE_A4 (REGISTERS_BASE + 0x09A0)
  78. #define SPARE_A5 (REGISTERS_BASE + 0x09A4)
  79. #define SPARE_A6 (REGISTERS_BASE + 0x09A8)
  80. #define SPARE_A7 (REGISTERS_BASE + 0x09AC)
  81. #define SPARE_A8 (REGISTERS_BASE + 0x09B0)
  82. #define SPARE_B1 (REGISTERS_BASE + 0x5420)
  83. #define SPARE_B2 (REGISTERS_BASE + 0x5424)
  84. #define SPARE_B3 (REGISTERS_BASE + 0x5428)
  85. #define SPARE_B4 (REGISTERS_BASE + 0x542C)
  86. #define SPARE_B5 (REGISTERS_BASE + 0x5430)
  87. #define SPARE_B6 (REGISTERS_BASE + 0x5434)
  88. #define SPARE_B7 (REGISTERS_BASE + 0x5438)
  89. #define SPARE_B8 (REGISTERS_BASE + 0x543C)
  90. enum wl12xx_acx_int_reg {
  91. ACX_REG_INTERRUPT_TRIG,
  92. ACX_REG_INTERRUPT_TRIG_H,
  93. /*=============================================
  94. Host Interrupt Mask Register - 32bit (RW)
  95. ------------------------------------------
  96. Setting a bit in this register masks the
  97. corresponding interrupt to the host.
  98. 0 - RX0 - Rx first dubble buffer Data Interrupt
  99. 1 - TXD - Tx Data Interrupt
  100. 2 - TXXFR - Tx Transfer Interrupt
  101. 3 - RX1 - Rx second dubble buffer Data Interrupt
  102. 4 - RXXFR - Rx Transfer Interrupt
  103. 5 - EVENT_A - Event Mailbox interrupt
  104. 6 - EVENT_B - Event Mailbox interrupt
  105. 7 - WNONHST - Wake On Host Interrupt
  106. 8 - TRACE_A - Debug Trace interrupt
  107. 9 - TRACE_B - Debug Trace interrupt
  108. 10 - CDCMP - Command Complete Interrupt
  109. 11 -
  110. 12 -
  111. 13 -
  112. 14 - ICOMP - Initialization Complete Interrupt
  113. 16 - SG SE - Soft Gemini - Sense enable interrupt
  114. 17 - SG SD - Soft Gemini - Sense disable interrupt
  115. 18 - -
  116. 19 - -
  117. 20 - -
  118. 21- -
  119. Default: 0x0001
  120. *==============================================*/
  121. ACX_REG_INTERRUPT_MASK,
  122. /*=============================================
  123. Host Interrupt Mask Set 16bit, (Write only)
  124. ------------------------------------------
  125. Setting a bit in this register sets
  126. the corresponding bin in ACX_HINT_MASK register
  127. without effecting the mask
  128. state of other bits (0 = no effect).
  129. ==============================================*/
  130. ACX_REG_HINT_MASK_SET,
  131. /*=============================================
  132. Host Interrupt Mask Clear 16bit,(Write only)
  133. ------------------------------------------
  134. Setting a bit in this register clears
  135. the corresponding bin in ACX_HINT_MASK register
  136. without effecting the mask
  137. state of other bits (0 = no effect).
  138. =============================================*/
  139. ACX_REG_HINT_MASK_CLR,
  140. /*=============================================
  141. Host Interrupt Status Nondestructive Read
  142. 16bit,(Read only)
  143. ------------------------------------------
  144. The host can read this register to determine
  145. which interrupts are active.
  146. Reading this register doesn't
  147. effect its content.
  148. =============================================*/
  149. ACX_REG_INTERRUPT_NO_CLEAR,
  150. /*=============================================
  151. Host Interrupt Status Clear on Read Register
  152. 16bit,(Read only)
  153. ------------------------------------------
  154. The host can read this register to determine
  155. which interrupts are active.
  156. Reading this register clears it,
  157. thus making all interrupts inactive.
  158. ==============================================*/
  159. ACX_REG_INTERRUPT_CLEAR,
  160. /*=============================================
  161. Host Interrupt Acknowledge Register
  162. 16bit,(Write only)
  163. ------------------------------------------
  164. The host can set individual bits in this
  165. register to clear (acknowledge) the corresp.
  166. interrupt status bits in the HINT_STS_CLR and
  167. HINT_STS_ND registers, thus making the
  168. assotiated interrupt inactive. (0-no effect)
  169. ==============================================*/
  170. ACX_REG_INTERRUPT_ACK,
  171. /*===============================================
  172. Host Software Reset - 32bit RW
  173. ------------------------------------------
  174. [31:1] Reserved
  175. 0 SOFT_RESET Soft Reset - When this bit is set,
  176. it holds the Wlan hardware in a soft reset state.
  177. This reset disables all MAC and baseband processor
  178. clocks except the CardBus/PCI interface clock.
  179. It also initializes all MAC state machines except
  180. the host interface. It does not reload the
  181. contents of the EEPROM. When this bit is cleared
  182. (not self-clearing), the Wlan hardware
  183. exits the software reset state.
  184. ===============================================*/
  185. ACX_REG_SLV_SOFT_RESET,
  186. /*===============================================
  187. EEPROM Burst Read Start - 32bit RW
  188. ------------------------------------------
  189. [31:1] Reserved
  190. 0 ACX_EE_START - EEPROM Burst Read Start 0
  191. Setting this bit starts a burst read from
  192. the external EEPROM.
  193. If this bit is set (after reset) before an EEPROM read/write,
  194. the burst read starts at EEPROM address 0.
  195. Otherwise, it starts at the address
  196. following the address of the previous access.
  197. TheWlan hardware hardware clears this bit automatically.
  198. Default: 0x00000000
  199. *================================================*/
  200. ACX_REG_EE_START,
  201. /* Embedded ARM CPU Control */
  202. /*===============================================
  203. Halt eCPU - 32bit RW
  204. ------------------------------------------
  205. 0 HALT_ECPU Halt Embedded CPU - This bit is the
  206. compliment of bit 1 (MDATA2) in the SOR_CFG register.
  207. During a hardware reset, this bit holds
  208. the inverse of MDATA2.
  209. When downloading firmware from the host,
  210. set this bit (pull down MDATA2).
  211. The host clears this bit after downloading the firmware into
  212. zero-wait-state SSRAM.
  213. When loading firmware from Flash, clear this bit (pull up MDATA2)
  214. so that the eCPU can run the bootloader code in Flash
  215. HALT_ECPU eCPU State
  216. --------------------
  217. 1 halt eCPU
  218. 0 enable eCPU
  219. ===============================================*/
  220. ACX_REG_ECPU_CONTROL,
  221. ACX_REG_TABLE_LEN
  222. };
  223. #define ACX_SLV_SOFT_RESET_BIT BIT(0)
  224. #define ACX_REG_EEPROM_START_BIT BIT(0)
  225. /* Command/Information Mailbox Pointers */
  226. /*===============================================
  227. Command Mailbox Pointer - 32bit RW
  228. ------------------------------------------
  229. This register holds the start address of
  230. the command mailbox located in the Wlan hardware memory.
  231. The host must read this pointer after a reset to
  232. find the location of the command mailbox.
  233. The Wlan hardware initializes the command mailbox
  234. pointer with the default address of the command mailbox.
  235. The command mailbox pointer is not valid until after
  236. the host receives the Init Complete interrupt from
  237. the Wlan hardware.
  238. ===============================================*/
  239. #define REG_COMMAND_MAILBOX_PTR (SCR_PAD0)
  240. /*===============================================
  241. Information Mailbox Pointer - 32bit RW
  242. ------------------------------------------
  243. This register holds the start address of
  244. the information mailbox located in the Wlan hardware memory.
  245. The host must read this pointer after a reset to find
  246. the location of the information mailbox.
  247. The Wlan hardware initializes the information mailbox pointer
  248. with the default address of the information mailbox.
  249. The information mailbox pointer is not valid
  250. until after the host receives the Init Complete interrupt from
  251. the Wlan hardware.
  252. ===============================================*/
  253. #define REG_EVENT_MAILBOX_PTR (SCR_PAD1)
  254. /* Misc */
  255. #define REG_ENABLE_TX_RX (ENABLE)
  256. /*
  257. * Rx configuration (filter) information element
  258. * ---------------------------------------------
  259. */
  260. #define REG_RX_CONFIG (RX_CFG)
  261. #define REG_RX_FILTER (RX_FILTER_CFG)
  262. #define RX_CFG_ENABLE_PHY_HEADER_PLCP 0x0002
  263. /* promiscuous - receives all valid frames */
  264. #define RX_CFG_PROMISCUOUS 0x0008
  265. /* receives frames from any BSSID */
  266. #define RX_CFG_BSSID 0x0020
  267. /* receives frames destined to any MAC address */
  268. #define RX_CFG_MAC 0x0010
  269. #define RX_CFG_ENABLE_ONLY_MY_DEST_MAC 0x0010
  270. #define RX_CFG_ENABLE_ANY_DEST_MAC 0x0000
  271. #define RX_CFG_ENABLE_ONLY_MY_BSSID 0x0020
  272. #define RX_CFG_ENABLE_ANY_BSSID 0x0000
  273. /* discards all broadcast frames */
  274. #define RX_CFG_DISABLE_BCAST 0x0200
  275. #define RX_CFG_ENABLE_ONLY_MY_SSID 0x0400
  276. #define RX_CFG_ENABLE_RX_CMPLT_FCS_ERROR 0x0800
  277. #define RX_CFG_COPY_RX_STATUS 0x2000
  278. #define RX_CFG_TSF 0x10000
  279. #define RX_CONFIG_OPTION_ANY_DST_MY_BSS (RX_CFG_ENABLE_ANY_DEST_MAC | \
  280. RX_CFG_ENABLE_ONLY_MY_BSSID)
  281. #define RX_CONFIG_OPTION_MY_DST_ANY_BSS (RX_CFG_ENABLE_ONLY_MY_DEST_MAC\
  282. | RX_CFG_ENABLE_ANY_BSSID)
  283. #define RX_CONFIG_OPTION_ANY_DST_ANY_BSS (RX_CFG_ENABLE_ANY_DEST_MAC | \
  284. RX_CFG_ENABLE_ANY_BSSID)
  285. #define RX_CONFIG_OPTION_MY_DST_MY_BSS (RX_CFG_ENABLE_ONLY_MY_DEST_MAC\
  286. | RX_CFG_ENABLE_ONLY_MY_BSSID)
  287. #define RX_CONFIG_OPTION_FOR_SCAN (RX_CFG_ENABLE_PHY_HEADER_PLCP \
  288. | RX_CFG_ENABLE_RX_CMPLT_FCS_ERROR \
  289. | RX_CFG_COPY_RX_STATUS | RX_CFG_TSF)
  290. #define RX_CONFIG_OPTION_FOR_MEASUREMENT (RX_CFG_ENABLE_ANY_DEST_MAC)
  291. #define RX_CONFIG_OPTION_FOR_JOIN (RX_CFG_ENABLE_ONLY_MY_BSSID | \
  292. RX_CFG_ENABLE_ONLY_MY_DEST_MAC)
  293. #define RX_CONFIG_OPTION_FOR_IBSS_JOIN (RX_CFG_ENABLE_ONLY_MY_SSID | \
  294. RX_CFG_ENABLE_ONLY_MY_DEST_MAC)
  295. #define RX_FILTER_OPTION_DEF (CFG_RX_MGMT_EN | CFG_RX_DATA_EN\
  296. | CFG_RX_CTL_EN | CFG_RX_BCN_EN\
  297. | CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN)
  298. #define RX_FILTER_OPTION_FILTER_ALL 0
  299. #define RX_FILTER_OPTION_DEF_PRSP_BCN (CFG_RX_PRSP_EN | CFG_RX_MGMT_EN\
  300. | CFG_RX_RCTS_ACK | CFG_RX_BCN_EN)
  301. #define RX_FILTER_OPTION_JOIN (CFG_RX_MGMT_EN | CFG_RX_DATA_EN\
  302. | CFG_RX_BCN_EN | CFG_RX_AUTH_EN\
  303. | CFG_RX_ASSOC_EN | CFG_RX_RCTS_ACK\
  304. | CFG_RX_PRSP_EN)
  305. /*===============================================
  306. EEPROM Read/Write Request 32bit RW
  307. ------------------------------------------
  308. 1 EE_READ - EEPROM Read Request 1 - Setting this bit
  309. loads a single byte of data into the EE_DATA
  310. register from the EEPROM location specified in
  311. the EE_ADDR register.
  312. The Wlan hardware hardware clears this bit automatically.
  313. EE_DATA is valid when this bit is cleared.
  314. 0 EE_WRITE - EEPROM Write Request - Setting this bit
  315. writes a single byte of data from the EE_DATA register into the
  316. EEPROM location specified in the EE_ADDR register.
  317. The Wlan hardware hardware clears this bit automatically.
  318. *===============================================*/
  319. #define EE_CTL (REGISTERS_BASE + 0x2000)
  320. #define ACX_EE_CTL_REG EE_CTL
  321. #define EE_WRITE 0x00000001ul
  322. #define EE_READ 0x00000002ul
  323. /*===============================================
  324. EEPROM Address - 32bit RW
  325. ------------------------------------------
  326. This register specifies the address
  327. within the EEPROM from/to which to read/write data.
  328. ===============================================*/
  329. #define EE_ADDR (REGISTERS_BASE + 0x2008)
  330. #define ACX_EE_ADDR_REG EE_ADDR
  331. /*===============================================
  332. EEPROM Data - 32bit RW
  333. ------------------------------------------
  334. This register either holds the read 8 bits of
  335. data from the EEPROM or the write data
  336. to be written to the EEPROM.
  337. ===============================================*/
  338. #define EE_DATA (REGISTERS_BASE + 0x2004)
  339. #define ACX_EE_DATA_REG EE_DATA
  340. #define EEPROM_ACCESS_TO 10000 /* timeout counter */
  341. #define START_EEPROM_MGR 0x00000001
  342. /*===============================================
  343. EEPROM Base Address - 32bit RW
  344. ------------------------------------------
  345. This register holds the upper nine bits
  346. [23:15] of the 24-bit Wlan hardware memory
  347. address for burst reads from EEPROM accesses.
  348. The EEPROM provides the lower 15 bits of this address.
  349. The MSB of the address from the EEPROM is ignored.
  350. ===============================================*/
  351. #define ACX_EE_CFG EE_CFG
  352. /*===============================================
  353. GPIO Output Values -32bit, RW
  354. ------------------------------------------
  355. [31:16] Reserved
  356. [15: 0] Specify the output values (at the output driver inputs) for
  357. GPIO[15:0], respectively.
  358. ===============================================*/
  359. #define ACX_GPIO_OUT_REG GPIO_OUT
  360. #define ACX_MAX_GPIO_LINES 15
  361. /*===============================================
  362. Contention window -32bit, RW
  363. ------------------------------------------
  364. [31:26] Reserved
  365. [25:16] Max (0x3ff)
  366. [15:07] Reserved
  367. [06:00] Current contention window value - default is 0x1F
  368. ===============================================*/
  369. #define ACX_CONT_WIND_CFG_REG CONT_WIND_CFG
  370. #define ACX_CONT_WIND_MIN_MASK 0x0000007f
  371. #define ACX_CONT_WIND_MAX 0x03ff0000
  372. /*===============================================
  373. HI_CFG Interface Configuration Register Values
  374. ------------------------------------------
  375. ===============================================*/
  376. #define HI_CFG_UART_ENABLE 0x00000004
  377. #define HI_CFG_RST232_ENABLE 0x00000008
  378. #define HI_CFG_CLOCK_REQ_SELECT 0x00000010
  379. #define HI_CFG_HOST_INT_ENABLE 0x00000020
  380. #define HI_CFG_VLYNQ_OUTPUT_ENABLE 0x00000040
  381. #define HI_CFG_HOST_INT_ACTIVE_LOW 0x00000080
  382. #define HI_CFG_UART_TX_OUT_GPIO_15 0x00000100
  383. #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200
  384. #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400
  385. /*
  386. * NOTE: USE_ACTIVE_HIGH compilation flag should be defined in makefile
  387. * for platforms using active high interrupt level
  388. */
  389. #ifdef USE_ACTIVE_HIGH
  390. #define HI_CFG_DEF_VAL \
  391. (HI_CFG_UART_ENABLE | \
  392. HI_CFG_RST232_ENABLE | \
  393. HI_CFG_CLOCK_REQ_SELECT | \
  394. HI_CFG_HOST_INT_ENABLE)
  395. #else
  396. #define HI_CFG_DEF_VAL \
  397. (HI_CFG_UART_ENABLE | \
  398. HI_CFG_RST232_ENABLE | \
  399. HI_CFG_CLOCK_REQ_SELECT | \
  400. HI_CFG_HOST_INT_ENABLE)
  401. #endif
  402. #define REF_FREQ_19_2 0
  403. #define REF_FREQ_26_0 1
  404. #define REF_FREQ_38_4 2
  405. #define REF_FREQ_40_0 3
  406. #define REF_FREQ_33_6 4
  407. #define REF_FREQ_NUM 5
  408. #define LUT_PARAM_INTEGER_DIVIDER 0
  409. #define LUT_PARAM_FRACTIONAL_DIVIDER 1
  410. #define LUT_PARAM_ATTN_BB 2
  411. #define LUT_PARAM_ALPHA_BB 3
  412. #define LUT_PARAM_STOP_TIME_BB 4
  413. #define LUT_PARAM_BB_PLL_LOOP_FILTER 5
  414. #define LUT_PARAM_NUM 6
  415. #define ACX_EEPROMLESS_IND_REG (SCR_PAD4)
  416. #define USE_EEPROM 0
  417. #define SOFT_RESET_MAX_TIME 1000000
  418. #define SOFT_RESET_STALL_TIME 1000
  419. #define NVS_DATA_BUNDARY_ALIGNMENT 4
  420. /* Firmware image load chunk size */
  421. #define CHUNK_SIZE 512
  422. /* Firmware image header size */
  423. #define FW_HDR_SIZE 8
  424. #define ECPU_CONTROL_HALT 0x00000101
  425. /******************************************************************************
  426. CHANNELS, BAND & REG DOMAINS definitions
  427. ******************************************************************************/
  428. enum {
  429. RADIO_BAND_2_4GHZ = 0, /* 2.4 Ghz band */
  430. RADIO_BAND_5GHZ = 1, /* 5 Ghz band */
  431. RADIO_BAND_JAPAN_4_9_GHZ = 2,
  432. DEFAULT_BAND = RADIO_BAND_2_4GHZ,
  433. INVALID_BAND = 0xFE,
  434. MAX_RADIO_BANDS = 0xFF
  435. };
  436. enum {
  437. NO_RATE = 0,
  438. RATE_1MBPS = 0x0A,
  439. RATE_2MBPS = 0x14,
  440. RATE_5_5MBPS = 0x37,
  441. RATE_6MBPS = 0x0B,
  442. RATE_9MBPS = 0x0F,
  443. RATE_11MBPS = 0x6E,
  444. RATE_12MBPS = 0x0A,
  445. RATE_18MBPS = 0x0E,
  446. RATE_22MBPS = 0xDC,
  447. RATE_24MBPS = 0x09,
  448. RATE_36MBPS = 0x0D,
  449. RATE_48MBPS = 0x08,
  450. RATE_54MBPS = 0x0C
  451. };
  452. enum {
  453. RATE_INDEX_1MBPS = 0,
  454. RATE_INDEX_2MBPS = 1,
  455. RATE_INDEX_5_5MBPS = 2,
  456. RATE_INDEX_6MBPS = 3,
  457. RATE_INDEX_9MBPS = 4,
  458. RATE_INDEX_11MBPS = 5,
  459. RATE_INDEX_12MBPS = 6,
  460. RATE_INDEX_18MBPS = 7,
  461. RATE_INDEX_22MBPS = 8,
  462. RATE_INDEX_24MBPS = 9,
  463. RATE_INDEX_36MBPS = 10,
  464. RATE_INDEX_48MBPS = 11,
  465. RATE_INDEX_54MBPS = 12,
  466. RATE_INDEX_MAX = RATE_INDEX_54MBPS,
  467. MAX_RATE_INDEX,
  468. INVALID_RATE_INDEX = MAX_RATE_INDEX,
  469. RATE_INDEX_ENUM_MAX_SIZE = 0x7FFFFFFF
  470. };
  471. enum {
  472. RATE_MASK_1MBPS = 0x1,
  473. RATE_MASK_2MBPS = 0x2,
  474. RATE_MASK_5_5MBPS = 0x4,
  475. RATE_MASK_11MBPS = 0x20,
  476. };
  477. #define SHORT_PREAMBLE_BIT BIT(0) /* CCK or Barker depending on the rate */
  478. #define OFDM_RATE_BIT BIT(6)
  479. #define PBCC_RATE_BIT BIT(7)
  480. enum {
  481. CCK_LONG = 0,
  482. CCK_SHORT = SHORT_PREAMBLE_BIT,
  483. PBCC_LONG = PBCC_RATE_BIT,
  484. PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
  485. OFDM = OFDM_RATE_BIT
  486. };
  487. /******************************************************************************
  488. Transmit-Descriptor RATE-SET field definitions...
  489. Define a new "Rate-Set" for TX path that incorporates the
  490. Rate & Modulation info into a single 16-bit field.
  491. TxdRateSet_t:
  492. b15 - Indicates Preamble type (1=SHORT, 0=LONG).
  493. Notes:
  494. Must be LONG (0) for 1Mbps rate.
  495. Does not apply (set to 0) for RevG-OFDM rates.
  496. b14 - Indicates PBCC encoding (1=PBCC, 0=not).
  497. Notes:
  498. Does not apply (set to 0) for rates 1 and 2 Mbps.
  499. Does not apply (set to 0) for RevG-OFDM rates.
  500. b13 - Unused (set to 0).
  501. b12-b0 - Supported Rate indicator bits as defined below.
  502. ******************************************************************************/
  503. /*************************************************************************
  504. Interrupt Trigger Register (Host -> WiLink)
  505. **************************************************************************/
  506. /* Hardware to Embedded CPU Interrupts - first 32-bit register set */
  507. /*
  508. * Host Command Interrupt. Setting this bit masks
  509. * the interrupt that the host issues to inform
  510. * the FW that it has sent a command
  511. * to the Wlan hardware Command Mailbox.
  512. */
  513. #define INTR_TRIG_CMD BIT(0)
  514. /*
  515. * Host Event Acknowlegde Interrupt. The host
  516. * sets this bit to acknowledge that it received
  517. * the unsolicited information from the event
  518. * mailbox.
  519. */
  520. #define INTR_TRIG_EVENT_ACK BIT(1)
  521. /*
  522. * The host sets this bit to inform the Wlan
  523. * FW that a TX packet is in the XFER
  524. * Buffer #0.
  525. */
  526. #define INTR_TRIG_TX_PROC0 BIT(2)
  527. /*
  528. * The host sets this bit to inform the FW
  529. * that it read a packet from RX XFER
  530. * Buffer #0.
  531. */
  532. #define INTR_TRIG_RX_PROC0 BIT(3)
  533. #define INTR_TRIG_DEBUG_ACK BIT(4)
  534. #define INTR_TRIG_STATE_CHANGED BIT(5)
  535. /* Hardware to Embedded CPU Interrupts - second 32-bit register set */
  536. /*
  537. * The host sets this bit to inform the FW
  538. * that it read a packet from RX XFER
  539. * Buffer #1.
  540. */
  541. #define INTR_TRIG_RX_PROC1 BIT(17)
  542. /*
  543. * The host sets this bit to inform the Wlan
  544. * hardware that a TX packet is in the XFER
  545. * Buffer #1.
  546. */
  547. #define INTR_TRIG_TX_PROC1 BIT(18)
  548. #endif