iwl-5000.c 20 KB

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