aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000-hw.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c62
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.h30
3 files changed, 95 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
index 72a266581aef..5cf8a684b3e1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
@@ -68,6 +68,9 @@
68#ifndef __iwl_5000_hw_h__ 68#ifndef __iwl_5000_hw_h__
69#define __iwl_5000_hw_h__ 69#define __iwl_5000_hw_h__
70 70
71/* EERPROM */
72#define IWL_5000_EEPROM_IMG_SIZE 2048
73
71 74
72#define IWL50_MAX_WIN_SIZE 64 75#define IWL50_MAX_WIN_SIZE 64
73#define IWL50_QUEUE_SIZE 256 76#define IWL50_QUEUE_SIZE 256
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 58a35cb2d78b..91b3e563bbea 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -86,6 +86,55 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
86 return ret; 86 return ret;
87} 87}
88 88
89/*
90 * EEPROM
91 */
92static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
93{
94 u16 offset = 0;
95
96 if ((address & INDIRECT_ADDRESS) == 0)
97 return address;
98
99 switch (address & INDIRECT_TYPE_MSK) {
100 case INDIRECT_HOST:
101 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_HOST);
102 break;
103 case INDIRECT_GENERAL:
104 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_GENERAL);
105 break;
106 case INDIRECT_REGULATORY:
107 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_REGULATORY);
108 break;
109 case INDIRECT_CALIBRATION:
110 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_CALIBRATION);
111 break;
112 case INDIRECT_PROCESS_ADJST:
113 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_PROCESS_ADJST);
114 break;
115 case INDIRECT_OTHERS:
116 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_OTHERS);
117 break;
118 default:
119 IWL_ERROR("illegal indirect type: 0x%X\n",
120 address & INDIRECT_TYPE_MSK);
121 break;
122 }
123
124 /* translate the offset from words to byte */
125 return (address & ADDRESS_MSK) + (offset << 1);
126}
127
128static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
129 size_t offset)
130{
131 u32 address = eeprom_indirect_address(priv, offset);
132 BUG_ON(address >= priv->cfg->eeprom_size);
133 return &priv->eeprom[address];
134}
135
136
137
89static struct iwl_hcmd_ops iwl5000_hcmd = { 138static struct iwl_hcmd_ops iwl5000_hcmd = {
90}; 139};
91 140
@@ -98,9 +147,19 @@ static struct iwl_lib_ops iwl5000_lib = {
98 .set_pwr_src = iwl4965_set_pwr_src, 147 .set_pwr_src = iwl4965_set_pwr_src,
99 }, 148 },
100 .eeprom_ops = { 149 .eeprom_ops = {
150 .regulatory_bands = {
151 EEPROM_5000_REG_BAND_1_CHANNELS,
152 EEPROM_5000_REG_BAND_2_CHANNELS,
153 EEPROM_5000_REG_BAND_3_CHANNELS,
154 EEPROM_5000_REG_BAND_4_CHANNELS,
155 EEPROM_5000_REG_BAND_5_CHANNELS,
156 EEPROM_5000_REG_BAND_24_FAT_CHANNELS,
157 EEPROM_5000_REG_BAND_52_FAT_CHANNELS
158 },
101 .verify_signature = iwlcore_eeprom_verify_signature, 159 .verify_signature = iwlcore_eeprom_verify_signature,
102 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, 160 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
103 .release_semaphore = iwlcore_eeprom_release_semaphore, 161 .release_semaphore = iwlcore_eeprom_release_semaphore,
162 .query_addr = iwl5000_eeprom_query_addr,
104 }, 163 },
105}; 164};
106 165
@@ -123,6 +182,7 @@ struct iwl_cfg iwl5300_agn_cfg = {
123 .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode", 182 .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode",
124 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 183 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
125 .ops = &iwl5000_ops, 184 .ops = &iwl5000_ops,
185 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
126 .mod_params = &iwl50_mod_params, 186 .mod_params = &iwl50_mod_params,
127}; 187};
128 188
@@ -131,6 +191,7 @@ struct iwl_cfg iwl5100_agn_cfg = {
131 .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode", 191 .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode",
132 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 192 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
133 .ops = &iwl5000_ops, 193 .ops = &iwl5000_ops,
194 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
134 .mod_params = &iwl50_mod_params, 195 .mod_params = &iwl50_mod_params,
135}; 196};
136 197
@@ -139,6 +200,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
139 .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode", 200 .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode",
140 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 201 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
141 .ops = &iwl5000_ops, 202 .ops = &iwl5000_ops,
203 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
142 .mod_params = &iwl50_mod_params, 204 .mod_params = &iwl50_mod_params,
143}; 205};
144 206
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
index 0c42e5a1288b..56e0a07b8183 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
@@ -140,6 +140,36 @@ struct iwl_eeprom_channel {
140#define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */ 140#define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */
141#define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */ 141#define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */
142 142
143/*5000 calibrations */
144#define EEPROM_5000_CALIB_ALL (INDIRECT_ADDRESS | INDIRECT_CALIBRATION)
145
146/* 5000 links */
147#define EEPROM_5000_LINK_HOST (2*0x64)
148#define EEPROM_5000_LINK_GENERAL (2*0x65)
149#define EEPROM_5000_LINK_REGULATORY (2*0x66)
150#define EEPROM_5000_LINK_CALIBRATION (2*0x67)
151#define EEPROM_5000_LINK_PROCESS_ADJST (2*0x68)
152#define EEPROM_5000_LINK_OTHERS (2*0x69)
153
154/* 5000 regulatory - indirect access */
155#define EEPROM_5000_REG_SKU_ID ((0x02)\
156 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 4 bytes */
157#define EEPROM_5000_REG_BAND_1_CHANNELS ((0x08)\
158 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 28 bytes */
159#define EEPROM_5000_REG_BAND_2_CHANNELS ((0x26)\
160 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 26 bytes */
161#define EEPROM_5000_REG_BAND_3_CHANNELS ((0x42)\
162 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 24 bytes */
163#define EEPROM_5000_REG_BAND_4_CHANNELS ((0x5C)\
164 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 22 bytes */
165#define EEPROM_5000_REG_BAND_5_CHANNELS ((0x74)\
166 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 12 bytes */
167#define EEPROM_5000_REG_BAND_24_FAT_CHANNELS ((0x82)\
168 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 14 bytes */
169#define EEPROM_5000_REG_BAND_52_FAT_CHANNELS ((0x92)\
170 | INDIRECT_ADDRESS | INDIRECT_REGULATORY) /* 22 bytes */
171
172
143/* 2.4 GHz */ 173/* 2.4 GHz */
144extern const u8 iwl_eeprom_band_1[14]; 174extern const u8 iwl_eeprom_band_1[14];
145 175