iwlwifi: clear STATUS_SCAN_HW when PAN_PARAMS fails
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / wireless / iwlwifi / iwl-5000.c
1 /******************************************************************************
2 *
3 * Copyright(c) 2007 - 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-cfg.h"
31 #include "iwl-agn-hw.h"
32 #include "iwl-csr.h"
33
34 /* Highest firmware API version supported */
35 #define IWL5000_UCODE_API_MAX 5
36 #define IWL5150_UCODE_API_MAX 2
37
38 /* Oldest version we won't warn about */
39 #define IWL5000_UCODE_API_OK 5
40 #define IWL5150_UCODE_API_OK 2
41
42 /* Lowest firmware API version supported */
43 #define IWL5000_UCODE_API_MIN 1
44 #define IWL5150_UCODE_API_MIN 1
45
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
52 #define IWL5000_FW_PRE "iwlwifi-5000-"
53 #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
54
55 #define IWL5150_FW_PRE "iwlwifi-5150-"
56 #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
57
58 static const struct iwl_base_params iwl5000_base_params = {
59 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
60 .num_of_queues = IWLAGN_NUM_QUEUES,
61 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
62 .led_compensation = 51,
63 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
64 .chain_noise_scale = 1000,
65 .wd_timeout = IWL_WATCHHDOG_DISABLED,
66 .max_event_log_size = 512,
67 .no_idle_support = true,
68 };
69
70 static const struct iwl_ht_params iwl5000_ht_params = {
71 .ht_greenfield_support = true,
72 };
73
74 #define IWL_DEVICE_5000 \
75 .fw_name_pre = IWL5000_FW_PRE, \
76 .ucode_api_max = IWL5000_UCODE_API_MAX, \
77 .ucode_api_ok = IWL5000_UCODE_API_OK, \
78 .ucode_api_min = IWL5000_UCODE_API_MIN, \
79 .device_family = IWL_DEVICE_FAMILY_5000, \
80 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
81 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
82 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
83 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
84 .base_params = &iwl5000_base_params, \
85 .led_mode = IWL_LED_BLINK
86
87 const struct iwl_cfg iwl5300_agn_cfg = {
88 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
89 IWL_DEVICE_5000,
90 /* at least EEPROM 0x11A has wrong info */
91 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
92 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
93 .ht_params = &iwl5000_ht_params,
94 };
95
96 const struct iwl_cfg iwl5100_bgn_cfg = {
97 .name = "Intel(R) WiFi Link 5100 BGN",
98 IWL_DEVICE_5000,
99 .valid_tx_ant = ANT_B, /* .cfg overwrite */
100 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
101 .ht_params = &iwl5000_ht_params,
102 };
103
104 const struct iwl_cfg iwl5100_abg_cfg = {
105 .name = "Intel(R) WiFi Link 5100 ABG",
106 IWL_DEVICE_5000,
107 .valid_tx_ant = ANT_B, /* .cfg overwrite */
108 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
109 };
110
111 const struct iwl_cfg iwl5100_agn_cfg = {
112 .name = "Intel(R) WiFi Link 5100 AGN",
113 IWL_DEVICE_5000,
114 .valid_tx_ant = ANT_B, /* .cfg overwrite */
115 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
116 .ht_params = &iwl5000_ht_params,
117 };
118
119 const struct iwl_cfg iwl5350_agn_cfg = {
120 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
121 .fw_name_pre = IWL5000_FW_PRE,
122 .ucode_api_max = IWL5000_UCODE_API_MAX,
123 .ucode_api_ok = IWL5000_UCODE_API_OK,
124 .ucode_api_min = IWL5000_UCODE_API_MIN,
125 .device_family = IWL_DEVICE_FAMILY_5000,
126 .max_inst_size = IWLAGN_RTC_INST_SIZE,
127 .max_data_size = IWLAGN_RTC_DATA_SIZE,
128 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
129 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
130 .base_params = &iwl5000_base_params,
131 .ht_params = &iwl5000_ht_params,
132 .led_mode = IWL_LED_BLINK,
133 .internal_wimax_coex = true,
134 };
135
136 #define IWL_DEVICE_5150 \
137 .fw_name_pre = IWL5150_FW_PRE, \
138 .ucode_api_max = IWL5150_UCODE_API_MAX, \
139 .ucode_api_ok = IWL5150_UCODE_API_OK, \
140 .ucode_api_min = IWL5150_UCODE_API_MIN, \
141 .device_family = IWL_DEVICE_FAMILY_5150, \
142 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
143 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
144 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
145 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
146 .base_params = &iwl5000_base_params, \
147 .no_xtal_calib = true, \
148 .led_mode = IWL_LED_BLINK, \
149 .internal_wimax_coex = true
150
151 const struct iwl_cfg iwl5150_agn_cfg = {
152 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
153 IWL_DEVICE_5150,
154 .ht_params = &iwl5000_ht_params,
155
156 };
157
158 const struct iwl_cfg iwl5150_abg_cfg = {
159 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
160 IWL_DEVICE_5150,
161 };
162
163 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
164 MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));