From nobody@FreeBSD.ORG  Sun Oct 22 02:54:39 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id A93A137B479; Sun, 22 Oct 2000 02:54:39 -0700 (PDT)
Message-Id: <20001022095439.A93A137B479@hub.freebsd.org>
Date: Sun, 22 Oct 2000 02:54:39 -0700 (PDT)
From: stake@po.shiojiri.ne.jp
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: vr0: MII without any phy! problem when coming back from Windows
X-Send-Pr-Version: www-1.0

>Number:         22208
>Category:       kern
>Synopsis:       vr0: MII without any phy! problem when coming back from Windows
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wpaul
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 22 03:00:01 PDT 2000
>Closed-Date:    Mon May 14 13:17:04 PDT 2001
>Last-Modified:  Mon May 14 13:18:16 PDT 2001
>Originator:     Takefumi SAYO
>Release:        4.1.1-STABLE
>Organization:
Personal
>Environment:
FreeBSD 4.1.1-STABLE i386
>Description:
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 $";

>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.

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

*** 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:

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


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wpaul 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sun Oct 22 11:07:25 PDT 2000 
Responsible-Changed-Why:  
Over to vr maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22208 
State-Changed-From-To: open->closed 
State-Changed-By: wpaul 
State-Changed-When: Mon May 14 13:17:04 PDT 2001 
State-Changed-Why:  
Patch applied, though I took the trouble to document the bits in 
the STICKYHW register instead of using magic numbers. Magic numbers 
bad, mkay? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22208 
>Unformatted:
