iwl-6000.c 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 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/skbuff.h>
  33. #include <linux/netdevice.h>
  34. #include <linux/wireless.h>
  35. #include <net/mac80211.h>
  36. #include <linux/etherdevice.h>
  37. #include <asm/unaligned.h>
  38. #include "iwl-eeprom.h"
  39. #include "iwl-dev.h"
  40. #include "iwl-core.h"
  41. #include "iwl-io.h"
  42. #include "iwl-sta.h"
  43. #include "iwl-agn.h"
  44. #include "iwl-helpers.h"
  45. #include "iwl-agn-hw.h"
  46. #include "iwl-6000-hw.h"
  47. #include "iwl-agn-led.h"
  48. #include "iwl-agn-debugfs.h"
  49. /* Highest firmware API version supported */
  50. #define IWL6000_UCODE_API_MAX 4
  51. #define IWL6050_UCODE_API_MAX 5
  52. #define IWL6000G2_UCODE_API_MAX 5
  53. /* Lowest firmware API version supported */
  54. #define IWL6000_UCODE_API_MIN 4
  55. #define IWL6050_UCODE_API_MIN 4
  56. #define IWL6000G2_UCODE_API_MIN 4
  57. #define IWL6000_FW_PRE "iwlwifi-6000-"
  58. #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
  59. #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api)
  60. #define IWL6050_FW_PRE "iwlwifi-6050-"
  61. #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
  62. #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
  63. #define IWL6000G2A_FW_PRE "iwlwifi-6000g2a-"
  64. #define _IWL6000G2A_MODULE_FIRMWARE(api) IWL6000G2A_FW_PRE #api ".ucode"
  65. #define IWL6000G2A_MODULE_FIRMWARE(api) _IWL6000G2A_MODULE_FIRMWARE(api)
  66. #define IWL6000G2B_FW_PRE "iwlwifi-6000g2b-"
  67. #define _IWL6000G2B_MODULE_FIRMWARE(api) IWL6000G2B_FW_PRE #api ".ucode"
  68. #define IWL6000G2B_MODULE_FIRMWARE(api) _IWL6000G2B_MODULE_FIRMWARE(api)
  69. static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
  70. {
  71. /* want Celsius */
  72. priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
  73. priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
  74. }
  75. static void iwl6050_additional_nic_config(struct iwl_priv *priv)
  76. {
  77. /* Indicate calibration version to uCode. */
  78. if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
  79. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  80. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  81. }
  82. static void iwl6050g2_additional_nic_config(struct iwl_priv *priv)
  83. {
  84. /* Indicate calibration version to uCode. */
  85. if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
  86. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  87. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  88. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  89. CSR_GP_DRIVER_REG_BIT_6050_1x2);
  90. }
  91. /* NIC configuration for 6000 series */
  92. static void iwl6000_nic_config(struct iwl_priv *priv)
  93. {
  94. u16 radio_cfg;
  95. radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
  96. /* write radio config values to register */
  97. if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
  98. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  99. EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
  100. EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
  101. EEPROM_RF_CFG_DASH_MSK(radio_cfg));
  102. /* set CSR_HW_CONFIG_REG for uCode use */
  103. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  104. CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
  105. CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
  106. /* no locking required for register write */
  107. if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
  108. /* 2x2 IPA phy type */
  109. iwl_write32(priv, CSR_GP_DRIVER_REG,
  110. CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
  111. }
  112. /* do additional nic configuration if needed */
  113. if (priv->cfg->ops->nic &&
  114. priv->cfg->ops->nic->additional_nic_config) {
  115. priv->cfg->ops->nic->additional_nic_config(priv);
  116. }
  117. }
  118. static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
  119. .min_nrg_cck = 97,
  120. .max_nrg_cck = 0, /* not used, set to 0 */
  121. .auto_corr_min_ofdm = 80,
  122. .auto_corr_min_ofdm_mrc = 128,
  123. .auto_corr_min_ofdm_x1 = 105,
  124. .auto_corr_min_ofdm_mrc_x1 = 192,
  125. .auto_corr_max_ofdm = 145,
  126. .auto_corr_max_ofdm_mrc = 232,
  127. .auto_corr_max_ofdm_x1 = 110,
  128. .auto_corr_max_ofdm_mrc_x1 = 232,
  129. .auto_corr_min_cck = 125,
  130. .auto_corr_max_cck = 175,
  131. .auto_corr_min_cck_mrc = 160,
  132. .auto_corr_max_cck_mrc = 310,
  133. .nrg_th_cck = 97,
  134. .nrg_th_ofdm = 100,
  135. .barker_corr_th_min = 190,
  136. .barker_corr_th_min_mrc = 390,
  137. .nrg_th_cca = 62,
  138. };
  139. static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
  140. {
  141. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  142. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  143. priv->cfg->base_params->num_of_queues =
  144. priv->cfg->mod_params->num_of_queues;
  145. priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
  146. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  147. priv->hw_params.scd_bc_tbls_size =
  148. priv->cfg->base_params->num_of_queues *
  149. sizeof(struct iwlagn_scd_bc_tbl);
  150. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  151. priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
  152. priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
  153. priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
  154. priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
  155. priv->hw_params.max_bsm_size = 0;
  156. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  157. BIT(IEEE80211_BAND_5GHZ);
  158. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  159. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  160. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  161. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  162. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  163. if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
  164. priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
  165. /* Set initial sensitivity parameters */
  166. /* Set initial calibration set */
  167. priv->hw_params.sens = &iwl6000_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_BASE_BAND);
  173. if (priv->cfg->need_dc_calib)
  174. priv->hw_params.calib_rt_cfg |= BIT(IWL_CALIB_CFG_DC_IDX);
  175. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  176. return 0;
  177. }
  178. static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
  179. struct ieee80211_channel_switch *ch_switch)
  180. {
  181. /*
  182. * MULTI-FIXME
  183. * See iwl_mac_channel_switch.
  184. */
  185. struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
  186. struct iwl6000_channel_switch_cmd cmd;
  187. const struct iwl_channel_info *ch_info;
  188. u32 switch_time_in_usec, ucode_switch_time;
  189. u16 ch;
  190. u32 tsf_low;
  191. u8 switch_count;
  192. u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
  193. struct ieee80211_vif *vif = ctx->vif;
  194. struct iwl_host_cmd hcmd = {
  195. .id = REPLY_CHANNEL_SWITCH,
  196. .len = sizeof(cmd),
  197. .flags = CMD_SYNC,
  198. .data = &cmd,
  199. };
  200. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  201. ch = ch_switch->channel->hw_value;
  202. IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
  203. ctx->active.channel, ch);
  204. cmd.channel = cpu_to_le16(ch);
  205. cmd.rxon_flags = ctx->staging.flags;
  206. cmd.rxon_filter_flags = ctx->staging.filter_flags;
  207. switch_count = ch_switch->count;
  208. tsf_low = ch_switch->timestamp & 0x0ffffffff;
  209. /*
  210. * calculate the ucode channel switch time
  211. * adding TSF as one of the factor for when to switch
  212. */
  213. if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
  214. if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
  215. beacon_interval)) {
  216. switch_count -= (priv->ucode_beacon_time -
  217. tsf_low) / beacon_interval;
  218. } else
  219. switch_count = 0;
  220. }
  221. if (switch_count <= 1)
  222. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  223. else {
  224. switch_time_in_usec =
  225. vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
  226. ucode_switch_time = iwl_usecs_to_beacons(priv,
  227. switch_time_in_usec,
  228. beacon_interval);
  229. cmd.switch_time = iwl_add_beacon_time(priv,
  230. priv->ucode_beacon_time,
  231. ucode_switch_time,
  232. beacon_interval);
  233. }
  234. IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
  235. cmd.switch_time);
  236. ch_info = iwl_get_channel_info(priv, priv->band, ch);
  237. if (ch_info)
  238. cmd.expect_beacon = is_channel_radar(ch_info);
  239. else {
  240. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  241. ctx->active.channel, ch);
  242. return -EFAULT;
  243. }
  244. priv->switch_rxon.channel = cmd.channel;
  245. priv->switch_rxon.switch_in_progress = true;
  246. return iwl_send_cmd_sync(priv, &hcmd);
  247. }
  248. static struct iwl_lib_ops iwl6000_lib = {
  249. .set_hw_params = iwl6000_hw_set_hw_params,
  250. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  251. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  252. .txq_set_sched = iwlagn_txq_set_sched,
  253. .txq_agg_enable = iwlagn_txq_agg_enable,
  254. .txq_agg_disable = iwlagn_txq_agg_disable,
  255. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  256. .txq_free_tfd = iwl_hw_txq_free_tfd,
  257. .txq_init = iwl_hw_tx_queue_init,
  258. .rx_handler_setup = iwlagn_rx_handler_setup,
  259. .setup_deferred_work = iwlagn_setup_deferred_work,
  260. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  261. .load_ucode = iwlagn_load_ucode,
  262. .dump_nic_event_log = iwl_dump_nic_event_log,
  263. .dump_nic_error_log = iwl_dump_nic_error_log,
  264. .dump_csr = iwl_dump_csr,
  265. .dump_fh = iwl_dump_fh,
  266. .init_alive_start = iwlagn_init_alive_start,
  267. .alive_notify = iwlagn_alive_notify,
  268. .send_tx_power = iwlagn_send_tx_power,
  269. .update_chain_flags = iwl_update_chain_flags,
  270. .set_channel_switch = iwl6000_hw_channel_switch,
  271. .apm_ops = {
  272. .init = iwl_apm_init,
  273. .stop = iwl_apm_stop,
  274. .config = iwl6000_nic_config,
  275. .set_pwr_src = iwl_set_pwr_src,
  276. },
  277. .eeprom_ops = {
  278. .regulatory_bands = {
  279. EEPROM_REG_BAND_1_CHANNELS,
  280. EEPROM_REG_BAND_2_CHANNELS,
  281. EEPROM_REG_BAND_3_CHANNELS,
  282. EEPROM_REG_BAND_4_CHANNELS,
  283. EEPROM_REG_BAND_5_CHANNELS,
  284. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  285. EEPROM_REG_BAND_52_HT40_CHANNELS
  286. },
  287. .verify_signature = iwlcore_eeprom_verify_signature,
  288. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  289. .release_semaphore = iwlcore_eeprom_release_semaphore,
  290. .calib_version = iwlagn_eeprom_calib_version,
  291. .query_addr = iwlagn_eeprom_query_addr,
  292. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  293. },
  294. .post_associate = iwl_post_associate,
  295. .isr = iwl_isr_ict,
  296. .config_ap = iwl_config_ap,
  297. .temp_ops = {
  298. .temperature = iwlagn_temperature,
  299. .set_ct_kill = iwl6000_set_ct_threshold,
  300. },
  301. .manage_ibss_station = iwlagn_manage_ibss_station,
  302. .update_bcast_stations = iwl_update_bcast_stations,
  303. .debugfs_ops = {
  304. .rx_stats_read = iwl_ucode_rx_stats_read,
  305. .tx_stats_read = iwl_ucode_tx_stats_read,
  306. .general_stats_read = iwl_ucode_general_stats_read,
  307. .bt_stats_read = iwl_ucode_bt_stats_read,
  308. .reply_tx_error = iwl_reply_tx_error_read,
  309. },
  310. .recover_from_tx_stall = iwl_bg_monitor_recover,
  311. .check_plcp_health = iwl_good_plcp_health,
  312. .check_ack_health = iwl_good_ack_health,
  313. .txfifo_flush = iwlagn_txfifo_flush,
  314. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  315. .tt_ops = {
  316. .lower_power_detection = iwl_tt_is_low_power_state,
  317. .tt_power_mode = iwl_tt_current_power_mode,
  318. .ct_kill_check = iwl_check_for_ct_kill,
  319. }
  320. };
  321. static struct iwl_lib_ops iwl6000g2b_lib = {
  322. .set_hw_params = iwl6000_hw_set_hw_params,
  323. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  324. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  325. .txq_set_sched = iwlagn_txq_set_sched,
  326. .txq_agg_enable = iwlagn_txq_agg_enable,
  327. .txq_agg_disable = iwlagn_txq_agg_disable,
  328. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  329. .txq_free_tfd = iwl_hw_txq_free_tfd,
  330. .txq_init = iwl_hw_tx_queue_init,
  331. .rx_handler_setup = iwlagn_bt_rx_handler_setup,
  332. .setup_deferred_work = iwlagn_bt_setup_deferred_work,
  333. .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
  334. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  335. .load_ucode = iwlagn_load_ucode,
  336. .dump_nic_event_log = iwl_dump_nic_event_log,
  337. .dump_nic_error_log = iwl_dump_nic_error_log,
  338. .dump_csr = iwl_dump_csr,
  339. .dump_fh = iwl_dump_fh,
  340. .init_alive_start = iwlagn_init_alive_start,
  341. .alive_notify = iwlagn_alive_notify,
  342. .send_tx_power = iwlagn_send_tx_power,
  343. .update_chain_flags = iwl_update_chain_flags,
  344. .set_channel_switch = iwl6000_hw_channel_switch,
  345. .apm_ops = {
  346. .init = iwl_apm_init,
  347. .stop = iwl_apm_stop,
  348. .config = iwl6000_nic_config,
  349. .set_pwr_src = iwl_set_pwr_src,
  350. },
  351. .eeprom_ops = {
  352. .regulatory_bands = {
  353. EEPROM_REG_BAND_1_CHANNELS,
  354. EEPROM_REG_BAND_2_CHANNELS,
  355. EEPROM_REG_BAND_3_CHANNELS,
  356. EEPROM_REG_BAND_4_CHANNELS,
  357. EEPROM_REG_BAND_5_CHANNELS,
  358. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  359. EEPROM_REG_BAND_52_HT40_CHANNELS
  360. },
  361. .verify_signature = iwlcore_eeprom_verify_signature,
  362. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  363. .release_semaphore = iwlcore_eeprom_release_semaphore,
  364. .calib_version = iwlagn_eeprom_calib_version,
  365. .query_addr = iwlagn_eeprom_query_addr,
  366. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  367. },
  368. .post_associate = iwl_post_associate,
  369. .isr = iwl_isr_ict,
  370. .config_ap = iwl_config_ap,
  371. .temp_ops = {
  372. .temperature = iwlagn_temperature,
  373. .set_ct_kill = iwl6000_set_ct_threshold,
  374. },
  375. .manage_ibss_station = iwlagn_manage_ibss_station,
  376. .update_bcast_stations = iwl_update_bcast_stations,
  377. .debugfs_ops = {
  378. .rx_stats_read = iwl_ucode_rx_stats_read,
  379. .tx_stats_read = iwl_ucode_tx_stats_read,
  380. .general_stats_read = iwl_ucode_general_stats_read,
  381. .bt_stats_read = iwl_ucode_bt_stats_read,
  382. .reply_tx_error = iwl_reply_tx_error_read,
  383. },
  384. .recover_from_tx_stall = iwl_bg_monitor_recover,
  385. .check_plcp_health = iwl_good_plcp_health,
  386. .check_ack_health = iwl_good_ack_health,
  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 struct iwl_nic_ops iwl6050_nic_ops = {
  396. .additional_nic_config = &iwl6050_additional_nic_config,
  397. };
  398. static struct iwl_nic_ops iwl6050g2_nic_ops = {
  399. .additional_nic_config = &iwl6050g2_additional_nic_config,
  400. };
  401. static const struct iwl_ops iwl6000_ops = {
  402. .lib = &iwl6000_lib,
  403. .hcmd = &iwlagn_hcmd,
  404. .utils = &iwlagn_hcmd_utils,
  405. .led = &iwlagn_led_ops,
  406. };
  407. static const struct iwl_ops iwl6050_ops = {
  408. .lib = &iwl6000_lib,
  409. .hcmd = &iwlagn_hcmd,
  410. .utils = &iwlagn_hcmd_utils,
  411. .led = &iwlagn_led_ops,
  412. .nic = &iwl6050_nic_ops,
  413. };
  414. static const struct iwl_ops iwl6050g2_ops = {
  415. .lib = &iwl6000_lib,
  416. .hcmd = &iwlagn_hcmd,
  417. .utils = &iwlagn_hcmd_utils,
  418. .led = &iwlagn_led_ops,
  419. .nic = &iwl6050g2_nic_ops,
  420. };
  421. static const struct iwl_ops iwl6000g2b_ops = {
  422. .lib = &iwl6000g2b_lib,
  423. .hcmd = &iwlagn_bt_hcmd,
  424. .utils = &iwlagn_hcmd_utils,
  425. .led = &iwlagn_led_ops,
  426. };
  427. static struct iwl_base_params iwl6000_base_params = {
  428. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  429. .num_of_queues = IWLAGN_NUM_QUEUES,
  430. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  431. .pll_cfg_val = 0,
  432. .set_l0s = true,
  433. .use_bsm = false,
  434. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  435. .shadow_ram_support = true,
  436. .led_compensation = 51,
  437. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  438. .supports_idle = true,
  439. .adv_thermal_throttle = true,
  440. .support_ct_kill_exit = true,
  441. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  442. .chain_noise_scale = 1000,
  443. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  444. .max_event_log_size = 512,
  445. .ucode_tracing = true,
  446. .sensitivity_calib_by_driver = true,
  447. .chain_noise_calib_by_driver = true,
  448. };
  449. static struct iwl_base_params iwl6050_base_params = {
  450. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  451. .num_of_queues = IWLAGN_NUM_QUEUES,
  452. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  453. .pll_cfg_val = 0,
  454. .set_l0s = true,
  455. .use_bsm = false,
  456. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  457. .shadow_ram_support = true,
  458. .led_compensation = 51,
  459. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  460. .supports_idle = true,
  461. .adv_thermal_throttle = true,
  462. .support_ct_kill_exit = true,
  463. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  464. .chain_noise_scale = 1500,
  465. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  466. .max_event_log_size = 1024,
  467. .ucode_tracing = true,
  468. .sensitivity_calib_by_driver = true,
  469. .chain_noise_calib_by_driver = true,
  470. };
  471. static struct iwl_ht_params iwl6000_ht_params = {
  472. .ht_greenfield_support = true,
  473. .use_rts_for_aggregation = true, /* use rts/cts protection */
  474. };
  475. static struct iwl_bt_params iwl6000_bt_params = {
  476. .bt_statistics = true,
  477. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  478. .advanced_bt_coexist = true,
  479. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  480. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  481. };
  482. struct iwl_cfg iwl6000g2a_2agn_cfg = {
  483. .name = "6000 Series 2x2 AGN Gen2a",
  484. .fw_name_pre = IWL6000G2A_FW_PRE,
  485. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  486. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  487. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  488. .valid_tx_ant = ANT_AB,
  489. .valid_rx_ant = ANT_AB,
  490. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  491. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  492. .ops = &iwl6000_ops,
  493. .mod_params = &iwlagn_mod_params,
  494. .base_params = &iwl6000_base_params,
  495. .ht_params = &iwl6000_ht_params,
  496. .need_dc_calib = true,
  497. };
  498. struct iwl_cfg iwl6000g2a_2abg_cfg = {
  499. .name = "6000 Series 2x2 ABG Gen2a",
  500. .fw_name_pre = IWL6000G2A_FW_PRE,
  501. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  502. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  503. .sku = IWL_SKU_A|IWL_SKU_G,
  504. .valid_tx_ant = ANT_AB,
  505. .valid_rx_ant = ANT_AB,
  506. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  507. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  508. .ops = &iwl6000_ops,
  509. .mod_params = &iwlagn_mod_params,
  510. .base_params = &iwl6000_base_params,
  511. .need_dc_calib = true,
  512. };
  513. struct iwl_cfg iwl6000g2a_2bg_cfg = {
  514. .name = "6000 Series 2x2 BG Gen2a",
  515. .fw_name_pre = IWL6000G2A_FW_PRE,
  516. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  517. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  518. .sku = IWL_SKU_G,
  519. .valid_tx_ant = ANT_AB,
  520. .valid_rx_ant = ANT_AB,
  521. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  522. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  523. .ops = &iwl6000_ops,
  524. .mod_params = &iwlagn_mod_params,
  525. .base_params = &iwl6000_base_params,
  526. .need_dc_calib = true,
  527. };
  528. struct iwl_cfg iwl6000g2b_2agn_cfg = {
  529. .name = "6000 Series 2x2 AGN Gen2b",
  530. .fw_name_pre = IWL6000G2B_FW_PRE,
  531. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  532. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  533. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  534. .valid_tx_ant = ANT_AB,
  535. .valid_rx_ant = ANT_AB,
  536. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  537. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  538. .ops = &iwl6000g2b_ops,
  539. .mod_params = &iwlagn_mod_params,
  540. .base_params = &iwl6000_base_params,
  541. .bt_params = &iwl6000_bt_params,
  542. .ht_params = &iwl6000_ht_params,
  543. .need_dc_calib = true,
  544. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  545. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  546. };
  547. struct iwl_cfg iwl6000g2b_2abg_cfg = {
  548. .name = "6000 Series 2x2 ABG Gen2b",
  549. .fw_name_pre = IWL6000G2B_FW_PRE,
  550. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  551. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  552. .sku = IWL_SKU_A|IWL_SKU_G,
  553. .valid_tx_ant = ANT_AB,
  554. .valid_rx_ant = ANT_AB,
  555. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  556. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  557. .ops = &iwl6000g2b_ops,
  558. .mod_params = &iwlagn_mod_params,
  559. .base_params = &iwl6000_base_params,
  560. .bt_params = &iwl6000_bt_params,
  561. .need_dc_calib = true,
  562. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  563. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  564. };
  565. struct iwl_cfg iwl6000g2b_2bgn_cfg = {
  566. .name = "6000 Series 2x2 BGN Gen2b",
  567. .fw_name_pre = IWL6000G2B_FW_PRE,
  568. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  569. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  570. .sku = IWL_SKU_G|IWL_SKU_N,
  571. .valid_tx_ant = ANT_AB,
  572. .valid_rx_ant = ANT_AB,
  573. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  574. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  575. .ops = &iwl6000g2b_ops,
  576. .mod_params = &iwlagn_mod_params,
  577. .base_params = &iwl6000_base_params,
  578. .bt_params = &iwl6000_bt_params,
  579. .ht_params = &iwl6000_ht_params,
  580. .need_dc_calib = true,
  581. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  582. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  583. };
  584. struct iwl_cfg iwl6000g2b_2bg_cfg = {
  585. .name = "6000 Series 2x2 BG Gen2b",
  586. .fw_name_pre = IWL6000G2B_FW_PRE,
  587. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  588. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  589. .sku = IWL_SKU_G,
  590. .valid_tx_ant = ANT_AB,
  591. .valid_rx_ant = ANT_AB,
  592. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  593. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  594. .ops = &iwl6000g2b_ops,
  595. .mod_params = &iwlagn_mod_params,
  596. .base_params = &iwl6000_base_params,
  597. .bt_params = &iwl6000_bt_params,
  598. .need_dc_calib = true,
  599. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  600. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  601. };
  602. struct iwl_cfg iwl6000g2b_bgn_cfg = {
  603. .name = "6000 Series 1x2 BGN Gen2b",
  604. .fw_name_pre = IWL6000G2B_FW_PRE,
  605. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  606. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  607. .sku = IWL_SKU_G|IWL_SKU_N,
  608. .valid_tx_ant = ANT_A,
  609. .valid_rx_ant = ANT_AB,
  610. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  611. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  612. .ops = &iwl6000g2b_ops,
  613. .mod_params = &iwlagn_mod_params,
  614. .base_params = &iwl6000_base_params,
  615. .bt_params = &iwl6000_bt_params,
  616. .ht_params = &iwl6000_ht_params,
  617. .need_dc_calib = true,
  618. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  619. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  620. };
  621. struct iwl_cfg iwl6000g2b_bg_cfg = {
  622. .name = "6000 Series 1x2 BG Gen2b",
  623. .fw_name_pre = IWL6000G2B_FW_PRE,
  624. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  625. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  626. .sku = IWL_SKU_G,
  627. .valid_tx_ant = ANT_A,
  628. .valid_rx_ant = ANT_AB,
  629. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  630. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  631. .ops = &iwl6000g2b_ops,
  632. .mod_params = &iwlagn_mod_params,
  633. .base_params = &iwl6000_base_params,
  634. .bt_params = &iwl6000_bt_params,
  635. .need_dc_calib = true,
  636. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  637. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  638. };
  639. /*
  640. * "i": Internal configuration, use internal Power Amplifier
  641. */
  642. struct iwl_cfg iwl6000i_2agn_cfg = {
  643. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  644. .fw_name_pre = IWL6000_FW_PRE,
  645. .ucode_api_max = IWL6000_UCODE_API_MAX,
  646. .ucode_api_min = IWL6000_UCODE_API_MIN,
  647. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  648. .valid_tx_ant = ANT_BC,
  649. .valid_rx_ant = ANT_BC,
  650. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  651. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  652. .ops = &iwl6000_ops,
  653. .mod_params = &iwlagn_mod_params,
  654. .base_params = &iwl6000_base_params,
  655. .ht_params = &iwl6000_ht_params,
  656. .pa_type = IWL_PA_INTERNAL,
  657. };
  658. struct iwl_cfg iwl6000i_2abg_cfg = {
  659. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  660. .fw_name_pre = IWL6000_FW_PRE,
  661. .ucode_api_max = IWL6000_UCODE_API_MAX,
  662. .ucode_api_min = IWL6000_UCODE_API_MIN,
  663. .sku = IWL_SKU_A|IWL_SKU_G,
  664. .valid_tx_ant = ANT_BC,
  665. .valid_rx_ant = ANT_BC,
  666. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  667. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  668. .ops = &iwl6000_ops,
  669. .mod_params = &iwlagn_mod_params,
  670. .base_params = &iwl6000_base_params,
  671. .pa_type = IWL_PA_INTERNAL,
  672. };
  673. struct iwl_cfg iwl6000i_2bg_cfg = {
  674. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  675. .fw_name_pre = IWL6000_FW_PRE,
  676. .ucode_api_max = IWL6000_UCODE_API_MAX,
  677. .ucode_api_min = IWL6000_UCODE_API_MIN,
  678. .sku = IWL_SKU_G,
  679. .valid_tx_ant = ANT_BC,
  680. .valid_rx_ant = ANT_BC,
  681. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  682. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  683. .ops = &iwl6000_ops,
  684. .mod_params = &iwlagn_mod_params,
  685. .base_params = &iwl6000_base_params,
  686. .pa_type = IWL_PA_INTERNAL,
  687. };
  688. struct iwl_cfg iwl6050_2agn_cfg = {
  689. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  690. .fw_name_pre = IWL6050_FW_PRE,
  691. .ucode_api_max = IWL6050_UCODE_API_MAX,
  692. .ucode_api_min = IWL6050_UCODE_API_MIN,
  693. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  694. .valid_tx_ant = ANT_AB,
  695. .valid_rx_ant = ANT_AB,
  696. .ops = &iwl6000_ops,
  697. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  698. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  699. .mod_params = &iwlagn_mod_params,
  700. .base_params = &iwl6050_base_params,
  701. .ht_params = &iwl6000_ht_params,
  702. .need_dc_calib = true,
  703. };
  704. struct iwl_cfg iwl6050g2_bgn_cfg = {
  705. .name = "6050 Series 1x2 BGN Gen2",
  706. .fw_name_pre = IWL6050_FW_PRE,
  707. .ucode_api_max = IWL6050_UCODE_API_MAX,
  708. .ucode_api_min = IWL6050_UCODE_API_MIN,
  709. .sku = IWL_SKU_G|IWL_SKU_N,
  710. .valid_tx_ant = ANT_A,
  711. .valid_rx_ant = ANT_AB,
  712. .eeprom_ver = EEPROM_6050G2_EEPROM_VERSION,
  713. .eeprom_calib_ver = EEPROM_6050G2_TX_POWER_VERSION,
  714. .ops = &iwl6050g2_ops,
  715. .mod_params = &iwlagn_mod_params,
  716. .base_params = &iwl6050_base_params,
  717. .ht_params = &iwl6000_ht_params,
  718. .need_dc_calib = true,
  719. };
  720. struct iwl_cfg iwl6050_2abg_cfg = {
  721. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  722. .fw_name_pre = IWL6050_FW_PRE,
  723. .ucode_api_max = IWL6050_UCODE_API_MAX,
  724. .ucode_api_min = IWL6050_UCODE_API_MIN,
  725. .sku = IWL_SKU_A|IWL_SKU_G,
  726. .valid_tx_ant = ANT_AB,
  727. .valid_rx_ant = ANT_AB,
  728. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  729. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  730. .ops = &iwl6050_ops,
  731. .mod_params = &iwlagn_mod_params,
  732. .base_params = &iwl6050_base_params,
  733. .need_dc_calib = true,
  734. };
  735. struct iwl_cfg iwl6000_3agn_cfg = {
  736. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  737. .fw_name_pre = IWL6000_FW_PRE,
  738. .ucode_api_max = IWL6000_UCODE_API_MAX,
  739. .ucode_api_min = IWL6000_UCODE_API_MIN,
  740. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  741. .valid_tx_ant = ANT_ABC,
  742. .valid_rx_ant = ANT_ABC,
  743. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  744. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  745. .ops = &iwl6000_ops,
  746. .mod_params = &iwlagn_mod_params,
  747. .base_params = &iwl6000_base_params,
  748. .ht_params = &iwl6000_ht_params,
  749. .need_dc_calib = true,
  750. };
  751. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  752. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  753. MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  754. MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));