From be0ca0b78db06d626b46c004ed7acc198ff0fc49 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Tue, 24 Mar 2009 23:32:03 -0700 Subject: [PATCH] --- yaml --- r: 135531 b: refs/heads/master c: 67fca028f1535e510689d2e444b0289e264e05c1 h: refs/heads/master i: 135529: 72464e2d1c1fdb8d4b3daded57cfe286f1af752a 135527: 40e787680bee2f65558f2a6b4c2bcea8152eb22e v: v3 --- [refs] | 2 +- trunk/drivers/net/ax88796.c | 17 ++++++++++++----- trunk/include/net/ax88796.h | 13 ++++++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index f973109f25c7..b29ecf8414a8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 47cb035560a41bd1bd3db506eeab93088815203e +refs/heads/master: 67fca028f1535e510689d2e444b0289e264e05c1 diff --git a/trunk/drivers/net/ax88796.c b/trunk/drivers/net/ax88796.c index e7c9748437d4..62d9c9cc5671 100644 --- a/trunk/drivers/net/ax88796.c +++ b/trunk/drivers/net/ax88796.c @@ -733,12 +733,19 @@ static int ax_init_dev(struct net_device *dev, int first_init) /* load the mac-address from the device if this is the * first time we've initialised */ - if (first_init && ax->plat->flags & AXFLG_MAC_FROMDEV) { - ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP, - ei_local->mem + E8390_CMD); /* 0x61 */ + if (first_init) { + if (ax->plat->flags & AXFLG_MAC_FROMDEV) { + ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP, + ei_local->mem + E8390_CMD); /* 0x61 */ + for (i = 0; i < ETHER_ADDR_LEN; i++) + dev->dev_addr[i] = + ei_inb(ioaddr + EN1_PHYS_SHIFT(i)); + } - for (i = 0 ; i < ETHER_ADDR_LEN ; i++) - dev->dev_addr[i] = ei_inb(ioaddr + EN1_PHYS_SHIFT(i)); + if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) && + ax->plat->mac_addr) + memcpy(dev->dev_addr, ax->plat->mac_addr, + ETHER_ADDR_LEN); } ax_reset_8390(dev); diff --git a/trunk/include/net/ax88796.h b/trunk/include/net/ax88796.h index 51329dae44e6..b9a3beca0ce4 100644 --- a/trunk/include/net/ax88796.h +++ b/trunk/include/net/ax88796.h @@ -15,14 +15,17 @@ #define AXFLG_HAS_EEPROM (1<<0) #define AXFLG_MAC_FROMDEV (1<<1) /* device already has MAC */ #define AXFLG_HAS_93CX6 (1<<2) /* use eeprom_93cx6 driver */ +#define AXFLG_MAC_FROMPLATFORM (1<<3) /* MAC given by platform data */ struct ax_plat_data { unsigned int flags; - unsigned char wordlength; /* 1 or 2 */ - unsigned char dcr_val; /* default value for DCR */ - unsigned char rcr_val; /* default value for RCR */ - unsigned char gpoc_val; /* default value for GPOC */ - u32 *reg_offsets; /* register offsets */ + unsigned char wordlength; /* 1 or 2 */ + unsigned char dcr_val; /* default value for DCR */ + unsigned char rcr_val; /* default value for RCR */ + unsigned char gpoc_val; /* default value for GPOC */ + u32 *reg_offsets; /* register offsets */ + u8 *mac_addr; /* MAC addr (only used when + AXFLG_MAC_FROMPLATFORM is used */ }; #endif /* __NET_AX88796_PLAT_H */