iwl-3945-hw.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  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 General 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. *****************************************************************************/
  63. #ifndef __iwl_3945_hw__
  64. #define __iwl_3945_hw__
  65. /* uCode queue management definitions */
  66. #define IWL_CMD_QUEUE_NUM 4
  67. #define IWL_CMD_FIFO_NUM 4
  68. #define IWL_BACK_QUEUE_FIRST_ID 7
  69. /* Tx rates */
  70. #define IWL_CCK_RATES 4
  71. #define IWL_OFDM_RATES 8
  72. #define IWL_HT_RATES 0
  73. #define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES)
  74. /* Time constants */
  75. #define SHORT_SLOT_TIME 9
  76. #define LONG_SLOT_TIME 20
  77. /* RSSI to dBm */
  78. #define IWL_RSSI_OFFSET 95
  79. /*
  80. * EEPROM related constants, enums, and structures.
  81. */
  82. /*
  83. * EEPROM access time values:
  84. *
  85. * Driver initiates EEPROM read by writing byte address << 1 to CSR_EEPROM_REG,
  86. * then clearing (with subsequent read/modify/write) CSR_EEPROM_REG bit
  87. * CSR_EEPROM_REG_BIT_CMD (0x2).
  88. * Driver then polls CSR_EEPROM_REG for CSR_EEPROM_REG_READ_VALID_MSK (0x1).
  89. * When polling, wait 10 uSec between polling loops, up to a maximum 5000 uSec.
  90. * Driver reads 16-bit value from bits 31-16 of CSR_EEPROM_REG.
  91. */
  92. #define IWL_EEPROM_ACCESS_TIMEOUT 5000 /* uSec */
  93. #define IWL_EEPROM_ACCESS_DELAY 10 /* uSec */
  94. /* EEPROM field values */
  95. #define ANTENNA_SWITCH_NORMAL 0
  96. #define ANTENNA_SWITCH_INVERSE 1
  97. /*
  98. * Regulatory channel usage flags in EEPROM struct iwl_eeprom_channel.flags.
  99. *
  100. * IBSS and/or AP operation is allowed *only* on those channels with
  101. * (VALID && IBSS && ACTIVE && !RADAR). This restriction is in place because
  102. * RADAR detection is not supported by the 3945 driver, but is a
  103. * requirement for establishing a new network for legal operation on channels
  104. * requiring RADAR detection or restricting ACTIVE scanning.
  105. *
  106. * NOTE: "WIDE" flag indicates that 20 MHz channel is supported;
  107. * 3945 does not support FAT 40 MHz-wide channels.
  108. *
  109. * NOTE: Using a channel inappropriately will result in a uCode error!
  110. */
  111. enum {
  112. EEPROM_CHANNEL_VALID = (1 << 0), /* usable for this SKU/geo */
  113. EEPROM_CHANNEL_IBSS = (1 << 1), /* usable as an IBSS channel */
  114. /* Bit 2 Reserved */
  115. EEPROM_CHANNEL_ACTIVE = (1 << 3), /* active scanning allowed */
  116. EEPROM_CHANNEL_RADAR = (1 << 4), /* radar detection required */
  117. EEPROM_CHANNEL_WIDE = (1 << 5), /* 20 MHz channel okay */
  118. EEPROM_CHANNEL_NARROW = (1 << 6), /* 10 MHz channel, not used */
  119. EEPROM_CHANNEL_DFS = (1 << 7), /* dynamic freq selection candidate */
  120. };
  121. /* EEPROM field lengths */
  122. #define EEPROM_BOARD_PBA_NUMBER_LENGTH 11
  123. /* EEPROM field lengths */
  124. #define EEPROM_BOARD_PBA_NUMBER_LENGTH 11
  125. #define EEPROM_REGULATORY_SKU_ID_LENGTH 4
  126. #define EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH 14
  127. #define EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH 13
  128. #define EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH 12
  129. #define EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH 11
  130. #define EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH 6
  131. #define EEPROM_REGULATORY_CHANNELS_LENGTH ( \
  132. EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH + \
  133. EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH + \
  134. EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH + \
  135. EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH + \
  136. EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH)
  137. #define EEPROM_REGULATORY_NUMBER_OF_BANDS 5
  138. /* SKU Capabilities */
  139. #define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0)
  140. #define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1)
  141. #define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
  142. /* *regulatory* channel data from eeprom, one for each channel */
  143. struct iwl3945_eeprom_channel {
  144. u8 flags; /* flags copied from EEPROM */
  145. s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
  146. } __attribute__ ((packed));
  147. /*
  148. * Mapping of a Tx power level, at factory calibration temperature,
  149. * to a radio/DSP gain table index.
  150. * One for each of 5 "sample" power levels in each band.
  151. * v_det is measured at the factory, using the 3945's built-in power amplifier
  152. * (PA) output voltage detector. This same detector is used during Tx of
  153. * long packets in normal operation to provide feedback as to proper output
  154. * level.
  155. * Data copied from EEPROM.
  156. * DO NOT ALTER THIS STRUCTURE!!!
  157. */
  158. struct iwl3945_eeprom_txpower_sample {
  159. u8 gain_index; /* index into power (gain) setup table ... */
  160. s8 power; /* ... for this pwr level for this chnl group */
  161. u16 v_det; /* PA output voltage */
  162. } __attribute__ ((packed));
  163. /*
  164. * Mappings of Tx power levels -> nominal radio/DSP gain table indexes.
  165. * One for each channel group (a.k.a. "band") (1 for BG, 4 for A).
  166. * Tx power setup code interpolates between the 5 "sample" power levels
  167. * to determine the nominal setup for a requested power level.
  168. * Data copied from EEPROM.
  169. * DO NOT ALTER THIS STRUCTURE!!!
  170. */
  171. struct iwl3945_eeprom_txpower_group {
  172. struct iwl3945_eeprom_txpower_sample samples[5]; /* 5 power levels */
  173. s32 a, b, c, d, e; /* coefficients for voltage->power
  174. * formula (signed) */
  175. s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
  176. * frequency (signed) */
  177. s8 saturation_power; /* highest power possible by h/w in this
  178. * band */
  179. u8 group_channel; /* "representative" channel # in this band */
  180. s16 temperature; /* h/w temperature at factory calib this band
  181. * (signed) */
  182. } __attribute__ ((packed));
  183. /*
  184. * Temperature-based Tx-power compensation data, not band-specific.
  185. * These coefficients are use to modify a/b/c/d/e coeffs based on
  186. * difference between current temperature and factory calib temperature.
  187. * Data copied from EEPROM.
  188. */
  189. struct iwl3945_eeprom_temperature_corr {
  190. u32 Ta;
  191. u32 Tb;
  192. u32 Tc;
  193. u32 Td;
  194. u32 Te;
  195. } __attribute__ ((packed));
  196. /*
  197. * EEPROM map
  198. */
  199. struct iwl3945_eeprom {
  200. u8 reserved0[16];
  201. #define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
  202. u16 device_id; /* abs.ofs: 16 */
  203. u8 reserved1[2];
  204. #define EEPROM_PMC (2*0x0A) /* 2 bytes */
  205. u16 pmc; /* abs.ofs: 20 */
  206. u8 reserved2[20];
  207. #define EEPROM_MAC_ADDRESS (2*0x15) /* 6 bytes */
  208. u8 mac_address[6]; /* abs.ofs: 42 */
  209. u8 reserved3[58];
  210. #define EEPROM_BOARD_REVISION (2*0x35) /* 2 bytes */
  211. u16 board_revision; /* abs.ofs: 106 */
  212. u8 reserved4[11];
  213. #define EEPROM_BOARD_PBA_NUMBER (2*0x3B+1) /* 9 bytes */
  214. u8 board_pba_number[9]; /* abs.ofs: 119 */
  215. u8 reserved5[8];
  216. #define EEPROM_VERSION (2*0x44) /* 2 bytes */
  217. u16 version; /* abs.ofs: 136 */
  218. #define EEPROM_SKU_CAP (2*0x45) /* 1 bytes */
  219. u8 sku_cap; /* abs.ofs: 138 */
  220. #define EEPROM_LEDS_MODE (2*0x45+1) /* 1 bytes */
  221. u8 leds_mode; /* abs.ofs: 139 */
  222. #define EEPROM_OEM_MODE (2*0x46) /* 2 bytes */
  223. u16 oem_mode;
  224. #define EEPROM_WOWLAN_MODE (2*0x47) /* 2 bytes */
  225. u16 wowlan_mode; /* abs.ofs: 142 */
  226. #define EEPROM_LEDS_TIME_INTERVAL (2*0x48) /* 2 bytes */
  227. u16 leds_time_interval; /* abs.ofs: 144 */
  228. #define EEPROM_LEDS_OFF_TIME (2*0x49) /* 1 bytes */
  229. u8 leds_off_time; /* abs.ofs: 146 */
  230. #define EEPROM_LEDS_ON_TIME (2*0x49+1) /* 1 bytes */
  231. u8 leds_on_time; /* abs.ofs: 147 */
  232. #define EEPROM_ALMGOR_M_VERSION (2*0x4A) /* 1 bytes */
  233. u8 almgor_m_version; /* abs.ofs: 148 */
  234. #define EEPROM_ANTENNA_SWITCH_TYPE (2*0x4A+1) /* 1 bytes */
  235. u8 antenna_switch_type; /* abs.ofs: 149 */
  236. u8 reserved6[42];
  237. #define EEPROM_REGULATORY_SKU_ID (2*0x60) /* 4 bytes */
  238. u8 sku_id[4]; /* abs.ofs: 192 */
  239. /*
  240. * Per-channel regulatory data.
  241. *
  242. * Each channel that *might* be supported by 3945 or 4965 has a fixed location
  243. * in EEPROM containing EEPROM_CHANNEL_* usage flags (LSB) and max regulatory
  244. * txpower (MSB).
  245. *
  246. * Entries immediately below are for 20 MHz channel width. FAT (40 MHz)
  247. * channels (only for 4965, not supported by 3945) appear later in the EEPROM.
  248. *
  249. * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
  250. */
  251. #define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
  252. u16 band_1_count; /* abs.ofs: 196 */
  253. #define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
  254. struct iwl3945_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
  255. /*
  256. * 4.9 GHz channels 183, 184, 185, 187, 188, 189, 192, 196,
  257. * 5.0 GHz channels 7, 8, 11, 12, 16
  258. * (4915-5080MHz) (none of these is ever supported)
  259. */
  260. #define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
  261. u16 band_2_count; /* abs.ofs: 226 */
  262. #define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
  263. struct iwl3945_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
  264. /*
  265. * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
  266. * (5170-5320MHz)
  267. */
  268. #define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
  269. u16 band_3_count; /* abs.ofs: 254 */
  270. #define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
  271. struct iwl3945_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
  272. /*
  273. * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
  274. * (5500-5700MHz)
  275. */
  276. #define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
  277. u16 band_4_count; /* abs.ofs: 280 */
  278. #define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
  279. struct iwl3945_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
  280. /*
  281. * 5.7 GHz channels 145, 149, 153, 157, 161, 165
  282. * (5725-5825MHz)
  283. */
  284. #define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
  285. u16 band_5_count; /* abs.ofs: 304 */
  286. #define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
  287. struct iwl3945_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
  288. u8 reserved9[194];
  289. /*
  290. * 3945 Txpower calibration data.
  291. */
  292. #define EEPROM_TXPOWER_CALIB_GROUP0 0x200
  293. #define EEPROM_TXPOWER_CALIB_GROUP1 0x240
  294. #define EEPROM_TXPOWER_CALIB_GROUP2 0x280
  295. #define EEPROM_TXPOWER_CALIB_GROUP3 0x2c0
  296. #define EEPROM_TXPOWER_CALIB_GROUP4 0x300
  297. #define IWL_NUM_TX_CALIB_GROUPS 5
  298. struct iwl3945_eeprom_txpower_group groups[IWL_NUM_TX_CALIB_GROUPS];
  299. /* abs.ofs: 512 */
  300. #define EEPROM_CALIB_TEMPERATURE_CORRECT 0x340
  301. struct iwl3945_eeprom_temperature_corr corrections; /* abs.ofs: 832 */
  302. u8 reserved16[172]; /* fill out to full 1024 byte block */
  303. } __attribute__ ((packed));
  304. #define IWL_EEPROM_IMAGE_SIZE 1024
  305. /* End of EEPROM */
  306. #include "iwl-3945-commands.h"
  307. #define PCI_LINK_CTRL 0x0F0
  308. #define PCI_POWER_SOURCE 0x0C8
  309. #define PCI_REG_WUM8 0x0E8
  310. #define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000)
  311. /*=== CSR (control and status registers) ===*/
  312. #define CSR_BASE (0x000)
  313. #define CSR_SW_VER (CSR_BASE+0x000)
  314. #define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) /* hardware interface config */
  315. #define CSR_INT_COALESCING (CSR_BASE+0x004) /* accum ints, 32-usec units */
  316. #define CSR_INT (CSR_BASE+0x008) /* host interrupt status/ack */
  317. #define CSR_INT_MASK (CSR_BASE+0x00c) /* host interrupt enable */
  318. #define CSR_FH_INT_STATUS (CSR_BASE+0x010) /* busmaster int status/ack*/
  319. #define CSR_GPIO_IN (CSR_BASE+0x018) /* read external chip pins */
  320. #define CSR_RESET (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
  321. #define CSR_GP_CNTRL (CSR_BASE+0x024)
  322. #define CSR_HW_REV (CSR_BASE+0x028)
  323. #define CSR_EEPROM_REG (CSR_BASE+0x02c)
  324. #define CSR_EEPROM_GP (CSR_BASE+0x030)
  325. #define CSR_GP_UCODE (CSR_BASE+0x044)
  326. #define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054)
  327. #define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058)
  328. #define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c)
  329. #define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060)
  330. #define CSR_LED_REG (CSR_BASE+0x094)
  331. #define CSR_DRAM_INT_TBL_CTL (CSR_BASE+0x0A0)
  332. #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)
  333. #define CSR_ANA_PLL_CFG (CSR_BASE+0x20c)
  334. #define CSR_HW_REV_WA_REG (CSR_BASE+0x22C)
  335. /* HW I/F configuration */
  336. #define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB (0x00000100)
  337. #define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM (0x00000200)
  338. #define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC (0x00000400)
  339. #define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE (0x00000800)
  340. #define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000)
  341. #define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000)
  342. #define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
  343. /* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
  344. * acknowledged (reset) by host writing "1" to flagged bits. */
  345. #define CSR_INT_BIT_FH_RX (1<<31) /* Rx DMA, cmd responses, FH_INT[17:16] */
  346. #define CSR_INT_BIT_HW_ERR (1<<29) /* DMA hardware error FH_INT[31] */
  347. #define CSR_INT_BIT_DNLD (1<<28) /* uCode Download */
  348. #define CSR_INT_BIT_FH_TX (1<<27) /* Tx DMA FH_INT[1:0] */
  349. #define CSR_INT_BIT_MAC_CLK_ACTV (1<<26) /* NIC controller's clock toggled on/off */
  350. #define CSR_INT_BIT_SW_ERR (1<<25) /* uCode error */
  351. #define CSR_INT_BIT_RF_KILL (1<<7) /* HW RFKILL switch GP_CNTRL[27] toggled */
  352. #define CSR_INT_BIT_CT_KILL (1<<6) /* Critical temp (chip too hot) rfkill */
  353. #define CSR_INT_BIT_SW_RX (1<<3) /* Rx, command responses, 3945 */
  354. #define CSR_INT_BIT_WAKEUP (1<<1) /* NIC controller waking up (pwr mgmt) */
  355. #define CSR_INT_BIT_ALIVE (1<<0) /* uCode interrupts once it initializes */
  356. #define CSR_INI_SET_MASK (CSR_INT_BIT_FH_RX | \
  357. CSR_INT_BIT_HW_ERR | \
  358. CSR_INT_BIT_FH_TX | \
  359. CSR_INT_BIT_SW_ERR | \
  360. CSR_INT_BIT_RF_KILL | \
  361. CSR_INT_BIT_SW_RX | \
  362. CSR_INT_BIT_WAKEUP | \
  363. CSR_INT_BIT_ALIVE)
  364. /* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
  365. #define CSR_FH_INT_BIT_ERR (1<<31) /* Error */
  366. #define CSR_FH_INT_BIT_HI_PRIOR (1<<30) /* High priority Rx, bypass coalescing */
  367. #define CSR_FH_INT_BIT_RX_CHNL2 (1<<18) /* Rx channel 2 (3945 only) */
  368. #define CSR_FH_INT_BIT_RX_CHNL1 (1<<17) /* Rx channel 1 */
  369. #define CSR_FH_INT_BIT_RX_CHNL0 (1<<16) /* Rx channel 0 */
  370. #define CSR_FH_INT_BIT_TX_CHNL6 (1<<6) /* Tx channel 6 (3945 only) */
  371. #define CSR_FH_INT_BIT_TX_CHNL1 (1<<1) /* Tx channel 1 */
  372. #define CSR_FH_INT_BIT_TX_CHNL0 (1<<0) /* Tx channel 0 */
  373. #define CSR_FH_INT_RX_MASK (CSR_FH_INT_BIT_HI_PRIOR | \
  374. CSR_FH_INT_BIT_RX_CHNL2 | \
  375. CSR_FH_INT_BIT_RX_CHNL1 | \
  376. CSR_FH_INT_BIT_RX_CHNL0)
  377. #define CSR_FH_INT_TX_MASK (CSR_FH_INT_BIT_TX_CHNL6 | \
  378. CSR_FH_INT_BIT_TX_CHNL1 | \
  379. CSR_FH_INT_BIT_TX_CHNL0)
  380. /* RESET */
  381. #define CSR_RESET_REG_FLAG_NEVO_RESET (0x00000001)
  382. #define CSR_RESET_REG_FLAG_FORCE_NMI (0x00000002)
  383. #define CSR_RESET_REG_FLAG_SW_RESET (0x00000080)
  384. #define CSR_RESET_REG_FLAG_MASTER_DISABLED (0x00000100)
  385. #define CSR_RESET_REG_FLAG_STOP_MASTER (0x00000200)
  386. /* GP (general purpose) CONTROL */
  387. #define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY (0x00000001)
  388. #define CSR_GP_CNTRL_REG_FLAG_INIT_DONE (0x00000004)
  389. #define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ (0x00000008)
  390. #define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010)
  391. #define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001)
  392. #define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000)
  393. #define CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE (0x04000000)
  394. #define CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW (0x08000000)
  395. /* EEPROM REG */
  396. #define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001)
  397. #define CSR_EEPROM_REG_BIT_CMD (0x00000002)
  398. /* EEPROM GP */
  399. #define CSR_EEPROM_GP_VALID_MSK (0x00000006)
  400. #define CSR_EEPROM_GP_BAD_SIGNATURE (0x00000000)
  401. #define CSR_EEPROM_GP_IF_OWNER_MSK (0x00000180)
  402. /* UCODE DRV GP */
  403. #define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001)
  404. #define CSR_UCODE_SW_BIT_RFKILL (0x00000002)
  405. #define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004)
  406. #define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT (0x00000008)
  407. /* GPIO */
  408. #define CSR_GPIO_IN_BIT_AUX_POWER (0x00000200)
  409. #define CSR_GPIO_IN_VAL_VAUX_PWR_SRC (0x00000000)
  410. #define CSR_GPIO_IN_VAL_VMAIN_PWR_SRC CSR_GPIO_IN_BIT_AUX_POWER
  411. /* GI Chicken Bits */
  412. #define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000)
  413. #define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER (0x20000000)
  414. /* CSR_ANA_PLL_CFG */
  415. #define CSR_ANA_PLL_CFG_SH (0x00880300)
  416. #define CSR_LED_REG_TRUN_ON (0x00000078)
  417. #define CSR_LED_REG_TRUN_OFF (0x00000038)
  418. #define CSR_LED_BSM_CTRL_MSK (0xFFFFFFDF)
  419. /* DRAM_INT_TBL_CTRL */
  420. #define CSR_DRAM_INT_TBL_CTRL_EN (1<<31)
  421. #define CSR_DRAM_INT_TBL_CTRL_WRAP_CHK (1<<27)
  422. /*=== HBUS (Host-side Bus) ===*/
  423. #define HBUS_BASE (0x400)
  424. #define HBUS_TARG_MEM_RADDR (HBUS_BASE+0x00c)
  425. #define HBUS_TARG_MEM_WADDR (HBUS_BASE+0x010)
  426. #define HBUS_TARG_MEM_WDAT (HBUS_BASE+0x018)
  427. #define HBUS_TARG_MEM_RDAT (HBUS_BASE+0x01c)
  428. #define HBUS_TARG_PRPH_WADDR (HBUS_BASE+0x044)
  429. #define HBUS_TARG_PRPH_RADDR (HBUS_BASE+0x048)
  430. #define HBUS_TARG_PRPH_WDAT (HBUS_BASE+0x04c)
  431. #define HBUS_TARG_PRPH_RDAT (HBUS_BASE+0x050)
  432. #define HBUS_TARG_WRPTR (HBUS_BASE+0x060)
  433. #define HBUS_TARG_MBX_C (HBUS_BASE+0x030)
  434. /* SCD (Scheduler) */
  435. #define SCD_BASE (CSR_BASE + 0x2E00)
  436. #define SCD_MODE_REG (SCD_BASE + 0x000)
  437. #define SCD_ARASTAT_REG (SCD_BASE + 0x004)
  438. #define SCD_TXFACT_REG (SCD_BASE + 0x010)
  439. #define SCD_TXF4MF_REG (SCD_BASE + 0x014)
  440. #define SCD_TXF5MF_REG (SCD_BASE + 0x020)
  441. #define SCD_SBYP_MODE_1_REG (SCD_BASE + 0x02C)
  442. #define SCD_SBYP_MODE_2_REG (SCD_BASE + 0x030)
  443. /*=== FH (data Flow Handler) ===*/
  444. #define FH_BASE (0x800)
  445. #define FH_CBCC_TABLE (FH_BASE+0x140)
  446. #define FH_TFDB_TABLE (FH_BASE+0x180)
  447. #define FH_RCSR_TABLE (FH_BASE+0x400)
  448. #define FH_RSSR_TABLE (FH_BASE+0x4c0)
  449. #define FH_TCSR_TABLE (FH_BASE+0x500)
  450. #define FH_TSSR_TABLE (FH_BASE+0x680)
  451. /* TFDB (Transmit Frame Buffer Descriptor) */
  452. #define FH_TFDB(_channel, buf) \
  453. (FH_TFDB_TABLE+((_channel)*2+(buf))*0x28)
  454. #define ALM_FH_TFDB_CHNL_BUF_CTRL_REG(_channel) \
  455. (FH_TFDB_TABLE + 0x50 * _channel)
  456. /* CBCC _channel is [0,2] */
  457. #define FH_CBCC(_channel) (FH_CBCC_TABLE+(_channel)*0x8)
  458. #define FH_CBCC_CTRL(_channel) (FH_CBCC(_channel)+0x00)
  459. #define FH_CBCC_BASE(_channel) (FH_CBCC(_channel)+0x04)
  460. /* RCSR _channel is [0,2] */
  461. #define FH_RCSR(_channel) (FH_RCSR_TABLE+(_channel)*0x40)
  462. #define FH_RCSR_CONFIG(_channel) (FH_RCSR(_channel)+0x00)
  463. #define FH_RCSR_RBD_BASE(_channel) (FH_RCSR(_channel)+0x04)
  464. #define FH_RCSR_WPTR(_channel) (FH_RCSR(_channel)+0x20)
  465. #define FH_RCSR_RPTR_ADDR(_channel) (FH_RCSR(_channel)+0x24)
  466. #define FH_RSCSR_CHNL0_WPTR (FH_RCSR_WPTR(0))
  467. /* RSSR */
  468. #define FH_RSSR_CTRL (FH_RSSR_TABLE+0x000)
  469. #define FH_RSSR_STATUS (FH_RSSR_TABLE+0x004)
  470. /* TCSR */
  471. #define FH_TCSR(_channel) (FH_TCSR_TABLE+(_channel)*0x20)
  472. #define FH_TCSR_CONFIG(_channel) (FH_TCSR(_channel)+0x00)
  473. #define FH_TCSR_CREDIT(_channel) (FH_TCSR(_channel)+0x04)
  474. #define FH_TCSR_BUFF_STTS(_channel) (FH_TCSR(_channel)+0x08)
  475. /* TSSR */
  476. #define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000)
  477. #define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008)
  478. #define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010)
  479. /* 18 - reserved */
  480. /* card static random access memory (SRAM) for processor data and instructs */
  481. #define RTC_INST_LOWER_BOUND (0x000000)
  482. #define RTC_DATA_LOWER_BOUND (0x800000)
  483. /* DBM */
  484. #define ALM_FH_SRVC_CHNL (6)
  485. #define ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE (20)
  486. #define ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH (4)
  487. #define ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN (0x08000000)
  488. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE (0x80000000)
  489. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE (0x20000000)
  490. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 (0x01000000)
  491. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST (0x00001000)
  492. #define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH (0x00000000)
  493. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF (0x00000000)
  494. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER (0x00000001)
  495. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL (0x00000000)
  496. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008)
  497. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD (0x00200000)
  498. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT (0x00000000)
  499. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE (0x00000000)
  500. #define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000)
  501. #define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID (0x00004000)
  502. #define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR (0x00000001)
  503. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON (0xFF000000)
  504. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON (0x00FF0000)
  505. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B (0x00000400)
  506. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON (0x00000100)
  507. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON (0x00000080)
  508. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH (0x00000020)
  509. #define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH (0x00000005)
  510. #define ALM_TB_MAX_BYTES_COUNT (0xFFF0)
  511. #define ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) \
  512. ((1LU << _channel) << 24)
  513. #define ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel) \
  514. ((1LU << _channel) << 16)
  515. #define ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_channel) \
  516. (ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) | \
  517. ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel))
  518. #define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */
  519. #define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */
  520. #define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004)
  521. #define TFD_QUEUE_MIN 0
  522. #define TFD_QUEUE_MAX 6
  523. #define TFD_QUEUE_SIZE_MAX (256)
  524. /* spectrum and channel data structures */
  525. #define IWL_NUM_SCAN_RATES (2)
  526. #define IWL_SCAN_FLAG_24GHZ (1<<0)
  527. #define IWL_SCAN_FLAG_52GHZ (1<<1)
  528. #define IWL_SCAN_FLAG_ACTIVE (1<<2)
  529. #define IWL_SCAN_FLAG_DIRECT (1<<3)
  530. #define IWL_MAX_CMD_SIZE 1024
  531. #define IWL_DEFAULT_TX_RETRY 15
  532. #define IWL_MAX_TX_RETRY 16
  533. /*********************************************/
  534. #define RFD_SIZE 4
  535. #define NUM_TFD_CHUNKS 4
  536. #define RX_QUEUE_SIZE 256
  537. #define RX_QUEUE_MASK 255
  538. #define RX_QUEUE_SIZE_LOG 8
  539. /* QoS definitions */
  540. #define CW_MIN_OFDM 15
  541. #define CW_MAX_OFDM 1023
  542. #define CW_MIN_CCK 31
  543. #define CW_MAX_CCK 1023
  544. #define QOS_TX0_CW_MIN_OFDM CW_MIN_OFDM
  545. #define QOS_TX1_CW_MIN_OFDM CW_MIN_OFDM
  546. #define QOS_TX2_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
  547. #define QOS_TX3_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 4 - 1)
  548. #define QOS_TX0_CW_MIN_CCK CW_MIN_CCK
  549. #define QOS_TX1_CW_MIN_CCK CW_MIN_CCK
  550. #define QOS_TX2_CW_MIN_CCK ((CW_MIN_CCK + 1) / 2 - 1)
  551. #define QOS_TX3_CW_MIN_CCK ((CW_MIN_CCK + 1) / 4 - 1)
  552. #define QOS_TX0_CW_MAX_OFDM CW_MAX_OFDM
  553. #define QOS_TX1_CW_MAX_OFDM CW_MAX_OFDM
  554. #define QOS_TX2_CW_MAX_OFDM CW_MIN_OFDM
  555. #define QOS_TX3_CW_MAX_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
  556. #define QOS_TX0_CW_MAX_CCK CW_MAX_CCK
  557. #define QOS_TX1_CW_MAX_CCK CW_MAX_CCK
  558. #define QOS_TX2_CW_MAX_CCK CW_MIN_CCK
  559. #define QOS_TX3_CW_MAX_CCK ((CW_MIN_CCK + 1) / 2 - 1)
  560. #define QOS_TX0_AIFS 3
  561. #define QOS_TX1_AIFS 7
  562. #define QOS_TX2_AIFS 2
  563. #define QOS_TX3_AIFS 2
  564. #define QOS_TX0_ACM 0
  565. #define QOS_TX1_ACM 0
  566. #define QOS_TX2_ACM 0
  567. #define QOS_TX3_ACM 0
  568. #define QOS_TX0_TXOP_LIMIT_CCK 0
  569. #define QOS_TX1_TXOP_LIMIT_CCK 0
  570. #define QOS_TX2_TXOP_LIMIT_CCK 6016
  571. #define QOS_TX3_TXOP_LIMIT_CCK 3264
  572. #define QOS_TX0_TXOP_LIMIT_OFDM 0
  573. #define QOS_TX1_TXOP_LIMIT_OFDM 0
  574. #define QOS_TX2_TXOP_LIMIT_OFDM 3008
  575. #define QOS_TX3_TXOP_LIMIT_OFDM 1504
  576. #define DEF_TX0_CW_MIN_OFDM CW_MIN_OFDM
  577. #define DEF_TX1_CW_MIN_OFDM CW_MIN_OFDM
  578. #define DEF_TX2_CW_MIN_OFDM CW_MIN_OFDM
  579. #define DEF_TX3_CW_MIN_OFDM CW_MIN_OFDM
  580. #define DEF_TX0_CW_MIN_CCK CW_MIN_CCK
  581. #define DEF_TX1_CW_MIN_CCK CW_MIN_CCK
  582. #define DEF_TX2_CW_MIN_CCK CW_MIN_CCK
  583. #define DEF_TX3_CW_MIN_CCK CW_MIN_CCK
  584. #define DEF_TX0_CW_MAX_OFDM CW_MAX_OFDM
  585. #define DEF_TX1_CW_MAX_OFDM CW_MAX_OFDM
  586. #define DEF_TX2_CW_MAX_OFDM CW_MAX_OFDM
  587. #define DEF_TX3_CW_MAX_OFDM CW_MAX_OFDM
  588. #define DEF_TX0_CW_MAX_CCK CW_MAX_CCK
  589. #define DEF_TX1_CW_MAX_CCK CW_MAX_CCK
  590. #define DEF_TX2_CW_MAX_CCK CW_MAX_CCK
  591. #define DEF_TX3_CW_MAX_CCK CW_MAX_CCK
  592. #define DEF_TX0_AIFS (2)
  593. #define DEF_TX1_AIFS (2)
  594. #define DEF_TX2_AIFS (2)
  595. #define DEF_TX3_AIFS (2)
  596. #define DEF_TX0_ACM 0
  597. #define DEF_TX1_ACM 0
  598. #define DEF_TX2_ACM 0
  599. #define DEF_TX3_ACM 0
  600. #define DEF_TX0_TXOP_LIMIT_CCK 0
  601. #define DEF_TX1_TXOP_LIMIT_CCK 0
  602. #define DEF_TX2_TXOP_LIMIT_CCK 0
  603. #define DEF_TX3_TXOP_LIMIT_CCK 0
  604. #define DEF_TX0_TXOP_LIMIT_OFDM 0
  605. #define DEF_TX1_TXOP_LIMIT_OFDM 0
  606. #define DEF_TX2_TXOP_LIMIT_OFDM 0
  607. #define DEF_TX3_TXOP_LIMIT_OFDM 0
  608. #define QOS_QOS_SETS 3
  609. #define QOS_PARAM_SET_ACTIVE 0
  610. #define QOS_PARAM_SET_DEF_CCK 1
  611. #define QOS_PARAM_SET_DEF_OFDM 2
  612. #define CTRL_QOS_NO_ACK (0x0020)
  613. #define DCT_FLAG_EXT_QOS_ENABLED (0x10)
  614. #define U32_PAD(n) ((4-(n))&0x3)
  615. /*
  616. * Generic queue structure
  617. *
  618. * Contains common data for Rx and Tx queues
  619. */
  620. #define TFD_CTL_COUNT_SET(n) (n<<24)
  621. #define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7)
  622. #define TFD_CTL_PAD_SET(n) (n<<28)
  623. #define TFD_CTL_PAD_GET(ctl) (ctl>>28)
  624. #define TFD_TX_CMD_SLOTS 256
  625. #define TFD_CMD_SLOTS 32
  626. #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
  627. sizeof(struct iwl3945_cmd_meta))
  628. /*
  629. * RX related structures and functions
  630. */
  631. #define RX_FREE_BUFFERS 64
  632. #define RX_LOW_WATERMARK 8
  633. #define IWL_RX_BUF_SIZE 3000
  634. /* card static random access memory (SRAM) for processor data and instructs */
  635. #define ALM_RTC_INST_UPPER_BOUND (0x014000)
  636. #define ALM_RTC_DATA_UPPER_BOUND (0x808000)
  637. #define ALM_RTC_INST_SIZE (ALM_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
  638. #define ALM_RTC_DATA_SIZE (ALM_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
  639. #define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE
  640. #define IWL_MAX_INST_SIZE ALM_RTC_INST_SIZE
  641. #define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE
  642. #define IWL_MAX_NUM_QUEUES 8
  643. static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr)
  644. {
  645. return (addr >= RTC_DATA_LOWER_BOUND) &&
  646. (addr < ALM_RTC_DATA_UPPER_BOUND);
  647. }
  648. /* Base physical address of iwl3945_shared is provided to FH_TSSR_CBB_BASE
  649. * and &iwl3945_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */
  650. struct iwl3945_shared {
  651. __le32 tx_base_ptr[8];
  652. __le32 rx_read_ptr[3];
  653. } __attribute__ ((packed));
  654. struct iwl3945_tfd_frame_data {
  655. __le32 addr;
  656. __le32 len;
  657. } __attribute__ ((packed));
  658. struct iwl3945_tfd_frame {
  659. __le32 control_flags;
  660. struct iwl3945_tfd_frame_data pa[4];
  661. u8 reserved[28];
  662. } __attribute__ ((packed));
  663. static inline u8 iwl3945_hw_get_rate(__le16 rate_n_flags)
  664. {
  665. return le16_to_cpu(rate_n_flags) & 0xFF;
  666. }
  667. static inline u16 iwl3945_hw_get_rate_n_flags(__le16 rate_n_flags)
  668. {
  669. return le16_to_cpu(rate_n_flags);
  670. }
  671. static inline __le16 iwl3945_hw_set_rate_n_flags(u8 rate, u16 flags)
  672. {
  673. return cpu_to_le16((u16)rate|flags);
  674. }
  675. #endif