Petko Manolov wrote:
On Thu, 13 Jan 2005, Mike Nix wrote:
I tested this by calling it from enable_net_traffic so that carrier was
checked whenever the interface was configured "up" - I then ran "ifconfig eth2 down;ifconfig eth2 up" inserting / removing the cable between runs - carrier was reported correctly every time.
I dug down to the code and found out that the real fix is to apply this patch:
---
@@ -1212,6 +1212,7 @@
dev_warn(&intf->dev, "can't locate MII phy, using default\n");
pegasus->phy = 1;
}
+ pegasus->mii.phy_id = pegasus->phy;
usb_set_intfdata(intf, pegasus);
SET_NETDEV_DEV(net, &intf->dev);
pegasus_reset_wol(net);
---
Definitly a good idea to set that - although nothing in the driver accesses it :-)
set_carrier was using pegasus->phy which should be set correctly.....
It was also accessing MII_BMSR (0x01) where the manufacturer's driver accesses register 0x45
I did just modify my version of set_carrier() a little -
- __u8 data[4] = { 0x01, 0x00, 0x04, 0x45 };
+ __u8 data[4] = { pegasus->phy, 0x00, 0x04, 0x45 };and
- if (regdi & 0x20) + if (le16_to_cpu(regdi) & 0x20)
just about to try it with a delayed workqueue...... will let you know shortly.....
Anyway, i'll think of something, may be timer..
Mike
-- WA Network Maintenance I can tell a computer http://www.wanm.com.au to do anything! PO Box 492, I just wish they'd Bridgetown 6255. listen to me! Phone: 04-1798-1973 Fax: 04-0929-1138
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
