diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-nvm-parse.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c index 83903a5025c2..8e604a3931ca 100644 --- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
7 | * | 7 | * |
8 | * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. |
9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
12 | * it under the terms of version 2 of the GNU General Public License as | 12 | * it under the terms of version 2 of the GNU General Public License as |
@@ -32,7 +32,7 @@ | |||
32 | * BSD LICENSE | 32 | * BSD LICENSE |
33 | * | 33 | * |
34 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. | 34 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
35 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | 35 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
36 | * All rights reserved. | 36 | * All rights reserved. |
37 | * | 37 | * |
38 | * Redistribution and use in source and binary forms, with or without | 38 | * Redistribution and use in source and binary forms, with or without |
@@ -116,10 +116,11 @@ enum family_8000_nvm_offsets { | |||
116 | 116 | ||
117 | /* SKU Capabilities (actual values from NVM definition) */ | 117 | /* SKU Capabilities (actual values from NVM definition) */ |
118 | enum nvm_sku_bits { | 118 | enum nvm_sku_bits { |
119 | NVM_SKU_CAP_BAND_24GHZ = BIT(0), | 119 | NVM_SKU_CAP_BAND_24GHZ = BIT(0), |
120 | NVM_SKU_CAP_BAND_52GHZ = BIT(1), | 120 | NVM_SKU_CAP_BAND_52GHZ = BIT(1), |
121 | NVM_SKU_CAP_11N_ENABLE = BIT(2), | 121 | NVM_SKU_CAP_11N_ENABLE = BIT(2), |
122 | NVM_SKU_CAP_11AC_ENABLE = BIT(3), | 122 | NVM_SKU_CAP_11AC_ENABLE = BIT(3), |
123 | NVM_SKU_CAP_MIMO_DISABLE = BIT(5), | ||
123 | }; | 124 | }; |
124 | 125 | ||
125 | /* | 126 | /* |
@@ -368,6 +369,11 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg, | |||
368 | if (cfg->ht_params->ldpc) | 369 | if (cfg->ht_params->ldpc) |
369 | vht_cap->cap |= IEEE80211_VHT_CAP_RXLDPC; | 370 | vht_cap->cap |= IEEE80211_VHT_CAP_RXLDPC; |
370 | 371 | ||
372 | if (data->sku_cap_mimo_disabled) { | ||
373 | num_rx_ants = 1; | ||
374 | num_tx_ants = 1; | ||
375 | } | ||
376 | |||
371 | if (num_tx_ants > 1) | 377 | if (num_tx_ants > 1) |
372 | vht_cap->cap |= IEEE80211_VHT_CAP_TXSTBC; | 378 | vht_cap->cap |= IEEE80211_VHT_CAP_TXSTBC; |
373 | else | 379 | else |
@@ -465,7 +471,7 @@ static int iwl_get_radio_cfg(const struct iwl_cfg *cfg, const __le16 *nvm_sw, | |||
465 | if (cfg->device_family != IWL_DEVICE_FAMILY_8000) | 471 | if (cfg->device_family != IWL_DEVICE_FAMILY_8000) |
466 | return le16_to_cpup(nvm_sw + RADIO_CFG); | 472 | return le16_to_cpup(nvm_sw + RADIO_CFG); |
467 | 473 | ||
468 | return le32_to_cpup((__le32 *)(nvm_sw + RADIO_CFG_FAMILY_8000)); | 474 | return le32_to_cpup((__le32 *)(phy_sku + RADIO_CFG_FAMILY_8000)); |
469 | 475 | ||
470 | } | 476 | } |
471 | 477 | ||
@@ -527,6 +533,10 @@ static void iwl_set_hw_address_family_8000(struct device *dev, | |||
527 | const u8 *hw_addr; | 533 | const u8 *hw_addr; |
528 | 534 | ||
529 | if (mac_override) { | 535 | if (mac_override) { |
536 | static const u8 reserved_mac[] = { | ||
537 | 0x02, 0xcc, 0xaa, 0xff, 0xee, 0x00 | ||
538 | }; | ||
539 | |||
530 | hw_addr = (const u8 *)(mac_override + | 540 | hw_addr = (const u8 *)(mac_override + |
531 | MAC_ADDRESS_OVERRIDE_FAMILY_8000); | 541 | MAC_ADDRESS_OVERRIDE_FAMILY_8000); |
532 | 542 | ||
@@ -538,7 +548,12 @@ static void iwl_set_hw_address_family_8000(struct device *dev, | |||
538 | data->hw_addr[4] = hw_addr[5]; | 548 | data->hw_addr[4] = hw_addr[5]; |
539 | data->hw_addr[5] = hw_addr[4]; | 549 | data->hw_addr[5] = hw_addr[4]; |
540 | 550 | ||
541 | if (is_valid_ether_addr(data->hw_addr)) | 551 | /* |
552 | * Force the use of the OTP MAC address in case of reserved MAC | ||
553 | * address in the NVM, or if address is given but invalid. | ||
554 | */ | ||
555 | if (is_valid_ether_addr(data->hw_addr) && | ||
556 | memcmp(reserved_mac, hw_addr, ETH_ALEN) != 0) | ||
542 | return; | 557 | return; |
543 | 558 | ||
544 | IWL_ERR_DEV(dev, | 559 | IWL_ERR_DEV(dev, |
@@ -610,6 +625,7 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg, | |||
610 | data->sku_cap_11n_enable = false; | 625 | data->sku_cap_11n_enable = false; |
611 | data->sku_cap_11ac_enable = data->sku_cap_11n_enable && | 626 | data->sku_cap_11ac_enable = data->sku_cap_11n_enable && |
612 | (sku & NVM_SKU_CAP_11AC_ENABLE); | 627 | (sku & NVM_SKU_CAP_11AC_ENABLE); |
628 | data->sku_cap_mimo_disabled = sku & NVM_SKU_CAP_MIMO_DISABLE; | ||
613 | 629 | ||
614 | data->n_hw_addrs = iwl_get_n_hw_addrs(cfg, nvm_sw); | 630 | data->n_hw_addrs = iwl_get_n_hw_addrs(cfg, nvm_sw); |
615 | 631 | ||