iwl-5000.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  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. priv->hw_params.sens = &iwl5000_sensitivity;
  172. priv->hw_params.calib_init_cfg =
  173. BIT(IWL_CALIB_XTAL) |
  174. BIT(IWL_CALIB_LO) |
  175. BIT(IWL_CALIB_TX_IQ) |
  176. BIT(IWL_CALIB_TX_IQ_PERD) |
  177. BIT(IWL_CALIB_BASE_BAND);
  178. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  179. return 0;
  180. }
  181. static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
  182. {
  183. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  184. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  185. priv->cfg->num_of_queues =
  186. priv->cfg->mod_params->num_of_queues;
  187. priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
  188. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  189. priv->hw_params.scd_bc_tbls_size =
  190. priv->cfg->num_of_queues *
  191. sizeof(struct iwlagn_scd_bc_tbl);
  192. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  193. priv->hw_params.max_stations = IWL5000_STATION_COUNT;
  194. priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
  195. priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
  196. priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
  197. priv->hw_params.max_bsm_size = 0;
  198. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  199. BIT(IEEE80211_BAND_5GHZ);
  200. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  201. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  202. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  203. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  204. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  205. if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
  206. priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
  207. /* Set initial sensitivity parameters */
  208. /* Set initial calibration set */
  209. priv->hw_params.sens = &iwl5150_sensitivity;
  210. priv->hw_params.calib_init_cfg =
  211. BIT(IWL_CALIB_DC) |
  212. BIT(IWL_CALIB_LO) |
  213. BIT(IWL_CALIB_TX_IQ) |
  214. BIT(IWL_CALIB_BASE_BAND);
  215. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  216. return 0;
  217. }
  218. static void iwl5150_temperature(struct iwl_priv *priv)
  219. {
  220. u32 vt = 0;
  221. s32 offset = iwl_temp_calib_to_offset(priv);
  222. vt = le32_to_cpu(priv->statistics.general.temperature);
  223. vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset;
  224. /* now vt hold the temperature in Kelvin */
  225. priv->temperature = KELVIN_TO_CELSIUS(vt);
  226. iwl_tt_handler(priv);
  227. }
  228. static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
  229. struct ieee80211_channel_switch *ch_switch)
  230. {
  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(priv->rxon_timing.beacon_interval);
  238. struct ieee80211_vif *vif = priv->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 = ieee80211_frequency_to_channel(ch_switch->channel->center_freq);
  247. IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
  248. priv->active_rxon.channel, ch);
  249. cmd.channel = cpu_to_le16(ch);
  250. cmd.rxon_flags = priv->staging_rxon.flags;
  251. cmd.rxon_filter_flags = priv->staging_rxon.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. priv->active_rxon.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_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. .dump_fh = iwl_dump_fh,
  310. .load_ucode = iwlagn_load_ucode,
  311. .init_alive_start = iwlagn_init_alive_start,
  312. .alive_notify = iwlagn_alive_notify,
  313. .send_tx_power = iwlagn_send_tx_power,
  314. .update_chain_flags = iwl_update_chain_flags,
  315. .set_channel_switch = iwl5000_hw_channel_switch,
  316. .apm_ops = {
  317. .init = iwl_apm_init,
  318. .stop = iwl_apm_stop,
  319. .config = iwl5000_nic_config,
  320. .set_pwr_src = iwl_set_pwr_src,
  321. },
  322. .eeprom_ops = {
  323. .regulatory_bands = {
  324. EEPROM_REG_BAND_1_CHANNELS,
  325. EEPROM_REG_BAND_2_CHANNELS,
  326. EEPROM_REG_BAND_3_CHANNELS,
  327. EEPROM_REG_BAND_4_CHANNELS,
  328. EEPROM_REG_BAND_5_CHANNELS,
  329. EEPROM_REG_BAND_24_HT40_CHANNELS,
  330. EEPROM_REG_BAND_52_HT40_CHANNELS
  331. },
  332. .verify_signature = iwlcore_eeprom_verify_signature,
  333. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  334. .release_semaphore = iwlcore_eeprom_release_semaphore,
  335. .calib_version = iwlagn_eeprom_calib_version,
  336. .query_addr = iwlagn_eeprom_query_addr,
  337. },
  338. .post_associate = iwl_post_associate,
  339. .isr = iwl_isr_ict,
  340. .config_ap = iwl_config_ap,
  341. .temp_ops = {
  342. .temperature = iwlagn_temperature,
  343. .set_ct_kill = iwl5000_set_ct_threshold,
  344. },
  345. .manage_ibss_station = iwlagn_manage_ibss_station,
  346. .debugfs_ops = {
  347. .rx_stats_read = iwl_ucode_rx_stats_read,
  348. .tx_stats_read = iwl_ucode_tx_stats_read,
  349. .general_stats_read = iwl_ucode_general_stats_read,
  350. },
  351. .recover_from_tx_stall = iwl_bg_monitor_recover,
  352. .check_plcp_health = iwl_good_plcp_health,
  353. .check_ack_health = iwl_good_ack_health,
  354. };
  355. static struct iwl_lib_ops iwl5150_lib = {
  356. .set_hw_params = iwl5150_hw_set_hw_params,
  357. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  358. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  359. .txq_set_sched = iwlagn_txq_set_sched,
  360. .txq_agg_enable = iwlagn_txq_agg_enable,
  361. .txq_agg_disable = iwlagn_txq_agg_disable,
  362. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  363. .txq_free_tfd = iwl_hw_txq_free_tfd,
  364. .txq_init = iwl_hw_tx_queue_init,
  365. .rx_handler_setup = iwlagn_rx_handler_setup,
  366. .setup_deferred_work = iwlagn_setup_deferred_work,
  367. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  368. .dump_nic_event_log = iwl_dump_nic_event_log,
  369. .dump_nic_error_log = iwl_dump_nic_error_log,
  370. .dump_csr = iwl_dump_csr,
  371. .load_ucode = iwlagn_load_ucode,
  372. .init_alive_start = iwlagn_init_alive_start,
  373. .alive_notify = iwlagn_alive_notify,
  374. .send_tx_power = iwlagn_send_tx_power,
  375. .update_chain_flags = iwl_update_chain_flags,
  376. .set_channel_switch = iwl5000_hw_channel_switch,
  377. .apm_ops = {
  378. .init = iwl_apm_init,
  379. .stop = iwl_apm_stop,
  380. .config = iwl5000_nic_config,
  381. .set_pwr_src = iwl_set_pwr_src,
  382. },
  383. .eeprom_ops = {
  384. .regulatory_bands = {
  385. EEPROM_REG_BAND_1_CHANNELS,
  386. EEPROM_REG_BAND_2_CHANNELS,
  387. EEPROM_REG_BAND_3_CHANNELS,
  388. EEPROM_REG_BAND_4_CHANNELS,
  389. EEPROM_REG_BAND_5_CHANNELS,
  390. EEPROM_REG_BAND_24_HT40_CHANNELS,
  391. EEPROM_REG_BAND_52_HT40_CHANNELS
  392. },
  393. .verify_signature = iwlcore_eeprom_verify_signature,
  394. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  395. .release_semaphore = iwlcore_eeprom_release_semaphore,
  396. .calib_version = iwlagn_eeprom_calib_version,
  397. .query_addr = iwlagn_eeprom_query_addr,
  398. },
  399. .post_associate = iwl_post_associate,
  400. .isr = iwl_isr_ict,
  401. .config_ap = iwl_config_ap,
  402. .temp_ops = {
  403. .temperature = iwl5150_temperature,
  404. .set_ct_kill = iwl5150_set_ct_threshold,
  405. },
  406. .manage_ibss_station = iwlagn_manage_ibss_station,
  407. .debugfs_ops = {
  408. .rx_stats_read = iwl_ucode_rx_stats_read,
  409. .tx_stats_read = iwl_ucode_tx_stats_read,
  410. .general_stats_read = iwl_ucode_general_stats_read,
  411. },
  412. .recover_from_tx_stall = iwl_bg_monitor_recover,
  413. .check_plcp_health = iwl_good_plcp_health,
  414. .check_ack_health = iwl_good_ack_health,
  415. };
  416. static const struct iwl_ops iwl5000_ops = {
  417. .lib = &iwl5000_lib,
  418. .hcmd = &iwlagn_hcmd,
  419. .utils = &iwlagn_hcmd_utils,
  420. .led = &iwlagn_led_ops,
  421. };
  422. static const struct iwl_ops iwl5150_ops = {
  423. .lib = &iwl5150_lib,
  424. .hcmd = &iwlagn_hcmd,
  425. .utils = &iwlagn_hcmd_utils,
  426. .led = &iwlagn_led_ops,
  427. };
  428. struct iwl_cfg iwl5300_agn_cfg = {
  429. .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
  430. .fw_name_pre = IWL5000_FW_PRE,
  431. .ucode_api_max = IWL5000_UCODE_API_MAX,
  432. .ucode_api_min = IWL5000_UCODE_API_MIN,
  433. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  434. .ops = &iwl5000_ops,
  435. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  436. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  437. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  438. .num_of_queues = IWLAGN_NUM_QUEUES,
  439. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  440. .mod_params = &iwlagn_mod_params,
  441. .valid_tx_ant = ANT_ABC,
  442. .valid_rx_ant = ANT_ABC,
  443. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  444. .set_l0s = true,
  445. .use_bsm = false,
  446. .ht_greenfield_support = true,
  447. .led_compensation = 51,
  448. .use_rts_for_ht = true, /* use rts/cts protection */
  449. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  450. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  451. .chain_noise_scale = 1000,
  452. .monitor_recover_period = IWL_MONITORING_PERIOD,
  453. .max_event_log_size = 512,
  454. .ucode_tracing = true,
  455. .sensitivity_calib_by_driver = true,
  456. .chain_noise_calib_by_driver = true,
  457. };
  458. struct iwl_cfg iwl5100_bgn_cfg = {
  459. .name = "Intel(R) WiFi Link 5100 BGN",
  460. .fw_name_pre = IWL5000_FW_PRE,
  461. .ucode_api_max = IWL5000_UCODE_API_MAX,
  462. .ucode_api_min = IWL5000_UCODE_API_MIN,
  463. .sku = IWL_SKU_G|IWL_SKU_N,
  464. .ops = &iwl5000_ops,
  465. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  466. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  467. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  468. .num_of_queues = IWLAGN_NUM_QUEUES,
  469. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  470. .mod_params = &iwlagn_mod_params,
  471. .valid_tx_ant = ANT_B,
  472. .valid_rx_ant = ANT_AB,
  473. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  474. .set_l0s = true,
  475. .use_bsm = false,
  476. .ht_greenfield_support = true,
  477. .led_compensation = 51,
  478. .use_rts_for_ht = true, /* use rts/cts protection */
  479. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  480. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  481. .chain_noise_scale = 1000,
  482. .monitor_recover_period = IWL_MONITORING_PERIOD,
  483. .max_event_log_size = 512,
  484. .ucode_tracing = true,
  485. .sensitivity_calib_by_driver = true,
  486. .chain_noise_calib_by_driver = true,
  487. };
  488. struct iwl_cfg iwl5100_abg_cfg = {
  489. .name = "Intel(R) WiFi Link 5100 ABG",
  490. .fw_name_pre = IWL5000_FW_PRE,
  491. .ucode_api_max = IWL5000_UCODE_API_MAX,
  492. .ucode_api_min = IWL5000_UCODE_API_MIN,
  493. .sku = IWL_SKU_A|IWL_SKU_G,
  494. .ops = &iwl5000_ops,
  495. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  496. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  497. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  498. .num_of_queues = IWLAGN_NUM_QUEUES,
  499. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  500. .mod_params = &iwlagn_mod_params,
  501. .valid_tx_ant = ANT_B,
  502. .valid_rx_ant = ANT_AB,
  503. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  504. .set_l0s = true,
  505. .use_bsm = false,
  506. .led_compensation = 51,
  507. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  508. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  509. .chain_noise_scale = 1000,
  510. .monitor_recover_period = IWL_MONITORING_PERIOD,
  511. .max_event_log_size = 512,
  512. .ucode_tracing = true,
  513. .sensitivity_calib_by_driver = true,
  514. .chain_noise_calib_by_driver = true,
  515. };
  516. struct iwl_cfg iwl5100_agn_cfg = {
  517. .name = "Intel(R) WiFi Link 5100 AGN",
  518. .fw_name_pre = IWL5000_FW_PRE,
  519. .ucode_api_max = IWL5000_UCODE_API_MAX,
  520. .ucode_api_min = IWL5000_UCODE_API_MIN,
  521. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  522. .ops = &iwl5000_ops,
  523. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  524. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  525. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  526. .num_of_queues = IWLAGN_NUM_QUEUES,
  527. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  528. .mod_params = &iwlagn_mod_params,
  529. .valid_tx_ant = ANT_B,
  530. .valid_rx_ant = ANT_AB,
  531. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  532. .set_l0s = true,
  533. .use_bsm = false,
  534. .ht_greenfield_support = true,
  535. .led_compensation = 51,
  536. .use_rts_for_ht = true, /* use rts/cts protection */
  537. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  538. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  539. .chain_noise_scale = 1000,
  540. .monitor_recover_period = IWL_MONITORING_PERIOD,
  541. .max_event_log_size = 512,
  542. .ucode_tracing = true,
  543. .sensitivity_calib_by_driver = true,
  544. .chain_noise_calib_by_driver = true,
  545. };
  546. struct iwl_cfg iwl5350_agn_cfg = {
  547. .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
  548. .fw_name_pre = IWL5000_FW_PRE,
  549. .ucode_api_max = IWL5000_UCODE_API_MAX,
  550. .ucode_api_min = IWL5000_UCODE_API_MIN,
  551. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  552. .ops = &iwl5000_ops,
  553. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  554. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  555. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  556. .num_of_queues = IWLAGN_NUM_QUEUES,
  557. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  558. .mod_params = &iwlagn_mod_params,
  559. .valid_tx_ant = ANT_ABC,
  560. .valid_rx_ant = ANT_ABC,
  561. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  562. .set_l0s = true,
  563. .use_bsm = false,
  564. .ht_greenfield_support = true,
  565. .led_compensation = 51,
  566. .use_rts_for_ht = true, /* use rts/cts protection */
  567. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  568. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  569. .chain_noise_scale = 1000,
  570. .monitor_recover_period = IWL_MONITORING_PERIOD,
  571. .max_event_log_size = 512,
  572. .ucode_tracing = true,
  573. .sensitivity_calib_by_driver = true,
  574. .chain_noise_calib_by_driver = true,
  575. };
  576. struct iwl_cfg iwl5150_agn_cfg = {
  577. .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
  578. .fw_name_pre = IWL5150_FW_PRE,
  579. .ucode_api_max = IWL5150_UCODE_API_MAX,
  580. .ucode_api_min = IWL5150_UCODE_API_MIN,
  581. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  582. .ops = &iwl5150_ops,
  583. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  584. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  585. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  586. .num_of_queues = IWLAGN_NUM_QUEUES,
  587. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  588. .mod_params = &iwlagn_mod_params,
  589. .valid_tx_ant = ANT_A,
  590. .valid_rx_ant = ANT_AB,
  591. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  592. .set_l0s = true,
  593. .use_bsm = false,
  594. .ht_greenfield_support = true,
  595. .led_compensation = 51,
  596. .use_rts_for_ht = true, /* use rts/cts protection */
  597. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  598. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  599. .chain_noise_scale = 1000,
  600. .monitor_recover_period = IWL_MONITORING_PERIOD,
  601. .max_event_log_size = 512,
  602. .ucode_tracing = true,
  603. .sensitivity_calib_by_driver = true,
  604. .chain_noise_calib_by_driver = true,
  605. };
  606. struct iwl_cfg iwl5150_abg_cfg = {
  607. .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
  608. .fw_name_pre = IWL5150_FW_PRE,
  609. .ucode_api_max = IWL5150_UCODE_API_MAX,
  610. .ucode_api_min = IWL5150_UCODE_API_MIN,
  611. .sku = IWL_SKU_A|IWL_SKU_G,
  612. .ops = &iwl5150_ops,
  613. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  614. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  615. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  616. .num_of_queues = IWLAGN_NUM_QUEUES,
  617. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  618. .mod_params = &iwlagn_mod_params,
  619. .valid_tx_ant = ANT_A,
  620. .valid_rx_ant = ANT_AB,
  621. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  622. .set_l0s = true,
  623. .use_bsm = false,
  624. .led_compensation = 51,
  625. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  626. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  627. .chain_noise_scale = 1000,
  628. .monitor_recover_period = IWL_MONITORING_PERIOD,
  629. .max_event_log_size = 512,
  630. .ucode_tracing = true,
  631. .sensitivity_calib_by_driver = true,
  632. .chain_noise_calib_by_driver = true,
  633. };
  634. MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
  635. MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));