Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275710
b: refs/heads/master
c: d366518
h: refs/heads/master
v: v3
  • Loading branch information
Grant Grundler authored and David S. Miller committed Nov 15, 2011
1 parent be85487 commit c147ce0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 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: a77929a278651d4451c872178d4d7aac8908aa8e
refs/heads/master: d3665188a79254c0698aa161e2c36dcda4e9ef55
30 changes: 25 additions & 5 deletions trunk/drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ static const struct net_device_ops ax88772_netdev_ops = {

static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
int ret, embd_phy;
struct asix_data *data = (struct asix_data *)&dev->data;
u8 buf[ETH_ALEN];
u32 phyid;
Expand All @@ -1108,16 +1108,36 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
dev->mii.reg_num_mask = 0x1f;
dev->mii.phy_id = asix_get_phy_addr(dev);

phyid = asix_get_phyid(dev);
dbg("PHYID=0x%08x", phyid);

dev->net->netdev_ops = &ax88772_netdev_ops;
dev->net->ethtool_ops = &ax88772_ethtool_ops;

ret = ax88772_reset(dev);
embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);

/* Reset the PHY to normal operation mode */
ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
if (ret < 0) {
dbg("Select PHY #1 failed: %d", ret);
return ret;
}

ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
if (ret < 0)
return ret;

msleep(150);

ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
if (ret < 0)
return ret;

msleep(150);

ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);

/* Read PHYID register *AFTER* the PHY was reset properly */
phyid = asix_get_phyid(dev);
dbg("PHYID=0x%08x", phyid);

/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
/* hard_mtu is still the default - the device does not support
Expand Down

0 comments on commit c147ce0

Please sign in to comment.