1 // SPDX-License-Identifier: GPL-2.0-only
2 /******************************************************************************
3  *
4  * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
5  * Copyright(c) 2018 - 2020 Intel Corporation
6  *****************************************************************************/
7 
8 #include <linux/module.h>
9 #include <linux/stringify.h>
10 #include "iwl-config.h"
11 #include "iwl-agn-hw.h"
12 
13 /* Highest firmware API version supported */
14 #define IWL1000_UCODE_API_MAX 5
15 #define IWL100_UCODE_API_MAX 5
16 
17 /* Lowest firmware API version supported */
18 #define IWL1000_UCODE_API_MIN 1
19 #define IWL100_UCODE_API_MIN 5
20 
21 /* EEPROM version */
22 #define EEPROM_1000_TX_POWER_VERSION	(4)
23 #define EEPROM_1000_EEPROM_VERSION	(0x15C)
24 
25 #define IWL1000_FW_PRE "iwlwifi-1000-"
26 #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode"
27 
28 #define IWL100_FW_PRE "iwlwifi-100-"
29 #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode"
30 
31 
32 static const struct iwl_base_params iwl1000_base_params = {
33 	.num_of_queues = IWLAGN_NUM_QUEUES,
34 	.max_tfd_queue_size = 256,
35 	.eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
36 	.pll_cfg = true,
37 	.max_ll_items = OTP_MAX_LL_ITEMS_1000,
38 	.shadow_ram_support = false,
39 	.led_compensation = 51,
40 	.wd_timeout = IWL_WATCHDOG_DISABLED,
41 	.max_event_log_size = 128,
42 	.scd_chain_ext_wa = true,
43 };
44 
45 static const struct iwl_ht_params iwl1000_ht_params = {
46 	.ht_greenfield_support = true,
47 	.use_rts_for_aggregation = true, /* use rts/cts protection */
48 	.ht40_bands = BIT(NL80211_BAND_2GHZ),
49 };
50 
51 static const struct iwl_eeprom_params iwl1000_eeprom_params = {
52 	.regulatory_bands = {
53 		EEPROM_REG_BAND_1_CHANNELS,
54 		EEPROM_REG_BAND_2_CHANNELS,
55 		EEPROM_REG_BAND_3_CHANNELS,
56 		EEPROM_REG_BAND_4_CHANNELS,
57 		EEPROM_REG_BAND_5_CHANNELS,
58 		EEPROM_REG_BAND_24_HT40_CHANNELS,
59 		EEPROM_REGULATORY_BAND_NO_HT40,
60 	}
61 };
62 
63 #define IWL_DEVICE_1000						\
64 	.fw_name_pre = IWL1000_FW_PRE,				\
65 	.ucode_api_max = IWL1000_UCODE_API_MAX,			\
66 	.ucode_api_min = IWL1000_UCODE_API_MIN,			\
67 	.trans.device_family = IWL_DEVICE_FAMILY_1000,		\
68 	.max_inst_size = IWLAGN_RTC_INST_SIZE,			\
69 	.max_data_size = IWLAGN_RTC_DATA_SIZE,			\
70 	.nvm_ver = EEPROM_1000_EEPROM_VERSION,		\
71 	.nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION,	\
72 	.trans.base_params = &iwl1000_base_params,		\
73 	.eeprom_params = &iwl1000_eeprom_params,		\
74 	.led_mode = IWL_LED_BLINK
75 
76 const struct iwl_cfg iwl1000_bgn_cfg = {
77 	.name = "Intel(R) Centrino(R) Wireless-N 1000 BGN",
78 	IWL_DEVICE_1000,
79 	.ht_params = &iwl1000_ht_params,
80 };
81 
82 const struct iwl_cfg iwl1000_bg_cfg = {
83 	.name = "Intel(R) Centrino(R) Wireless-N 1000 BG",
84 	IWL_DEVICE_1000,
85 };
86 
87 #define IWL_DEVICE_100						\
88 	.fw_name_pre = IWL100_FW_PRE,				\
89 	.ucode_api_max = IWL100_UCODE_API_MAX,			\
90 	.ucode_api_min = IWL100_UCODE_API_MIN,			\
91 	.trans.device_family = IWL_DEVICE_FAMILY_100,		\
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 	.trans.base_params = &iwl1000_base_params,		\
97 	.eeprom_params = &iwl1000_eeprom_params,		\
98 	.led_mode = IWL_LED_RF_STATE,				\
99 	.rx_with_siso_diversity = true
100 
101 const struct iwl_cfg iwl100_bgn_cfg = {
102 	.name = "Intel(R) Centrino(R) Wireless-N 100 BGN",
103 	IWL_DEVICE_100,
104 	.ht_params = &iwl1000_ht_params,
105 };
106 
107 const struct iwl_cfg iwl100_bg_cfg = {
108 	.name = "Intel(R) Centrino(R) Wireless-N 100 BG",
109 	IWL_DEVICE_100,
110 };
111 
112 MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
113 MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX));
114