iwl-6000.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008-2009 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-helpers.h"
  44. #include "iwl-5000-hw.h"
  45. /* Highest firmware API version supported */
  46. #define IWL6000_UCODE_API_MAX 2
  47. #define IWL6050_UCODE_API_MAX 2
  48. /* Lowest firmware API version supported */
  49. #define IWL6000_UCODE_API_MIN 1
  50. #define IWL6050_UCODE_API_MIN 1
  51. #define IWL6000_FW_PRE "iwlwifi-6000-"
  52. #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
  53. #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api)
  54. #define IWL6050_FW_PRE "iwlwifi-6050-"
  55. #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
  56. #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
  57. static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
  58. .get_hcmd_size = iwl5000_get_hcmd_size,
  59. .build_addsta_hcmd = iwl5000_build_addsta_hcmd,
  60. .rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag,
  61. .calc_rssi = iwl5000_calc_rssi,
  62. };
  63. static struct iwl_ops iwl6000_ops = {
  64. .lib = &iwl5000_lib,
  65. .hcmd = &iwl5000_hcmd,
  66. .utils = &iwl6000_hcmd_utils,
  67. };
  68. struct iwl_cfg iwl6000_2ag_cfg = {
  69. .name = "6000 Series 2x2 AG",
  70. .fw_name_pre = IWL6000_FW_PRE,
  71. .ucode_api_max = IWL6000_UCODE_API_MAX,
  72. .ucode_api_min = IWL6000_UCODE_API_MIN,
  73. .sku = IWL_SKU_A|IWL_SKU_G,
  74. .ops = &iwl6000_ops,
  75. .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
  76. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  77. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  78. .mod_params = &iwl50_mod_params,
  79. .valid_tx_ant = ANT_BC,
  80. .valid_rx_ant = ANT_BC,
  81. .need_pll_cfg = false,
  82. };
  83. struct iwl_cfg iwl6000_2agn_cfg = {
  84. .name = "6000 Series 2x2 AGN",
  85. .fw_name_pre = IWL6000_FW_PRE,
  86. .ucode_api_max = IWL6000_UCODE_API_MAX,
  87. .ucode_api_min = IWL6000_UCODE_API_MIN,
  88. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  89. .ops = &iwl6000_ops,
  90. .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
  91. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  92. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  93. .mod_params = &iwl50_mod_params,
  94. .valid_tx_ant = ANT_BC,
  95. .valid_rx_ant = ANT_BC,
  96. .need_pll_cfg = false,
  97. };
  98. struct iwl_cfg iwl6050_2agn_cfg = {
  99. .name = "6050 Series 2x2 AGN",
  100. .fw_name_pre = IWL6050_FW_PRE,
  101. .ucode_api_max = IWL6050_UCODE_API_MAX,
  102. .ucode_api_min = IWL6050_UCODE_API_MIN,
  103. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  104. .ops = &iwl6000_ops,
  105. .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
  106. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  107. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  108. .mod_params = &iwl50_mod_params,
  109. .valid_tx_ant = ANT_BC,
  110. .valid_rx_ant = ANT_BC,
  111. .need_pll_cfg = false,
  112. };
  113. struct iwl_cfg iwl6000_3agn_cfg = {
  114. .name = "6000 Series 3x3 AGN",
  115. .fw_name_pre = IWL6000_FW_PRE,
  116. .ucode_api_max = IWL6000_UCODE_API_MAX,
  117. .ucode_api_min = IWL6000_UCODE_API_MIN,
  118. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  119. .ops = &iwl6000_ops,
  120. .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
  121. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  122. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  123. .mod_params = &iwl50_mod_params,
  124. .valid_tx_ant = ANT_ABC,
  125. .valid_rx_ant = ANT_ABC,
  126. .need_pll_cfg = false,
  127. };
  128. struct iwl_cfg iwl6050_3agn_cfg = {
  129. .name = "6050 Series 3x3 AGN",
  130. .fw_name_pre = IWL6050_FW_PRE,
  131. .ucode_api_max = IWL6050_UCODE_API_MAX,
  132. .ucode_api_min = IWL6050_UCODE_API_MIN,
  133. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  134. .ops = &iwl6000_ops,
  135. .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
  136. .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
  137. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
  138. .mod_params = &iwl50_mod_params,
  139. .valid_tx_ant = ANT_ABC,
  140. .valid_rx_ant = ANT_ABC,
  141. .need_pll_cfg = false,
  142. };
  143. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  144. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));