reg.h 21 KB

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