Skip to content

Commit

Permalink
dm9601: fix phy/eeprom write routine
Browse files Browse the repository at this point in the history
Use correct bit positions in DM_SHARED_CTRL register for writes.

Michael Planes recently encountered a 'KY-RS9600 USB-LAN converter', which
came with a driver CD containing a Linux driver. This driver turns out to
be a copy of dm9601.c with symbols renamed and my copyright stripped.
That aside, it did contain 1 functional change in dm_write_shared_word(),
and after checking the datasheet the original value was indeed wrong
(read versus write bits).

On Michaels HW, this change bumps receive speed from ~30KB/s to ~900KB/s.
On other devices the difference is less spectacular, but still significant
(~30%).

Reported-by: Michael Planes <michael.planes@free.fr>
CC: stable@kernel.org
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Peter Korsgaard authored and David S. Miller committed May 3, 2010
1 parent 19937d0 commit e9162ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu
goto out;

dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg);
dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1c : 0x14);
dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12);

for (i = 0; i < DM_TIMEOUT; i++) {
u8 tmp;
Expand Down

0 comments on commit e9162ab

Please sign in to comment.