projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[package] uhttpd: make it work without shadow password support
[openwrt.git]
/
package
/
mac80211
/
patches
/
407-ath9k-override-mac-address-from-platform-data.patch
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
index e4aeab5cefa2ba39998ff0bb52e09994e8c4ab89..315e7992c57a63c5b517a00114d42424a1ac6383 100644
(file)
--- 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
@@
-1,17
+1,17
@@
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -16,8 +16,10 @@
-
+@@ -17,8 +17,10 @@
#include <linux/io.h>
#include <linux/io.h>
+ #include <linux/slab.h>
#include <linux/etherdevice.h>
+#include <linux/ath9k_platform.h>
#include <asm/unaligned.h>
+#include "ath9k.h"
#include "hw.h"
#include <linux/etherdevice.h>
+#include <linux/ath9k_platform.h>
#include <asm/unaligned.h>
+#include "ath9k.h"
#include "hw.h"
+ #include "hw-ops.h"
#include "rc.h"
#include "rc.h"
- #include "initvals.h"
-@@ -472,17 +474,23 @@ static int ath9k_hw_rf_claim(struct ath_
+@@ -434,18 +436,23 @@ static void ath9k_hw_init_defaults(struc
static int ath9k_hw_init_macaddr(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
static int ath9k_hw_init_macaddr(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@
-20,10
+20,11
@@
u32 sum;
int i;
u16 eeval;
u32 sum;
int i;
u16 eeval;
+ u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW };
sum = 0;
- for (i = 0; i < 3; i++) {
sum = 0;
- for (i = 0; i < 3; i++) {
-- eeval = ah->eep_ops->get_eeprom(ah,
AR_EEPROM_MAC(i)
);
+- eeval = ah->eep_ops->get_eeprom(ah,
EEP_MAC[i]
);
- sum += eeval;
- common->macaddr[2 * i] = eeval >> 8;
- common->macaddr[2 * i + 1] = eeval & 0xff;
- sum += eeval;
- common->macaddr[2 * i] = eeval >> 8;
- common->macaddr[2 * i + 1] = eeval & 0xff;
@@
-32,15
+33,14
@@
+ memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
+ else
+ for (i = 0; i < 3; i++) {
+ 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)
);
++ eeval = ah->eep_ops->get_eeprom(ah,
EEP_MAC[i]
);
+ sum += eeval;
+ common->macaddr[2 * i] = eeval >> 8;
+ common->macaddr[2 * i + 1] = eeval & 0xff;
+ }
+ sum += eeval;
+ common->macaddr[2 * i] = eeval >> 8;
+ common->macaddr[2 * i + 1] = eeval & 0xff;
+ }
-+
if (!is_valid_ether_addr(common->macaddr)) {
if (!is_valid_ether_addr(common->macaddr)) {
- DECLARE_MAC_BUF(macbuf);
-
+ ath_print(common, ATH_DBG_EEPROM,
+ "eeprom contains invalid mac address: %pM\n",
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -23,6 +23,7 @@
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -23,6 +23,7 @@