James Painter wrote:
I spent some time looking at this today
...
I found that the link_reset didn't re-establish link correctly when I
just moved that cat5 cable between the switch and the hub, but on a
fresh usb hotplug, it did connect and run stable for me.
I found a rather stupid bug I introduced that may explain the half
duplex problem. This was folded into David Brownell's latest usbnet
modularization patch set. I was or'ing instead of and'ing the
advertised and link partner capabilities. This resulted in
AX88772_MEDIUM_FULL_DUPLEX bit being set in the medium mode register
when it shouldn't have been. It didn't seem to prevent me from
communicating with my hub, so this may or may not fix your problem.
The attached patch repairs this. Apply it after the Brownell patches.
Let us know if it fixes your problem.
--Jamie
--- linux-2.6.13/drivers/usb/net/asix.c.orig 2005-09-03 11:36:04.000000000 -0600
+++ linux-2.6.13/drivers/usb/net/asix.c 2005-09-03 16:56:25.000000000 -0600
@@ -317,7 +317,7 @@
mode = AX_MEDIUM_TX_ABORT_ALLOW | AX_MEDIUM_FLOW_CONTROL_EN;
lpa = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_LPA);
adv = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_ADVERTISE);
- res = mii_nway_result(lpa|adv);
+ res = mii_nway_result(lpa&adv);
if (res & LPA_DUPLEX)
mode |= AX_MEDIUM_FULL_DUPLEX;
ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
@@ -799,7 +799,7 @@
mode = AX88772_MEDIUM_DEFAULT;
lpa = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_LPA);
adv = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_ADVERTISE);
- res = mii_nway_result(lpa|adv);
+ res = mii_nway_result(lpa&adv);
if ((res & LPA_DUPLEX) == 0)
mode &= ~AX88772_MEDIUM_FULL_DUPLEX;