iwl-1000.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 2014 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/module.h>
  27. #include <linux/stringify.h>
  28. #include "iwl-config.h"
  29. #include "iwl-csr.h"
  30. #include "iwl-agn-hw.h"
  31. /* Highest firmware API version supported */
  32. #define IWL1000_UCODE_API_MAX 5
  33. #define IWL100_UCODE_API_MAX 5
  34. /* Oldest version we won't warn about */
  35. #define IWL1000_UCODE_API_OK 5
  36. #define IWL100_UCODE_API_OK 5
  37. /* Lowest firmware API version supported */
  38. #define IWL1000_UCODE_API_MIN 1
  39. #define IWL100_UCODE_API_MIN 5
  40. /* EEPROM version */
  41. #define EEPROM_1000_TX_POWER_VERSION (4)
  42. #define EEPROM_1000_EEPROM_VERSION (0x15C)
  43. #define IWL1000_FW_PRE "iwlwifi-1000-"
  44. #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode"
  45. #define IWL100_FW_PRE "iwlwifi-100-"
  46. #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode"
  47. static const struct iwl_base_params iwl1000_base_params = {
  48. .num_of_queues = IWLAGN_NUM_QUEUES,
  49. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  50. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  51. .max_ll_items = OTP_MAX_LL_ITEMS_1000,
  52. .shadow_ram_support = false,
  53. .led_compensation = 51,
  54. .wd_timeout = IWL_WATCHDOG_DISABLED,
  55. .max_event_log_size = 128,
  56. .scd_chain_ext_wa = true,
  57. };
  58. static const struct iwl_ht_params iwl1000_ht_params = {
  59. .ht_greenfield_support = true,
  60. .use_rts_for_aggregation = true, /* use rts/cts protection */
  61. .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
  62. };
  63. static const struct iwl_eeprom_params iwl1000_eeprom_params = {
  64. .regulatory_bands = {
  65. EEPROM_REG_BAND_1_CHANNELS,
  66. EEPROM_REG_BAND_2_CHANNELS,
  67. EEPROM_REG_BAND_3_CHANNELS,
  68. EEPROM_REG_BAND_4_CHANNELS,
  69. EEPROM_REG_BAND_5_CHANNELS,
  70. EEPROM_REG_BAND_24_HT40_CHANNELS,
  71. EEPROM_REGULATORY_BAND_NO_HT40,
  72. }
  73. };
  74. #define IWL_DEVICE_1000 \
  75. .fw_name_pre = IWL1000_FW_PRE, \
  76. .ucode_api_max = IWL1000_UCODE_API_MAX, \
  77. .ucode_api_ok = IWL1000_UCODE_API_OK, \
  78. .ucode_api_min = IWL1000_UCODE_API_MIN, \
  79. .device_family = IWL_DEVICE_FAMILY_1000, \
  80. .max_inst_size = IWLAGN_RTC_INST_SIZE, \
  81. .max_data_size = IWLAGN_RTC_DATA_SIZE, \
  82. .nvm_ver = EEPROM_1000_EEPROM_VERSION, \
  83. .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
  84. .base_params = &iwl1000_base_params, \
  85. .eeprom_params = &iwl1000_eeprom_params, \
  86. .led_mode = IWL_LED_BLINK, \
  87. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  88. const struct iwl_cfg iwl1000_bgn_cfg = {
  89. .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN",
  90. IWL_DEVICE_1000,
  91. .ht_params = &iwl1000_ht_params,
  92. };
  93. const struct iwl_cfg iwl1000_bg_cfg = {
  94. .name = "Intel(R) Centrino(R) Wireless-N 1000 BG",
  95. IWL_DEVICE_1000,
  96. };
  97. #define IWL_DEVICE_100 \
  98. .fw_name_pre = IWL100_FW_PRE, \
  99. .ucode_api_max = IWL100_UCODE_API_MAX, \
  100. .ucode_api_ok = IWL100_UCODE_API_OK, \
  101. .ucode_api_min = IWL100_UCODE_API_MIN, \
  102. .device_family = IWL_DEVICE_FAMILY_100, \
  103. .max_inst_size = IWLAGN_RTC_INST_SIZE, \
  104. .max_data_size = IWLAGN_RTC_DATA_SIZE, \
  105. .nvm_ver = EEPROM_1000_EEPROM_VERSION, \
  106. .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
  107. .base_params = &iwl1000_base_params, \
  108. .eeprom_params = &iwl1000_eeprom_params, \
  109. .led_mode = IWL_LED_RF_STATE, \
  110. .rx_with_siso_diversity = true, \
  111. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  112. const struct iwl_cfg iwl100_bgn_cfg = {
  113. .name = "Intel(R) Centrino(R) Wireless-N 100 BGN",
  114. IWL_DEVICE_100,
  115. .ht_params = &iwl1000_ht_params,
  116. };
  117. const struct iwl_cfg iwl100_bg_cfg = {
  118. .name = "Intel(R) Centrino(R) Wireless-N 100 BG",
  119. IWL_DEVICE_100,
  120. };
  121. MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
  122. MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));