Skip to content

Commit

Permalink
iwlwifi: nvm: force mac from otp in case nvm mac is reserved
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liad Kaufman authored and Emmanuel Grumbach committed May 21, 2015
1 parent 2fc863a commit 18f8467
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ static void iwl_set_hw_address_family_8000(struct device *dev,
const u8 *hw_addr;

if (mac_override) {
static const u8 reserved_mac[] = {
0x02, 0xcc, 0xaa, 0xff, 0xee, 0x00
};

hw_addr = (const u8 *)(mac_override +
MAC_ADDRESS_OVERRIDE_FAMILY_8000);

Expand All @@ -544,7 +548,12 @@ static void iwl_set_hw_address_family_8000(struct device *dev,
data->hw_addr[4] = hw_addr[5];
data->hw_addr[5] = hw_addr[4];

if (is_valid_ether_addr(data->hw_addr))
/*
* Force the use of the OTP MAC address in case of reserved MAC
* address in the NVM, or if address is given but invalid.
*/
if (is_valid_ether_addr(data->hw_addr) &&
memcmp(reserved_mac, hw_addr, ETH_ALEN) != 0)
return;

IWL_ERR_DEV(dev,
Expand Down

0 comments on commit 18f8467

Please sign in to comment.