iwlwifi: move PCIe into subdirectory
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / wireless / iwlwifi / pcie / 1000.c
1 /******************************************************************************
2 *
3 * Copyright(c) 2008 - 2012 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 #include "cfg.h"
33
34 /* Highest firmware API version supported */
35 #define IWL1000_UCODE_API_MAX 5
36 #define IWL100_UCODE_API_MAX 5
37
38 /* Oldest version we won't warn about */
39 #define IWL1000_UCODE_API_OK 5
40 #define IWL100_UCODE_API_OK 5
41
42 /* Lowest firmware API version supported */
43 #define IWL1000_UCODE_API_MIN 1
44 #define IWL100_UCODE_API_MIN 5
45
46 /* EEPROM version */
47 #define EEPROM_1000_TX_POWER_VERSION (4)
48 #define EEPROM_1000_EEPROM_VERSION (0x15C)
49
50 #define IWL1000_FW_PRE "iwlwifi-1000-"
51 #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode"
52
53 #define IWL100_FW_PRE "iwlwifi-100-"
54 #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode"
55
56
57 static const struct iwl_base_params iwl1000_base_params = {
58 .num_of_queues = IWLAGN_NUM_QUEUES,
59 .eeprom_size = OTP_LOW_IMAGE_SIZE,
60 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
61 .max_ll_items = OTP_MAX_LL_ITEMS_1000,
62 .shadow_ram_support = false,
63 .led_compensation = 51,
64 .support_ct_kill_exit = true,
65 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
66 .chain_noise_scale = 1000,
67 .wd_timeout = IWL_WATCHHDOG_DISABLED,
68 .max_event_log_size = 128,
69 };
70
71 static const struct iwl_ht_params iwl1000_ht_params = {
72 .ht_greenfield_support = true,
73 .use_rts_for_aggregation = true, /* use rts/cts protection */
74 };
75
76 #define IWL_DEVICE_1000 \
77 .fw_name_pre = IWL1000_FW_PRE, \
78 .ucode_api_max = IWL1000_UCODE_API_MAX, \
79 .ucode_api_ok = IWL1000_UCODE_API_OK, \
80 .ucode_api_min = IWL1000_UCODE_API_MIN, \
81 .device_family = IWL_DEVICE_FAMILY_1000, \
82 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
83 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
84 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
85 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
86 .base_params = &iwl1000_base_params, \
87 .led_mode = IWL_LED_BLINK
88
89 const struct iwl_cfg iwl1000_bgn_cfg = {
90 .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN",
91 IWL_DEVICE_1000,
92 .ht_params = &iwl1000_ht_params,
93 };
94
95 const struct iwl_cfg iwl1000_bg_cfg = {
96 .name = "Intel(R) Centrino(R) Wireless-N 1000 BG",
97 IWL_DEVICE_1000,
98 };
99
100 #define IWL_DEVICE_100 \
101 .fw_name_pre = IWL100_FW_PRE, \
102 .ucode_api_max = IWL100_UCODE_API_MAX, \
103 .ucode_api_ok = IWL100_UCODE_API_OK, \
104 .ucode_api_min = IWL100_UCODE_API_MIN, \
105 .device_family = IWL_DEVICE_FAMILY_100, \
106 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
107 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
108 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
109 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
110 .base_params = &iwl1000_base_params, \
111 .led_mode = IWL_LED_RF_STATE, \
112 .rx_with_siso_diversity = true
113
114 const struct iwl_cfg iwl100_bgn_cfg = {
115 .name = "Intel(R) Centrino(R) Wireless-N 100 BGN",
116 IWL_DEVICE_100,
117 .ht_params = &iwl1000_ht_params,
118 };
119
120 const struct iwl_cfg iwl100_bg_cfg = {
121 .name = "Intel(R) Centrino(R) Wireless-N 100 BG",
122 IWL_DEVICE_100,
123 };
124
125 MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
126 MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));