iwl-5000.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2010 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 2
  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 IWL5000_MODULE_FIRMWARE(api) _IWL5000_MODULE_FIRMWARE(api)
  59. #define IWL5150_FW_PRE "iwlwifi-5150-"
  60. #define _IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode"
  61. #define IWL5150_MODULE_FIRMWARE(api) _IWL5150_MODULE_FIRMWARE(api)
  62. /* NIC configuration for 5000 series */
  63. static void iwl5000_nic_config(struct iwl_priv *priv)
  64. {
  65. unsigned long flags;
  66. u16 radio_cfg;
  67. spin_lock_irqsave(&priv->lock, flags);
  68. radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
  69. /* write radio config values to register */
  70. if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) < EEPROM_RF_CONFIG_TYPE_MAX)
  71. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  72. EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
  73. EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
  74. EEPROM_RF_CFG_DASH_MSK(radio_cfg));
  75. /* set CSR_HW_CONFIG_REG for uCode use */
  76. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  77. CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
  78. CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
  79. /* W/A : NIC is stuck in a reset state after Early PCIe power off
  80. * (PCIe power is lost before PERST# is asserted),
  81. * causing ME FW to lose ownership and not being able to obtain it back.
  82. */
  83. iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
  84. APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,
  85. ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);
  86. spin_unlock_irqrestore(&priv->lock, flags);
  87. }
  88. static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
  89. .min_nrg_cck = 95,
  90. .max_nrg_cck = 0, /* not used, set to 0 */
  91. .auto_corr_min_ofdm = 90,
  92. .auto_corr_min_ofdm_mrc = 170,
  93. .auto_corr_min_ofdm_x1 = 120,
  94. .auto_corr_min_ofdm_mrc_x1 = 240,
  95. .auto_corr_max_ofdm = 120,
  96. .auto_corr_max_ofdm_mrc = 210,
  97. .auto_corr_max_ofdm_x1 = 120,
  98. .auto_corr_max_ofdm_mrc_x1 = 240,
  99. .auto_corr_min_cck = 125,
  100. .auto_corr_max_cck = 200,
  101. .auto_corr_min_cck_mrc = 170,
  102. .auto_corr_max_cck_mrc = 400,
  103. .nrg_th_cck = 95,
  104. .nrg_th_ofdm = 95,
  105. .barker_corr_th_min = 190,
  106. .barker_corr_th_min_mrc = 390,
  107. .nrg_th_cca = 62,
  108. };
  109. static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
  110. .min_nrg_cck = 95,
  111. .max_nrg_cck = 0, /* not used, set to 0 */
  112. .auto_corr_min_ofdm = 90,
  113. .auto_corr_min_ofdm_mrc = 170,
  114. .auto_corr_min_ofdm_x1 = 105,
  115. .auto_corr_min_ofdm_mrc_x1 = 220,
  116. .auto_corr_max_ofdm = 120,
  117. .auto_corr_max_ofdm_mrc = 210,
  118. /* max = min for performance bug in 5150 DSP */
  119. .auto_corr_max_ofdm_x1 = 105,
  120. .auto_corr_max_ofdm_mrc_x1 = 220,
  121. .auto_corr_min_cck = 125,
  122. .auto_corr_max_cck = 200,
  123. .auto_corr_min_cck_mrc = 170,
  124. .auto_corr_max_cck_mrc = 400,
  125. .nrg_th_cck = 95,
  126. .nrg_th_ofdm = 95,
  127. .barker_corr_th_min = 190,
  128. .barker_corr_th_min_mrc = 390,
  129. .nrg_th_cca = 62,
  130. };
  131. static void iwl5150_set_ct_threshold(struct iwl_priv *priv)
  132. {
  133. const s32 volt2temp_coef = IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF;
  134. s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) -
  135. iwl_temp_calib_to_offset(priv);
  136. priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef;
  137. }
  138. static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
  139. {
  140. /* want Celsius */
  141. priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
  142. }
  143. static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
  144. {
  145. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  146. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  147. priv->cfg->num_of_queues =
  148. priv->cfg->mod_params->num_of_queues;
  149. priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
  150. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  151. priv->hw_params.scd_bc_tbls_size =
  152. priv->cfg->num_of_queues *
  153. sizeof(struct iwlagn_scd_bc_tbl);
  154. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  155. priv->hw_params.max_stations = IWL5000_STATION_COUNT;
  156. priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
  157. priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
  158. priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
  159. priv->hw_params.max_bsm_size = 0;
  160. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  161. BIT(IEEE80211_BAND_5GHZ);
  162. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  163. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  164. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  165. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  166. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  167. if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
  168. priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
  169. /* Set initial sensitivity parameters */
  170. /* Set initial calibration set */
  171. switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
  172. case CSR_HW_REV_TYPE_5150:
  173. priv->hw_params.sens = &iwl5150_sensitivity;
  174. priv->hw_params.calib_init_cfg =
  175. BIT(IWL_CALIB_DC) |
  176. BIT(IWL_CALIB_LO) |
  177. BIT(IWL_CALIB_TX_IQ) |
  178. BIT(IWL_CALIB_BASE_BAND);
  179. break;
  180. default:
  181. priv->hw_params.sens = &iwl5000_sensitivity;
  182. priv->hw_params.calib_init_cfg =
  183. BIT(IWL_CALIB_XTAL) |
  184. BIT(IWL_CALIB_LO) |
  185. BIT(IWL_CALIB_TX_IQ) |
  186. BIT(IWL_CALIB_TX_IQ_PERD) |
  187. BIT(IWL_CALIB_BASE_BAND);
  188. break;
  189. }
  190. return 0;
  191. }
  192. static void iwl5150_temperature(struct iwl_priv *priv)
  193. {
  194. u32 vt = 0;
  195. s32 offset = iwl_temp_calib_to_offset(priv);
  196. vt = le32_to_cpu(priv->statistics.general.temperature);
  197. vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset;
  198. /* now vt hold the temperature in Kelvin */
  199. priv->temperature = KELVIN_TO_CELSIUS(vt);
  200. iwl_tt_handler(priv);
  201. }
  202. static int iwl5000_hw_channel_switch(struct iwl_priv *priv, u16 channel)
  203. {
  204. struct iwl5000_channel_switch_cmd cmd;
  205. const struct iwl_channel_info *ch_info;
  206. struct iwl_host_cmd hcmd = {
  207. .id = REPLY_CHANNEL_SWITCH,
  208. .len = sizeof(cmd),
  209. .flags = CMD_SIZE_HUGE,
  210. .data = &cmd,
  211. };
  212. IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
  213. priv->active_rxon.channel, channel);
  214. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  215. cmd.channel = cpu_to_le16(channel);
  216. cmd.rxon_flags = priv->staging_rxon.flags;
  217. cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
  218. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  219. ch_info = iwl_get_channel_info(priv, priv->band, channel);
  220. if (ch_info)
  221. cmd.expect_beacon = is_channel_radar(ch_info);
  222. else {
  223. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  224. priv->active_rxon.channel, channel);
  225. return -EFAULT;
  226. }
  227. priv->switch_rxon.channel = cpu_to_le16(channel);
  228. priv->switch_rxon.switch_in_progress = true;
  229. return iwl_send_cmd_sync(priv, &hcmd);
  230. }
  231. static struct iwl_lib_ops iwl5000_lib = {
  232. .set_hw_params = iwl5000_hw_set_hw_params,
  233. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  234. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  235. .txq_set_sched = iwlagn_txq_set_sched,
  236. .txq_agg_enable = iwlagn_txq_agg_enable,
  237. .txq_agg_disable = iwlagn_txq_agg_disable,
  238. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  239. .txq_free_tfd = iwl_hw_txq_free_tfd,
  240. .txq_init = iwl_hw_tx_queue_init,
  241. .rx_handler_setup = iwlagn_rx_handler_setup,
  242. .setup_deferred_work = iwlagn_setup_deferred_work,
  243. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  244. .dump_nic_event_log = iwl_dump_nic_event_log,
  245. .dump_nic_error_log = iwl_dump_nic_error_log,
  246. .dump_csr = iwl_dump_csr,
  247. .dump_fh = iwl_dump_fh,
  248. .load_ucode = iwlagn_load_ucode,
  249. .init_alive_start = iwlagn_init_alive_start,
  250. .alive_notify = iwlagn_alive_notify,
  251. .send_tx_power = iwlagn_send_tx_power,
  252. .update_chain_flags = iwl_update_chain_flags,
  253. .set_channel_switch = iwl5000_hw_channel_switch,
  254. .apm_ops = {
  255. .init = iwl_apm_init,
  256. .stop = iwl_apm_stop,
  257. .config = iwl5000_nic_config,
  258. .set_pwr_src = iwl_set_pwr_src,
  259. },
  260. .eeprom_ops = {
  261. .regulatory_bands = {
  262. EEPROM_REG_BAND_1_CHANNELS,
  263. EEPROM_REG_BAND_2_CHANNELS,
  264. EEPROM_REG_BAND_3_CHANNELS,
  265. EEPROM_REG_BAND_4_CHANNELS,
  266. EEPROM_REG_BAND_5_CHANNELS,
  267. EEPROM_REG_BAND_24_HT40_CHANNELS,
  268. EEPROM_REG_BAND_52_HT40_CHANNELS
  269. },
  270. .verify_signature = iwlcore_eeprom_verify_signature,
  271. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  272. .release_semaphore = iwlcore_eeprom_release_semaphore,
  273. .calib_version = iwlagn_eeprom_calib_version,
  274. .query_addr = iwlagn_eeprom_query_addr,
  275. },
  276. .post_associate = iwl_post_associate,
  277. .isr = iwl_isr_ict,
  278. .config_ap = iwl_config_ap,
  279. .temp_ops = {
  280. .temperature = iwlagn_temperature,
  281. .set_ct_kill = iwl5000_set_ct_threshold,
  282. },
  283. .add_bcast_station = iwl_add_bcast_station,
  284. .debugfs_ops = {
  285. .rx_stats_read = iwl_ucode_rx_stats_read,
  286. .tx_stats_read = iwl_ucode_tx_stats_read,
  287. .general_stats_read = iwl_ucode_general_stats_read,
  288. },
  289. .recover_from_tx_stall = iwl_bg_monitor_recover,
  290. .check_plcp_health = iwl_good_plcp_health,
  291. .check_ack_health = iwl_good_ack_health,
  292. };
  293. static struct iwl_lib_ops iwl5150_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_agg_enable = iwlagn_txq_agg_enable,
  299. .txq_agg_disable = iwlagn_txq_agg_disable,
  300. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  301. .txq_free_tfd = iwl_hw_txq_free_tfd,
  302. .txq_init = iwl_hw_tx_queue_init,
  303. .rx_handler_setup = iwlagn_rx_handler_setup,
  304. .setup_deferred_work = iwlagn_setup_deferred_work,
  305. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  306. .dump_nic_event_log = iwl_dump_nic_event_log,
  307. .dump_nic_error_log = iwl_dump_nic_error_log,
  308. .dump_csr = iwl_dump_csr,
  309. .load_ucode = iwlagn_load_ucode,
  310. .init_alive_start = iwlagn_init_alive_start,
  311. .alive_notify = iwlagn_alive_notify,
  312. .send_tx_power = iwlagn_send_tx_power,
  313. .update_chain_flags = iwl_update_chain_flags,
  314. .set_channel_switch = iwl5000_hw_channel_switch,
  315. .apm_ops = {
  316. .init = iwl_apm_init,
  317. .stop = iwl_apm_stop,
  318. .config = iwl5000_nic_config,
  319. .set_pwr_src = iwl_set_pwr_src,
  320. },
  321. .eeprom_ops = {
  322. .regulatory_bands = {
  323. EEPROM_REG_BAND_1_CHANNELS,
  324. EEPROM_REG_BAND_2_CHANNELS,
  325. EEPROM_REG_BAND_3_CHANNELS,
  326. EEPROM_REG_BAND_4_CHANNELS,
  327. EEPROM_REG_BAND_5_CHANNELS,
  328. EEPROM_REG_BAND_24_HT40_CHANNELS,
  329. EEPROM_REG_BAND_52_HT40_CHANNELS
  330. },
  331. .verify_signature = iwlcore_eeprom_verify_signature,
  332. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  333. .release_semaphore = iwlcore_eeprom_release_semaphore,
  334. .calib_version = iwlagn_eeprom_calib_version,
  335. .query_addr = iwlagn_eeprom_query_addr,
  336. },
  337. .post_associate = iwl_post_associate,
  338. .isr = iwl_isr_ict,
  339. .config_ap = iwl_config_ap,
  340. .temp_ops = {
  341. .temperature = iwl5150_temperature,
  342. .set_ct_kill = iwl5150_set_ct_threshold,
  343. },
  344. .add_bcast_station = iwl_add_bcast_station,
  345. .debugfs_ops = {
  346. .rx_stats_read = iwl_ucode_rx_stats_read,
  347. .tx_stats_read = iwl_ucode_tx_stats_read,
  348. .general_stats_read = iwl_ucode_general_stats_read,
  349. },
  350. .recover_from_tx_stall = iwl_bg_monitor_recover,
  351. .check_plcp_health = iwl_good_plcp_health,
  352. .check_ack_health = iwl_good_ack_health,
  353. };
  354. static const struct iwl_ops iwl5000_ops = {
  355. .ucode = &iwlagn_ucode,
  356. .lib = &iwl5000_lib,
  357. .hcmd = &iwlagn_hcmd,
  358. .utils = &iwlagn_hcmd_utils,
  359. .led = &iwlagn_led_ops,
  360. };
  361. static const struct iwl_ops iwl5150_ops = {
  362. .ucode = &iwlagn_ucode,
  363. .lib = &iwl5150_lib,
  364. .hcmd = &iwlagn_hcmd,
  365. .utils = &iwlagn_hcmd_utils,
  366. .led = &iwlagn_led_ops,
  367. };
  368. struct iwl_cfg iwl5300_agn_cfg = {
  369. .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
  370. .fw_name_pre = IWL5000_FW_PRE,
  371. .ucode_api_max = IWL5000_UCODE_API_MAX,
  372. .ucode_api_min = IWL5000_UCODE_API_MIN,
  373. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  374. .ops = &iwl5000_ops,
  375. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  376. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  377. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  378. .num_of_queues = IWLAGN_NUM_QUEUES,
  379. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  380. .mod_params = &iwlagn_mod_params,
  381. .valid_tx_ant = ANT_ABC,
  382. .valid_rx_ant = ANT_ABC,
  383. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  384. .set_l0s = true,
  385. .use_bsm = false,
  386. .ht_greenfield_support = true,
  387. .led_compensation = 51,
  388. .use_rts_for_ht = true, /* use rts/cts protection */
  389. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  390. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  391. .chain_noise_scale = 1000,
  392. .monitor_recover_period = IWL_MONITORING_PERIOD,
  393. .max_event_log_size = 512,
  394. };
  395. struct iwl_cfg iwl5100_bgn_cfg = {
  396. .name = "Intel(R) WiFi Link 5100 BGN",
  397. .fw_name_pre = IWL5000_FW_PRE,
  398. .ucode_api_max = IWL5000_UCODE_API_MAX,
  399. .ucode_api_min = IWL5000_UCODE_API_MIN,
  400. .sku = IWL_SKU_G|IWL_SKU_N,
  401. .ops = &iwl5000_ops,
  402. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  403. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  404. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  405. .num_of_queues = IWLAGN_NUM_QUEUES,
  406. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  407. .mod_params = &iwlagn_mod_params,
  408. .valid_tx_ant = ANT_B,
  409. .valid_rx_ant = ANT_AB,
  410. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  411. .set_l0s = true,
  412. .use_bsm = false,
  413. .ht_greenfield_support = true,
  414. .led_compensation = 51,
  415. .use_rts_for_ht = true, /* use rts/cts protection */
  416. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  417. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  418. .chain_noise_scale = 1000,
  419. .monitor_recover_period = IWL_MONITORING_PERIOD,
  420. .max_event_log_size = 512,
  421. };
  422. struct iwl_cfg iwl5100_abg_cfg = {
  423. .name = "Intel(R) WiFi Link 5100 ABG",
  424. .fw_name_pre = IWL5000_FW_PRE,
  425. .ucode_api_max = IWL5000_UCODE_API_MAX,
  426. .ucode_api_min = IWL5000_UCODE_API_MIN,
  427. .sku = IWL_SKU_A|IWL_SKU_G,
  428. .ops = &iwl5000_ops,
  429. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  430. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  431. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  432. .num_of_queues = IWLAGN_NUM_QUEUES,
  433. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  434. .mod_params = &iwlagn_mod_params,
  435. .valid_tx_ant = ANT_B,
  436. .valid_rx_ant = ANT_AB,
  437. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  438. .set_l0s = true,
  439. .use_bsm = false,
  440. .led_compensation = 51,
  441. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  442. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  443. .chain_noise_scale = 1000,
  444. .monitor_recover_period = IWL_MONITORING_PERIOD,
  445. .max_event_log_size = 512,
  446. };
  447. struct iwl_cfg iwl5100_agn_cfg = {
  448. .name = "Intel(R) WiFi Link 5100 AGN",
  449. .fw_name_pre = IWL5000_FW_PRE,
  450. .ucode_api_max = IWL5000_UCODE_API_MAX,
  451. .ucode_api_min = IWL5000_UCODE_API_MIN,
  452. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  453. .ops = &iwl5000_ops,
  454. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  455. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  456. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  457. .num_of_queues = IWLAGN_NUM_QUEUES,
  458. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  459. .mod_params = &iwlagn_mod_params,
  460. .valid_tx_ant = ANT_B,
  461. .valid_rx_ant = ANT_AB,
  462. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  463. .set_l0s = true,
  464. .use_bsm = false,
  465. .ht_greenfield_support = true,
  466. .led_compensation = 51,
  467. .use_rts_for_ht = true, /* use rts/cts protection */
  468. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  469. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  470. .chain_noise_scale = 1000,
  471. .monitor_recover_period = IWL_MONITORING_PERIOD,
  472. .max_event_log_size = 512,
  473. };
  474. struct iwl_cfg iwl5350_agn_cfg = {
  475. .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
  476. .fw_name_pre = IWL5000_FW_PRE,
  477. .ucode_api_max = IWL5000_UCODE_API_MAX,
  478. .ucode_api_min = IWL5000_UCODE_API_MIN,
  479. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  480. .ops = &iwl5000_ops,
  481. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  482. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  483. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  484. .num_of_queues = IWLAGN_NUM_QUEUES,
  485. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  486. .mod_params = &iwlagn_mod_params,
  487. .valid_tx_ant = ANT_ABC,
  488. .valid_rx_ant = ANT_ABC,
  489. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  490. .set_l0s = true,
  491. .use_bsm = false,
  492. .ht_greenfield_support = true,
  493. .led_compensation = 51,
  494. .use_rts_for_ht = true, /* use rts/cts protection */
  495. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  496. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  497. .chain_noise_scale = 1000,
  498. .monitor_recover_period = IWL_MONITORING_PERIOD,
  499. .max_event_log_size = 512,
  500. };
  501. struct iwl_cfg iwl5150_agn_cfg = {
  502. .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
  503. .fw_name_pre = IWL5150_FW_PRE,
  504. .ucode_api_max = IWL5150_UCODE_API_MAX,
  505. .ucode_api_min = IWL5150_UCODE_API_MIN,
  506. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  507. .ops = &iwl5150_ops,
  508. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  509. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  510. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  511. .num_of_queues = IWLAGN_NUM_QUEUES,
  512. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  513. .mod_params = &iwlagn_mod_params,
  514. .valid_tx_ant = ANT_A,
  515. .valid_rx_ant = ANT_AB,
  516. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  517. .set_l0s = true,
  518. .use_bsm = false,
  519. .ht_greenfield_support = true,
  520. .led_compensation = 51,
  521. .use_rts_for_ht = true, /* use rts/cts protection */
  522. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  523. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  524. .chain_noise_scale = 1000,
  525. .monitor_recover_period = IWL_MONITORING_PERIOD,
  526. .max_event_log_size = 512,
  527. };
  528. struct iwl_cfg iwl5150_abg_cfg = {
  529. .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
  530. .fw_name_pre = IWL5150_FW_PRE,
  531. .ucode_api_max = IWL5150_UCODE_API_MAX,
  532. .ucode_api_min = IWL5150_UCODE_API_MIN,
  533. .sku = IWL_SKU_A|IWL_SKU_G,
  534. .ops = &iwl5150_ops,
  535. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  536. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  537. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  538. .num_of_queues = IWLAGN_NUM_QUEUES,
  539. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  540. .mod_params = &iwlagn_mod_params,
  541. .valid_tx_ant = ANT_A,
  542. .valid_rx_ant = ANT_AB,
  543. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  544. .set_l0s = true,
  545. .use_bsm = false,
  546. .led_compensation = 51,
  547. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  548. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  549. .chain_noise_scale = 1000,
  550. .monitor_recover_period = IWL_MONITORING_PERIOD,
  551. .max_event_log_size = 512,
  552. };
  553. MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
  554. MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));