Hi,I agree, thanks a lot.
Brian, thank you very much for contributing to forcedeth.
NvRegOffloadConfig = 0x90,Interesting - does that explain why VLAN doesn't work properly? I have a report that maximum sized packets are rejected.
#define NVREG_OFFLOAD_HOMEPHY 0x601
-#define NVREG_OFFLOAD_NORMAL 0x5ee
+#define NVREG_OFFLOAD_NORMAL RX_NIC_BUFSIZE
+ struct {Bitfields for hw access are evil, it caused problems before. I'd prefer a macro with explicit shifts.
+ u32 Length:14;
+ u32 Flags:18;
+ } v2;
+Waiting for phy reset is also evil - it should be done either in a separate thread or asynchroneously. Not urgent, we can fix it later.
+ //wait for 500ms
+ mdelay(500);
+Dito.
+ // check auto negotiation is complete
+ mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+ while (!(mii_status & BMSR_ANEGCOMPLETE)) {
+ udelay(NV_MIIBUSY_DELAY);
+ mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+ microseconds++;
+ if (microseconds == 20) {
+ microseconds = 0;
+ milliseconds++;
+ }
+ if (milliseconds > 1200) {
+ printk(KERN_INFO "%s: phy init failed to autoneg.\n", dev->name);
+ return PHY_TIMEOUT;
+ }