iwl-5000.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Intel Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * Intel Linux Wireless <ilw@linux.intel.com>
  23. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  24. *
  25. *****************************************************************************/
  26. #include <linux/kernel.h>
  27. #include <linux/module.h>
  28. #include <linux/init.h>
  29. #include <linux/pci.h>
  30. #include <linux/dma-mapping.h>
  31. #include <linux/delay.h>
  32. #include <linux/sched.h>
  33. #include <linux/skbuff.h>
  34. #include <linux/netdevice.h>
  35. #include <linux/wireless.h>
  36. #include <net/mac80211.h>
  37. #include <linux/etherdevice.h>
  38. #include <asm/unaligned.h>
  39. #include "iwl-eeprom.h"
  40. #include "iwl-dev.h"
  41. #include "iwl-core.h"
  42. #include "iwl-io.h"
  43. #include "iwl-sta.h"
  44. #include "iwl-helpers.h"
  45. #include "iwl-agn.h"
  46. #include "iwl-agn-led.h"
  47. #include "iwl-agn-hw.h"
  48. #include "iwl-5000-hw.h"
  49. #include "iwl-agn-debugfs.h"
  50. /* Highest firmware API version supported */
  51. #define IWL5000_UCODE_API_MAX 5
  52. #define IWL5150_UCODE_API_MAX 2
  53. /* Lowest firmware API version supported */
  54. #define IWL5000_UCODE_API_MIN 1
  55. #define IWL5150_UCODE_API_MIN 1
  56. #define IWL5000_FW_PRE "iwlwifi-5000-"
  57. #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode"
  58. #define IWL5150_FW_PRE "iwlwifi-5150-"
  59. #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode"
  60. /* NIC configuration for 5000 series */
  61. static void iwl5000_nic_config(struct iwl_priv *priv)
  62. {
  63. unsigned long flags;
  64. u16 radio_cfg;
  65. spin_lock_irqsave(&priv->lock, flags);
  66. radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
  67. /* write radio config values to register */
  68. if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) < EEPROM_RF_CONFIG_TYPE_MAX)
  69. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  70. EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
  71. EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
  72. EEPROM_RF_CFG_DASH_MSK(radio_cfg));
  73. /* set CSR_HW_CONFIG_REG for uCode use */
  74. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  75. CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
  76. CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
  77. /* W/A : NIC is stuck in a reset state after Early PCIe power off
  78. * (PCIe power is lost before PERST# is asserted),
  79. * causing ME FW to lose ownership and not being able to obtain it back.
  80. */
  81. iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
  82. APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,
  83. ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);
  84. spin_unlock_irqrestore(&priv->lock, flags);
  85. }
  86. static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
  87. .min_nrg_cck = 95,
  88. .max_nrg_cck = 0, /* not used, set to 0 */
  89. .auto_corr_min_ofdm = 90,
  90. .auto_corr_min_ofdm_mrc = 170,
  91. .auto_corr_min_ofdm_x1 = 120,
  92. .auto_corr_min_ofdm_mrc_x1 = 240,
  93. .auto_corr_max_ofdm = 120,
  94. .auto_corr_max_ofdm_mrc = 210,
  95. .auto_corr_max_ofdm_x1 = 120,
  96. .auto_corr_max_ofdm_mrc_x1 = 240,
  97. .auto_corr_min_cck = 125,
  98. .auto_corr_max_cck = 200,
  99. .auto_corr_min_cck_mrc = 170,
  100. .auto_corr_max_cck_mrc = 400,
  101. .nrg_th_cck = 95,
  102. .nrg_th_ofdm = 95,
  103. .barker_corr_th_min = 190,
  104. .barker_corr_th_min_mrc = 390,
  105. .nrg_th_cca = 62,
  106. };
  107. static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
  108. .min_nrg_cck = 95,
  109. .max_nrg_cck = 0, /* not used, set to 0 */
  110. .auto_corr_min_ofdm = 90,
  111. .auto_corr_min_ofdm_mrc = 170,
  112. .auto_corr_min_ofdm_x1 = 105,
  113. .auto_corr_min_ofdm_mrc_x1 = 220,
  114. .auto_corr_max_ofdm = 120,
  115. .auto_corr_max_ofdm_mrc = 210,
  116. /* max = min for performance bug in 5150 DSP */
  117. .auto_corr_max_ofdm_x1 = 105,
  118. .auto_corr_max_ofdm_mrc_x1 = 220,
  119. .auto_corr_min_cck = 125,
  120. .auto_corr_max_cck = 200,
  121. .auto_corr_min_cck_mrc = 170,
  122. .auto_corr_max_cck_mrc = 400,
  123. .nrg_th_cck = 95,
  124. .nrg_th_ofdm = 95,
  125. .barker_corr_th_min = 190,
  126. .barker_corr_th_min_mrc = 390,
  127. .nrg_th_cca = 62,
  128. };
  129. static void iwl5150_set_ct_threshold(struct iwl_priv *priv)
  130. {
  131. const s32 volt2temp_coef = IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF;
  132. s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) -
  133. iwl_temp_calib_to_offset(priv);
  134. priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef;
  135. }
  136. static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
  137. {
  138. /* want Celsius */
  139. priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
  140. }
  141. static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
  142. {
  143. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  144. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  145. priv->cfg->base_params->num_of_queues =
  146. priv->cfg->mod_params->num_of_queues;
  147. priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
  148. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  149. priv->hw_params.scd_bc_tbls_size =
  150. priv->cfg->base_params->num_of_queues *
  151. sizeof(struct iwlagn_scd_bc_tbl);
  152. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  153. priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
  154. priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
  155. priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
  156. priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
  157. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  158. BIT(IEEE80211_BAND_5GHZ);
  159. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  160. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  161. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  162. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  163. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  164. iwl5000_set_ct_threshold(priv);
  165. /* Set initial sensitivity parameters */
  166. /* Set initial calibration set */
  167. priv->hw_params.sens = &iwl5000_sensitivity;
  168. priv->hw_params.calib_init_cfg =
  169. BIT(IWL_CALIB_XTAL) |
  170. BIT(IWL_CALIB_LO) |
  171. BIT(IWL_CALIB_TX_IQ) |
  172. BIT(IWL_CALIB_TX_IQ_PERD) |
  173. BIT(IWL_CALIB_BASE_BAND);
  174. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  175. return 0;
  176. }
  177. static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
  178. {
  179. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  180. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  181. priv->cfg->base_params->num_of_queues =
  182. priv->cfg->mod_params->num_of_queues;
  183. priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
  184. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  185. priv->hw_params.scd_bc_tbls_size =
  186. priv->cfg->base_params->num_of_queues *
  187. sizeof(struct iwlagn_scd_bc_tbl);
  188. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  189. priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
  190. priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
  191. priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
  192. priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
  193. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  194. BIT(IEEE80211_BAND_5GHZ);
  195. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  196. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  197. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  198. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  199. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  200. iwl5150_set_ct_threshold(priv);
  201. /* Set initial sensitivity parameters */
  202. /* Set initial calibration set */
  203. priv->hw_params.sens = &iwl5150_sensitivity;
  204. priv->hw_params.calib_init_cfg =
  205. BIT(IWL_CALIB_LO) |
  206. BIT(IWL_CALIB_TX_IQ) |
  207. BIT(IWL_CALIB_BASE_BAND);
  208. if (priv->cfg->need_dc_calib)
  209. priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_DC);
  210. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  211. return 0;
  212. }
  213. static void iwl5150_temperature(struct iwl_priv *priv)
  214. {
  215. u32 vt = 0;
  216. s32 offset = iwl_temp_calib_to_offset(priv);
  217. vt = le32_to_cpu(priv->_agn.statistics.general.common.temperature);
  218. vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset;
  219. /* now vt hold the temperature in Kelvin */
  220. priv->temperature = KELVIN_TO_CELSIUS(vt);
  221. iwl_tt_handler(priv);
  222. }
  223. static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
  224. struct ieee80211_channel_switch *ch_switch)
  225. {
  226. /*
  227. * MULTI-FIXME
  228. * See iwl_mac_channel_switch.
  229. */
  230. struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
  231. struct iwl5000_channel_switch_cmd cmd;
  232. const struct iwl_channel_info *ch_info;
  233. u32 switch_time_in_usec, ucode_switch_time;
  234. u16 ch;
  235. u32 tsf_low;
  236. u8 switch_count;
  237. u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
  238. struct ieee80211_vif *vif = ctx->vif;
  239. struct iwl_host_cmd hcmd = {
  240. .id = REPLY_CHANNEL_SWITCH,
  241. .len = sizeof(cmd),
  242. .flags = CMD_SYNC,
  243. .data = &cmd,
  244. };
  245. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  246. ch = ch_switch->channel->hw_value;
  247. IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
  248. ctx->active.channel, ch);
  249. cmd.channel = cpu_to_le16(ch);
  250. cmd.rxon_flags = ctx->staging.flags;
  251. cmd.rxon_filter_flags = ctx->staging.filter_flags;
  252. switch_count = ch_switch->count;
  253. tsf_low = ch_switch->timestamp & 0x0ffffffff;
  254. /*
  255. * calculate the ucode channel switch time
  256. * adding TSF as one of the factor for when to switch
  257. */
  258. if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
  259. if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
  260. beacon_interval)) {
  261. switch_count -= (priv->ucode_beacon_time -
  262. tsf_low) / beacon_interval;
  263. } else
  264. switch_count = 0;
  265. }
  266. if (switch_count <= 1)
  267. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  268. else {
  269. switch_time_in_usec =
  270. vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
  271. ucode_switch_time = iwl_usecs_to_beacons(priv,
  272. switch_time_in_usec,
  273. beacon_interval);
  274. cmd.switch_time = iwl_add_beacon_time(priv,
  275. priv->ucode_beacon_time,
  276. ucode_switch_time,
  277. beacon_interval);
  278. }
  279. IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
  280. cmd.switch_time);
  281. ch_info = iwl_get_channel_info(priv, priv->band, ch);
  282. if (ch_info)
  283. cmd.expect_beacon = is_channel_radar(ch_info);
  284. else {
  285. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  286. ctx->active.channel, ch);
  287. return -EFAULT;
  288. }
  289. priv->switch_rxon.channel = cmd.channel;
  290. priv->switch_rxon.switch_in_progress = true;
  291. return iwl_send_cmd_sync(priv, &hcmd);
  292. }
  293. static struct iwl_lib_ops iwl5000_lib = {
  294. .set_hw_params = iwl5000_hw_set_hw_params,
  295. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  296. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  297. .txq_set_sched = iwlagn_txq_set_sched,
  298. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  299. .txq_free_tfd = iwl_hw_txq_free_tfd,
  300. .txq_init = iwl_hw_tx_queue_init,
  301. .rx_handler_setup = iwlagn_rx_handler_setup,
  302. .setup_deferred_work = iwlagn_setup_deferred_work,
  303. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  304. .send_tx_power = iwlagn_send_tx_power,
  305. .update_chain_flags = iwl_update_chain_flags,
  306. .set_channel_switch = iwl5000_hw_channel_switch,
  307. .apm_ops = {
  308. .init = iwl_apm_init,
  309. .config = iwl5000_nic_config,
  310. },
  311. .eeprom_ops = {
  312. .regulatory_bands = {
  313. EEPROM_REG_BAND_1_CHANNELS,
  314. EEPROM_REG_BAND_2_CHANNELS,
  315. EEPROM_REG_BAND_3_CHANNELS,
  316. EEPROM_REG_BAND_4_CHANNELS,
  317. EEPROM_REG_BAND_5_CHANNELS,
  318. EEPROM_REG_BAND_24_HT40_CHANNELS,
  319. EEPROM_REG_BAND_52_HT40_CHANNELS
  320. },
  321. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  322. .release_semaphore = iwlcore_eeprom_release_semaphore,
  323. .calib_version = iwlagn_eeprom_calib_version,
  324. .query_addr = iwlagn_eeprom_query_addr,
  325. },
  326. .temp_ops = {
  327. .temperature = iwlagn_temperature,
  328. },
  329. .debugfs_ops = {
  330. .rx_stats_read = iwl_ucode_rx_stats_read,
  331. .tx_stats_read = iwl_ucode_tx_stats_read,
  332. .general_stats_read = iwl_ucode_general_stats_read,
  333. .bt_stats_read = iwl_ucode_bt_stats_read,
  334. .reply_tx_error = iwl_reply_tx_error_read,
  335. },
  336. .txfifo_flush = iwlagn_txfifo_flush,
  337. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  338. .tt_ops = {
  339. .lower_power_detection = iwl_tt_is_low_power_state,
  340. .tt_power_mode = iwl_tt_current_power_mode,
  341. .ct_kill_check = iwl_check_for_ct_kill,
  342. }
  343. };
  344. static struct iwl_lib_ops iwl5150_lib = {
  345. .set_hw_params = iwl5150_hw_set_hw_params,
  346. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  347. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  348. .txq_set_sched = iwlagn_txq_set_sched,
  349. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  350. .txq_free_tfd = iwl_hw_txq_free_tfd,
  351. .txq_init = iwl_hw_tx_queue_init,
  352. .rx_handler_setup = iwlagn_rx_handler_setup,
  353. .setup_deferred_work = iwlagn_setup_deferred_work,
  354. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  355. .send_tx_power = iwlagn_send_tx_power,
  356. .update_chain_flags = iwl_update_chain_flags,
  357. .set_channel_switch = iwl5000_hw_channel_switch,
  358. .apm_ops = {
  359. .init = iwl_apm_init,
  360. .config = iwl5000_nic_config,
  361. },
  362. .eeprom_ops = {
  363. .regulatory_bands = {
  364. EEPROM_REG_BAND_1_CHANNELS,
  365. EEPROM_REG_BAND_2_CHANNELS,
  366. EEPROM_REG_BAND_3_CHANNELS,
  367. EEPROM_REG_BAND_4_CHANNELS,
  368. EEPROM_REG_BAND_5_CHANNELS,
  369. EEPROM_REG_BAND_24_HT40_CHANNELS,
  370. EEPROM_REG_BAND_52_HT40_CHANNELS
  371. },
  372. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  373. .release_semaphore = iwlcore_eeprom_release_semaphore,
  374. .calib_version = iwlagn_eeprom_calib_version,
  375. .query_addr = iwlagn_eeprom_query_addr,
  376. },
  377. .temp_ops = {
  378. .temperature = iwl5150_temperature,
  379. },
  380. .debugfs_ops = {
  381. .rx_stats_read = iwl_ucode_rx_stats_read,
  382. .tx_stats_read = iwl_ucode_tx_stats_read,
  383. .general_stats_read = iwl_ucode_general_stats_read,
  384. .bt_stats_read = iwl_ucode_bt_stats_read,
  385. .reply_tx_error = iwl_reply_tx_error_read,
  386. },
  387. .txfifo_flush = iwlagn_txfifo_flush,
  388. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  389. .tt_ops = {
  390. .lower_power_detection = iwl_tt_is_low_power_state,
  391. .tt_power_mode = iwl_tt_current_power_mode,
  392. .ct_kill_check = iwl_check_for_ct_kill,
  393. }
  394. };
  395. static const struct iwl_ops iwl5000_ops = {
  396. .lib = &iwl5000_lib,
  397. .hcmd = &iwlagn_hcmd,
  398. .utils = &iwlagn_hcmd_utils,
  399. .led = &iwlagn_led_ops,
  400. .ieee80211_ops = &iwlagn_hw_ops,
  401. };
  402. static const struct iwl_ops iwl5150_ops = {
  403. .lib = &iwl5150_lib,
  404. .hcmd = &iwlagn_hcmd,
  405. .utils = &iwlagn_hcmd_utils,
  406. .led = &iwlagn_led_ops,
  407. .ieee80211_ops = &iwlagn_hw_ops,
  408. };
  409. static struct iwl_base_params iwl5000_base_params = {
  410. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  411. .num_of_queues = IWLAGN_NUM_QUEUES,
  412. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  413. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  414. .led_compensation = 51,
  415. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  416. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  417. .chain_noise_scale = 1000,
  418. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  419. .max_event_log_size = 512,
  420. .ucode_tracing = true,
  421. };
  422. static struct iwl_ht_params iwl5000_ht_params = {
  423. .ht_greenfield_support = true,
  424. .use_rts_for_aggregation = true, /* use rts/cts protection */
  425. };
  426. #define IWL_DEVICE_5000 \
  427. .fw_name_pre = IWL5000_FW_PRE, \
  428. .ucode_api_max = IWL5000_UCODE_API_MAX, \
  429. .ucode_api_min = IWL5000_UCODE_API_MIN, \
  430. .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
  431. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
  432. .ops = &iwl5000_ops, \
  433. .mod_params = &iwlagn_mod_params, \
  434. .base_params = &iwl5000_base_params, \
  435. .led_mode = IWL_LED_BLINK
  436. struct iwl_cfg iwl5300_agn_cfg = {
  437. .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
  438. IWL_DEVICE_5000,
  439. /* at least EEPROM 0x11A has wrong info */
  440. .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
  441. .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
  442. .ht_params = &iwl5000_ht_params,
  443. };
  444. struct iwl_cfg iwl5100_bgn_cfg = {
  445. .name = "Intel(R) WiFi Link 5100 BGN",
  446. IWL_DEVICE_5000,
  447. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  448. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  449. .ht_params = &iwl5000_ht_params,
  450. };
  451. struct iwl_cfg iwl5100_abg_cfg = {
  452. .name = "Intel(R) WiFi Link 5100 ABG",
  453. IWL_DEVICE_5000,
  454. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  455. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  456. };
  457. struct iwl_cfg iwl5100_agn_cfg = {
  458. .name = "Intel(R) WiFi Link 5100 AGN",
  459. IWL_DEVICE_5000,
  460. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  461. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  462. .ht_params = &iwl5000_ht_params,
  463. };
  464. struct iwl_cfg iwl5350_agn_cfg = {
  465. .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
  466. .fw_name_pre = IWL5000_FW_PRE,
  467. .ucode_api_max = IWL5000_UCODE_API_MAX,
  468. .ucode_api_min = IWL5000_UCODE_API_MIN,
  469. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  470. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  471. .ops = &iwl5000_ops,
  472. .mod_params = &iwlagn_mod_params,
  473. .base_params = &iwl5000_base_params,
  474. .ht_params = &iwl5000_ht_params,
  475. .led_mode = IWL_LED_BLINK,
  476. .internal_wimax_coex = true,
  477. };
  478. #define IWL_DEVICE_5150 \
  479. .fw_name_pre = IWL5150_FW_PRE, \
  480. .ucode_api_max = IWL5150_UCODE_API_MAX, \
  481. .ucode_api_min = IWL5150_UCODE_API_MIN, \
  482. .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
  483. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
  484. .ops = &iwl5150_ops, \
  485. .mod_params = &iwlagn_mod_params, \
  486. .base_params = &iwl5000_base_params, \
  487. .need_dc_calib = true, \
  488. .led_mode = IWL_LED_BLINK, \
  489. .internal_wimax_coex = true
  490. struct iwl_cfg iwl5150_agn_cfg = {
  491. .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
  492. IWL_DEVICE_5150,
  493. .ht_params = &iwl5000_ht_params,
  494. };
  495. struct iwl_cfg iwl5150_abg_cfg = {
  496. .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
  497. IWL_DEVICE_5150,
  498. };
  499. MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
  500. MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));