aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGrant Grundler <grundler@google.com>2011-11-15 02:12:41 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-15 16:26:06 -0500
commitd3665188a79254c0698aa161e2c36dcda4e9ef55 (patch)
treea94d0b253cb3ffcb505a9eb71140a799548a661e /drivers/net
parenta77929a278651d4451c872178d4d7aac8908aa8e (diff)
net-next:asix: reduce AX88772 init time by about 2 seconds
ax88772_reset takes about 2 seconds and is called twice. Once from ax88772_bind() directly and again indirectly from usbnet_open(). Reset the USB FW/Phy enough to blink the LEDs when inserted. Signed-off-by: Allan Chou <allan@asix.com.tw> Signed-off-by: Grant Grundler <grundler@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/asix.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index b4675e89e42c..8462be589558 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1083,7 +1083,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
1083 1083
1084static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 1084static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
1085{ 1085{
1086 int ret; 1086 int ret, embd_phy;
1087 struct asix_data *data = (struct asix_data *)&dev->data; 1087 struct asix_data *data = (struct asix_data *)&dev->data;
1088 u8 buf[ETH_ALEN]; 1088 u8 buf[ETH_ALEN];
1089 u32 phyid; 1089 u32 phyid;
@@ -1108,16 +1108,36 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
1108 dev->mii.reg_num_mask = 0x1f; 1108 dev->mii.reg_num_mask = 0x1f;
1109 dev->mii.phy_id = asix_get_phy_addr(dev); 1109 dev->mii.phy_id = asix_get_phy_addr(dev);
1110 1110
1111 phyid = asix_get_phyid(dev);
1112 dbg("PHYID=0x%08x", phyid);
1113
1114 dev->net->netdev_ops = &ax88772_netdev_ops; 1111 dev->net->netdev_ops = &ax88772_netdev_ops;
1115 dev->net->ethtool_ops = &ax88772_ethtool_ops; 1112 dev->net->ethtool_ops = &ax88772_ethtool_ops;
1116 1113
1117 ret = ax88772_reset(dev); 1114 embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
1115
1116 /* Reset the PHY to normal operation mode */
1117 ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
1118 if (ret < 0) {
1119 dbg("Select PHY #1 failed: %d", ret);
1120 return ret;
1121 }
1122
1123 ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
1118 if (ret < 0) 1124 if (ret < 0)
1119 return ret; 1125 return ret;
1120 1126
1127 msleep(150);
1128
1129 ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
1130 if (ret < 0)
1131 return ret;
1132
1133 msleep(150);
1134
1135 ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);
1136
1137 /* Read PHYID register *AFTER* the PHY was reset properly */
1138 phyid = asix_get_phyid(dev);
1139 dbg("PHYID=0x%08x", phyid);
1140
1121 /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */ 1141 /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
1122 if (dev->driver_info->flags & FLAG_FRAMING_AX) { 1142 if (dev->driver_info->flags & FLAG_FRAMING_AX) {
1123 /* hard_mtu is still the default - the device does not support 1143 /* hard_mtu is still the default - the device does not support