aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2015-05-20 08:50:07 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-05-21 15:27:02 -0400
commit18f84673fb0fb3b4727ecf53a7455874172899d4 (patch)
treecac006fd407e1a5ad5c6eff2838ea77f3350ed32
parent2fc863a5143d64b8f06576cc3d7fd5622c5cf3b5 (diff)
iwlwifi: nvm: force mac from otp in case nvm mac is reserved
Take the MAC address from the OTP even if one is present in the NVM, if that MAC address happens to be a reserved one. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-nvm-parse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
index cf86f3cdbb8e..75e96db6626b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
@@ -533,6 +533,10 @@ static void iwl_set_hw_address_family_8000(struct device *dev,
533 const u8 *hw_addr; 533 const u8 *hw_addr;
534 534
535 if (mac_override) { 535 if (mac_override) {
536 static const u8 reserved_mac[] = {
537 0x02, 0xcc, 0xaa, 0xff, 0xee, 0x00
538 };
539
536 hw_addr = (const u8 *)(mac_override + 540 hw_addr = (const u8 *)(mac_override +
537 MAC_ADDRESS_OVERRIDE_FAMILY_8000); 541 MAC_ADDRESS_OVERRIDE_FAMILY_8000);
538 542
@@ -544,7 +548,12 @@ static void iwl_set_hw_address_family_8000(struct device *dev,
544 data->hw_addr[4] = hw_addr[5]; 548 data->hw_addr[4] = hw_addr[5];
545 data->hw_addr[5] = hw_addr[4]; 549 data->hw_addr[5] = hw_addr[4];
546 550
547 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)
548 return; 557 return;
549 558
550 IWL_ERR_DEV(dev, 559 IWL_ERR_DEV(dev,