blob: bd438d8acf55b258d86cee4609ef9274b182671d [file] [log] [blame]
Jay Sternberge1228372009-01-19 15:30:34 -08001/******************************************************************************
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 Sternberg76a24072009-01-29 11:09:14 -080049#define IWL6000_UCODE_API_MAX 2
50#define IWL6050_UCODE_API_MAX 2
Jay Sternberge1228372009-01-19 15:30:34 -080051
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 Sternberg29f35c12009-01-29 11:09:16 -080064static 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
71static struct iwl_ops iwl6000_ops = {
72 .lib = &iwl5000_lib,
73 .hcmd = &iwl5000_hcmd,
74 .utils = &iwl6000_hcmd_utils,
75};
76
Jay Sternberge1228372009-01-19 15:30:34 -080077struct iwl_cfg iwl6000_2ag_cfg = {
78 .name = "6000 Series 2x2 AG",
79 .fw_name_pre = IWL6000_FW_PRE,
80 .ucode_api_max = IWL6000_UCODE_API_MAX,
81 .ucode_api_min = IWL6000_UCODE_API_MIN,
82 .sku = IWL_SKU_A|IWL_SKU_G,
Jay Sternberg29f35c12009-01-29 11:09:16 -080083 .ops = &iwl6000_ops,
Jay Sternberge1228372009-01-19 15:30:34 -080084 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
85 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
86 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
87 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -080088 .valid_tx_ant = ANT_BC,
89 .valid_rx_ant = ANT_BC,
Jay Sternberg050681b2009-01-29 11:09:13 -080090 .need_pll_cfg = false,
Jay Sternberge1228372009-01-19 15:30:34 -080091};
92
93struct iwl_cfg iwl6000_2agn_cfg = {
94 .name = "6000 Series 2x2 AGN",
95 .fw_name_pre = IWL6000_FW_PRE,
96 .ucode_api_max = IWL6000_UCODE_API_MAX,
97 .ucode_api_min = IWL6000_UCODE_API_MIN,
98 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Jay Sternberg29f35c12009-01-29 11:09:16 -080099 .ops = &iwl6000_ops,
Jay Sternberge1228372009-01-19 15:30:34 -0800100 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
101 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
102 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
103 .mod_params = &iwl50_mod_params,
Jay Sternberg542cc792009-05-08 13:44:46 -0700104 .valid_tx_ant = ANT_AB,
105 .valid_rx_ant = ANT_AB,
Jay Sternberg050681b2009-01-29 11:09:13 -0800106 .need_pll_cfg = false,
Jay Sternberge1228372009-01-19 15:30:34 -0800107};
108
109struct iwl_cfg iwl6050_2agn_cfg = {
110 .name = "6050 Series 2x2 AGN",
111 .fw_name_pre = IWL6050_FW_PRE,
112 .ucode_api_max = IWL6050_UCODE_API_MAX,
113 .ucode_api_min = IWL6050_UCODE_API_MIN,
114 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Jay Sternberg29f35c12009-01-29 11:09:16 -0800115 .ops = &iwl6000_ops,
Jay Sternberge1228372009-01-19 15:30:34 -0800116 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
117 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
118 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
119 .mod_params = &iwl50_mod_params,
Jay Sternberg542cc792009-05-08 13:44:46 -0700120 .valid_tx_ant = ANT_AB,
121 .valid_rx_ant = ANT_AB,
Jay Sternberg050681b2009-01-29 11:09:13 -0800122 .need_pll_cfg = false,
Jay Sternberge1228372009-01-19 15:30:34 -0800123};
124
125struct iwl_cfg iwl6000_3agn_cfg = {
126 .name = "6000 Series 3x3 AGN",
127 .fw_name_pre = IWL6000_FW_PRE,
128 .ucode_api_max = IWL6000_UCODE_API_MAX,
129 .ucode_api_min = IWL6000_UCODE_API_MIN,
130 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Jay Sternberg29f35c12009-01-29 11:09:16 -0800131 .ops = &iwl6000_ops,
Jay Sternberge1228372009-01-19 15:30:34 -0800132 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
133 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
134 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
135 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800136 .valid_tx_ant = ANT_ABC,
137 .valid_rx_ant = ANT_ABC,
Jay Sternberg050681b2009-01-29 11:09:13 -0800138 .need_pll_cfg = false,
Jay Sternberge1228372009-01-19 15:30:34 -0800139};
140
141struct iwl_cfg iwl6050_3agn_cfg = {
142 .name = "6050 Series 3x3 AGN",
143 .fw_name_pre = IWL6050_FW_PRE,
144 .ucode_api_max = IWL6050_UCODE_API_MAX,
145 .ucode_api_min = IWL6050_UCODE_API_MIN,
146 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Jay Sternberg29f35c12009-01-29 11:09:16 -0800147 .ops = &iwl6000_ops,
Jay Sternberge1228372009-01-19 15:30:34 -0800148 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
149 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
150 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
151 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800152 .valid_tx_ant = ANT_ABC,
153 .valid_rx_ant = ANT_ABC,
Jay Sternberg050681b2009-01-29 11:09:13 -0800154 .need_pll_cfg = false,
Jay Sternberge1228372009-01-19 15:30:34 -0800155};
156
157MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
158MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));