Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85602
b: refs/heads/master
c: 89c8b0e
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed Feb 11, 2008
1 parent 671844d commit 936e1b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 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: 7da998591798ea52938d8482b52ae3f854f14359
refs/heads/master: 89c8b0e6cd3859a6445398c5aa94ebd21d0e64ce
17 changes: 16 additions & 1 deletion trunk/drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,15 +1127,22 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
iow(db, DM9000_EPAR, DM9000_PHY | reg);

iow(db, DM9000_EPCR, 0xc); /* Issue phyxcer read command */

writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock,flags);

udelay(100); /* Wait read complete */

spin_lock_irqsave(&db->lock,flags);
reg_save = readb(db->io_addr);

iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */

/* The read data keeps on REG_0D & REG_0E */
ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);

/* restore the previous address */
writeb(reg_save, db->io_addr);

spin_unlock_irqrestore(&db->lock,flags);

return ret;
Expand Down Expand Up @@ -1164,7 +1171,15 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
iow(db, DM9000_EPDRH, ((value >> 8) & 0xff));

iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */

writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock,flags);

udelay(500); /* Wait write complete */

spin_lock_irqsave(&db->lock,flags);
reg_save = readb(db->io_addr);

iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */

/* restore the previous address */
Expand Down

0 comments on commit 936e1b3

Please sign in to comment.