summaryrefslogtreecommitdiff
path: root/package/mac80211
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-11-28 18:01:03 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-11-28 18:01:03 +0000
commitbecedde3f1ec42dc99dce12c34c3e0f562f7b4d9 (patch)
tree4530213258efc17fb2757f70dc5aef04b3d94541 /package/mac80211
parent756b6fdbf312b441202cfef5883304a0579db8a9 (diff)
downloadmtk-20170518-becedde3f1ec42dc99dce12c34c3e0f562f7b4d9.zip
mtk-20170518-becedde3f1ec42dc99dce12c34c3e0f562f7b4d9.tar.gz
mtk-20170518-becedde3f1ec42dc99dce12c34c3e0f562f7b4d9.tar.bz2
mac80211: use mac address from platform data if present on ath9k
SVN-Revision: 18584
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/Makefile2
-rw-r--r--package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch53
2 files changed, 54 insertions, 1 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
index 5eaf77b..4ee9555 100644
--- a/package/mac80211/Makefile
+++ b/package/mac80211/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=2009-11-21
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_SOURCE_URL:= \
http://www.orbit-lab.org/kernel/compat-wireless-2.6/2009/11 \
http://wireless.kernel.org/download/compat-wireless-2.6
diff --git a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
new file mode 100644
index 0000000..e4aeab5
--- /dev/null
+++ b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
@@ -0,0 +1,53 @@
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -16,8 +16,10 @@
+
+ #include <linux/io.h>
+ #include <linux/etherdevice.h>
++#include <linux/ath9k_platform.h>
+ #include <asm/unaligned.h>
+
++#include "ath9k.h"
+ #include "hw.h"
+ #include "rc.h"
+ #include "initvals.h"
+@@ -472,17 +474,23 @@ static int ath9k_hw_rf_claim(struct ath_
+ static int ath9k_hw_init_macaddr(struct ath_hw *ah)
+ {
+ struct ath_common *common = ath9k_hw_common(ah);
++ struct ath_softc *sc = (struct ath_softc *) common->priv;
++ struct ath9k_platform_data *pdata = sc->dev->platform_data;
+ u32 sum;
+ int i;
+ u16 eeval;
+
+ sum = 0;
+- for (i = 0; i < 3; i++) {
+- eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i));
+- sum += eeval;
+- common->macaddr[2 * i] = eeval >> 8;
+- common->macaddr[2 * i + 1] = eeval & 0xff;
+- }
++ if (pdata && pdata->macaddr)
++ memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
++ else
++ for (i = 0; i < 3; i++) {
++ eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i));
++ sum += eeval;
++ common->macaddr[2 * i] = eeval >> 8;
++ common->macaddr[2 * i + 1] = eeval & 0xff;
++ }
++
+ if (!is_valid_ether_addr(common->macaddr)) {
+ DECLARE_MAC_BUF(macbuf);
+
+--- a/include/linux/ath9k_platform.h
++++ b/include/linux/ath9k_platform.h
+@@ -23,6 +23,7 @@
+
+ struct ath9k_platform_data {
+ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
++ u8 *macaddr;
+ };
+
+ #endif /* _LINUX_ATH9K_PLATFORM_H */