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