Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 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 | |
| 27 | #include <linux/kernel.h> |
| 28 | #include <linux/module.h> |
| 29 | #include <linux/init.h> |
| 30 | #include <linux/pci.h> |
| 31 | #include <linux/dma-mapping.h> |
| 32 | #include <linux/delay.h> |
| 33 | #include <linux/skbuff.h> |
| 34 | #include <linux/netdevice.h> |
| 35 | #include <linux/wireless.h> |
| 36 | #include <net/mac80211.h> |
| 37 | #include <linux/etherdevice.h> |
| 38 | #include <asm/unaligned.h> |
| 39 | |
| 40 | #include "iwl-eeprom.h" |
| 41 | #include "iwl-dev.h" |
| 42 | #include "iwl-core.h" |
| 43 | #include "iwl-io.h" |
| 44 | #include "iwl-sta.h" |
| 45 | #include "iwl-helpers.h" |
| 46 | #include "iwl-5000-hw.h" |
| 47 | |
| 48 | /* Highest firmware API version supported */ |
Jay Sternberg | cc0f555 | 2009-07-17 09:30:16 -0700 | [diff] [blame^] | 49 | #define IWL6000_UCODE_API_MAX 3 |
| 50 | #define IWL6050_UCODE_API_MAX 3 |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 51 | |
| 52 | /* Lowest firmware API version supported */ |
| 53 | #define IWL6000_UCODE_API_MIN 1 |
| 54 | #define IWL6050_UCODE_API_MIN 1 |
| 55 | |
| 56 | #define IWL6000_FW_PRE "iwlwifi-6000-" |
| 57 | #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode" |
| 58 | #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api) |
| 59 | |
| 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 | |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 64 | static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = { |
| 65 | .get_hcmd_size = iwl5000_get_hcmd_size, |
| 66 | .build_addsta_hcmd = iwl5000_build_addsta_hcmd, |
| 67 | .rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag, |
| 68 | .calc_rssi = iwl5000_calc_rssi, |
| 69 | }; |
| 70 | |
| 71 | static struct iwl_ops iwl6000_ops = { |
Jay Sternberg | cc0f555 | 2009-07-17 09:30:16 -0700 | [diff] [blame^] | 72 | .ucode = &iwl5000_ucode, |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 73 | .lib = &iwl5000_lib, |
| 74 | .hcmd = &iwl5000_hcmd, |
| 75 | .utils = &iwl6000_hcmd_utils, |
| 76 | }; |
| 77 | |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 78 | struct iwl_cfg iwl6000_2ag_cfg = { |
| 79 | .name = "6000 Series 2x2 AG", |
| 80 | .fw_name_pre = IWL6000_FW_PRE, |
| 81 | .ucode_api_max = IWL6000_UCODE_API_MAX, |
| 82 | .ucode_api_min = IWL6000_UCODE_API_MIN, |
| 83 | .sku = IWL_SKU_A|IWL_SKU_G, |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 84 | .ops = &iwl6000_ops, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 85 | .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, |
| 86 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 87 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
| 88 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 89 | .valid_tx_ant = ANT_BC, |
| 90 | .valid_rx_ant = ANT_BC, |
Jay Sternberg | 050681b | 2009-01-29 11:09:13 -0800 | [diff] [blame] | 91 | .need_pll_cfg = false, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | struct iwl_cfg iwl6000_2agn_cfg = { |
| 95 | .name = "6000 Series 2x2 AGN", |
| 96 | .fw_name_pre = IWL6000_FW_PRE, |
| 97 | .ucode_api_max = IWL6000_UCODE_API_MAX, |
| 98 | .ucode_api_min = IWL6000_UCODE_API_MIN, |
| 99 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 100 | .ops = &iwl6000_ops, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 101 | .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, |
| 102 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 103 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
| 104 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | 542cc79 | 2009-05-08 13:44:46 -0700 | [diff] [blame] | 105 | .valid_tx_ant = ANT_AB, |
| 106 | .valid_rx_ant = ANT_AB, |
Jay Sternberg | 050681b | 2009-01-29 11:09:13 -0800 | [diff] [blame] | 107 | .need_pll_cfg = false, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 108 | }; |
| 109 | |
| 110 | struct iwl_cfg iwl6050_2agn_cfg = { |
| 111 | .name = "6050 Series 2x2 AGN", |
| 112 | .fw_name_pre = IWL6050_FW_PRE, |
| 113 | .ucode_api_max = IWL6050_UCODE_API_MAX, |
| 114 | .ucode_api_min = IWL6050_UCODE_API_MIN, |
| 115 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 116 | .ops = &iwl6000_ops, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 117 | .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, |
| 118 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 119 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
| 120 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | 542cc79 | 2009-05-08 13:44:46 -0700 | [diff] [blame] | 121 | .valid_tx_ant = ANT_AB, |
| 122 | .valid_rx_ant = ANT_AB, |
Jay Sternberg | 050681b | 2009-01-29 11:09:13 -0800 | [diff] [blame] | 123 | .need_pll_cfg = false, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 124 | }; |
| 125 | |
| 126 | struct iwl_cfg iwl6000_3agn_cfg = { |
| 127 | .name = "6000 Series 3x3 AGN", |
| 128 | .fw_name_pre = IWL6000_FW_PRE, |
| 129 | .ucode_api_max = IWL6000_UCODE_API_MAX, |
| 130 | .ucode_api_min = IWL6000_UCODE_API_MIN, |
| 131 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 132 | .ops = &iwl6000_ops, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 133 | .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, |
| 134 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 135 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
| 136 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 137 | .valid_tx_ant = ANT_ABC, |
| 138 | .valid_rx_ant = ANT_ABC, |
Jay Sternberg | 050681b | 2009-01-29 11:09:13 -0800 | [diff] [blame] | 139 | .need_pll_cfg = false, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 140 | }; |
| 141 | |
| 142 | struct iwl_cfg iwl6050_3agn_cfg = { |
| 143 | .name = "6050 Series 3x3 AGN", |
| 144 | .fw_name_pre = IWL6050_FW_PRE, |
| 145 | .ucode_api_max = IWL6050_UCODE_API_MAX, |
| 146 | .ucode_api_min = IWL6050_UCODE_API_MIN, |
| 147 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Jay Sternberg | 29f35c1 | 2009-01-29 11:09:16 -0800 | [diff] [blame] | 148 | .ops = &iwl6000_ops, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 149 | .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, |
| 150 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 151 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
| 152 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 153 | .valid_tx_ant = ANT_ABC, |
| 154 | .valid_rx_ant = ANT_ABC, |
Jay Sternberg | 050681b | 2009-01-29 11:09:13 -0800 | [diff] [blame] | 155 | .need_pll_cfg = false, |
Jay Sternberg | e122837 | 2009-01-19 15:30:34 -0800 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
| 159 | MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX)); |