iwlwifi: virtualize iwl_{grab,release}_nic_access
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / pcie / 5000.c
CommitLineData
5a6a256e
TW
1/******************************************************************************
2 *
4e318262 3 * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved.
5a6a256e
TW
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:
3d2b162e 22 * Intel Linux Wireless <ilw@linux.intel.com>
5a6a256e
TW
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
5a6a256e 27#include <linux/module.h>
8fcbd4dc 28#include <linux/stringify.h>
e9676695 29#include "iwl-config.h"
0db19cde
JB
30#include "iwl-agn-hw.h"
31#include "iwl-csr.h"
6468a01a 32#include "cfg.h"
5a6a256e 33
a0987a8d 34/* Highest firmware API version supported */
41504cce 35#define IWL5000_UCODE_API_MAX 5
39e6d225 36#define IWL5150_UCODE_API_MAX 2
5a6a256e 37
78cbcf2b
MV
38/* Oldest version we won't warn about */
39#define IWL5000_UCODE_API_OK 5
40#define IWL5150_UCODE_API_OK 2
41
a0987a8d
RC
42/* Lowest firmware API version supported */
43#define IWL5000_UCODE_API_MIN 1
44#define IWL5150_UCODE_API_MIN 1
45
586aed96
JB
46/* EEPROM versions */
47#define EEPROM_5000_TX_POWER_VERSION (4)
48#define EEPROM_5000_EEPROM_VERSION (0x11A)
49#define EEPROM_5050_TX_POWER_VERSION (4)
50#define EEPROM_5050_EEPROM_VERSION (0x21E)
51
a0987a8d 52#define IWL5000_FW_PRE "iwlwifi-5000-"
8fcbd4dc 53#define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
a0987a8d
RC
54
55#define IWL5150_FW_PRE "iwlwifi-5150-"
8fcbd4dc 56#define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
4e062f99 57
6794f3ee 58static const struct iwl_base_params iwl5000_base_params = {
19e6cda0 59 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
19e6cda0 60 .num_of_queues = IWLAGN_NUM_QUEUES,
fadb3582 61 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
f2d0d0e2 62 .led_compensation = 51,
3e4fb5fa 63 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
d4fe5ac9 64 .chain_noise_scale = 1000,
6de4902e 65 .wd_timeout = IWL_WATCHDOG_DISABLED,
678b385d 66 .max_event_log_size = 512,
f3529108 67 .no_idle_support = true,
5a6a256e 68};
6794f3ee
JB
69
70static const struct iwl_ht_params iwl5000_ht_params = {
7cb1b088 71 .ht_greenfield_support = true,
d370493f 72 .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
7cb1b088
WYG
73};
74
26a7ca9a
JB
75static const struct iwl_eeprom_params iwl5000_eeprom_params = {
76 .regulatory_bands = {
77 EEPROM_REG_BAND_1_CHANNELS,
78 EEPROM_REG_BAND_2_CHANNELS,
79 EEPROM_REG_BAND_3_CHANNELS,
80 EEPROM_REG_BAND_4_CHANNELS,
81 EEPROM_REG_BAND_5_CHANNELS,
82 EEPROM_REG_BAND_24_HT40_CHANNELS,
83 EEPROM_REG_BAND_52_HT40_CHANNELS
84 },
85};
86
65af8dea
WYG
87#define IWL_DEVICE_5000 \
88 .fw_name_pre = IWL5000_FW_PRE, \
89 .ucode_api_max = IWL5000_UCODE_API_MAX, \
78cbcf2b 90 .ucode_api_ok = IWL5000_UCODE_API_OK, \
65af8dea 91 .ucode_api_min = IWL5000_UCODE_API_MIN, \
2d771cb6 92 .device_family = IWL_DEVICE_FAMILY_5000, \
dae66d0d
EG
93 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
94 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
b7998c8b
EL
95 .nvm_ver = EEPROM_5000_EEPROM_VERSION, \
96 .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
65af8dea 97 .base_params = &iwl5000_base_params, \
26a7ca9a 98 .eeprom_params = &iwl5000_eeprom_params, \
65af8dea
WYG
99 .led_mode = IWL_LED_BLINK
100
706c4ff6 101const struct iwl_cfg iwl5300_agn_cfg = {
7cb1b088 102 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
65af8dea 103 IWL_DEVICE_5000,
2845fd85
JB
104 /* at least EEPROM 0x11A has wrong info */
105 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
106 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
7cb1b088
WYG
107 .ht_params = &iwl5000_ht_params,
108};
5a6a256e 109
706c4ff6 110const struct iwl_cfg iwl5100_bgn_cfg = {
c11362c0 111 .name = "Intel(R) WiFi Link 5100 BGN",
65af8dea 112 IWL_DEVICE_5000,
dbbf1755
WYG
113 .valid_tx_ant = ANT_B, /* .cfg overwrite */
114 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
7cb1b088 115 .ht_params = &iwl5000_ht_params,
47408639
EK
116};
117
706c4ff6 118const struct iwl_cfg iwl5100_abg_cfg = {
c11362c0 119 .name = "Intel(R) WiFi Link 5100 ABG",
65af8dea 120 IWL_DEVICE_5000,
dbbf1755
WYG
121 .valid_tx_ant = ANT_B, /* .cfg overwrite */
122 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
47408639
EK
123};
124
706c4ff6 125const struct iwl_cfg iwl5100_agn_cfg = {
c11362c0 126 .name = "Intel(R) WiFi Link 5100 AGN",
65af8dea 127 IWL_DEVICE_5000,
dbbf1755
WYG
128 .valid_tx_ant = ANT_B, /* .cfg overwrite */
129 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
7cb1b088 130 .ht_params = &iwl5000_ht_params,
5a6a256e
TW
131};
132
706c4ff6 133const struct iwl_cfg iwl5350_agn_cfg = {
c11362c0 134 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
a0987a8d
RC
135 .fw_name_pre = IWL5000_FW_PRE,
136 .ucode_api_max = IWL5000_UCODE_API_MAX,
78cbcf2b 137 .ucode_api_ok = IWL5000_UCODE_API_OK,
a0987a8d 138 .ucode_api_min = IWL5000_UCODE_API_MIN,
2d771cb6 139 .device_family = IWL_DEVICE_FAMILY_5000,
dae66d0d
EG
140 .max_inst_size = IWLAGN_RTC_INST_SIZE,
141 .max_data_size = IWLAGN_RTC_DATA_SIZE,
b7998c8b
EL
142 .nvm_ver = EEPROM_5050_EEPROM_VERSION,
143 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION,
7cb1b088 144 .base_params = &iwl5000_base_params,
26a7ca9a 145 .eeprom_params = &iwl5000_eeprom_params,
7cb1b088 146 .ht_params = &iwl5000_ht_params,
564b344c 147 .led_mode = IWL_LED_BLINK,
50619ac9 148 .internal_wimax_coex = true,
5a6a256e
TW
149};
150
65af8dea
WYG
151#define IWL_DEVICE_5150 \
152 .fw_name_pre = IWL5150_FW_PRE, \
153 .ucode_api_max = IWL5150_UCODE_API_MAX, \
78cbcf2b 154 .ucode_api_ok = IWL5150_UCODE_API_OK, \
65af8dea 155 .ucode_api_min = IWL5150_UCODE_API_MIN, \
2d771cb6 156 .device_family = IWL_DEVICE_FAMILY_5150, \
dae66d0d
EG
157 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
158 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
b7998c8b
EL
159 .nvm_ver = EEPROM_5050_EEPROM_VERSION, \
160 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
65af8dea 161 .base_params = &iwl5000_base_params, \
26a7ca9a 162 .eeprom_params = &iwl5000_eeprom_params, \
c27bdc84 163 .no_xtal_calib = true, \
65af8dea
WYG
164 .led_mode = IWL_LED_BLINK, \
165 .internal_wimax_coex = true
166
706c4ff6 167const struct iwl_cfg iwl5150_agn_cfg = {
c11362c0 168 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
65af8dea 169 IWL_DEVICE_5150,
7cb1b088 170 .ht_params = &iwl5000_ht_params,
65af8dea 171
7100e924
TW
172};
173
706c4ff6 174const struct iwl_cfg iwl5150_abg_cfg = {
c11362c0 175 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
65af8dea 176 IWL_DEVICE_5150,
7100e924
TW
177};
178
78cbcf2b
MV
179MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
180MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));
This page took 0.628531 seconds and 5 git commands to generate.