iwlwifi: add 7000 series device configuration
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / pcie / 7000.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2008 - 2013 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-agn-hw.h"
31 #include "cfg.h"
32
33 /* Highest firmware API version supported */
34 #define IWL7260_UCODE_API_MAX   6
35 #define IWL3160_UCODE_API_MAX   6
36
37 /* Oldest version we won't warn about */
38 #define IWL7260_UCODE_API_OK    6
39 #define IWL3160_UCODE_API_OK    6
40
41 /* Lowest firmware API version supported */
42 #define IWL7260_UCODE_API_MIN   6
43 #define IWL3160_UCODE_API_MIN   6
44
45 /* NVM versions */
46 #define IWL7260_NVM_VERSION             0x0a1d
47 #define IWL7260_TX_POWER_VERSION        0xffff /* meaningless */
48 #define IWL3160_NVM_VERSION             0x709
49 #define IWL3160_TX_POWER_VERSION        0xffff /* meaningless */
50
51 #define IWL7260_FW_PRE "iwlwifi-7260-"
52 #define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE __stringify(api) ".ucode"
53
54 #define IWL3160_FW_PRE "iwlwifi-3160-"
55 #define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode"
56
57 static const struct iwl_base_params iwl7000_base_params = {
58         .eeprom_size = OTP_LOW_IMAGE_SIZE,
59         .num_of_queues = IWLAGN_NUM_QUEUES,
60         .pll_cfg_val = 0,
61         .shadow_ram_support = true,
62         .led_compensation = 57,
63         .adv_thermal_throttle = true,
64         .support_ct_kill_exit = true,
65         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
66         .chain_noise_scale = 1000,
67         .wd_timeout = IWL_LONG_WD_TIMEOUT,
68         .max_event_log_size = 512,
69         .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
70 };
71
72 static const struct iwl_ht_params iwl7000_ht_params = {
73         .ht_greenfield_support = true,
74         .use_rts_for_aggregation = true, /* use rts/cts protection */
75         .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
76 };
77
78 #define IWL_DEVICE_7000                                         \
79         .ucode_api_max = IWL7260_UCODE_API_MAX,                 \
80         .ucode_api_ok = IWL7260_UCODE_API_OK,                   \
81         .ucode_api_min = IWL7260_UCODE_API_MIN,                 \
82         .device_family = IWL_DEVICE_FAMILY_7000,                \
83         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
84         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
85         .base_params = &iwl7000_base_params,                    \
86         /* TODO: .bt_params? */                                 \
87         .need_temp_offset_calib = true,                         \
88         .led_mode = IWL_LED_RF_STATE,                           \
89         .adv_pm = true                                          \
90
91
92 const struct iwl_cfg iwl7260_2ac_cfg = {
93         .name = "Intel(R) Dual Band Wireless AC7260",
94         .fw_name_pre = IWL7260_FW_PRE,
95         IWL_DEVICE_7000,
96         .ht_params = &iwl7000_ht_params,
97         .nvm_ver = IWL7260_NVM_VERSION,
98         .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
99 };
100
101 const struct iwl_cfg iwl3160_ac_cfg = {
102         .name = "Intel(R) Dual Band Wireless AC3160",
103         .fw_name_pre = IWL3160_FW_PRE,
104         IWL_DEVICE_7000,
105         .ht_params = &iwl7000_ht_params,
106         .nvm_ver = IWL3160_NVM_VERSION,
107         .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
108 };
109
110 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
111 MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));