From nobody@FreeBSD.org  Wed May 12 04:16:39 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A60D816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 May 2004 04:16:39 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 578C743D31
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 May 2004 04:16:39 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i4CBGcGQ008601
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 May 2004 04:16:38 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i4CBGcgB008600;
	Wed, 12 May 2004 04:16:38 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200405121116.i4CBGcgB008600@www.freebsd.org>
Date: Wed, 12 May 2004 04:16:38 -0700 (PDT)
From: Alexander Romanov <ar@apmk.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 3c920-MV00 PHY detection problem
X-Send-Pr-Version: www-2.3

>Number:         66564
>Category:       kern
>Synopsis:       [xl] [patch] 3c920-MV00 PHY detection problem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 12 04:20:19 PDT 2004
>Closed-Date:    Sun Jan 27 22:38:35 UTC 2008
>Last-Modified:  Sun Jan 27 22:38:35 UTC 2008
>Originator:     Alexander Romanov
>Release:        5.2.1
>Organization:
>Environment:
FreeBSD  5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #5: Wed May 12 18:03:35 MSD 2004     root@:/usr/src/sys/i386/compile/GENERIC  i386
>Description:
I have motherboard Albatron PX865PE Pro (2.0) with lan chip Marvell 3c920-mv00 onboard.

pciconf -l says
class=0x020000 card=0x4c0017f2 chip=0x920010b7 rev=0x78 hdr=0x00

xl driver recognized it as "3C905-TX Fast Etherlink XL", but complains with "no PHY found"


>How-To-Repeat:
Take this mobo and install freebsd, but, may be, this chip is also installed elsewhere.
>Fix:
Investigating this problem, I have found dirty-hack solution.

1. change if_xlreg.c to lie about pciids, to force recognize this chip as 3c920-EMB

/* AR: change pci ids to force identify 3c920-MV00 as 3c920-EMB */
#define TC_DEVICEID_TORNADO_10_100BT            0x9201
#define TC_DEVICEID_TORNADO_10_100BT_920B       0x9200

/* this was before changing
#define TC_DEVICEID_TORNADO_10_100BT            0x9200
#define TC_DEVICEID_TORNADO_10_100BT_920B       0x9201
  :AR */

2. add to mii_phy_probe() in mii.c printf

 for (i = 0; i < MII_NPHY; i++) {
                bmsr = MIIBUS_READREG(dev, i, MII_BMSR);

                /* AR: It's magic, but without this printf we can't find PHY! */
                printf( "MII:%u %x\n", i, bmsr );

                if (bmsr == 0 || bmsr == 0xffff ||
                    (bmsr & BMSR_MEDIAMASK) == 0) {
                        /* Assume no PHY at this address. */
                        continue;
                } else
                        break;
        }

So, as I sayd before, this solution is dirty. Can you fix driver to provide clean solution ?
I have driver for this card for linux, shipped on cd with mobo.
May be, this driver will help ? 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wpaul 
Responsible-Changed-By: vs 
Responsible-Changed-When: Tue Jul 20 08:12:33 GMT 2004 
Responsible-Changed-Why:  
Over to xl-author 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66564 
Responsible-Changed-From-To: wpaul->freebsd-bugs 
Responsible-Changed-By: wpaul 
Responsible-Changed-When: Wed Jul 21 16:56:57 GMT 2004 
Responsible-Changed-Why:  
Do not blindly assign PRs to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66564 
State-Changed-From-To: open->feedback 
State-Changed-By: gavin 
State-Changed-When: Wed Jun 13 21:37:07 UTC 2007 
State-Changed-Why:  

To submitter:  Do you still have this problem with a more recent 
version of FreeBSD?  If so, are you able to test a patch? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66564 
State-Changed-From-To: feedback->closed 
State-Changed-By: gavin 
State-Changed-When: Sun Jan 27 22:38:08 UTC 2008 
State-Changed-Why:  
Feedback timeout (6 months) 


Responsible-Changed-From-To: freebsd-bugs->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun Jan 27 22:38:08 UTC 2008 
Responsible-Changed-Why:  
Feedback timeout (6 months) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66564 
>Unformatted:
