Subject: Re: kern/29113: re(4) reports "unknown subtype"
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
List: netbsd-bugs
Date: 01/25/2005 11:11:02
The following reply was made to PR kern/29113; it has been noted by GNATS.

From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
To: yamt@mwd.biglobe.ne.jp
Cc: gnats-bugs@netbsd.org, kanaoka@ann.hi-ho.ne.jp
Subject: Re: kern/29113: re(4) reports "unknown subtype"
Date: Tue, 25 Jan 2005 20:10:45 +0900 (JST)

 ----Security_Multipart(Tue_Jan_25_20_10_45_2005_097)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
        From: yamt@mwd.biglobe.ne.jp
     Subject: kern/29113: re(4) reports "unknown subtype"
       Date : Tue, 25 Jan 2005 02:02:01 +0000 (UTC)
  Message-ID: <20050125020201.22C0163B844@narn.netbsd.org>
 
 $ 	check RTK_ENABLED in re_ifmedia_sts().
 
 I checked rtk driver with ukphy. 
 rtk has same code, but media is NONE when NIC is down. 
 So I think that problem is rgephy.c rather than rtl8169.c.
 
 I attached a patch.
 After Applied it,I test below:
 
 [kanaoka@idea]% sudo /sbin/ifconfig re0 | grep media
         media: Ethernet autoselect (1000baseT full-duplex)
 [kanaoka@idea]% sudo /sbin/ifconfig re0 down
 [kanaoka@idea]% sudo /sbin/ifconfig re0 | grep media
         media: Ethernet autoselect (none)
 
 ---
  Masanori Kanaoka        kanaoka AT ann.hi-ho.ne.jp
 
 
 Index: rgephy.c
 ===================================================================
 RCS file: /ftp/cvs/src/sys/dev/mii/rgephy.c,v
 retrieving revision 1.2
 diff -u -r1.2 rgephy.c
 --- rgephy.c    21 Jan 2005 11:55:52 -0000      1.2
 +++ rgephy.c    25 Jan 2005 10:59:45 -0000
 @@ -349,6 +349,12 @@
  
         bmcr = PHY_READ(sc, RGEPHY_MII_BMCR);
  
 +       if (bmcr & RGEPHY_BMCR_ISO) {
 +               mii->mii_media_active |= IFM_NONE;
 +               mii->mii_media_status = 0;
 +               return;
 +       }
 +
         if (bmcr & RGEPHY_BMCR_LOOP)
                 mii->mii_media_active |= IFM_LOOP;
  
 
 ----Security_Multipart(Tue_Jan_25_20_10_45_2005_097)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (NetBSD)
 
 iQEVAwUAQfYpPKZTiBfoL27MAQLhdAf/W5c2v+Zi+6gm31wmwRvkiUp2FgZCJuIJ
 +BFRzAjy0SA9XXCPrJT2OkGUrad80JDwbaNlZyJtf1hD6HH8lVoFimhc6uPTHj/y
 cPiU4h/z+ZHXEp8Z8sh7Goo/NhnQRr4cSXn4LVWQkw7fKl6mwm7r+NnI11SKwcJf
 r/JkRQlgLB/MbdFVPa6As6s6wzcmSrmCsjKX2qtCYmxsOa0m8R2FLMZ5KpS4T8XE
 sqkdJ07TTnRyhwzg7u5gcs4sWBK5ki1dDAK0sJjCNoVl/0yIThfxQgldtGR6RaE+
 Bxij783LP8SXQrcQC6+HSnqTTYZKf6ffOp9ZzhGilH52FmIlv9eiXA==
 =hiFl
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Tue_Jan_25_20_10_45_2005_097)----