[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1335808616-22513-8-git-send-email-steve.glendinning@shawell.net>
Date: Mon, 30 Apr 2012 18:56:56 +0100
From: Steve Glendinning <steve.glendinning@...well.net>
To: netdev@...r.kernel.org
Cc: David Miller <davem@...emloft.net>,
Stephane Fillod <fillods@...rs.sf.net>,
Steve Glendinning <steve.glendinning@...well.net>
Subject: [PATCH 7/7] smsc75xx: enable mac to detect speed/duplex from phy
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@...rs.sf.net>
Signed-off-by: Steve Glendinning <steve.glendinning@...well.net>
---
drivers/net/usb/smsc75xx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index ae23d85..00103a8 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -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);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists