iwl-hw.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of version 2 of the GNU Geeral Public License as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  22. * USA
  23. *
  24. * The full GNU General Public License is included in this distribution
  25. * in the file called LICENSE.GPL.
  26. *
  27. * Contact Information:
  28. * James P. Ketrenos <ipw2100-admin@linux.intel.com>
  29. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  30. *
  31. * BSD LICENSE
  32. *
  33. * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
  34. * All rights reserved.
  35. *
  36. * Redistribution and use in source and binary forms, with or without
  37. * modification, are permitted provided that the following conditions
  38. * are met:
  39. *
  40. * * Redistributions of source code must retain the above copyright
  41. * notice, this list of conditions and the following disclaimer.
  42. * * Redistributions in binary form must reproduce the above copyright
  43. * notice, this list of conditions and the following disclaimer in
  44. * the documentation and/or other materials provided with the
  45. * distribution.
  46. * * Neither the name Intel Corporation nor the names of its
  47. * contributors may be used to endorse or promote products derived
  48. * from this software without specific prior written permission.
  49. *
  50. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  51. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  52. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  53. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  54. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  55. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  56. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  57. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  58. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  59. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  60. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61. *****************************************************************************/
  62. #ifndef __iwlwifi_hw_h__
  63. #define __iwlwifi_hw_h__
  64. /*
  65. * This file defines hardware constants common to 3945 and 4965.
  66. *
  67. * Device-specific constants are defined in iwl-3945-hw.h and iwl-4965-hw.h,
  68. * although this file contains a few definitions for which the .c
  69. * implementation is the same for 3945 and 4965, except for the value of
  70. * a constant.
  71. *
  72. * uCode API constants are defined in iwl-commands.h.
  73. *
  74. * NOTE: DO NOT PUT OS IMPLEMENTATION-SPECIFIC DECLARATIONS HERE
  75. *
  76. * The iwl-*hw.h (and files they include) files should remain OS/driver
  77. * implementation independent, declaring only the hardware interface.
  78. */
  79. /* uCode queue management definitions */
  80. #define IWL_CMD_QUEUE_NUM 4
  81. #define IWL_CMD_FIFO_NUM 4
  82. #define IWL_BACK_QUEUE_FIRST_ID 7
  83. /* Tx rates */
  84. #define IWL_CCK_RATES 4
  85. #define IWL_OFDM_RATES 8
  86. #if IWL == 3945
  87. #define IWL_HT_RATES 0
  88. #elif IWL == 4965
  89. #define IWL_HT_RATES 16
  90. #endif
  91. #define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES)
  92. /* Time constants */
  93. #define SHORT_SLOT_TIME 9
  94. #define LONG_SLOT_TIME 20
  95. /* RSSI to dBm */
  96. #if IWL == 3945
  97. #define IWL_RSSI_OFFSET 95
  98. #elif IWL == 4965
  99. #define IWL_RSSI_OFFSET 44
  100. #endif
  101. #include "iwl-eeprom.h"
  102. #include "iwl-commands.h"
  103. #define PCI_LINK_CTRL 0x0F0
  104. #define PCI_POWER_SOURCE 0x0C8
  105. #define PCI_REG_WUM8 0x0E8
  106. #define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000)
  107. /*=== CSR (control and status registers) ===*/
  108. #define CSR_BASE (0x000)
  109. #define CSR_SW_VER (CSR_BASE+0x000)
  110. #define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) /* hardware interface config */
  111. #define CSR_INT_COALESCING (CSR_BASE+0x004) /* accum ints, 32-usec units */
  112. #define CSR_INT (CSR_BASE+0x008) /* host interrupt status/ack */
  113. #define CSR_INT_MASK (CSR_BASE+0x00c) /* host interrupt enable */
  114. #define CSR_FH_INT_STATUS (CSR_BASE+0x010) /* busmaster int status/ack*/
  115. #define CSR_GPIO_IN (CSR_BASE+0x018) /* read external chip pins */
  116. #define CSR_RESET (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
  117. #define CSR_GP_CNTRL (CSR_BASE+0x024)
  118. #define CSR_HW_REV (CSR_BASE+0x028)
  119. #define CSR_EEPROM_REG (CSR_BASE+0x02c)
  120. #define CSR_EEPROM_GP (CSR_BASE+0x030)
  121. #define CSR_GP_UCODE (CSR_BASE+0x044)
  122. #define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054)
  123. #define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058)
  124. #define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c)
  125. #define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060)
  126. #define CSR_LED_REG (CSR_BASE+0x094)
  127. #define CSR_DRAM_INT_TBL_CTL (CSR_BASE+0x0A0)
  128. #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)
  129. #define CSR_ANA_PLL_CFG (CSR_BASE+0x20c)
  130. #define CSR_HW_REV_WA_REG (CSR_BASE+0x22C)
  131. /* HW I/F configuration */
  132. #define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB (0x00000100)
  133. #define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM (0x00000200)
  134. #define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC (0x00000400)
  135. #define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE (0x00000800)
  136. #define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000)
  137. #define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000)
  138. #define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
  139. /* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
  140. * acknowledged (reset) by host writing "1" to flagged bits. */
  141. #define CSR_INT_BIT_FH_RX (1<<31) /* Rx DMA, cmd responses, FH_INT[17:16] */
  142. #define CSR_INT_BIT_HW_ERR (1<<29) /* DMA hardware error FH_INT[31] */
  143. #define CSR_INT_BIT_DNLD (1<<28) /* uCode Download */
  144. #define CSR_INT_BIT_FH_TX (1<<27) /* Tx DMA FH_INT[1:0] */
  145. #define CSR_INT_BIT_MAC_CLK_ACTV (1<<26) /* NIC controller's clock toggled on/off */
  146. #define CSR_INT_BIT_SW_ERR (1<<25) /* uCode error */
  147. #define CSR_INT_BIT_RF_KILL (1<<7) /* HW RFKILL switch GP_CNTRL[27] toggled */
  148. #define CSR_INT_BIT_CT_KILL (1<<6) /* Critical temp (chip too hot) rfkill */
  149. #define CSR_INT_BIT_SW_RX (1<<3) /* Rx, command responses, 3945 */
  150. #define CSR_INT_BIT_WAKEUP (1<<1) /* NIC controller waking up (pwr mgmt) */
  151. #define CSR_INT_BIT_ALIVE (1<<0) /* uCode interrupts once it initializes */
  152. #define CSR_INI_SET_MASK (CSR_INT_BIT_FH_RX | \
  153. CSR_INT_BIT_HW_ERR | \
  154. CSR_INT_BIT_FH_TX | \
  155. CSR_INT_BIT_SW_ERR | \
  156. CSR_INT_BIT_RF_KILL | \
  157. CSR_INT_BIT_SW_RX | \
  158. CSR_INT_BIT_WAKEUP | \
  159. CSR_INT_BIT_ALIVE)
  160. /* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
  161. #define CSR_FH_INT_BIT_ERR (1<<31) /* Error */
  162. #define CSR_FH_INT_BIT_HI_PRIOR (1<<30) /* High priority Rx, bypass coalescing */
  163. #define CSR_FH_INT_BIT_RX_CHNL2 (1<<18) /* Rx channel 2 (3945 only) */
  164. #define CSR_FH_INT_BIT_RX_CHNL1 (1<<17) /* Rx channel 1 */
  165. #define CSR_FH_INT_BIT_RX_CHNL0 (1<<16) /* Rx channel 0 */
  166. #define CSR_FH_INT_BIT_TX_CHNL6 (1<<6) /* Tx channel 6 (3945 only) */
  167. #define CSR_FH_INT_BIT_TX_CHNL1 (1<<1) /* Tx channel 1 */
  168. #define CSR_FH_INT_BIT_TX_CHNL0 (1<<0) /* Tx channel 0 */
  169. #define CSR_FH_INT_RX_MASK (CSR_FH_INT_BIT_HI_PRIOR | \
  170. CSR_FH_INT_BIT_RX_CHNL2 | \
  171. CSR_FH_INT_BIT_RX_CHNL1 | \
  172. CSR_FH_INT_BIT_RX_CHNL0)
  173. #define CSR_FH_INT_TX_MASK (CSR_FH_INT_BIT_TX_CHNL6 | \
  174. CSR_FH_INT_BIT_TX_CHNL1 | \
  175. CSR_FH_INT_BIT_TX_CHNL0 )
  176. /* RESET */
  177. #define CSR_RESET_REG_FLAG_NEVO_RESET (0x00000001)
  178. #define CSR_RESET_REG_FLAG_FORCE_NMI (0x00000002)
  179. #define CSR_RESET_REG_FLAG_SW_RESET (0x00000080)
  180. #define CSR_RESET_REG_FLAG_MASTER_DISABLED (0x00000100)
  181. #define CSR_RESET_REG_FLAG_STOP_MASTER (0x00000200)
  182. /* GP (general purpose) CONTROL */
  183. #define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY (0x00000001)
  184. #define CSR_GP_CNTRL_REG_FLAG_INIT_DONE (0x00000004)
  185. #define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ (0x00000008)
  186. #define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010)
  187. #define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001)
  188. #define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000)
  189. #define CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE (0x04000000)
  190. #define CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW (0x08000000)
  191. /* EEPROM REG */
  192. #define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001)
  193. #define CSR_EEPROM_REG_BIT_CMD (0x00000002)
  194. /* EEPROM GP */
  195. #define CSR_EEPROM_GP_VALID_MSK (0x00000006)
  196. #define CSR_EEPROM_GP_BAD_SIGNATURE (0x00000000)
  197. #define CSR_EEPROM_GP_IF_OWNER_MSK (0x00000180)
  198. /* UCODE DRV GP */
  199. #define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001)
  200. #define CSR_UCODE_SW_BIT_RFKILL (0x00000002)
  201. #define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004)
  202. #define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT (0x00000008)
  203. /* GPIO */
  204. #define CSR_GPIO_IN_BIT_AUX_POWER (0x00000200)
  205. #define CSR_GPIO_IN_VAL_VAUX_PWR_SRC (0x00000000)
  206. #define CSR_GPIO_IN_VAL_VMAIN_PWR_SRC CSR_GPIO_IN_BIT_AUX_POWER
  207. /* GI Chicken Bits */
  208. #define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000)
  209. #define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER (0x20000000)
  210. /* CSR_ANA_PLL_CFG */
  211. #define CSR_ANA_PLL_CFG_SH (0x00880300)
  212. #define CSR_LED_REG_TRUN_ON (0x00000078)
  213. #define CSR_LED_REG_TRUN_OFF (0x00000038)
  214. #define CSR_LED_BSM_CTRL_MSK (0xFFFFFFDF)
  215. /* DRAM_INT_TBL_CTRL */
  216. #define CSR_DRAM_INT_TBL_CTRL_EN (1<<31)
  217. #define CSR_DRAM_INT_TBL_CTRL_WRAP_CHK (1<<27)
  218. /*=== HBUS (Host-side Bus) ===*/
  219. #define HBUS_BASE (0x400)
  220. #define HBUS_TARG_MEM_RADDR (HBUS_BASE+0x00c)
  221. #define HBUS_TARG_MEM_WADDR (HBUS_BASE+0x010)
  222. #define HBUS_TARG_MEM_WDAT (HBUS_BASE+0x018)
  223. #define HBUS_TARG_MEM_RDAT (HBUS_BASE+0x01c)
  224. #define HBUS_TARG_PRPH_WADDR (HBUS_BASE+0x044)
  225. #define HBUS_TARG_PRPH_RADDR (HBUS_BASE+0x048)
  226. #define HBUS_TARG_PRPH_WDAT (HBUS_BASE+0x04c)
  227. #define HBUS_TARG_PRPH_RDAT (HBUS_BASE+0x050)
  228. #define HBUS_TARG_WRPTR (HBUS_BASE+0x060)
  229. #define HBUS_TARG_MBX_C (HBUS_BASE+0x030)
  230. /* SCD (Scheduler) */
  231. #define SCD_BASE (CSR_BASE + 0x2E00)
  232. #define SCD_MODE_REG (SCD_BASE + 0x000)
  233. #define SCD_ARASTAT_REG (SCD_BASE + 0x004)
  234. #define SCD_TXFACT_REG (SCD_BASE + 0x010)
  235. #define SCD_TXF4MF_REG (SCD_BASE + 0x014)
  236. #define SCD_TXF5MF_REG (SCD_BASE + 0x020)
  237. #define SCD_SBYP_MODE_1_REG (SCD_BASE + 0x02C)
  238. #define SCD_SBYP_MODE_2_REG (SCD_BASE + 0x030)
  239. /*=== FH (data Flow Handler) ===*/
  240. #define FH_BASE (0x800)
  241. #define FH_CBCC_TABLE (FH_BASE+0x140)
  242. #define FH_TFDB_TABLE (FH_BASE+0x180)
  243. #define FH_RCSR_TABLE (FH_BASE+0x400)
  244. #define FH_RSSR_TABLE (FH_BASE+0x4c0)
  245. #define FH_TCSR_TABLE (FH_BASE+0x500)
  246. #define FH_TSSR_TABLE (FH_BASE+0x680)
  247. /* TFDB (Transmit Frame Buffer Descriptor) */
  248. #define FH_TFDB(_channel, buf) \
  249. (FH_TFDB_TABLE+((_channel)*2+(buf))*0x28)
  250. #define ALM_FH_TFDB_CHNL_BUF_CTRL_REG(_channel) \
  251. (FH_TFDB_TABLE + 0x50 * _channel)
  252. /* CBCC _channel is [0,2] */
  253. #define FH_CBCC(_channel) (FH_CBCC_TABLE+(_channel)*0x8)
  254. #define FH_CBCC_CTRL(_channel) (FH_CBCC(_channel)+0x00)
  255. #define FH_CBCC_BASE(_channel) (FH_CBCC(_channel)+0x04)
  256. /* RCSR _channel is [0,2] */
  257. #define FH_RCSR(_channel) (FH_RCSR_TABLE+(_channel)*0x40)
  258. #define FH_RCSR_CONFIG(_channel) (FH_RCSR(_channel)+0x00)
  259. #define FH_RCSR_RBD_BASE(_channel) (FH_RCSR(_channel)+0x04)
  260. #define FH_RCSR_WPTR(_channel) (FH_RCSR(_channel)+0x20)
  261. #define FH_RCSR_RPTR_ADDR(_channel) (FH_RCSR(_channel)+0x24)
  262. #if IWL == 3945
  263. #define FH_RSCSR_CHNL0_WPTR (FH_RCSR_WPTR(0))
  264. #elif IWL == 4965
  265. #define FH_RSCSR_CHNL0_WPTR (FH_RSCSR_CHNL0_RBDCB_WPTR_REG)
  266. #endif
  267. /* RSSR */
  268. #define FH_RSSR_CTRL (FH_RSSR_TABLE+0x000)
  269. #define FH_RSSR_STATUS (FH_RSSR_TABLE+0x004)
  270. /* TCSR */
  271. #define FH_TCSR(_channel) (FH_TCSR_TABLE+(_channel)*0x20)
  272. #define FH_TCSR_CONFIG(_channel) (FH_TCSR(_channel)+0x00)
  273. #define FH_TCSR_CREDIT(_channel) (FH_TCSR(_channel)+0x04)
  274. #define FH_TCSR_BUFF_STTS(_channel) (FH_TCSR(_channel)+0x08)
  275. /* TSSR */
  276. #define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000)
  277. #define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008)
  278. #define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010)
  279. /* 18 - reserved */
  280. /* card static random access memory (SRAM) for processor data and instructs */
  281. #define RTC_INST_LOWER_BOUND (0x000000)
  282. #define RTC_DATA_LOWER_BOUND (0x800000)
  283. /* DBM */
  284. #define ALM_FH_SRVC_CHNL (6)
  285. #define ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE (20)
  286. #define ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH (4)
  287. #define ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN (0x08000000)
  288. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE (0x80000000)
  289. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE (0x20000000)
  290. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 (0x01000000)
  291. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST (0x00001000)
  292. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH (0x00000000)
  293. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF (0x00000000)
  294. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER (0x00000001)
  295. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL (0x00000000)
  296. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008)
  297. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD (0x00200000)
  298. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT (0x00000000)
  299. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE (0x00000000)
  300. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000)
  301. #define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID (0x00004000)
  302. #define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR (0x00000001)
  303. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON (0xFF000000)
  304. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON (0x00FF0000)
  305. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B (0x00000400)
  306. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON (0x00000100)
  307. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON (0x00000080)
  308. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH (0x00000020)
  309. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH (0x00000005)
  310. #define ALM_TB_MAX_BYTES_COUNT (0xFFF0)
  311. #define ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) \
  312. ((1LU << _channel) << 24)
  313. #define ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel) \
  314. ((1LU << _channel) << 16)
  315. #define ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_channel) \
  316. (ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) | \
  317. ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel))
  318. #define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */
  319. #define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */
  320. #define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004)
  321. #define TFD_QUEUE_MIN 0
  322. #define TFD_QUEUE_MAX 6
  323. #define TFD_QUEUE_SIZE_MAX (256)
  324. /* spectrum and channel data structures */
  325. #define IWL_NUM_SCAN_RATES (2)
  326. #define IWL_SCAN_FLAG_24GHZ (1<<0)
  327. #define IWL_SCAN_FLAG_52GHZ (1<<1)
  328. #define IWL_SCAN_FLAG_ACTIVE (1<<2)
  329. #define IWL_SCAN_FLAG_DIRECT (1<<3)
  330. #define IWL_MAX_CMD_SIZE 1024
  331. #define IWL_DEFAULT_TX_RETRY 15
  332. #define IWL_MAX_TX_RETRY 16
  333. /*********************************************/
  334. #define RFD_SIZE 4
  335. #define NUM_TFD_CHUNKS 4
  336. #define RX_QUEUE_SIZE 256
  337. #define RX_QUEUE_MASK 255
  338. #define RX_QUEUE_SIZE_LOG 8
  339. /* QoS definitions */
  340. #define CW_MIN_OFDM 15
  341. #define CW_MAX_OFDM 1023
  342. #define CW_MIN_CCK 31
  343. #define CW_MAX_CCK 1023
  344. #define QOS_TX0_CW_MIN_OFDM CW_MIN_OFDM
  345. #define QOS_TX1_CW_MIN_OFDM CW_MIN_OFDM
  346. #define QOS_TX2_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
  347. #define QOS_TX3_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 4 - 1)
  348. #define QOS_TX0_CW_MIN_CCK CW_MIN_CCK
  349. #define QOS_TX1_CW_MIN_CCK CW_MIN_CCK
  350. #define QOS_TX2_CW_MIN_CCK ((CW_MIN_CCK + 1) / 2 - 1)
  351. #define QOS_TX3_CW_MIN_CCK ((CW_MIN_CCK + 1) / 4 - 1)
  352. #define QOS_TX0_CW_MAX_OFDM CW_MAX_OFDM
  353. #define QOS_TX1_CW_MAX_OFDM CW_MAX_OFDM
  354. #define QOS_TX2_CW_MAX_OFDM CW_MIN_OFDM
  355. #define QOS_TX3_CW_MAX_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
  356. #define QOS_TX0_CW_MAX_CCK CW_MAX_CCK
  357. #define QOS_TX1_CW_MAX_CCK CW_MAX_CCK
  358. #define QOS_TX2_CW_MAX_CCK CW_MIN_CCK
  359. #define QOS_TX3_CW_MAX_CCK ((CW_MIN_CCK + 1) / 2 - 1)
  360. #define QOS_TX0_AIFS 3
  361. #define QOS_TX1_AIFS 7
  362. #define QOS_TX2_AIFS 2
  363. #define QOS_TX3_AIFS 2
  364. #define QOS_TX0_ACM 0
  365. #define QOS_TX1_ACM 0
  366. #define QOS_TX2_ACM 0
  367. #define QOS_TX3_ACM 0
  368. #define QOS_TX0_TXOP_LIMIT_CCK 0
  369. #define QOS_TX1_TXOP_LIMIT_CCK 0
  370. #define QOS_TX2_TXOP_LIMIT_CCK 6016
  371. #define QOS_TX3_TXOP_LIMIT_CCK 3264
  372. #define QOS_TX0_TXOP_LIMIT_OFDM 0
  373. #define QOS_TX1_TXOP_LIMIT_OFDM 0
  374. #define QOS_TX2_TXOP_LIMIT_OFDM 3008
  375. #define QOS_TX3_TXOP_LIMIT_OFDM 1504
  376. #define DEF_TX0_CW_MIN_OFDM CW_MIN_OFDM
  377. #define DEF_TX1_CW_MIN_OFDM CW_MIN_OFDM
  378. #define DEF_TX2_CW_MIN_OFDM CW_MIN_OFDM
  379. #define DEF_TX3_CW_MIN_OFDM CW_MIN_OFDM
  380. #define DEF_TX0_CW_MIN_CCK CW_MIN_CCK
  381. #define DEF_TX1_CW_MIN_CCK CW_MIN_CCK
  382. #define DEF_TX2_CW_MIN_CCK CW_MIN_CCK
  383. #define DEF_TX3_CW_MIN_CCK CW_MIN_CCK
  384. #define DEF_TX0_CW_MAX_OFDM CW_MAX_OFDM
  385. #define DEF_TX1_CW_MAX_OFDM CW_MAX_OFDM
  386. #define DEF_TX2_CW_MAX_OFDM CW_MAX_OFDM
  387. #define DEF_TX3_CW_MAX_OFDM CW_MAX_OFDM
  388. #define DEF_TX0_CW_MAX_CCK CW_MAX_CCK
  389. #define DEF_TX1_CW_MAX_CCK CW_MAX_CCK
  390. #define DEF_TX2_CW_MAX_CCK CW_MAX_CCK
  391. #define DEF_TX3_CW_MAX_CCK CW_MAX_CCK
  392. #define DEF_TX0_AIFS (2)
  393. #define DEF_TX1_AIFS (2)
  394. #define DEF_TX2_AIFS (2)
  395. #define DEF_TX3_AIFS (2)
  396. #define DEF_TX0_ACM 0
  397. #define DEF_TX1_ACM 0
  398. #define DEF_TX2_ACM 0
  399. #define DEF_TX3_ACM 0
  400. #define DEF_TX0_TXOP_LIMIT_CCK 0
  401. #define DEF_TX1_TXOP_LIMIT_CCK 0
  402. #define DEF_TX2_TXOP_LIMIT_CCK 0
  403. #define DEF_TX3_TXOP_LIMIT_CCK 0
  404. #define DEF_TX0_TXOP_LIMIT_OFDM 0
  405. #define DEF_TX1_TXOP_LIMIT_OFDM 0
  406. #define DEF_TX2_TXOP_LIMIT_OFDM 0
  407. #define DEF_TX3_TXOP_LIMIT_OFDM 0
  408. #define QOS_QOS_SETS 3
  409. #define QOS_PARAM_SET_ACTIVE 0
  410. #define QOS_PARAM_SET_DEF_CCK 1
  411. #define QOS_PARAM_SET_DEF_OFDM 2
  412. #define CTRL_QOS_NO_ACK (0x0020)
  413. #define DCT_FLAG_EXT_QOS_ENABLED (0x10)
  414. #define U32_PAD(n) ((4-(n))&0x3)
  415. /*
  416. * Generic queue structure
  417. *
  418. * Contains common data for Rx and Tx queues
  419. */
  420. #define TFD_CTL_COUNT_SET(n) (n<<24)
  421. #define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7)
  422. #define TFD_CTL_PAD_SET(n) (n<<28)
  423. #define TFD_CTL_PAD_GET(ctl) (ctl>>28)
  424. #define TFD_TX_CMD_SLOTS 256
  425. #define TFD_CMD_SLOTS 32
  426. #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
  427. sizeof(struct iwl_cmd_meta))
  428. /*
  429. * RX related structures and functions
  430. */
  431. #define RX_FREE_BUFFERS 64
  432. #define RX_LOW_WATERMARK 8
  433. #endif /* __iwlwifi_hw_h__ */