iwl-6000.c 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  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 4
  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. /* Indicate calibration version to uCode. */
  76. static void iwl6000_set_calib_version(struct iwl_priv *priv)
  77. {
  78. if (priv->cfg->need_dc_calib &&
  79. (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6))
  80. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  81. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  82. }
  83. /* NIC configuration for 6000 series */
  84. static void iwl6000_nic_config(struct iwl_priv *priv)
  85. {
  86. u16 radio_cfg;
  87. radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
  88. /* write radio config values to register */
  89. if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
  90. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  91. EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
  92. EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
  93. EEPROM_RF_CFG_DASH_MSK(radio_cfg));
  94. /* set CSR_HW_CONFIG_REG for uCode use */
  95. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  96. CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
  97. CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
  98. /* no locking required for register write */
  99. if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
  100. /* 2x2 IPA phy type */
  101. iwl_write32(priv, CSR_GP_DRIVER_REG,
  102. CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
  103. }
  104. /* else do nothing, uCode configured */
  105. if (priv->cfg->ops->lib->temp_ops.set_calib_version)
  106. priv->cfg->ops->lib->temp_ops.set_calib_version(priv);
  107. }
  108. /*
  109. * Macros to access the lookup table.
  110. *
  111. * The lookup table has 7 inputs: bt3_prio, bt3_txrx, bt_rf_act, wifi_req,
  112. * wifi_prio, wifi_txrx and wifi_sh_ant_req.
  113. *
  114. * It has three outputs: WLAN_ACTIVE, WLAN_KILL and ANT_SWITCH
  115. *
  116. * The format is that "registers" 8 through 11 contain the WLAN_ACTIVE bits
  117. * one after another in 32-bit registers, and "registers" 0 through 7 contain
  118. * the WLAN_KILL and ANT_SWITCH bits interleaved (in that order).
  119. *
  120. * These macros encode that format.
  121. */
  122. #define LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, wifi_req, wifi_prio, \
  123. wifi_txrx, wifi_sh_ant_req) \
  124. (bt3_prio | (bt3_txrx << 1) | (bt_rf_act << 2) | (wifi_req << 3) | \
  125. (wifi_prio << 4) | (wifi_txrx << 5) | (wifi_sh_ant_req << 6))
  126. #define LUT_PTA_WLAN_ACTIVE_OP(lut, op, val) \
  127. lut[8 + ((val) >> 5)] op (cpu_to_le32(BIT((val) & 0x1f)))
  128. #define LUT_TEST_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
  129. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  130. (!!(LUT_PTA_WLAN_ACTIVE_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx,\
  131. bt_rf_act, wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
  132. #define LUT_SET_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
  133. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  134. LUT_PTA_WLAN_ACTIVE_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, \
  135. bt_rf_act, wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
  136. #define LUT_CLEAR_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
  137. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  138. LUT_PTA_WLAN_ACTIVE_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, \
  139. bt_rf_act, wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
  140. #define LUT_WLAN_KILL_OP(lut, op, val) \
  141. lut[(val) >> 4] op (cpu_to_le32(BIT(((val) << 1) & 0x1e)))
  142. #define LUT_TEST_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
  143. wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  144. (!!(LUT_WLAN_KILL_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
  145. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
  146. #define LUT_SET_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
  147. wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  148. LUT_WLAN_KILL_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
  149. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
  150. #define LUT_CLEAR_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
  151. wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  152. LUT_WLAN_KILL_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
  153. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
  154. #define LUT_ANT_SWITCH_OP(lut, op, val) \
  155. lut[(val) >> 4] op (cpu_to_le32(BIT((((val) << 1) & 0x1e) + 1)))
  156. #define LUT_TEST_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
  157. wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  158. (!!(LUT_ANT_SWITCH_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
  159. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
  160. #define LUT_SET_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
  161. wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  162. LUT_ANT_SWITCH_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
  163. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
  164. #define LUT_CLEAR_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
  165. wifi_prio, wifi_txrx, wifi_sh_ant_req) \
  166. LUT_ANT_SWITCH_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
  167. wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
  168. static const __le32 iwl6000g2b_def_3w_lookup[12] = {
  169. cpu_to_le32(0xaaaaaaaa),
  170. cpu_to_le32(0xaaaaaaaa),
  171. cpu_to_le32(0xaeaaaaaa),
  172. cpu_to_le32(0xaaaaaaaa),
  173. cpu_to_le32(0xcc00ff28),
  174. cpu_to_le32(0x0000aaaa),
  175. cpu_to_le32(0xcc00aaaa),
  176. cpu_to_le32(0x0000aaaa),
  177. cpu_to_le32(0xc0004000),
  178. cpu_to_le32(0x00004000),
  179. cpu_to_le32(0xf0005000),
  180. cpu_to_le32(0xf0004000),
  181. };
  182. static void iwl6000g2b_send_bt_config(struct iwl_priv *priv)
  183. {
  184. struct iwl6000g2b_bt_cmd bt_cmd = {
  185. .prio_boost = IWL6000G2B_BT_PRIO_BOOST_DEFAULT,
  186. .max_kill = IWL6000G2B_BT_MAX_KILL_DEFAULT,
  187. .bt3_timer_t7_value = IWL6000G2B_BT3_T7_DEFAULT,
  188. .kill_ack_mask = IWL6000G2B_BT_KILL_ACK_MASK_DEFAULT,
  189. .kill_cts_mask = IWL6000G2B_BT_KILL_CTS_MASK_DEFAULT,
  190. .bt3_prio_sample_time = IWL6000G2B_BT3_PRIO_SAMPLE_DEFAULT,
  191. .bt3_timer_t2_value = IWL6000G2B_BT3_T2_DEFAULT,
  192. .valid = IWL6000G2B_BT_VALID_ENABLE_FLAGS,
  193. };
  194. BUILD_BUG_ON(sizeof(iwl6000g2b_def_3w_lookup) !=
  195. sizeof(bt_cmd.bt3_lookup_table));
  196. if (!bt_coex_active) {
  197. bt_cmd.flags = 0;
  198. } else {
  199. bt_cmd.flags = IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION |
  200. IWL6000G2B_BT_FLAG_COEX_MODE_3W <<
  201. IWL6000G2B_BT_FLAG_COEX_MODE_SHIFT;
  202. bt_cmd.valid |= IWL6000G2B_BT_ALL_VALID_MSK;
  203. }
  204. memcpy(bt_cmd.bt3_lookup_table, iwl6000g2b_def_3w_lookup,
  205. sizeof(iwl6000g2b_def_3w_lookup));
  206. IWL_DEBUG_INFO(priv, "BT coex %s\n",
  207. bt_cmd.flags ? "active" : "disabled");
  208. if (iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG, sizeof(bt_cmd), &bt_cmd))
  209. IWL_ERR(priv, "failed to send BT Coex Config\n");
  210. }
  211. static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
  212. .min_nrg_cck = 97,
  213. .max_nrg_cck = 0, /* not used, set to 0 */
  214. .auto_corr_min_ofdm = 80,
  215. .auto_corr_min_ofdm_mrc = 128,
  216. .auto_corr_min_ofdm_x1 = 105,
  217. .auto_corr_min_ofdm_mrc_x1 = 192,
  218. .auto_corr_max_ofdm = 145,
  219. .auto_corr_max_ofdm_mrc = 232,
  220. .auto_corr_max_ofdm_x1 = 110,
  221. .auto_corr_max_ofdm_mrc_x1 = 232,
  222. .auto_corr_min_cck = 125,
  223. .auto_corr_max_cck = 175,
  224. .auto_corr_min_cck_mrc = 160,
  225. .auto_corr_max_cck_mrc = 310,
  226. .nrg_th_cck = 97,
  227. .nrg_th_ofdm = 100,
  228. .barker_corr_th_min = 190,
  229. .barker_corr_th_min_mrc = 390,
  230. .nrg_th_cca = 62,
  231. };
  232. static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
  233. {
  234. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  235. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  236. priv->cfg->num_of_queues =
  237. priv->cfg->mod_params->num_of_queues;
  238. priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
  239. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  240. priv->hw_params.scd_bc_tbls_size =
  241. priv->cfg->num_of_queues *
  242. sizeof(struct iwlagn_scd_bc_tbl);
  243. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  244. priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
  245. priv->hw_params.bcast_sta_id = IWLAGN_BROADCAST_ID;
  246. priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
  247. priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
  248. priv->hw_params.max_bsm_size = 0;
  249. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  250. BIT(IEEE80211_BAND_5GHZ);
  251. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  252. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  253. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  254. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  255. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  256. if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
  257. priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
  258. /* Set initial sensitivity parameters */
  259. /* Set initial calibration set */
  260. priv->hw_params.sens = &iwl6000_sensitivity;
  261. priv->hw_params.calib_init_cfg =
  262. BIT(IWL_CALIB_XTAL) |
  263. BIT(IWL_CALIB_LO) |
  264. BIT(IWL_CALIB_TX_IQ) |
  265. BIT(IWL_CALIB_BASE_BAND);
  266. if (priv->cfg->need_dc_calib)
  267. priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_DC);
  268. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  269. return 0;
  270. }
  271. static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
  272. struct ieee80211_channel_switch *ch_switch)
  273. {
  274. struct iwl6000_channel_switch_cmd cmd;
  275. const struct iwl_channel_info *ch_info;
  276. u32 switch_time_in_usec, ucode_switch_time;
  277. u16 ch;
  278. u32 tsf_low;
  279. u8 switch_count;
  280. u16 beacon_interval = le16_to_cpu(priv->rxon_timing.beacon_interval);
  281. struct ieee80211_vif *vif = priv->vif;
  282. struct iwl_host_cmd hcmd = {
  283. .id = REPLY_CHANNEL_SWITCH,
  284. .len = sizeof(cmd),
  285. .flags = CMD_SYNC,
  286. .data = &cmd,
  287. };
  288. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  289. ch = ch_switch->channel->hw_value;
  290. IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
  291. priv->active_rxon.channel, ch);
  292. cmd.channel = cpu_to_le16(ch);
  293. cmd.rxon_flags = priv->staging_rxon.flags;
  294. cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
  295. switch_count = ch_switch->count;
  296. tsf_low = ch_switch->timestamp & 0x0ffffffff;
  297. /*
  298. * calculate the ucode channel switch time
  299. * adding TSF as one of the factor for when to switch
  300. */
  301. if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
  302. if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
  303. beacon_interval)) {
  304. switch_count -= (priv->ucode_beacon_time -
  305. tsf_low) / beacon_interval;
  306. } else
  307. switch_count = 0;
  308. }
  309. if (switch_count <= 1)
  310. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  311. else {
  312. switch_time_in_usec =
  313. vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
  314. ucode_switch_time = iwl_usecs_to_beacons(priv,
  315. switch_time_in_usec,
  316. beacon_interval);
  317. cmd.switch_time = iwl_add_beacon_time(priv,
  318. priv->ucode_beacon_time,
  319. ucode_switch_time,
  320. beacon_interval);
  321. }
  322. IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
  323. cmd.switch_time);
  324. ch_info = iwl_get_channel_info(priv, priv->band, ch);
  325. if (ch_info)
  326. cmd.expect_beacon = is_channel_radar(ch_info);
  327. else {
  328. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  329. priv->active_rxon.channel, ch);
  330. return -EFAULT;
  331. }
  332. priv->switch_rxon.channel = cmd.channel;
  333. priv->switch_rxon.switch_in_progress = true;
  334. return iwl_send_cmd_sync(priv, &hcmd);
  335. }
  336. static void iwl6000g2b_bt_traffic_change_work(struct work_struct *work)
  337. {
  338. struct iwl_priv *priv =
  339. container_of(work, struct iwl_priv, bt_traffic_change_work);
  340. int smps_request = -1;
  341. switch (priv->bt_traffic_load) {
  342. case IWL_BT_COEX_TRAFFIC_LOAD_NONE:
  343. smps_request = IEEE80211_SMPS_AUTOMATIC;
  344. break;
  345. case IWL_BT_COEX_TRAFFIC_LOAD_LOW:
  346. smps_request = IEEE80211_SMPS_DYNAMIC;
  347. break;
  348. case IWL_BT_COEX_TRAFFIC_LOAD_HIGH:
  349. case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
  350. smps_request = IEEE80211_SMPS_STATIC;
  351. break;
  352. default:
  353. IWL_ERR(priv, "Invalid BT traffic load: %d\n",
  354. priv->bt_traffic_load);
  355. break;
  356. }
  357. mutex_lock(&priv->mutex);
  358. if (smps_request != -1 &&
  359. priv->vif && priv->vif->type == NL80211_IFTYPE_STATION)
  360. ieee80211_request_smps(priv->vif, smps_request);
  361. mutex_unlock(&priv->mutex);
  362. }
  363. static void iwl6000g2b_bt_coex_profile_notif(struct iwl_priv *priv,
  364. struct iwl_rx_mem_buffer *rxb)
  365. {
  366. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  367. struct iwl_bt_coex_profile_notif *coex = &pkt->u.bt_coex_profile_notif;
  368. struct iwl6000g2b_bt_sco_cmd sco_cmd = { .flags = 0 };
  369. IWL_DEBUG_NOTIF(priv, "BT Coex notification:\n");
  370. IWL_DEBUG_NOTIF(priv, " status: %d\n", coex->bt_status);
  371. IWL_DEBUG_NOTIF(priv, " traffic load: %d\n", coex->bt_traffic_load);
  372. IWL_DEBUG_NOTIF(priv, " CI compliance: %d\n", coex->bt_ci_compliance);
  373. IWL_DEBUG_NOTIF(priv, " UART msg: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x:"
  374. "%.2x:%.2x\n",
  375. coex->uart_msg[0], coex->uart_msg[1], coex->uart_msg[2],
  376. coex->uart_msg[3], coex->uart_msg[4], coex->uart_msg[5],
  377. coex->uart_msg[6], coex->uart_msg[7]);
  378. if (coex->bt_traffic_load != priv->bt_traffic_load) {
  379. priv->bt_traffic_load = coex->bt_traffic_load;
  380. queue_work(priv->workqueue, &priv->bt_traffic_change_work);
  381. }
  382. /* FIXME: add defines for this check */
  383. priv->bt_sco_active = coex->uart_msg[3] & 1;
  384. if (priv->bt_sco_active)
  385. sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE;
  386. iwl_send_cmd_pdu_async(priv, REPLY_BT_COEX_SCO,
  387. sizeof(sco_cmd), &sco_cmd, NULL);
  388. }
  389. void iwl6000g2b_rx_handler_setup(struct iwl_priv *priv)
  390. {
  391. iwlagn_rx_handler_setup(priv);
  392. priv->rx_handlers[REPLY_BT_COEX_PROFILE_NOTIF] =
  393. iwl6000g2b_bt_coex_profile_notif;
  394. }
  395. static void iwl6000g2b_bt_setup_deferred_work(struct iwl_priv *priv)
  396. {
  397. iwlagn_setup_deferred_work(priv);
  398. INIT_WORK(&priv->bt_traffic_change_work,
  399. iwl6000g2b_bt_traffic_change_work);
  400. }
  401. static void iwl6000g2b_bt_cancel_deferred_work(struct iwl_priv *priv)
  402. {
  403. cancel_work_sync(&priv->bt_traffic_change_work);
  404. }
  405. static struct iwl_lib_ops iwl6000_lib = {
  406. .set_hw_params = iwl6000_hw_set_hw_params,
  407. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  408. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  409. .txq_set_sched = iwlagn_txq_set_sched,
  410. .txq_agg_enable = iwlagn_txq_agg_enable,
  411. .txq_agg_disable = iwlagn_txq_agg_disable,
  412. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  413. .txq_free_tfd = iwl_hw_txq_free_tfd,
  414. .txq_init = iwl_hw_tx_queue_init,
  415. .rx_handler_setup = iwlagn_rx_handler_setup,
  416. .setup_deferred_work = iwlagn_setup_deferred_work,
  417. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  418. .load_ucode = iwlagn_load_ucode,
  419. .dump_nic_event_log = iwl_dump_nic_event_log,
  420. .dump_nic_error_log = iwl_dump_nic_error_log,
  421. .dump_csr = iwl_dump_csr,
  422. .dump_fh = iwl_dump_fh,
  423. .init_alive_start = iwlagn_init_alive_start,
  424. .alive_notify = iwlagn_alive_notify,
  425. .send_tx_power = iwlagn_send_tx_power,
  426. .update_chain_flags = iwl_update_chain_flags,
  427. .set_channel_switch = iwl6000_hw_channel_switch,
  428. .apm_ops = {
  429. .init = iwl_apm_init,
  430. .stop = iwl_apm_stop,
  431. .config = iwl6000_nic_config,
  432. .set_pwr_src = iwl_set_pwr_src,
  433. },
  434. .eeprom_ops = {
  435. .regulatory_bands = {
  436. EEPROM_REG_BAND_1_CHANNELS,
  437. EEPROM_REG_BAND_2_CHANNELS,
  438. EEPROM_REG_BAND_3_CHANNELS,
  439. EEPROM_REG_BAND_4_CHANNELS,
  440. EEPROM_REG_BAND_5_CHANNELS,
  441. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  442. EEPROM_REG_BAND_52_HT40_CHANNELS
  443. },
  444. .verify_signature = iwlcore_eeprom_verify_signature,
  445. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  446. .release_semaphore = iwlcore_eeprom_release_semaphore,
  447. .calib_version = iwlagn_eeprom_calib_version,
  448. .query_addr = iwlagn_eeprom_query_addr,
  449. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  450. },
  451. .post_associate = iwl_post_associate,
  452. .isr = iwl_isr_ict,
  453. .config_ap = iwl_config_ap,
  454. .temp_ops = {
  455. .temperature = iwlagn_temperature,
  456. .set_ct_kill = iwl6000_set_ct_threshold,
  457. .set_calib_version = iwl6000_set_calib_version,
  458. },
  459. .manage_ibss_station = iwlagn_manage_ibss_station,
  460. .update_bcast_station = iwl_update_bcast_station,
  461. .debugfs_ops = {
  462. .rx_stats_read = iwl_ucode_rx_stats_read,
  463. .tx_stats_read = iwl_ucode_tx_stats_read,
  464. .general_stats_read = iwl_ucode_general_stats_read,
  465. .bt_stats_read = iwl_ucode_bt_stats_read,
  466. },
  467. .recover_from_tx_stall = iwl_bg_monitor_recover,
  468. .check_plcp_health = iwl_good_plcp_health,
  469. .check_ack_health = iwl_good_ack_health,
  470. .txfifo_flush = iwlagn_txfifo_flush,
  471. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  472. .tt_ops = {
  473. .lower_power_detection = iwl_tt_is_low_power_state,
  474. .tt_power_mode = iwl_tt_current_power_mode,
  475. .ct_kill_check = iwl_check_for_ct_kill,
  476. }
  477. };
  478. static struct iwl_lib_ops iwl6000g2b_lib = {
  479. .set_hw_params = iwl6000_hw_set_hw_params,
  480. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  481. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  482. .txq_set_sched = iwlagn_txq_set_sched,
  483. .txq_agg_enable = iwlagn_txq_agg_enable,
  484. .txq_agg_disable = iwlagn_txq_agg_disable,
  485. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  486. .txq_free_tfd = iwl_hw_txq_free_tfd,
  487. .txq_init = iwl_hw_tx_queue_init,
  488. .rx_handler_setup = iwl6000g2b_rx_handler_setup,
  489. .setup_deferred_work = iwl6000g2b_bt_setup_deferred_work,
  490. .cancel_deferred_work = iwl6000g2b_bt_cancel_deferred_work,
  491. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  492. .load_ucode = iwlagn_load_ucode,
  493. .dump_nic_event_log = iwl_dump_nic_event_log,
  494. .dump_nic_error_log = iwl_dump_nic_error_log,
  495. .dump_csr = iwl_dump_csr,
  496. .dump_fh = iwl_dump_fh,
  497. .init_alive_start = iwlagn_init_alive_start,
  498. .alive_notify = iwlagn_alive_notify,
  499. .send_tx_power = iwlagn_send_tx_power,
  500. .update_chain_flags = iwl_update_chain_flags,
  501. .set_channel_switch = iwl6000_hw_channel_switch,
  502. .apm_ops = {
  503. .init = iwl_apm_init,
  504. .stop = iwl_apm_stop,
  505. .config = iwl6000_nic_config,
  506. .set_pwr_src = iwl_set_pwr_src,
  507. },
  508. .eeprom_ops = {
  509. .regulatory_bands = {
  510. EEPROM_REG_BAND_1_CHANNELS,
  511. EEPROM_REG_BAND_2_CHANNELS,
  512. EEPROM_REG_BAND_3_CHANNELS,
  513. EEPROM_REG_BAND_4_CHANNELS,
  514. EEPROM_REG_BAND_5_CHANNELS,
  515. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  516. EEPROM_REG_BAND_52_HT40_CHANNELS
  517. },
  518. .verify_signature = iwlcore_eeprom_verify_signature,
  519. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  520. .release_semaphore = iwlcore_eeprom_release_semaphore,
  521. .calib_version = iwlagn_eeprom_calib_version,
  522. .query_addr = iwlagn_eeprom_query_addr,
  523. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  524. },
  525. .post_associate = iwl_post_associate,
  526. .isr = iwl_isr_ict,
  527. .config_ap = iwl_config_ap,
  528. .temp_ops = {
  529. .temperature = iwlagn_temperature,
  530. .set_ct_kill = iwl6000_set_ct_threshold,
  531. .set_calib_version = iwl6000_set_calib_version,
  532. },
  533. .manage_ibss_station = iwlagn_manage_ibss_station,
  534. .update_bcast_station = iwl_update_bcast_station,
  535. .debugfs_ops = {
  536. .rx_stats_read = iwl_ucode_rx_stats_read,
  537. .tx_stats_read = iwl_ucode_tx_stats_read,
  538. .general_stats_read = iwl_ucode_general_stats_read,
  539. .bt_stats_read = iwl_ucode_bt_stats_read,
  540. },
  541. .recover_from_tx_stall = iwl_bg_monitor_recover,
  542. .check_plcp_health = iwl_good_plcp_health,
  543. .check_ack_health = iwl_good_ack_health,
  544. .txfifo_flush = iwlagn_txfifo_flush,
  545. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  546. .tt_ops = {
  547. .lower_power_detection = iwl_tt_is_low_power_state,
  548. .tt_power_mode = iwl_tt_current_power_mode,
  549. .ct_kill_check = iwl_check_for_ct_kill,
  550. }
  551. };
  552. static const struct iwl_ops iwl6000_ops = {
  553. .lib = &iwl6000_lib,
  554. .hcmd = &iwlagn_hcmd,
  555. .utils = &iwlagn_hcmd_utils,
  556. .led = &iwlagn_led_ops,
  557. };
  558. static struct iwl_hcmd_ops iwl6000g2b_hcmd = {
  559. .rxon_assoc = iwlagn_send_rxon_assoc,
  560. .commit_rxon = iwl_commit_rxon,
  561. .set_rxon_chain = iwl_set_rxon_chain,
  562. .set_tx_ant = iwlagn_send_tx_ant_config,
  563. .send_bt_config = iwl6000g2b_send_bt_config,
  564. };
  565. static const struct iwl_ops iwl6000g2b_ops = {
  566. .lib = &iwl6000g2b_lib,
  567. .hcmd = &iwl6000g2b_hcmd,
  568. .utils = &iwlagn_hcmd_utils,
  569. .led = &iwlagn_led_ops,
  570. };
  571. struct iwl_cfg iwl6000g2a_2agn_cfg = {
  572. .name = "6000 Series 2x2 AGN Gen2a",
  573. .fw_name_pre = IWL6000G2A_FW_PRE,
  574. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  575. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  576. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  577. .ops = &iwl6000_ops,
  578. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  579. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  580. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  581. .num_of_queues = IWLAGN_NUM_QUEUES,
  582. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  583. .mod_params = &iwlagn_mod_params,
  584. .valid_tx_ant = ANT_AB,
  585. .valid_rx_ant = ANT_AB,
  586. .pll_cfg_val = 0,
  587. .set_l0s = true,
  588. .use_bsm = false,
  589. .pa_type = IWL_PA_SYSTEM,
  590. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  591. .shadow_ram_support = true,
  592. .ht_greenfield_support = true,
  593. .led_compensation = 51,
  594. .use_rts_for_aggregation = true, /* use rts/cts protection */
  595. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  596. .supports_idle = true,
  597. .adv_thermal_throttle = true,
  598. .support_ct_kill_exit = true,
  599. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  600. .chain_noise_scale = 1000,
  601. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  602. .max_event_log_size = 512,
  603. .ucode_tracing = true,
  604. .sensitivity_calib_by_driver = true,
  605. .chain_noise_calib_by_driver = true,
  606. .need_dc_calib = true,
  607. };
  608. struct iwl_cfg iwl6000g2a_2abg_cfg = {
  609. .name = "6000 Series 2x2 ABG Gen2a",
  610. .fw_name_pre = IWL6000G2A_FW_PRE,
  611. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  612. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  613. .sku = IWL_SKU_A|IWL_SKU_G,
  614. .ops = &iwl6000_ops,
  615. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  616. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  617. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  618. .num_of_queues = IWLAGN_NUM_QUEUES,
  619. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  620. .mod_params = &iwlagn_mod_params,
  621. .valid_tx_ant = ANT_AB,
  622. .valid_rx_ant = ANT_AB,
  623. .pll_cfg_val = 0,
  624. .set_l0s = true,
  625. .use_bsm = false,
  626. .pa_type = IWL_PA_SYSTEM,
  627. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  628. .shadow_ram_support = true,
  629. .led_compensation = 51,
  630. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  631. .supports_idle = true,
  632. .adv_thermal_throttle = true,
  633. .support_ct_kill_exit = true,
  634. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  635. .chain_noise_scale = 1000,
  636. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  637. .max_event_log_size = 512,
  638. .sensitivity_calib_by_driver = true,
  639. .chain_noise_calib_by_driver = true,
  640. .need_dc_calib = true,
  641. };
  642. struct iwl_cfg iwl6000g2a_2bg_cfg = {
  643. .name = "6000 Series 2x2 BG Gen2a",
  644. .fw_name_pre = IWL6000G2A_FW_PRE,
  645. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  646. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  647. .sku = IWL_SKU_G,
  648. .ops = &iwl6000_ops,
  649. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  650. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  651. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  652. .num_of_queues = IWLAGN_NUM_QUEUES,
  653. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  654. .mod_params = &iwlagn_mod_params,
  655. .valid_tx_ant = ANT_AB,
  656. .valid_rx_ant = ANT_AB,
  657. .pll_cfg_val = 0,
  658. .set_l0s = true,
  659. .use_bsm = false,
  660. .pa_type = IWL_PA_SYSTEM,
  661. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  662. .shadow_ram_support = true,
  663. .led_compensation = 51,
  664. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  665. .supports_idle = true,
  666. .adv_thermal_throttle = true,
  667. .support_ct_kill_exit = true,
  668. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  669. .chain_noise_scale = 1000,
  670. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  671. .max_event_log_size = 512,
  672. .sensitivity_calib_by_driver = true,
  673. .chain_noise_calib_by_driver = true,
  674. .need_dc_calib = true,
  675. };
  676. struct iwl_cfg iwl6000g2b_2agn_cfg = {
  677. .name = "6000 Series 2x2 AGN Gen2b",
  678. .fw_name_pre = IWL6000G2B_FW_PRE,
  679. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  680. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  681. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  682. .ops = &iwl6000g2b_ops,
  683. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  684. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  685. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  686. .num_of_queues = IWLAGN_NUM_QUEUES,
  687. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  688. .mod_params = &iwlagn_mod_params,
  689. .valid_tx_ant = ANT_AB,
  690. .valid_rx_ant = ANT_AB,
  691. .pll_cfg_val = 0,
  692. .set_l0s = true,
  693. .use_bsm = false,
  694. .pa_type = IWL_PA_SYSTEM,
  695. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  696. .shadow_ram_support = true,
  697. .ht_greenfield_support = true,
  698. .led_compensation = 51,
  699. .use_rts_for_aggregation = true, /* use rts/cts protection */
  700. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  701. .supports_idle = true,
  702. .adv_thermal_throttle = true,
  703. .support_ct_kill_exit = true,
  704. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  705. .chain_noise_scale = 1000,
  706. .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
  707. .max_event_log_size = 512,
  708. .sensitivity_calib_by_driver = true,
  709. .chain_noise_calib_by_driver = true,
  710. .need_dc_calib = true,
  711. .bt_statistics = true,
  712. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  713. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  714. .advanced_bt_coexist = true,
  715. };
  716. struct iwl_cfg iwl6000g2b_2abg_cfg = {
  717. .name = "6000 Series 2x2 ABG Gen2b",
  718. .fw_name_pre = IWL6000G2B_FW_PRE,
  719. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  720. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  721. .sku = IWL_SKU_A|IWL_SKU_G,
  722. .ops = &iwl6000g2b_ops,
  723. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  724. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  725. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  726. .num_of_queues = IWLAGN_NUM_QUEUES,
  727. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  728. .mod_params = &iwlagn_mod_params,
  729. .valid_tx_ant = ANT_AB,
  730. .valid_rx_ant = ANT_AB,
  731. .pll_cfg_val = 0,
  732. .set_l0s = true,
  733. .use_bsm = false,
  734. .pa_type = IWL_PA_SYSTEM,
  735. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  736. .shadow_ram_support = true,
  737. .led_compensation = 51,
  738. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  739. .supports_idle = true,
  740. .adv_thermal_throttle = true,
  741. .support_ct_kill_exit = true,
  742. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  743. .chain_noise_scale = 1000,
  744. .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
  745. .max_event_log_size = 512,
  746. .sensitivity_calib_by_driver = true,
  747. .chain_noise_calib_by_driver = true,
  748. .need_dc_calib = true,
  749. .bt_statistics = true,
  750. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  751. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  752. .advanced_bt_coexist = true,
  753. };
  754. struct iwl_cfg iwl6000g2b_2bgn_cfg = {
  755. .name = "6000 Series 2x2 BGN Gen2b",
  756. .fw_name_pre = IWL6000G2B_FW_PRE,
  757. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  758. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  759. .sku = IWL_SKU_G|IWL_SKU_N,
  760. .ops = &iwl6000g2b_ops,
  761. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  762. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  763. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  764. .num_of_queues = IWLAGN_NUM_QUEUES,
  765. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  766. .mod_params = &iwlagn_mod_params,
  767. .valid_tx_ant = ANT_AB,
  768. .valid_rx_ant = ANT_AB,
  769. .pll_cfg_val = 0,
  770. .set_l0s = true,
  771. .use_bsm = false,
  772. .pa_type = IWL_PA_SYSTEM,
  773. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  774. .shadow_ram_support = true,
  775. .ht_greenfield_support = true,
  776. .led_compensation = 51,
  777. .use_rts_for_aggregation = true, /* use rts/cts protection */
  778. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  779. .supports_idle = true,
  780. .adv_thermal_throttle = true,
  781. .support_ct_kill_exit = true,
  782. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  783. .chain_noise_scale = 1000,
  784. .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
  785. .max_event_log_size = 512,
  786. .sensitivity_calib_by_driver = true,
  787. .chain_noise_calib_by_driver = true,
  788. .need_dc_calib = true,
  789. .bt_statistics = true,
  790. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  791. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  792. .advanced_bt_coexist = true,
  793. };
  794. struct iwl_cfg iwl6000g2b_2bg_cfg = {
  795. .name = "6000 Series 2x2 BG Gen2b",
  796. .fw_name_pre = IWL6000G2B_FW_PRE,
  797. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  798. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  799. .sku = IWL_SKU_G,
  800. .ops = &iwl6000g2b_ops,
  801. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  802. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  803. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  804. .num_of_queues = IWLAGN_NUM_QUEUES,
  805. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  806. .mod_params = &iwlagn_mod_params,
  807. .valid_tx_ant = ANT_AB,
  808. .valid_rx_ant = ANT_AB,
  809. .pll_cfg_val = 0,
  810. .set_l0s = true,
  811. .use_bsm = false,
  812. .pa_type = IWL_PA_SYSTEM,
  813. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  814. .shadow_ram_support = true,
  815. .led_compensation = 51,
  816. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  817. .supports_idle = true,
  818. .adv_thermal_throttle = true,
  819. .support_ct_kill_exit = true,
  820. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  821. .chain_noise_scale = 1000,
  822. .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
  823. .max_event_log_size = 512,
  824. .sensitivity_calib_by_driver = true,
  825. .chain_noise_calib_by_driver = true,
  826. .need_dc_calib = true,
  827. .bt_statistics = true,
  828. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  829. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  830. .advanced_bt_coexist = true,
  831. };
  832. struct iwl_cfg iwl6000g2b_bgn_cfg = {
  833. .name = "6000 Series 1x2 BGN Gen2b",
  834. .fw_name_pre = IWL6000G2B_FW_PRE,
  835. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  836. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  837. .sku = IWL_SKU_G|IWL_SKU_N,
  838. .ops = &iwl6000g2b_ops,
  839. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  840. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  841. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  842. .num_of_queues = IWLAGN_NUM_QUEUES,
  843. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  844. .mod_params = &iwlagn_mod_params,
  845. .valid_tx_ant = ANT_A,
  846. .valid_rx_ant = ANT_AB,
  847. .pll_cfg_val = 0,
  848. .set_l0s = true,
  849. .use_bsm = false,
  850. .pa_type = IWL_PA_SYSTEM,
  851. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  852. .shadow_ram_support = true,
  853. .ht_greenfield_support = true,
  854. .led_compensation = 51,
  855. .use_rts_for_aggregation = true, /* use rts/cts protection */
  856. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  857. .supports_idle = true,
  858. .adv_thermal_throttle = true,
  859. .support_ct_kill_exit = true,
  860. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  861. .chain_noise_scale = 1000,
  862. .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
  863. .max_event_log_size = 512,
  864. .sensitivity_calib_by_driver = true,
  865. .chain_noise_calib_by_driver = true,
  866. .need_dc_calib = true,
  867. .bt_statistics = true,
  868. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  869. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  870. .advanced_bt_coexist = true,
  871. };
  872. struct iwl_cfg iwl6000g2b_bg_cfg = {
  873. .name = "6000 Series 1x2 BG Gen2b",
  874. .fw_name_pre = IWL6000G2B_FW_PRE,
  875. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  876. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  877. .sku = IWL_SKU_G,
  878. .ops = &iwl6000g2b_ops,
  879. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  880. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  881. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  882. .num_of_queues = IWLAGN_NUM_QUEUES,
  883. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  884. .mod_params = &iwlagn_mod_params,
  885. .valid_tx_ant = ANT_A,
  886. .valid_rx_ant = ANT_AB,
  887. .pll_cfg_val = 0,
  888. .set_l0s = true,
  889. .use_bsm = false,
  890. .pa_type = IWL_PA_SYSTEM,
  891. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  892. .shadow_ram_support = true,
  893. .led_compensation = 51,
  894. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  895. .supports_idle = true,
  896. .adv_thermal_throttle = true,
  897. .support_ct_kill_exit = true,
  898. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  899. .chain_noise_scale = 1000,
  900. .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
  901. .max_event_log_size = 512,
  902. .sensitivity_calib_by_driver = true,
  903. .chain_noise_calib_by_driver = true,
  904. .need_dc_calib = true,
  905. .bt_statistics = true,
  906. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  907. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  908. .advanced_bt_coexist = true,
  909. };
  910. /*
  911. * "i": Internal configuration, use internal Power Amplifier
  912. */
  913. struct iwl_cfg iwl6000i_2agn_cfg = {
  914. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  915. .fw_name_pre = IWL6000_FW_PRE,
  916. .ucode_api_max = IWL6000_UCODE_API_MAX,
  917. .ucode_api_min = IWL6000_UCODE_API_MIN,
  918. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  919. .ops = &iwl6000_ops,
  920. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  921. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  922. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  923. .num_of_queues = IWLAGN_NUM_QUEUES,
  924. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  925. .mod_params = &iwlagn_mod_params,
  926. .valid_tx_ant = ANT_BC,
  927. .valid_rx_ant = ANT_BC,
  928. .pll_cfg_val = 0,
  929. .set_l0s = true,
  930. .use_bsm = false,
  931. .pa_type = IWL_PA_INTERNAL,
  932. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  933. .shadow_ram_support = true,
  934. .ht_greenfield_support = true,
  935. .led_compensation = 51,
  936. .use_rts_for_aggregation = true, /* use rts/cts protection */
  937. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  938. .supports_idle = true,
  939. .adv_thermal_throttle = true,
  940. .support_ct_kill_exit = true,
  941. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  942. .chain_noise_scale = 1000,
  943. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  944. .max_event_log_size = 1024,
  945. .ucode_tracing = true,
  946. .sensitivity_calib_by_driver = true,
  947. .chain_noise_calib_by_driver = true,
  948. };
  949. struct iwl_cfg iwl6000i_2abg_cfg = {
  950. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  951. .fw_name_pre = IWL6000_FW_PRE,
  952. .ucode_api_max = IWL6000_UCODE_API_MAX,
  953. .ucode_api_min = IWL6000_UCODE_API_MIN,
  954. .sku = IWL_SKU_A|IWL_SKU_G,
  955. .ops = &iwl6000_ops,
  956. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  957. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  958. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  959. .num_of_queues = IWLAGN_NUM_QUEUES,
  960. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  961. .mod_params = &iwlagn_mod_params,
  962. .valid_tx_ant = ANT_BC,
  963. .valid_rx_ant = ANT_BC,
  964. .pll_cfg_val = 0,
  965. .set_l0s = true,
  966. .use_bsm = false,
  967. .pa_type = IWL_PA_INTERNAL,
  968. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  969. .shadow_ram_support = true,
  970. .led_compensation = 51,
  971. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  972. .supports_idle = true,
  973. .adv_thermal_throttle = true,
  974. .support_ct_kill_exit = true,
  975. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  976. .chain_noise_scale = 1000,
  977. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  978. .max_event_log_size = 1024,
  979. .ucode_tracing = true,
  980. .sensitivity_calib_by_driver = true,
  981. .chain_noise_calib_by_driver = true,
  982. };
  983. struct iwl_cfg iwl6000i_2bg_cfg = {
  984. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  985. .fw_name_pre = IWL6000_FW_PRE,
  986. .ucode_api_max = IWL6000_UCODE_API_MAX,
  987. .ucode_api_min = IWL6000_UCODE_API_MIN,
  988. .sku = IWL_SKU_G,
  989. .ops = &iwl6000_ops,
  990. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  991. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  992. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  993. .num_of_queues = IWLAGN_NUM_QUEUES,
  994. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  995. .mod_params = &iwlagn_mod_params,
  996. .valid_tx_ant = ANT_BC,
  997. .valid_rx_ant = ANT_BC,
  998. .pll_cfg_val = 0,
  999. .set_l0s = true,
  1000. .use_bsm = false,
  1001. .pa_type = IWL_PA_INTERNAL,
  1002. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  1003. .shadow_ram_support = true,
  1004. .led_compensation = 51,
  1005. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  1006. .supports_idle = true,
  1007. .adv_thermal_throttle = true,
  1008. .support_ct_kill_exit = true,
  1009. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  1010. .chain_noise_scale = 1000,
  1011. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  1012. .max_event_log_size = 1024,
  1013. .ucode_tracing = true,
  1014. .sensitivity_calib_by_driver = true,
  1015. .chain_noise_calib_by_driver = true,
  1016. };
  1017. struct iwl_cfg iwl6050_2agn_cfg = {
  1018. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  1019. .fw_name_pre = IWL6050_FW_PRE,
  1020. .ucode_api_max = IWL6050_UCODE_API_MAX,
  1021. .ucode_api_min = IWL6050_UCODE_API_MIN,
  1022. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  1023. .ops = &iwl6000_ops,
  1024. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  1025. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  1026. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  1027. .num_of_queues = IWLAGN_NUM_QUEUES,
  1028. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  1029. .mod_params = &iwlagn_mod_params,
  1030. .valid_tx_ant = ANT_AB,
  1031. .valid_rx_ant = ANT_AB,
  1032. .pll_cfg_val = 0,
  1033. .set_l0s = true,
  1034. .use_bsm = false,
  1035. .pa_type = IWL_PA_SYSTEM,
  1036. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  1037. .shadow_ram_support = true,
  1038. .ht_greenfield_support = true,
  1039. .led_compensation = 51,
  1040. .use_rts_for_aggregation = true, /* use rts/cts protection */
  1041. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  1042. .supports_idle = true,
  1043. .adv_thermal_throttle = true,
  1044. .support_ct_kill_exit = true,
  1045. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  1046. .chain_noise_scale = 1500,
  1047. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  1048. .max_event_log_size = 1024,
  1049. .ucode_tracing = true,
  1050. .sensitivity_calib_by_driver = true,
  1051. .chain_noise_calib_by_driver = true,
  1052. .need_dc_calib = true,
  1053. };
  1054. struct iwl_cfg iwl6050g2_bgn_cfg = {
  1055. .name = "6050 Series 1x2 BGN Gen2",
  1056. .fw_name_pre = IWL6050_FW_PRE,
  1057. .ucode_api_max = IWL6050_UCODE_API_MAX,
  1058. .ucode_api_min = IWL6050_UCODE_API_MIN,
  1059. .sku = IWL_SKU_G|IWL_SKU_N,
  1060. .ops = &iwl6000_ops,
  1061. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  1062. .eeprom_ver = EEPROM_6050G2_EEPROM_VERSION,
  1063. .eeprom_calib_ver = EEPROM_6050G2_TX_POWER_VERSION,
  1064. .num_of_queues = IWLAGN_NUM_QUEUES,
  1065. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  1066. .mod_params = &iwlagn_mod_params,
  1067. .valid_tx_ant = ANT_A,
  1068. .valid_rx_ant = ANT_AB,
  1069. .pll_cfg_val = 0,
  1070. .set_l0s = true,
  1071. .use_bsm = false,
  1072. .pa_type = IWL_PA_SYSTEM,
  1073. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  1074. .shadow_ram_support = true,
  1075. .ht_greenfield_support = true,
  1076. .led_compensation = 51,
  1077. .use_rts_for_aggregation = true, /* use rts/cts protection */
  1078. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  1079. .supports_idle = true,
  1080. .adv_thermal_throttle = true,
  1081. .support_ct_kill_exit = true,
  1082. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  1083. .chain_noise_scale = 1500,
  1084. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  1085. .max_event_log_size = 1024,
  1086. .ucode_tracing = true,
  1087. .sensitivity_calib_by_driver = true,
  1088. .chain_noise_calib_by_driver = true,
  1089. .need_dc_calib = true,
  1090. };
  1091. struct iwl_cfg iwl6050_2abg_cfg = {
  1092. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  1093. .fw_name_pre = IWL6050_FW_PRE,
  1094. .ucode_api_max = IWL6050_UCODE_API_MAX,
  1095. .ucode_api_min = IWL6050_UCODE_API_MIN,
  1096. .sku = IWL_SKU_A|IWL_SKU_G,
  1097. .ops = &iwl6000_ops,
  1098. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  1099. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  1100. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  1101. .num_of_queues = IWLAGN_NUM_QUEUES,
  1102. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  1103. .mod_params = &iwlagn_mod_params,
  1104. .valid_tx_ant = ANT_AB,
  1105. .valid_rx_ant = ANT_AB,
  1106. .pll_cfg_val = 0,
  1107. .set_l0s = true,
  1108. .use_bsm = false,
  1109. .pa_type = IWL_PA_SYSTEM,
  1110. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  1111. .shadow_ram_support = true,
  1112. .led_compensation = 51,
  1113. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  1114. .supports_idle = true,
  1115. .adv_thermal_throttle = true,
  1116. .support_ct_kill_exit = true,
  1117. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  1118. .chain_noise_scale = 1500,
  1119. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  1120. .max_event_log_size = 1024,
  1121. .ucode_tracing = true,
  1122. .sensitivity_calib_by_driver = true,
  1123. .chain_noise_calib_by_driver = true,
  1124. .need_dc_calib = true,
  1125. };
  1126. struct iwl_cfg iwl6000_3agn_cfg = {
  1127. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  1128. .fw_name_pre = IWL6000_FW_PRE,
  1129. .ucode_api_max = IWL6000_UCODE_API_MAX,
  1130. .ucode_api_min = IWL6000_UCODE_API_MIN,
  1131. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  1132. .ops = &iwl6000_ops,
  1133. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  1134. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  1135. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  1136. .num_of_queues = IWLAGN_NUM_QUEUES,
  1137. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  1138. .mod_params = &iwlagn_mod_params,
  1139. .valid_tx_ant = ANT_ABC,
  1140. .valid_rx_ant = ANT_ABC,
  1141. .pll_cfg_val = 0,
  1142. .set_l0s = true,
  1143. .use_bsm = false,
  1144. .pa_type = IWL_PA_SYSTEM,
  1145. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  1146. .shadow_ram_support = true,
  1147. .ht_greenfield_support = true,
  1148. .led_compensation = 51,
  1149. .use_rts_for_aggregation = true, /* use rts/cts protection */
  1150. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  1151. .supports_idle = true,
  1152. .adv_thermal_throttle = true,
  1153. .support_ct_kill_exit = true,
  1154. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  1155. .chain_noise_scale = 1000,
  1156. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  1157. .max_event_log_size = 1024,
  1158. .ucode_tracing = true,
  1159. .sensitivity_calib_by_driver = true,
  1160. .chain_noise_calib_by_driver = true,
  1161. };
  1162. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  1163. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  1164. MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  1165. MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));