Skip to content

Commit

Permalink
ar6000: fix Huawei butchering
Browse files Browse the repository at this point in the history
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
Daz Jones committed Oct 14, 2013
1 parent f680b51 commit 22deb80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ar6000/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions ar6000/softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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");
Expand All @@ -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) {
Expand Down

0 comments on commit 22deb80

Please sign in to comment.