summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/init.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-03-19 13:55:39 +0100
committerJohn W. Linville <linville@tuxdriver.com>2011-03-30 14:15:15 -0400
commit6fb1b1e18fe3d141c54182c5d5b3af823bed455f (patch)
tree78d4b143bd0ef2368b3e4456f69a78bbe427b259 /drivers/net/wireless/ath/ath9k/init.c
parent691680b8335fa8995b190676f53e3bcef6477b4a (diff)
downloadop-kernel-dev-6fb1b1e18fe3d141c54182c5d5b3af823bed455f.zip
op-kernel-dev-6fb1b1e18fe3d141c54182c5d5b3af823bed455f.tar.gz
ath9k: add support for overriding the MAC address through platform data
On some devices the correct MAC address is not in the EEPROM data, but stored somewhere else. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/init.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 79aec983..e22e821 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -15,6 +15,7 @@
*/
#include <linux/slab.h>
+#include <linux/ath9k_platform.h>
#include "ath9k.h"
@@ -537,6 +538,7 @@ static void ath9k_init_misc(struct ath_softc *sc)
static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
const struct ath_bus_ops *bus_ops)
{
+ struct ath9k_platform_data *pdata = sc->dev->platform_data;
struct ath_hw *ah = NULL;
struct ath_common *common;
int ret = 0, i;
@@ -551,7 +553,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
ah->hw_version.subsysid = subsysid;
sc->sc_ah = ah;
- if (!sc->dev->platform_data)
+ if (!pdata)
ah->ah_flags |= AH_USE_EEPROM;
common = ath9k_hw_common(ah);
@@ -587,6 +589,9 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
if (ret)
goto err_hw;
+ if (pdata && pdata->macaddr)
+ memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
+
ret = ath9k_init_queues(sc);
if (ret)
goto err_queues;
OpenPOWER on IntegriCloud