Skip to content
Permalink
Browse files

ar6000: fix Huawei butchering

In the actual release, the ifdef around "unsigned int softmac[6]"
was commented out, which caused an unused variable warning. It wasn't
merged as a result, though the debug messages they added (in code they
didn't seem to be using) were.

Clearly, this code is meant to be used as softmac sets incorrect addresses
based on the contents of the softmac file without it, though ath6kl_fetch_mac_file
should be used instead. This should be as Huawei intended and how it works
in stock firmware.
  • Loading branch information
Dazzozo committed Oct 14, 2013
1 parent f680b51 commit 22deb805ba53aadc462c065005a12ea723c8560c
Showing with 12 additions and 2 deletions.
  1. +2 −0 ar6000/Makefile
  2. +10 −2 ar6000/softmac.c
@@ -13,6 +13,8 @@ ccflags-y += -DCONFIG_CFG80211_DEFAULT_PS
ccflags-y += -DCONFIG_CFG80211_WEXT
ccflags-y += -DCONFIG_NL80211_TESTMODE

ccflags-y += -DFIX_HUAWEI_BUTCHERING

ATH_ROOT = $(src)/..

ccflags-y += -I$(ATH_ROOT)/include
@@ -138,7 +138,7 @@ void ath6kl_mangle_mac_address(struct ath6kl *ar, u8 locally_administered_bit)
{
u8 *ptr_mac;
int i, ret;
#ifdef CONFIG_MACH_PX
#if defined(CONFIG_MACH_PX) || defined(FIX_HUAWEI_BUTCHERING)
unsigned int softmac[6];
#endif

@@ -162,8 +162,12 @@ void ath6kl_mangle_mac_address(struct ath6kl *ar, u8 locally_administered_bit)
ptr_mac[0], ptr_mac[1], ptr_mac[2],
ptr_mac[3], ptr_mac[4], ptr_mac[5]);

#ifdef CONFIG_MACH_PX
#if defined(CONFIG_MACH_PX) || defined(FIX_HUAWEI_BUTCHERING)
#ifdef FIX_HUAWEI_BUTCHERING
ret = ath6kl_fetch_mac_file(ar);
#else
ret = ath6kl_fetch_nvmac_info(ar);
#endif

if (ret) {
ath6kl_err("MAC address file not found\n");
@@ -189,7 +193,11 @@ void ath6kl_mangle_mac_address(struct ath6kl *ar, u8 locally_administered_bit)
printk("MAC from ptr_mac %02X:%02X:%02X:%02X:%02X:%02X\n",
ptr_mac[0], ptr_mac[1], ptr_mac[2],
ptr_mac[3], ptr_mac[4], ptr_mac[5]);
#ifdef FIX_HUAWEI_BUTCHERING
kfree(ath6kl_softmac);
#else
vfree(ath6kl_softmac);
#endif
#else
ret = ath6kl_fetch_mac_file(ar);
if (ret) {

0 comments on commit 22deb80

Please sign in to comment.
You can’t perform that action at this time.