diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-eeprom.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-eeprom.c | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c index 5bf3f49b74ab..1075f1d7f016 100644 --- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c +++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c | |||
@@ -81,7 +81,7 @@ | |||
81 | * EEPROM contents to the specific channel number supported for each | 81 | * EEPROM contents to the specific channel number supported for each |
82 | * band. | 82 | * band. |
83 | * | 83 | * |
84 | * For example, iwl_priv->eeprom.band_3_channels[4] from the band_3 | 84 | * For example, il_priv->eeprom.band_3_channels[4] from the band_3 |
85 | * definition below maps to physical channel 42 in the 5.2GHz spectrum. | 85 | * definition below maps to physical channel 42 in the 5.2GHz spectrum. |
86 | * The specific geography and calibration information for that channel | 86 | * The specific geography and calibration information for that channel |
87 | * is contained in the eeprom map itself. | 87 | * is contained in the eeprom map itself. |
@@ -142,18 +142,18 @@ static const u8 iwlegacy_eeprom_band_7[] = { /* 5.2 ht40 channel */ | |||
142 | * | 142 | * |
143 | ******************************************************************************/ | 143 | ******************************************************************************/ |
144 | 144 | ||
145 | static int iwl_legacy_eeprom_verify_signature(struct iwl_priv *priv) | 145 | static int il_eeprom_verify_signature(struct il_priv *priv) |
146 | { | 146 | { |
147 | u32 gp = iwl_read32(priv, CSR_EEPROM_GP) & CSR_EEPROM_GP_VALID_MSK; | 147 | u32 gp = il_read32(priv, CSR_EEPROM_GP) & CSR_EEPROM_GP_VALID_MSK; |
148 | int ret = 0; | 148 | int ret = 0; |
149 | 149 | ||
150 | IWL_DEBUG_EEPROM(priv, "EEPROM signature=0x%08x\n", gp); | 150 | IL_DEBUG_EEPROM(priv, "EEPROM signature=0x%08x\n", gp); |
151 | switch (gp) { | 151 | switch (gp) { |
152 | case CSR_EEPROM_GP_GOOD_SIG_EEP_LESS_THAN_4K: | 152 | case CSR_EEPROM_GP_GOOD_SIG_EEP_LESS_THAN_4K: |
153 | case CSR_EEPROM_GP_GOOD_SIG_EEP_MORE_THAN_4K: | 153 | case CSR_EEPROM_GP_GOOD_SIG_EEP_MORE_THAN_4K: |
154 | break; | 154 | break; |
155 | default: | 155 | default: |
156 | IWL_ERR(priv, "bad EEPROM signature," | 156 | IL_ERR(priv, "bad EEPROM signature," |
157 | "EEPROM_GP=0x%08x\n", gp); | 157 | "EEPROM_GP=0x%08x\n", gp); |
158 | ret = -ENOENT; | 158 | ret = -ENOENT; |
159 | break; | 159 | break; |
@@ -162,39 +162,39 @@ static int iwl_legacy_eeprom_verify_signature(struct iwl_priv *priv) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | const u8 | 164 | const u8 |
165 | *iwl_legacy_eeprom_query_addr(const struct iwl_priv *priv, size_t offset) | 165 | *il_eeprom_query_addr(const struct il_priv *priv, size_t offset) |
166 | { | 166 | { |
167 | BUG_ON(offset >= priv->cfg->base_params->eeprom_size); | 167 | BUG_ON(offset >= priv->cfg->base_params->eeprom_size); |
168 | return &priv->eeprom[offset]; | 168 | return &priv->eeprom[offset]; |
169 | } | 169 | } |
170 | EXPORT_SYMBOL(iwl_legacy_eeprom_query_addr); | 170 | EXPORT_SYMBOL(il_eeprom_query_addr); |
171 | 171 | ||
172 | u16 iwl_legacy_eeprom_query16(const struct iwl_priv *priv, size_t offset) | 172 | u16 il_eeprom_query16(const struct il_priv *priv, size_t offset) |
173 | { | 173 | { |
174 | if (!priv->eeprom) | 174 | if (!priv->eeprom) |
175 | return 0; | 175 | return 0; |
176 | return (u16)priv->eeprom[offset] | ((u16)priv->eeprom[offset + 1] << 8); | 176 | return (u16)priv->eeprom[offset] | ((u16)priv->eeprom[offset + 1] << 8); |
177 | } | 177 | } |
178 | EXPORT_SYMBOL(iwl_legacy_eeprom_query16); | 178 | EXPORT_SYMBOL(il_eeprom_query16); |
179 | 179 | ||
180 | /** | 180 | /** |
181 | * iwl_legacy_eeprom_init - read EEPROM contents | 181 | * il_eeprom_init - read EEPROM contents |
182 | * | 182 | * |
183 | * Load the EEPROM contents from adapter into priv->eeprom | 183 | * Load the EEPROM contents from adapter into priv->eeprom |
184 | * | 184 | * |
185 | * NOTE: This routine uses the non-debug IO access functions. | 185 | * NOTE: This routine uses the non-debug IO access functions. |
186 | */ | 186 | */ |
187 | int iwl_legacy_eeprom_init(struct iwl_priv *priv) | 187 | int il_eeprom_init(struct il_priv *priv) |
188 | { | 188 | { |
189 | __le16 *e; | 189 | __le16 *e; |
190 | u32 gp = iwl_read32(priv, CSR_EEPROM_GP); | 190 | u32 gp = il_read32(priv, CSR_EEPROM_GP); |
191 | int sz; | 191 | int sz; |
192 | int ret; | 192 | int ret; |
193 | u16 addr; | 193 | u16 addr; |
194 | 194 | ||
195 | /* allocate eeprom */ | 195 | /* allocate eeprom */ |
196 | sz = priv->cfg->base_params->eeprom_size; | 196 | sz = priv->cfg->base_params->eeprom_size; |
197 | IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); | 197 | IL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); |
198 | priv->eeprom = kzalloc(sz, GFP_KERNEL); | 198 | priv->eeprom = kzalloc(sz, GFP_KERNEL); |
199 | if (!priv->eeprom) { | 199 | if (!priv->eeprom) { |
200 | ret = -ENOMEM; | 200 | ret = -ENOMEM; |
@@ -204,9 +204,9 @@ int iwl_legacy_eeprom_init(struct iwl_priv *priv) | |||
204 | 204 | ||
205 | priv->cfg->ops->lib->apm_ops.init(priv); | 205 | priv->cfg->ops->lib->apm_ops.init(priv); |
206 | 206 | ||
207 | ret = iwl_legacy_eeprom_verify_signature(priv); | 207 | ret = il_eeprom_verify_signature(priv); |
208 | if (ret < 0) { | 208 | if (ret < 0) { |
209 | IWL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp); | 209 | IL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp); |
210 | ret = -ENOENT; | 210 | ret = -ENOENT; |
211 | goto err; | 211 | goto err; |
212 | } | 212 | } |
@@ -214,7 +214,7 @@ int iwl_legacy_eeprom_init(struct iwl_priv *priv) | |||
214 | /* Make sure driver (instead of uCode) is allowed to read EEPROM */ | 214 | /* Make sure driver (instead of uCode) is allowed to read EEPROM */ |
215 | ret = priv->cfg->ops->lib->eeprom_ops.acquire_semaphore(priv); | 215 | ret = priv->cfg->ops->lib->eeprom_ops.acquire_semaphore(priv); |
216 | if (ret < 0) { | 216 | if (ret < 0) { |
217 | IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n"); | 217 | IL_ERR(priv, "Failed to acquire EEPROM semaphore.\n"); |
218 | ret = -ENOENT; | 218 | ret = -ENOENT; |
219 | goto err; | 219 | goto err; |
220 | } | 220 | } |
@@ -223,25 +223,25 @@ int iwl_legacy_eeprom_init(struct iwl_priv *priv) | |||
223 | for (addr = 0; addr < sz; addr += sizeof(u16)) { | 223 | for (addr = 0; addr < sz; addr += sizeof(u16)) { |
224 | u32 r; | 224 | u32 r; |
225 | 225 | ||
226 | _iwl_legacy_write32(priv, CSR_EEPROM_REG, | 226 | _il_write32(priv, CSR_EEPROM_REG, |
227 | CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); | 227 | CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); |
228 | 228 | ||
229 | ret = iwl_poll_bit(priv, CSR_EEPROM_REG, | 229 | ret = il_poll_bit(priv, CSR_EEPROM_REG, |
230 | CSR_EEPROM_REG_READ_VALID_MSK, | 230 | CSR_EEPROM_REG_READ_VALID_MSK, |
231 | CSR_EEPROM_REG_READ_VALID_MSK, | 231 | CSR_EEPROM_REG_READ_VALID_MSK, |
232 | IWL_EEPROM_ACCESS_TIMEOUT); | 232 | IL_EEPROM_ACCESS_TIMEOUT); |
233 | if (ret < 0) { | 233 | if (ret < 0) { |
234 | IWL_ERR(priv, "Time out reading EEPROM[%d]\n", | 234 | IL_ERR(priv, "Time out reading EEPROM[%d]\n", |
235 | addr); | 235 | addr); |
236 | goto done; | 236 | goto done; |
237 | } | 237 | } |
238 | r = _iwl_legacy_read_direct32(priv, CSR_EEPROM_REG); | 238 | r = _il_read_direct32(priv, CSR_EEPROM_REG); |
239 | e[addr / 2] = cpu_to_le16(r >> 16); | 239 | e[addr / 2] = cpu_to_le16(r >> 16); |
240 | } | 240 | } |
241 | 241 | ||
242 | IWL_DEBUG_EEPROM(priv, "NVM Type: %s, version: 0x%x\n", | 242 | IL_DEBUG_EEPROM(priv, "NVM Type: %s, version: 0x%x\n", |
243 | "EEPROM", | 243 | "EEPROM", |
244 | iwl_legacy_eeprom_query16(priv, EEPROM_VERSION)); | 244 | il_eeprom_query16(priv, EEPROM_VERSION)); |
245 | 245 | ||
246 | ret = 0; | 246 | ret = 0; |
247 | done: | 247 | done: |
@@ -249,24 +249,24 @@ done: | |||
249 | 249 | ||
250 | err: | 250 | err: |
251 | if (ret) | 251 | if (ret) |
252 | iwl_legacy_eeprom_free(priv); | 252 | il_eeprom_free(priv); |
253 | /* Reset chip to save power until we load uCode during "up". */ | 253 | /* Reset chip to save power until we load uCode during "up". */ |
254 | iwl_legacy_apm_stop(priv); | 254 | il_apm_stop(priv); |
255 | alloc_err: | 255 | alloc_err: |
256 | return ret; | 256 | return ret; |
257 | } | 257 | } |
258 | EXPORT_SYMBOL(iwl_legacy_eeprom_init); | 258 | EXPORT_SYMBOL(il_eeprom_init); |
259 | 259 | ||
260 | void iwl_legacy_eeprom_free(struct iwl_priv *priv) | 260 | void il_eeprom_free(struct il_priv *priv) |
261 | { | 261 | { |
262 | kfree(priv->eeprom); | 262 | kfree(priv->eeprom); |
263 | priv->eeprom = NULL; | 263 | priv->eeprom = NULL; |
264 | } | 264 | } |
265 | EXPORT_SYMBOL(iwl_legacy_eeprom_free); | 265 | EXPORT_SYMBOL(il_eeprom_free); |
266 | 266 | ||
267 | static void iwl_legacy_init_band_reference(const struct iwl_priv *priv, | 267 | static void il_init_band_reference(const struct il_priv *priv, |
268 | int eep_band, int *eeprom_ch_count, | 268 | int eep_band, int *eeprom_ch_count, |
269 | const struct iwl_eeprom_channel **eeprom_ch_info, | 269 | const struct il_eeprom_channel **eeprom_ch_info, |
270 | const u8 **eeprom_ch_index) | 270 | const u8 **eeprom_ch_index) |
271 | { | 271 | { |
272 | u32 offset = priv->cfg->ops->lib-> | 272 | u32 offset = priv->cfg->ops->lib-> |
@@ -274,44 +274,44 @@ static void iwl_legacy_init_band_reference(const struct iwl_priv *priv, | |||
274 | switch (eep_band) { | 274 | switch (eep_band) { |
275 | case 1: /* 2.4GHz band */ | 275 | case 1: /* 2.4GHz band */ |
276 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_1); | 276 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_1); |
277 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 277 | *eeprom_ch_info = (struct il_eeprom_channel *) |
278 | iwl_legacy_eeprom_query_addr(priv, offset); | 278 | il_eeprom_query_addr(priv, offset); |
279 | *eeprom_ch_index = iwlegacy_eeprom_band_1; | 279 | *eeprom_ch_index = iwlegacy_eeprom_band_1; |
280 | break; | 280 | break; |
281 | case 2: /* 4.9GHz band */ | 281 | case 2: /* 4.9GHz band */ |
282 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_2); | 282 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_2); |
283 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 283 | *eeprom_ch_info = (struct il_eeprom_channel *) |
284 | iwl_legacy_eeprom_query_addr(priv, offset); | 284 | il_eeprom_query_addr(priv, offset); |
285 | *eeprom_ch_index = iwlegacy_eeprom_band_2; | 285 | *eeprom_ch_index = iwlegacy_eeprom_band_2; |
286 | break; | 286 | break; |
287 | case 3: /* 5.2GHz band */ | 287 | case 3: /* 5.2GHz band */ |
288 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_3); | 288 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_3); |
289 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 289 | *eeprom_ch_info = (struct il_eeprom_channel *) |
290 | iwl_legacy_eeprom_query_addr(priv, offset); | 290 | il_eeprom_query_addr(priv, offset); |
291 | *eeprom_ch_index = iwlegacy_eeprom_band_3; | 291 | *eeprom_ch_index = iwlegacy_eeprom_band_3; |
292 | break; | 292 | break; |
293 | case 4: /* 5.5GHz band */ | 293 | case 4: /* 5.5GHz band */ |
294 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_4); | 294 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_4); |
295 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 295 | *eeprom_ch_info = (struct il_eeprom_channel *) |
296 | iwl_legacy_eeprom_query_addr(priv, offset); | 296 | il_eeprom_query_addr(priv, offset); |
297 | *eeprom_ch_index = iwlegacy_eeprom_band_4; | 297 | *eeprom_ch_index = iwlegacy_eeprom_band_4; |
298 | break; | 298 | break; |
299 | case 5: /* 5.7GHz band */ | 299 | case 5: /* 5.7GHz band */ |
300 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_5); | 300 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_5); |
301 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 301 | *eeprom_ch_info = (struct il_eeprom_channel *) |
302 | iwl_legacy_eeprom_query_addr(priv, offset); | 302 | il_eeprom_query_addr(priv, offset); |
303 | *eeprom_ch_index = iwlegacy_eeprom_band_5; | 303 | *eeprom_ch_index = iwlegacy_eeprom_band_5; |
304 | break; | 304 | break; |
305 | case 6: /* 2.4GHz ht40 channels */ | 305 | case 6: /* 2.4GHz ht40 channels */ |
306 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_6); | 306 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_6); |
307 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 307 | *eeprom_ch_info = (struct il_eeprom_channel *) |
308 | iwl_legacy_eeprom_query_addr(priv, offset); | 308 | il_eeprom_query_addr(priv, offset); |
309 | *eeprom_ch_index = iwlegacy_eeprom_band_6; | 309 | *eeprom_ch_index = iwlegacy_eeprom_band_6; |
310 | break; | 310 | break; |
311 | case 7: /* 5 GHz ht40 channels */ | 311 | case 7: /* 5 GHz ht40 channels */ |
312 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_7); | 312 | *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_7); |
313 | *eeprom_ch_info = (struct iwl_eeprom_channel *) | 313 | *eeprom_ch_info = (struct il_eeprom_channel *) |
314 | iwl_legacy_eeprom_query_addr(priv, offset); | 314 | il_eeprom_query_addr(priv, offset); |
315 | *eeprom_ch_index = iwlegacy_eeprom_band_7; | 315 | *eeprom_ch_index = iwlegacy_eeprom_band_7; |
316 | break; | 316 | break; |
317 | default: | 317 | default: |
@@ -322,27 +322,27 @@ static void iwl_legacy_init_band_reference(const struct iwl_priv *priv, | |||
322 | #define CHECK_AND_PRINT(x) ((eeprom_ch->flags & EEPROM_CHANNEL_##x) \ | 322 | #define CHECK_AND_PRINT(x) ((eeprom_ch->flags & EEPROM_CHANNEL_##x) \ |
323 | ? # x " " : "") | 323 | ? # x " " : "") |
324 | /** | 324 | /** |
325 | * iwl_legacy_mod_ht40_chan_info - Copy ht40 channel info into driver's priv. | 325 | * il_mod_ht40_chan_info - Copy ht40 channel info into driver's priv. |
326 | * | 326 | * |
327 | * Does not set up a command, or touch hardware. | 327 | * Does not set up a command, or touch hardware. |
328 | */ | 328 | */ |
329 | static int iwl_legacy_mod_ht40_chan_info(struct iwl_priv *priv, | 329 | static int il_mod_ht40_chan_info(struct il_priv *priv, |
330 | enum ieee80211_band band, u16 channel, | 330 | enum ieee80211_band band, u16 channel, |
331 | const struct iwl_eeprom_channel *eeprom_ch, | 331 | const struct il_eeprom_channel *eeprom_ch, |
332 | u8 clear_ht40_extension_channel) | 332 | u8 clear_ht40_extension_channel) |
333 | { | 333 | { |
334 | struct iwl_channel_info *ch_info; | 334 | struct il_channel_info *ch_info; |
335 | 335 | ||
336 | ch_info = (struct iwl_channel_info *) | 336 | ch_info = (struct il_channel_info *) |
337 | iwl_legacy_get_channel_info(priv, band, channel); | 337 | il_get_channel_info(priv, band, channel); |
338 | 338 | ||
339 | if (!iwl_legacy_is_channel_valid(ch_info)) | 339 | if (!il_is_channel_valid(ch_info)) |
340 | return -1; | 340 | return -1; |
341 | 341 | ||
342 | IWL_DEBUG_EEPROM(priv, "HT40 Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):" | 342 | IL_DEBUG_EEPROM(priv, "HT40 Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):" |
343 | " Ad-Hoc %ssupported\n", | 343 | " Ad-Hoc %ssupported\n", |
344 | ch_info->channel, | 344 | ch_info->channel, |
345 | iwl_legacy_is_channel_a_band(ch_info) ? | 345 | il_is_channel_a_band(ch_info) ? |
346 | "5.2" : "2.4", | 346 | "5.2" : "2.4", |
347 | CHECK_AND_PRINT(IBSS), | 347 | CHECK_AND_PRINT(IBSS), |
348 | CHECK_AND_PRINT(ACTIVE), | 348 | CHECK_AND_PRINT(ACTIVE), |
@@ -369,22 +369,22 @@ static int iwl_legacy_mod_ht40_chan_info(struct iwl_priv *priv, | |||
369 | ? # x " " : "") | 369 | ? # x " " : "") |
370 | 370 | ||
371 | /** | 371 | /** |
372 | * iwl_legacy_init_channel_map - Set up driver's info for all possible channels | 372 | * il_init_channel_map - Set up driver's info for all possible channels |
373 | */ | 373 | */ |
374 | int iwl_legacy_init_channel_map(struct iwl_priv *priv) | 374 | int il_init_channel_map(struct il_priv *priv) |
375 | { | 375 | { |
376 | int eeprom_ch_count = 0; | 376 | int eeprom_ch_count = 0; |
377 | const u8 *eeprom_ch_index = NULL; | 377 | const u8 *eeprom_ch_index = NULL; |
378 | const struct iwl_eeprom_channel *eeprom_ch_info = NULL; | 378 | const struct il_eeprom_channel *eeprom_ch_info = NULL; |
379 | int band, ch; | 379 | int band, ch; |
380 | struct iwl_channel_info *ch_info; | 380 | struct il_channel_info *ch_info; |
381 | 381 | ||
382 | if (priv->channel_count) { | 382 | if (priv->channel_count) { |
383 | IWL_DEBUG_EEPROM(priv, "Channel map already initialized.\n"); | 383 | IL_DEBUG_EEPROM(priv, "Channel map already initialized.\n"); |
384 | return 0; | 384 | return 0; |
385 | } | 385 | } |
386 | 386 | ||
387 | IWL_DEBUG_EEPROM(priv, "Initializing regulatory info from EEPROM\n"); | 387 | IL_DEBUG_EEPROM(priv, "Initializing regulatory info from EEPROM\n"); |
388 | 388 | ||
389 | priv->channel_count = | 389 | priv->channel_count = |
390 | ARRAY_SIZE(iwlegacy_eeprom_band_1) + | 390 | ARRAY_SIZE(iwlegacy_eeprom_band_1) + |
@@ -393,13 +393,13 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
393 | ARRAY_SIZE(iwlegacy_eeprom_band_4) + | 393 | ARRAY_SIZE(iwlegacy_eeprom_band_4) + |
394 | ARRAY_SIZE(iwlegacy_eeprom_band_5); | 394 | ARRAY_SIZE(iwlegacy_eeprom_band_5); |
395 | 395 | ||
396 | IWL_DEBUG_EEPROM(priv, "Parsing data for %d channels.\n", | 396 | IL_DEBUG_EEPROM(priv, "Parsing data for %d channels.\n", |
397 | priv->channel_count); | 397 | priv->channel_count); |
398 | 398 | ||
399 | priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) * | 399 | priv->channel_info = kzalloc(sizeof(struct il_channel_info) * |
400 | priv->channel_count, GFP_KERNEL); | 400 | priv->channel_count, GFP_KERNEL); |
401 | if (!priv->channel_info) { | 401 | if (!priv->channel_info) { |
402 | IWL_ERR(priv, "Could not allocate channel_info\n"); | 402 | IL_ERR(priv, "Could not allocate channel_info\n"); |
403 | priv->channel_count = 0; | 403 | priv->channel_count = 0; |
404 | return -ENOMEM; | 404 | return -ENOMEM; |
405 | } | 405 | } |
@@ -411,7 +411,7 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
411 | * what just in the EEPROM) */ | 411 | * what just in the EEPROM) */ |
412 | for (band = 1; band <= 5; band++) { | 412 | for (band = 1; band <= 5; band++) { |
413 | 413 | ||
414 | iwl_legacy_init_band_reference(priv, band, &eeprom_ch_count, | 414 | il_init_band_reference(priv, band, &eeprom_ch_count, |
415 | &eeprom_ch_info, &eeprom_ch_index); | 415 | &eeprom_ch_info, &eeprom_ch_index); |
416 | 416 | ||
417 | /* Loop through each band adding each of the channels */ | 417 | /* Loop through each band adding each of the channels */ |
@@ -432,13 +432,13 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
432 | ch_info->ht40_extension_channel = | 432 | ch_info->ht40_extension_channel = |
433 | IEEE80211_CHAN_NO_HT40; | 433 | IEEE80211_CHAN_NO_HT40; |
434 | 434 | ||
435 | if (!(iwl_legacy_is_channel_valid(ch_info))) { | 435 | if (!(il_is_channel_valid(ch_info))) { |
436 | IWL_DEBUG_EEPROM(priv, | 436 | IL_DEBUG_EEPROM(priv, |
437 | "Ch. %d Flags %x [%sGHz] - " | 437 | "Ch. %d Flags %x [%sGHz] - " |
438 | "No traffic\n", | 438 | "No traffic\n", |
439 | ch_info->channel, | 439 | ch_info->channel, |
440 | ch_info->flags, | 440 | ch_info->flags, |
441 | iwl_legacy_is_channel_a_band(ch_info) ? | 441 | il_is_channel_a_band(ch_info) ? |
442 | "5.2" : "2.4"); | 442 | "5.2" : "2.4"); |
443 | ch_info++; | 443 | ch_info++; |
444 | continue; | 444 | continue; |
@@ -450,11 +450,11 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
450 | ch_info->scan_power = eeprom_ch_info[ch].max_power_avg; | 450 | ch_info->scan_power = eeprom_ch_info[ch].max_power_avg; |
451 | ch_info->min_power = 0; | 451 | ch_info->min_power = 0; |
452 | 452 | ||
453 | IWL_DEBUG_EEPROM(priv, "Ch. %d [%sGHz] " | 453 | IL_DEBUG_EEPROM(priv, "Ch. %d [%sGHz] " |
454 | "%s%s%s%s%s%s(0x%02x %ddBm):" | 454 | "%s%s%s%s%s%s(0x%02x %ddBm):" |
455 | " Ad-Hoc %ssupported\n", | 455 | " Ad-Hoc %ssupported\n", |
456 | ch_info->channel, | 456 | ch_info->channel, |
457 | iwl_legacy_is_channel_a_band(ch_info) ? | 457 | il_is_channel_a_band(ch_info) ? |
458 | "5.2" : "2.4", | 458 | "5.2" : "2.4", |
459 | CHECK_AND_PRINT_I(VALID), | 459 | CHECK_AND_PRINT_I(VALID), |
460 | CHECK_AND_PRINT_I(IBSS), | 460 | CHECK_AND_PRINT_I(IBSS), |
@@ -485,7 +485,7 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
485 | for (band = 6; band <= 7; band++) { | 485 | for (band = 6; band <= 7; band++) { |
486 | enum ieee80211_band ieeeband; | 486 | enum ieee80211_band ieeeband; |
487 | 487 | ||
488 | iwl_legacy_init_band_reference(priv, band, &eeprom_ch_count, | 488 | il_init_band_reference(priv, band, &eeprom_ch_count, |
489 | &eeprom_ch_info, &eeprom_ch_index); | 489 | &eeprom_ch_info, &eeprom_ch_index); |
490 | 490 | ||
491 | /* EEPROM band 6 is 2.4, band 7 is 5 GHz */ | 491 | /* EEPROM band 6 is 2.4, band 7 is 5 GHz */ |
@@ -495,13 +495,13 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
495 | /* Loop through each band adding each of the channels */ | 495 | /* Loop through each band adding each of the channels */ |
496 | for (ch = 0; ch < eeprom_ch_count; ch++) { | 496 | for (ch = 0; ch < eeprom_ch_count; ch++) { |
497 | /* Set up driver's info for lower half */ | 497 | /* Set up driver's info for lower half */ |
498 | iwl_legacy_mod_ht40_chan_info(priv, ieeeband, | 498 | il_mod_ht40_chan_info(priv, ieeeband, |
499 | eeprom_ch_index[ch], | 499 | eeprom_ch_index[ch], |
500 | &eeprom_ch_info[ch], | 500 | &eeprom_ch_info[ch], |
501 | IEEE80211_CHAN_NO_HT40PLUS); | 501 | IEEE80211_CHAN_NO_HT40PLUS); |
502 | 502 | ||
503 | /* Set up driver's info for upper half */ | 503 | /* Set up driver's info for upper half */ |
504 | iwl_legacy_mod_ht40_chan_info(priv, ieeeband, | 504 | il_mod_ht40_chan_info(priv, ieeeband, |
505 | eeprom_ch_index[ch] + 4, | 505 | eeprom_ch_index[ch] + 4, |
506 | &eeprom_ch_info[ch], | 506 | &eeprom_ch_info[ch], |
507 | IEEE80211_CHAN_NO_HT40MINUS); | 507 | IEEE80211_CHAN_NO_HT40MINUS); |
@@ -510,25 +510,25 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) | |||
510 | 510 | ||
511 | return 0; | 511 | return 0; |
512 | } | 512 | } |
513 | EXPORT_SYMBOL(iwl_legacy_init_channel_map); | 513 | EXPORT_SYMBOL(il_init_channel_map); |
514 | 514 | ||
515 | /* | 515 | /* |
516 | * iwl_legacy_free_channel_map - undo allocations in iwl_legacy_init_channel_map | 516 | * il_free_channel_map - undo allocations in il_init_channel_map |
517 | */ | 517 | */ |
518 | void iwl_legacy_free_channel_map(struct iwl_priv *priv) | 518 | void il_free_channel_map(struct il_priv *priv) |
519 | { | 519 | { |
520 | kfree(priv->channel_info); | 520 | kfree(priv->channel_info); |
521 | priv->channel_count = 0; | 521 | priv->channel_count = 0; |
522 | } | 522 | } |
523 | EXPORT_SYMBOL(iwl_legacy_free_channel_map); | 523 | EXPORT_SYMBOL(il_free_channel_map); |
524 | 524 | ||
525 | /** | 525 | /** |
526 | * iwl_legacy_get_channel_info - Find driver's private channel info | 526 | * il_get_channel_info - Find driver's private channel info |
527 | * | 527 | * |
528 | * Based on band and channel number. | 528 | * Based on band and channel number. |
529 | */ | 529 | */ |
530 | const struct | 530 | const struct |
531 | iwl_channel_info *iwl_legacy_get_channel_info(const struct iwl_priv *priv, | 531 | il_channel_info *il_get_channel_info(const struct il_priv *priv, |
532 | enum ieee80211_band band, u16 channel) | 532 | enum ieee80211_band band, u16 channel) |
533 | { | 533 | { |
534 | int i; | 534 | int i; |
@@ -550,4 +550,4 @@ iwl_channel_info *iwl_legacy_get_channel_info(const struct iwl_priv *priv, | |||
550 | 550 | ||
551 | return NULL; | 551 | return NULL; |
552 | } | 552 | } |
553 | EXPORT_SYMBOL(iwl_legacy_get_channel_info); | 553 | EXPORT_SYMBOL(il_get_channel_info); |