Bug 22208

Summary: vr0: MII without any phy! problem when coming back from Windows
Product: Base System Reporter: stake <stake>
Component: kernAssignee: Bill Paul <wpaul>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1.1-STABLE   
Hardware: Any   
OS: Any   

Description stake 2000-10-22 11:00:01 UTC
vr driver claims "vr0: MII without any phy!" when coming back from Windows.

# pciconf -l | grep vr
vr0@pci0:11:0:  class=0x020000 card=0xa1111259 chip=0x30651106 rev=0x42 hdr=0x00

% grep '$FreeBSD' /usr/src/sys/pci/{if_vrreg.h,if_vr.c}
/usr/src/sys/pci/if_vrreg.h: * $FreeBSD: src/sys/pci/if_vrreg.h,v 1.7.2.1 2000/07/05 21:43:59 wpaul Exp $
/usr/src/sys/pci/if_vr.c: * $FreeBSD: src/sys/pci/if_vr.c,v 1.26.2.4 2000/08/04 23:45:28 peter Exp $
/usr/src/sys/pci/if_vr.c:  "$FreeBSD: src/sys/pci/if_vr.c,v 1.26.2.4 2000/08/04 23:45:28 peter Exp $";

Fix: a. Power off after using Windows.
b. Apply next patch to if_vr.c.  But I don't know why it works.



Corega K.K. support page (in Japanese)
  http://www.corega.co.jp/technical/kondara11.htm
and (modified ?) via-rhine.c for Linux
  http://www.corega.co.jp/technical/sorce/via-rhine.c
Linux Drivers for PCI Ethernet Chips
  http://www.scyld.com/network/ethercard.html--YraTCZVe79HWjc7LTqIkWMJErtS6k5oh3dU8Ehk3BL7biZBL
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** if_vr.c.dist        Sat Aug  5 08:45:28 2000
--- if_vr.c     Thu Oct 12 00:35:47 2000
***************
*** 729,734 ****
--- 729,740 ----
                goto fail;
        }
  
+       /* 
+        * Next code comes from Linux via-rhine.c driver and it says
+        * "clear sticky bit before reset & read ethernet address".
+        */
+       VR_CLRBIT(sc, 0x83, 0x3);
+ 
        /* Reset the adapter. */
        vr_reset(sc);
  
References:
How-To-Repeat: 1. Boot Windows9x which has VIA Rhine network driver.  
2. Select reboot from Windows startup menu and boot FreeBSD with GENERIC kernel.
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2000-10-22 19:07:25 UTC
Responsible Changed
From-To: freebsd-bugs->wpaul

Over to vr maintainer.
Comment 2 Bill Paul freebsd_committer freebsd_triage 2001-05-14 21:17:04 UTC
State Changed
From-To: open->closed

Patch applied, though I took the trouble to document the bits in 
the STICKYHW register instead of using magic numbers. Magic numbers 
bad, mkay?