Skip to content

Commit

Permalink
smsc75xx: enable mac to detect speed/duplex from phy
Browse files Browse the repository at this point in the history
This patch sets the automatic speed and duplex detection bits
in MAC_CR to enable the mac to determine its speed automatically
from the phy.

Note this must be done BEFORE the receiver or transmitter is
enabled.

Signed-off-by: Stephane Fillod <fillods@users.sf.net>
Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Steve Glendinning authored and David S. Miller committed May 1, 2012
1 parent c0b92e4 commit 2f3a081
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/usb/smsc75xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,14 @@ static int smsc75xx_reset(struct usbnet *dev)
ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf);
check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret);

/* allow mac to detect speed and duplex from phy */
ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
check_warn_return(ret, "Failed to read MAC_CR: %d", ret);

buf |= (MAC_CR_ADD | MAC_CR_ASD);
ret = smsc75xx_write_reg(dev, MAC_CR, buf);
check_warn_return(ret, "Failed to write MAC_CR: %d", ret);

ret = smsc75xx_read_reg(dev, MAC_TX, &buf);
check_warn_return(ret, "Failed to read MAC_TX: %d", ret);

Expand Down

0 comments on commit 2f3a081

Please sign in to comment.