iwl-8000.c 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  24. * USA
  25. *
  26. * The full GNU General Public License is included in this distribution
  27. * in the file called COPYING.
  28. *
  29. * Contact Information:
  30. * Intel Linux Wireless <linuxwifi@intel.com>
  31. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  32. *
  33. * BSD LICENSE
  34. *
  35. * Copyright(c) 2014 Intel Corporation. All rights reserved.
  36. * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
  37. * All rights reserved.
  38. *
  39. * Redistribution and use in source and binary forms, with or without
  40. * modification, are permitted provided that the following conditions
  41. * are met:
  42. *
  43. * * Redistributions of source code must retain the above copyright
  44. * notice, this list of conditions and the following disclaimer.
  45. * * Redistributions in binary form must reproduce the above copyright
  46. * notice, this list of conditions and the following disclaimer in
  47. * the documentation and/or other materials provided with the
  48. * distribution.
  49. * * Neither the name Intel Corporation nor the names of its
  50. * contributors may be used to endorse or promote products derived
  51. * from this software without specific prior written permission.
  52. *
  53. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  54. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  55. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  56. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  57. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  58. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  59. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  60. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  61. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  62. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  63. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  64. *
  65. *****************************************************************************/
  66. #include <linux/module.h>
  67. #include <linux/stringify.h>
  68. #include "iwl-config.h"
  69. #include "iwl-agn-hw.h"
  70. /* Highest firmware API version supported */
  71. #define IWL8000_UCODE_API_MAX 21
  72. #define IWL8265_UCODE_API_MAX 21
  73. /* Oldest version we won't warn about */
  74. #define IWL8000_UCODE_API_OK 13
  75. #define IWL8265_UCODE_API_OK 20
  76. /* Lowest firmware API version supported */
  77. #define IWL8000_UCODE_API_MIN 13
  78. #define IWL8265_UCODE_API_MIN 20
  79. /* NVM versions */
  80. #define IWL8000_NVM_VERSION 0x0a1d
  81. #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */
  82. /* Memory offsets and lengths */
  83. #define IWL8260_DCCM_OFFSET 0x800000
  84. #define IWL8260_DCCM_LEN 0x18000
  85. #define IWL8260_DCCM2_OFFSET 0x880000
  86. #define IWL8260_DCCM2_LEN 0x8000
  87. #define IWL8260_SMEM_OFFSET 0x400000
  88. #define IWL8260_SMEM_LEN 0x68000
  89. #define IWL8000_FW_PRE "iwlwifi-8000"
  90. #define IWL8000_MODULE_FIRMWARE(api) \
  91. IWL8000_FW_PRE "-" __stringify(api) ".ucode"
  92. #define IWL8265_FW_PRE "iwlwifi-8265-"
  93. #define IWL8265_MODULE_FIRMWARE(api) \
  94. IWL8265_FW_PRE __stringify(api) ".ucode"
  95. #define NVM_HW_SECTION_NUM_FAMILY_8000 10
  96. #define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B"
  97. #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C"
  98. /* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */
  99. #define MAX_RX_AGG_SIZE_8260_SDIO 21
  100. #define MAX_TX_AGG_SIZE_8260_SDIO 40
  101. /* Max A-MPDU exponent for HT and VHT */
  102. #define MAX_HT_AMPDU_EXPONENT_8260_SDIO IEEE80211_HT_MAX_AMPDU_32K
  103. #define MAX_VHT_AMPDU_EXPONENT_8260_SDIO IEEE80211_VHT_MAX_AMPDU_32K
  104. static const struct iwl_base_params iwl8000_base_params = {
  105. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000,
  106. .num_of_queues = 31,
  107. .pll_cfg_val = 0,
  108. .shadow_ram_support = true,
  109. .led_compensation = 57,
  110. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  111. .max_event_log_size = 512,
  112. .shadow_reg_enable = true,
  113. .pcie_l1_allowed = true,
  114. };
  115. static const struct iwl_ht_params iwl8000_ht_params = {
  116. .stbc = true,
  117. .ldpc = true,
  118. .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
  119. };
  120. static const struct iwl_tt_params iwl8000_tt_params = {
  121. .ct_kill_entry = 115,
  122. .ct_kill_exit = 93,
  123. .ct_kill_duration = 5,
  124. .dynamic_smps_entry = 111,
  125. .dynamic_smps_exit = 107,
  126. .tx_protection_entry = 112,
  127. .tx_protection_exit = 105,
  128. .tx_backoff = {
  129. {.temperature = 110, .backoff = 200},
  130. {.temperature = 111, .backoff = 600},
  131. {.temperature = 112, .backoff = 1200},
  132. {.temperature = 113, .backoff = 2000},
  133. {.temperature = 114, .backoff = 4000},
  134. },
  135. .support_ct_kill = true,
  136. .support_dynamic_smps = true,
  137. .support_tx_protection = true,
  138. .support_tx_backoff = true,
  139. };
  140. #define IWL_DEVICE_8000_COMMON \
  141. .device_family = IWL_DEVICE_FAMILY_8000, \
  142. .max_inst_size = IWL60_RTC_INST_SIZE, \
  143. .max_data_size = IWL60_RTC_DATA_SIZE, \
  144. .base_params = &iwl8000_base_params, \
  145. .led_mode = IWL_LED_RF_STATE, \
  146. .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \
  147. .features = NETIF_F_RXCSUM, \
  148. .non_shared_ant = ANT_A, \
  149. .dccm_offset = IWL8260_DCCM_OFFSET, \
  150. .dccm_len = IWL8260_DCCM_LEN, \
  151. .dccm2_offset = IWL8260_DCCM2_OFFSET, \
  152. .dccm2_len = IWL8260_DCCM2_LEN, \
  153. .smem_offset = IWL8260_SMEM_OFFSET, \
  154. .smem_len = IWL8260_SMEM_LEN, \
  155. .default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B, \
  156. .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \
  157. .thermal_params = &iwl8000_tt_params, \
  158. .apmg_not_supported = true
  159. #define IWL_DEVICE_8000 \
  160. IWL_DEVICE_8000_COMMON, \
  161. .ucode_api_max = IWL8000_UCODE_API_MAX, \
  162. .ucode_api_ok = IWL8000_UCODE_API_OK, \
  163. .ucode_api_min = IWL8000_UCODE_API_MIN \
  164. #define IWL_DEVICE_8260 \
  165. IWL_DEVICE_8000_COMMON, \
  166. .ucode_api_max = IWL8000_UCODE_API_MAX, \
  167. .ucode_api_ok = IWL8000_UCODE_API_OK, \
  168. .ucode_api_min = IWL8000_UCODE_API_MIN \
  169. #define IWL_DEVICE_8265 \
  170. IWL_DEVICE_8000_COMMON, \
  171. .ucode_api_max = IWL8265_UCODE_API_MAX, \
  172. .ucode_api_ok = IWL8265_UCODE_API_OK, \
  173. .ucode_api_min = IWL8265_UCODE_API_MIN \
  174. const struct iwl_cfg iwl8260_2n_cfg = {
  175. .name = "Intel(R) Dual Band Wireless N 8260",
  176. .fw_name_pre = IWL8000_FW_PRE,
  177. IWL_DEVICE_8260,
  178. .ht_params = &iwl8000_ht_params,
  179. .nvm_ver = IWL8000_NVM_VERSION,
  180. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  181. };
  182. const struct iwl_cfg iwl8260_2ac_cfg = {
  183. .name = "Intel(R) Dual Band Wireless AC 8260",
  184. .fw_name_pre = IWL8000_FW_PRE,
  185. IWL_DEVICE_8260,
  186. .ht_params = &iwl8000_ht_params,
  187. .nvm_ver = IWL8000_NVM_VERSION,
  188. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  189. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  190. };
  191. const struct iwl_cfg iwl8265_2ac_cfg = {
  192. .name = "Intel(R) Dual Band Wireless AC 8265",
  193. .fw_name_pre = IWL8265_FW_PRE,
  194. IWL_DEVICE_8265,
  195. .ht_params = &iwl8000_ht_params,
  196. .nvm_ver = IWL8000_NVM_VERSION,
  197. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  198. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  199. .vht_mu_mimo_supported = true,
  200. };
  201. const struct iwl_cfg iwl4165_2ac_cfg = {
  202. .name = "Intel(R) Dual Band Wireless AC 4165",
  203. .fw_name_pre = IWL8000_FW_PRE,
  204. IWL_DEVICE_8000,
  205. .ht_params = &iwl8000_ht_params,
  206. .nvm_ver = IWL8000_NVM_VERSION,
  207. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  208. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  209. };
  210. const struct iwl_cfg iwl8260_2ac_sdio_cfg = {
  211. .name = "Intel(R) Dual Band Wireless-AC 8260",
  212. .fw_name_pre = IWL8000_FW_PRE,
  213. IWL_DEVICE_8260,
  214. .ht_params = &iwl8000_ht_params,
  215. .nvm_ver = IWL8000_NVM_VERSION,
  216. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  217. .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
  218. .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
  219. .disable_dummy_notification = true,
  220. .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
  221. .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
  222. };
  223. const struct iwl_cfg iwl4165_2ac_sdio_cfg = {
  224. .name = "Intel(R) Dual Band Wireless-AC 4165",
  225. .fw_name_pre = IWL8000_FW_PRE,
  226. IWL_DEVICE_8000,
  227. .ht_params = &iwl8000_ht_params,
  228. .nvm_ver = IWL8000_NVM_VERSION,
  229. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  230. .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
  231. .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
  232. .bt_shared_single_ant = true,
  233. .disable_dummy_notification = true,
  234. .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
  235. .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
  236. };
  237. MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_OK));
  238. MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_OK));