Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275711
b: refs/heads/master
c: b2d3ad2
h: refs/heads/master
i:
  275709: be85487
  275707: e3370c1
  275703: fd9f470
  275695: d423ffc
  275679: 0d278db
  275647: 0983e03
  275583: f40fdab
  275455: 3d6d630
v: v3
  • Loading branch information
Grant Grundler authored and David S. Miller committed Nov 15, 2011
1 parent c147ce0 commit f6f7b8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 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: d3665188a79254c0698aa161e2c36dcda4e9ef55
refs/heads/master: b2d3ad291fab1783cc12eef3dd91c5fa98c2e5d5
22 changes: 15 additions & 7 deletions trunk/drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@ static int ax88178_reset(struct usbnet *dev)
__le16 eeprom;
u8 status;
int gpio0 = 0;
u32 phyid;

asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status);
dbg("GPIO Status: 0x%04x", status);
Expand All @@ -1263,12 +1264,13 @@ static int ax88178_reset(struct usbnet *dev)
data->ledmode = 0;
gpio0 = 1;
} else {
data->phymode = le16_to_cpu(eeprom) & 7;
data->phymode = le16_to_cpu(eeprom) & 0x7F;
data->ledmode = le16_to_cpu(eeprom) >> 8;
gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1;
}
dbg("GPIO0: %d, PhyMode: %d", gpio0, data->phymode);

/* Power up external GigaPHY through AX88178 GPIO pin */
asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40);
if ((le16_to_cpu(eeprom) >> 8) != 1) {
asix_write_gpio(dev, 0x003c, 30);
Expand All @@ -1280,6 +1282,13 @@ static int ax88178_reset(struct usbnet *dev)
asix_write_gpio(dev, AX_GPIO_GPO1EN | AX_GPIO_GPO_1, 30);
}

/* Read PHYID register *AFTER* powering up PHY */
phyid = asix_get_phyid(dev);
dbg("PHYID=0x%08x", phyid);

/* Set AX88178 to enable MII/GMII/RGMII interface for external PHY */
asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL);

asix_sw_reset(dev, 0);
msleep(150);

Expand Down Expand Up @@ -1424,7 +1433,6 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
u8 buf[ETH_ALEN];
u32 phyid;
struct asix_data *data = (struct asix_data *)&dev->data;

data->eeprom_len = AX88772_EEPROM_LEN;
Expand All @@ -1451,12 +1459,12 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->netdev_ops = &ax88178_netdev_ops;
dev->net->ethtool_ops = &ax88178_ethtool_ops;

phyid = asix_get_phyid(dev);
dbg("PHYID=0x%08x", phyid);
/* Blink LEDS so users know driver saw dongle */
asix_sw_reset(dev, 0);
msleep(150);

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

/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
Expand Down

0 comments on commit f6f7b8a

Please sign in to comment.