Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135531
b: refs/heads/master
c: 67fca02
h: refs/heads/master
i:
  135529: 72464e2
  135527: 40e7876
v: v3
  • Loading branch information
Daniel Mack authored and David S. Miller committed Mar 25, 2009
1 parent 0eb0a51 commit be0ca0b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47cb035560a41bd1bd3db506eeab93088815203e
refs/heads/master: 67fca028f1535e510689d2e444b0289e264e05c1
17 changes: 12 additions & 5 deletions trunk/drivers/net/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 8 additions & 5 deletions trunk/include/net/ax88796.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit be0ca0b

Please sign in to comment.