mt7603: extract mac address from eeprom

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2015-12-16 17:26:52 +01:00
parent 68c34a4ed2
commit b3d00246a5
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -75,6 +75,7 @@ struct mt7603_dev {
u8 tx_chains;
u8 rssi_offset[3];
u8 macaddr[ETH_ALEN];
struct mt7603_mcu mcu;
struct mt76_queue q_rx;
+3 -2
View File
@@ -14,6 +14,7 @@
#include <linux/etherdevice.h>
#include "mt7603.h"
#include "mt7603_dma.h"
#include "mt7603_eeprom.h"
struct mt7603_dev *mt7603_alloc_device(struct device *pdev)
{
@@ -223,6 +224,7 @@ mt7603_init_hardware(struct mt7603_dev *dev)
return ret;
dev->mt76.cap.has_2ghz = true;
memcpy(dev->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, ETH_ALEN);
ret = mt7603_dma_init(dev);
if (ret)
@@ -278,7 +280,6 @@ static struct ieee80211_rate mt7603_rates[] = {
int mt7603_register_device(struct mt7603_dev *dev)
{
static u8 macaddr[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
struct ieee80211_hw *hw = mt76_hw(dev);
struct ieee80211_supported_band *sband;
struct wiphy *wiphy = hw->wiphy;
@@ -299,7 +300,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
hw->max_rate_tries = 1;
hw->extra_tx_headroom = 2;
SET_IEEE80211_PERM_ADDR(hw, macaddr);
SET_IEEE80211_PERM_ADDR(hw, dev->macaddr);
ret = mt76_register_device(&dev->mt76, true, mt7603_rates,
ARRAY_SIZE(mt7603_rates));