iwl-6000.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  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. iwl6000_set_ct_threshold(priv);
  164. /* Set initial sensitivity parameters */
  165. /* Set initial calibration set */
  166. priv->hw_params.sens = &iwl6000_sensitivity;
  167. priv->hw_params.calib_init_cfg =
  168. BIT(IWL_CALIB_XTAL) |
  169. BIT(IWL_CALIB_LO) |
  170. BIT(IWL_CALIB_TX_IQ) |
  171. BIT(IWL_CALIB_BASE_BAND);
  172. if (priv->cfg->need_dc_calib)
  173. priv->hw_params.calib_rt_cfg |= BIT(IWL_CALIB_CFG_DC_IDX);
  174. if (priv->cfg->need_temp_offset_calib)
  175. priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);
  176. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  177. return 0;
  178. }
  179. static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
  180. struct ieee80211_channel_switch *ch_switch)
  181. {
  182. /*
  183. * MULTI-FIXME
  184. * See iwl_mac_channel_switch.
  185. */
  186. struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
  187. struct iwl6000_channel_switch_cmd cmd;
  188. const struct iwl_channel_info *ch_info;
  189. u32 switch_time_in_usec, ucode_switch_time;
  190. u16 ch;
  191. u32 tsf_low;
  192. u8 switch_count;
  193. u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
  194. struct ieee80211_vif *vif = ctx->vif;
  195. struct iwl_host_cmd hcmd = {
  196. .id = REPLY_CHANNEL_SWITCH,
  197. .len = sizeof(cmd),
  198. .flags = CMD_SYNC,
  199. .data = &cmd,
  200. };
  201. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  202. ch = ch_switch->channel->hw_value;
  203. IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
  204. ctx->active.channel, ch);
  205. cmd.channel = cpu_to_le16(ch);
  206. cmd.rxon_flags = ctx->staging.flags;
  207. cmd.rxon_filter_flags = ctx->staging.filter_flags;
  208. switch_count = ch_switch->count;
  209. tsf_low = ch_switch->timestamp & 0x0ffffffff;
  210. /*
  211. * calculate the ucode channel switch time
  212. * adding TSF as one of the factor for when to switch
  213. */
  214. if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
  215. if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
  216. beacon_interval)) {
  217. switch_count -= (priv->ucode_beacon_time -
  218. tsf_low) / beacon_interval;
  219. } else
  220. switch_count = 0;
  221. }
  222. if (switch_count <= 1)
  223. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  224. else {
  225. switch_time_in_usec =
  226. vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
  227. ucode_switch_time = iwl_usecs_to_beacons(priv,
  228. switch_time_in_usec,
  229. beacon_interval);
  230. cmd.switch_time = iwl_add_beacon_time(priv,
  231. priv->ucode_beacon_time,
  232. ucode_switch_time,
  233. beacon_interval);
  234. }
  235. IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
  236. cmd.switch_time);
  237. ch_info = iwl_get_channel_info(priv, priv->band, ch);
  238. if (ch_info)
  239. cmd.expect_beacon = is_channel_radar(ch_info);
  240. else {
  241. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  242. ctx->active.channel, ch);
  243. return -EFAULT;
  244. }
  245. priv->switch_rxon.channel = cmd.channel;
  246. priv->switch_rxon.switch_in_progress = true;
  247. return iwl_send_cmd_sync(priv, &hcmd);
  248. }
  249. static struct iwl_lib_ops iwl6000_lib = {
  250. .set_hw_params = iwl6000_hw_set_hw_params,
  251. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  252. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  253. .txq_set_sched = iwlagn_txq_set_sched,
  254. .txq_agg_enable = iwlagn_txq_agg_enable,
  255. .txq_agg_disable = iwlagn_txq_agg_disable,
  256. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  257. .txq_free_tfd = iwl_hw_txq_free_tfd,
  258. .txq_init = iwl_hw_tx_queue_init,
  259. .rx_handler_setup = iwlagn_rx_handler_setup,
  260. .setup_deferred_work = iwlagn_setup_deferred_work,
  261. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  262. .load_ucode = iwlagn_load_ucode,
  263. .dump_nic_event_log = iwl_dump_nic_event_log,
  264. .dump_nic_error_log = iwl_dump_nic_error_log,
  265. .dump_csr = iwl_dump_csr,
  266. .dump_fh = iwl_dump_fh,
  267. .init_alive_start = iwlagn_init_alive_start,
  268. .alive_notify = iwlagn_alive_notify,
  269. .send_tx_power = iwlagn_send_tx_power,
  270. .update_chain_flags = iwl_update_chain_flags,
  271. .set_channel_switch = iwl6000_hw_channel_switch,
  272. .apm_ops = {
  273. .init = iwl_apm_init,
  274. .config = iwl6000_nic_config,
  275. },
  276. .eeprom_ops = {
  277. .regulatory_bands = {
  278. EEPROM_REG_BAND_1_CHANNELS,
  279. EEPROM_REG_BAND_2_CHANNELS,
  280. EEPROM_REG_BAND_3_CHANNELS,
  281. EEPROM_REG_BAND_4_CHANNELS,
  282. EEPROM_REG_BAND_5_CHANNELS,
  283. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  284. EEPROM_REG_BAND_52_HT40_CHANNELS
  285. },
  286. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  287. .release_semaphore = iwlcore_eeprom_release_semaphore,
  288. .calib_version = iwlagn_eeprom_calib_version,
  289. .query_addr = iwlagn_eeprom_query_addr,
  290. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  291. },
  292. .isr_ops = {
  293. .isr = iwl_isr_ict,
  294. .free = iwl_free_isr_ict,
  295. .alloc = iwl_alloc_isr_ict,
  296. .reset = iwl_reset_ict,
  297. .disable = iwl_disable_ict,
  298. },
  299. .temp_ops = {
  300. .temperature = iwlagn_temperature,
  301. },
  302. .debugfs_ops = {
  303. .rx_stats_read = iwl_ucode_rx_stats_read,
  304. .tx_stats_read = iwl_ucode_tx_stats_read,
  305. .general_stats_read = iwl_ucode_general_stats_read,
  306. .bt_stats_read = iwl_ucode_bt_stats_read,
  307. .reply_tx_error = iwl_reply_tx_error_read,
  308. },
  309. .check_plcp_health = iwl_good_plcp_health,
  310. .check_ack_health = iwl_good_ack_health,
  311. .txfifo_flush = iwlagn_txfifo_flush,
  312. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  313. .tt_ops = {
  314. .lower_power_detection = iwl_tt_is_low_power_state,
  315. .tt_power_mode = iwl_tt_current_power_mode,
  316. .ct_kill_check = iwl_check_for_ct_kill,
  317. }
  318. };
  319. static struct iwl_lib_ops iwl6000g2b_lib = {
  320. .set_hw_params = iwl6000_hw_set_hw_params,
  321. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  322. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  323. .txq_set_sched = iwlagn_txq_set_sched,
  324. .txq_agg_enable = iwlagn_txq_agg_enable,
  325. .txq_agg_disable = iwlagn_txq_agg_disable,
  326. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  327. .txq_free_tfd = iwl_hw_txq_free_tfd,
  328. .txq_init = iwl_hw_tx_queue_init,
  329. .rx_handler_setup = iwlagn_bt_rx_handler_setup,
  330. .setup_deferred_work = iwlagn_bt_setup_deferred_work,
  331. .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
  332. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  333. .load_ucode = iwlagn_load_ucode,
  334. .dump_nic_event_log = iwl_dump_nic_event_log,
  335. .dump_nic_error_log = iwl_dump_nic_error_log,
  336. .dump_csr = iwl_dump_csr,
  337. .dump_fh = iwl_dump_fh,
  338. .init_alive_start = iwlagn_init_alive_start,
  339. .alive_notify = iwlagn_alive_notify,
  340. .send_tx_power = iwlagn_send_tx_power,
  341. .update_chain_flags = iwl_update_chain_flags,
  342. .set_channel_switch = iwl6000_hw_channel_switch,
  343. .apm_ops = {
  344. .init = iwl_apm_init,
  345. .config = iwl6000_nic_config,
  346. },
  347. .eeprom_ops = {
  348. .regulatory_bands = {
  349. EEPROM_REG_BAND_1_CHANNELS,
  350. EEPROM_REG_BAND_2_CHANNELS,
  351. EEPROM_REG_BAND_3_CHANNELS,
  352. EEPROM_REG_BAND_4_CHANNELS,
  353. EEPROM_REG_BAND_5_CHANNELS,
  354. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  355. EEPROM_REG_BAND_52_HT40_CHANNELS
  356. },
  357. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  358. .release_semaphore = iwlcore_eeprom_release_semaphore,
  359. .calib_version = iwlagn_eeprom_calib_version,
  360. .query_addr = iwlagn_eeprom_query_addr,
  361. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  362. },
  363. .isr_ops = {
  364. .isr = iwl_isr_ict,
  365. .free = iwl_free_isr_ict,
  366. .alloc = iwl_alloc_isr_ict,
  367. .reset = iwl_reset_ict,
  368. .disable = iwl_disable_ict,
  369. },
  370. .temp_ops = {
  371. .temperature = iwlagn_temperature,
  372. },
  373. .debugfs_ops = {
  374. .rx_stats_read = iwl_ucode_rx_stats_read,
  375. .tx_stats_read = iwl_ucode_tx_stats_read,
  376. .general_stats_read = iwl_ucode_general_stats_read,
  377. .bt_stats_read = iwl_ucode_bt_stats_read,
  378. .reply_tx_error = iwl_reply_tx_error_read,
  379. },
  380. .check_plcp_health = iwl_good_plcp_health,
  381. .check_ack_health = iwl_good_ack_health,
  382. .txfifo_flush = iwlagn_txfifo_flush,
  383. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  384. .tt_ops = {
  385. .lower_power_detection = iwl_tt_is_low_power_state,
  386. .tt_power_mode = iwl_tt_current_power_mode,
  387. .ct_kill_check = iwl_check_for_ct_kill,
  388. }
  389. };
  390. static struct iwl_nic_ops iwl6050_nic_ops = {
  391. .additional_nic_config = &iwl6050_additional_nic_config,
  392. };
  393. static struct iwl_nic_ops iwl6050g2_nic_ops = {
  394. .additional_nic_config = &iwl6050g2_additional_nic_config,
  395. };
  396. static const struct iwl_ops iwl6000_ops = {
  397. .lib = &iwl6000_lib,
  398. .hcmd = &iwlagn_hcmd,
  399. .utils = &iwlagn_hcmd_utils,
  400. .led = &iwlagn_led_ops,
  401. .ieee80211_ops = &iwlagn_hw_ops,
  402. };
  403. static const struct iwl_ops iwl6050_ops = {
  404. .lib = &iwl6000_lib,
  405. .hcmd = &iwlagn_hcmd,
  406. .utils = &iwlagn_hcmd_utils,
  407. .led = &iwlagn_led_ops,
  408. .nic = &iwl6050_nic_ops,
  409. .ieee80211_ops = &iwlagn_hw_ops,
  410. };
  411. static const struct iwl_ops iwl6050g2_ops = {
  412. .lib = &iwl6000_lib,
  413. .hcmd = &iwlagn_hcmd,
  414. .utils = &iwlagn_hcmd_utils,
  415. .led = &iwlagn_led_ops,
  416. .nic = &iwl6050g2_nic_ops,
  417. .ieee80211_ops = &iwlagn_hw_ops,
  418. };
  419. static const struct iwl_ops iwl6000g2b_ops = {
  420. .lib = &iwl6000g2b_lib,
  421. .hcmd = &iwlagn_bt_hcmd,
  422. .utils = &iwlagn_hcmd_utils,
  423. .led = &iwlagn_led_ops,
  424. .ieee80211_ops = &iwlagn_hw_ops,
  425. };
  426. static struct iwl_base_params iwl6000_base_params = {
  427. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  428. .num_of_queues = IWLAGN_NUM_QUEUES,
  429. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  430. .pll_cfg_val = 0,
  431. .set_l0s = true,
  432. .use_bsm = false,
  433. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  434. .shadow_ram_support = true,
  435. .led_compensation = 51,
  436. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  437. .supports_idle = true,
  438. .adv_thermal_throttle = true,
  439. .support_ct_kill_exit = true,
  440. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  441. .chain_noise_scale = 1000,
  442. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  443. .max_event_log_size = 512,
  444. .ucode_tracing = true,
  445. .sensitivity_calib_by_driver = true,
  446. .chain_noise_calib_by_driver = true,
  447. .shadow_reg_enable = 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. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  466. .max_event_log_size = 1024,
  467. .ucode_tracing = true,
  468. .sensitivity_calib_by_driver = true,
  469. .chain_noise_calib_by_driver = true,
  470. .shadow_reg_enable = true,
  471. };
  472. static struct iwl_base_params iwl6000_coex_base_params = {
  473. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  474. .num_of_queues = IWLAGN_NUM_QUEUES,
  475. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  476. .pll_cfg_val = 0,
  477. .set_l0s = true,
  478. .use_bsm = false,
  479. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  480. .shadow_ram_support = true,
  481. .led_compensation = 51,
  482. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  483. .supports_idle = true,
  484. .adv_thermal_throttle = true,
  485. .support_ct_kill_exit = true,
  486. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  487. .chain_noise_scale = 1000,
  488. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  489. .max_event_log_size = 512,
  490. .ucode_tracing = true,
  491. .sensitivity_calib_by_driver = true,
  492. .chain_noise_calib_by_driver = true,
  493. .shadow_reg_enable = true,
  494. };
  495. static struct iwl_ht_params iwl6000_ht_params = {
  496. .ht_greenfield_support = true,
  497. .use_rts_for_aggregation = true, /* use rts/cts protection */
  498. };
  499. static struct iwl_bt_params iwl6000_bt_params = {
  500. .bt_statistics = true,
  501. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  502. .advanced_bt_coexist = true,
  503. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  504. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  505. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  506. .bt_sco_disable = true,
  507. };
  508. struct iwl_cfg iwl6005_2agn_cfg = {
  509. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  510. .fw_name_pre = IWL6000G2A_FW_PRE,
  511. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  512. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  513. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  514. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  515. .ops = &iwl6000_ops,
  516. .mod_params = &iwlagn_mod_params,
  517. .base_params = &iwl6000_base_params,
  518. .ht_params = &iwl6000_ht_params,
  519. .need_dc_calib = true,
  520. .need_temp_offset_calib = true,
  521. .led_mode = IWL_LED_RF_STATE,
  522. };
  523. struct iwl_cfg iwl6005_2abg_cfg = {
  524. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  525. .fw_name_pre = IWL6000G2A_FW_PRE,
  526. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  527. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  528. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  529. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  530. .ops = &iwl6000_ops,
  531. .mod_params = &iwlagn_mod_params,
  532. .base_params = &iwl6000_base_params,
  533. .need_dc_calib = true,
  534. .need_temp_offset_calib = true,
  535. .led_mode = IWL_LED_RF_STATE,
  536. };
  537. struct iwl_cfg iwl6005_2bg_cfg = {
  538. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  539. .fw_name_pre = IWL6000G2A_FW_PRE,
  540. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  541. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  542. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  543. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  544. .ops = &iwl6000_ops,
  545. .mod_params = &iwlagn_mod_params,
  546. .base_params = &iwl6000_base_params,
  547. .need_dc_calib = true,
  548. .need_temp_offset_calib = true,
  549. .led_mode = IWL_LED_RF_STATE,
  550. };
  551. struct iwl_cfg iwl6030_2agn_cfg = {
  552. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  553. .fw_name_pre = IWL6000G2B_FW_PRE,
  554. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  555. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  556. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  557. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  558. .ops = &iwl6000g2b_ops,
  559. .mod_params = &iwlagn_mod_params,
  560. .base_params = &iwl6000_coex_base_params,
  561. .bt_params = &iwl6000_bt_params,
  562. .ht_params = &iwl6000_ht_params,
  563. .need_dc_calib = true,
  564. .need_temp_offset_calib = true,
  565. .led_mode = IWL_LED_RF_STATE,
  566. .adv_pm = true,
  567. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  568. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  569. };
  570. struct iwl_cfg iwl6030_2abg_cfg = {
  571. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  572. .fw_name_pre = IWL6000G2B_FW_PRE,
  573. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  574. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  575. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  576. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  577. .ops = &iwl6000g2b_ops,
  578. .mod_params = &iwlagn_mod_params,
  579. .base_params = &iwl6000_coex_base_params,
  580. .bt_params = &iwl6000_bt_params,
  581. .need_dc_calib = true,
  582. .need_temp_offset_calib = true,
  583. .led_mode = IWL_LED_RF_STATE,
  584. .adv_pm = true,
  585. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  586. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  587. };
  588. struct iwl_cfg iwl6030_2bgn_cfg = {
  589. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  590. .fw_name_pre = IWL6000G2B_FW_PRE,
  591. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  592. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  593. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  594. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  595. .ops = &iwl6000g2b_ops,
  596. .mod_params = &iwlagn_mod_params,
  597. .base_params = &iwl6000_coex_base_params,
  598. .bt_params = &iwl6000_bt_params,
  599. .ht_params = &iwl6000_ht_params,
  600. .need_dc_calib = true,
  601. .need_temp_offset_calib = true,
  602. .led_mode = IWL_LED_RF_STATE,
  603. .adv_pm = true,
  604. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  605. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  606. };
  607. struct iwl_cfg iwl6030_2bg_cfg = {
  608. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  609. .fw_name_pre = IWL6000G2B_FW_PRE,
  610. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  611. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  612. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  613. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  614. .ops = &iwl6000g2b_ops,
  615. .mod_params = &iwlagn_mod_params,
  616. .base_params = &iwl6000_coex_base_params,
  617. .bt_params = &iwl6000_bt_params,
  618. .need_dc_calib = true,
  619. .need_temp_offset_calib = true,
  620. .led_mode = IWL_LED_RF_STATE,
  621. .adv_pm = true,
  622. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  623. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  624. };
  625. struct iwl_cfg iwl1030_bgn_cfg = {
  626. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  627. .fw_name_pre = IWL6000G2B_FW_PRE,
  628. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  629. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  630. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  631. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  632. .ops = &iwl6000g2b_ops,
  633. .mod_params = &iwlagn_mod_params,
  634. .base_params = &iwl6000_coex_base_params,
  635. .bt_params = &iwl6000_bt_params,
  636. .ht_params = &iwl6000_ht_params,
  637. .need_dc_calib = true,
  638. .need_temp_offset_calib = true,
  639. .led_mode = IWL_LED_RF_STATE,
  640. .adv_pm = true,
  641. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  642. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  643. };
  644. struct iwl_cfg iwl1030_bg_cfg = {
  645. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  646. .fw_name_pre = IWL6000G2B_FW_PRE,
  647. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  648. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  649. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  650. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  651. .ops = &iwl6000g2b_ops,
  652. .mod_params = &iwlagn_mod_params,
  653. .base_params = &iwl6000_coex_base_params,
  654. .bt_params = &iwl6000_bt_params,
  655. .need_dc_calib = true,
  656. .need_temp_offset_calib = true,
  657. .led_mode = IWL_LED_RF_STATE,
  658. .adv_pm = true,
  659. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  660. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  661. };
  662. /*
  663. * "i": Internal configuration, use internal Power Amplifier
  664. */
  665. struct iwl_cfg iwl6000i_2agn_cfg = {
  666. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  667. .fw_name_pre = IWL6000_FW_PRE,
  668. .ucode_api_max = IWL6000_UCODE_API_MAX,
  669. .ucode_api_min = IWL6000_UCODE_API_MIN,
  670. .valid_tx_ant = ANT_BC, /* .cfg overwrite */
  671. .valid_rx_ant = ANT_BC, /* .cfg overwrite */
  672. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  673. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  674. .ops = &iwl6000_ops,
  675. .mod_params = &iwlagn_mod_params,
  676. .base_params = &iwl6000_base_params,
  677. .ht_params = &iwl6000_ht_params,
  678. .pa_type = IWL_PA_INTERNAL,
  679. .led_mode = IWL_LED_BLINK,
  680. };
  681. struct iwl_cfg iwl6000i_2abg_cfg = {
  682. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  683. .fw_name_pre = IWL6000_FW_PRE,
  684. .ucode_api_max = IWL6000_UCODE_API_MAX,
  685. .ucode_api_min = IWL6000_UCODE_API_MIN,
  686. .valid_tx_ant = ANT_BC, /* .cfg overwrite */
  687. .valid_rx_ant = ANT_BC, /* .cfg overwrite */
  688. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  689. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  690. .ops = &iwl6000_ops,
  691. .mod_params = &iwlagn_mod_params,
  692. .base_params = &iwl6000_base_params,
  693. .pa_type = IWL_PA_INTERNAL,
  694. .led_mode = IWL_LED_BLINK,
  695. };
  696. struct iwl_cfg iwl6000i_2bg_cfg = {
  697. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  698. .fw_name_pre = IWL6000_FW_PRE,
  699. .ucode_api_max = IWL6000_UCODE_API_MAX,
  700. .ucode_api_min = IWL6000_UCODE_API_MIN,
  701. .valid_tx_ant = ANT_BC, /* .cfg overwrite */
  702. .valid_rx_ant = ANT_BC, /* .cfg overwrite */
  703. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  704. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  705. .ops = &iwl6000_ops,
  706. .mod_params = &iwlagn_mod_params,
  707. .base_params = &iwl6000_base_params,
  708. .pa_type = IWL_PA_INTERNAL,
  709. .led_mode = IWL_LED_BLINK,
  710. };
  711. struct iwl_cfg iwl6050_2agn_cfg = {
  712. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  713. .fw_name_pre = IWL6050_FW_PRE,
  714. .ucode_api_max = IWL6050_UCODE_API_MAX,
  715. .ucode_api_min = IWL6050_UCODE_API_MIN,
  716. .ops = &iwl6050_ops,
  717. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  718. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  719. .mod_params = &iwlagn_mod_params,
  720. .base_params = &iwl6050_base_params,
  721. .ht_params = &iwl6000_ht_params,
  722. .need_dc_calib = true,
  723. .led_mode = IWL_LED_BLINK,
  724. };
  725. struct iwl_cfg iwl6150_bgn_cfg = {
  726. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  727. .fw_name_pre = IWL6050_FW_PRE,
  728. .ucode_api_max = IWL6050_UCODE_API_MAX,
  729. .ucode_api_min = IWL6050_UCODE_API_MIN,
  730. .eeprom_ver = EEPROM_6050G2_EEPROM_VERSION,
  731. .eeprom_calib_ver = EEPROM_6050G2_TX_POWER_VERSION,
  732. .ops = &iwl6050g2_ops,
  733. .mod_params = &iwlagn_mod_params,
  734. .base_params = &iwl6050_base_params,
  735. .ht_params = &iwl6000_ht_params,
  736. .need_dc_calib = true,
  737. .led_mode = IWL_LED_RF_STATE,
  738. };
  739. struct iwl_cfg iwl6050_2abg_cfg = {
  740. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  741. .fw_name_pre = IWL6050_FW_PRE,
  742. .ucode_api_max = IWL6050_UCODE_API_MAX,
  743. .ucode_api_min = IWL6050_UCODE_API_MIN,
  744. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  745. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  746. .ops = &iwl6050_ops,
  747. .mod_params = &iwlagn_mod_params,
  748. .base_params = &iwl6050_base_params,
  749. .need_dc_calib = true,
  750. .led_mode = IWL_LED_BLINK,
  751. };
  752. struct iwl_cfg iwl6000_3agn_cfg = {
  753. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  754. .fw_name_pre = IWL6000_FW_PRE,
  755. .ucode_api_max = IWL6000_UCODE_API_MAX,
  756. .ucode_api_min = IWL6000_UCODE_API_MIN,
  757. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  758. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  759. .ops = &iwl6000_ops,
  760. .mod_params = &iwlagn_mod_params,
  761. .base_params = &iwl6000_base_params,
  762. .ht_params = &iwl6000_ht_params,
  763. .need_dc_calib = true,
  764. .led_mode = IWL_LED_BLINK,
  765. };
  766. struct iwl_cfg iwl130_bgn_cfg = {
  767. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  768. .fw_name_pre = IWL6000G2B_FW_PRE,
  769. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  770. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  771. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  772. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  773. .ops = &iwl6000g2b_ops,
  774. .mod_params = &iwlagn_mod_params,
  775. .base_params = &iwl6000_coex_base_params,
  776. .bt_params = &iwl6000_bt_params,
  777. .ht_params = &iwl6000_ht_params,
  778. .need_dc_calib = true,
  779. .led_mode = IWL_LED_RF_STATE,
  780. .adv_pm = true,
  781. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  782. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  783. };
  784. struct iwl_cfg iwl130_bg_cfg = {
  785. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  786. .fw_name_pre = IWL6000G2B_FW_PRE,
  787. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  788. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  789. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  790. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  791. .ops = &iwl6000g2b_ops,
  792. .mod_params = &iwlagn_mod_params,
  793. .base_params = &iwl6000_coex_base_params,
  794. .bt_params = &iwl6000_bt_params,
  795. .need_dc_calib = true,
  796. .led_mode = IWL_LED_RF_STATE,
  797. .adv_pm = true,
  798. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  799. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  800. };
  801. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  802. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  803. MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  804. MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));