Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Dec 2011 11:04:51 +0100
From:      Stefan Bethke <stb@lassitu.de>
To:        pyunyh@gmail.com
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: "ifconfig media off"?
Message-ID:  <45B0B859-207C-4F02-A28F-7E34B775A273@lassitu.de>
In-Reply-To: <20111213025041.GF3705@michelle.cdnetworks.com>
References:  <600A8C6C-DAB4-4E22-A034-38224017166B@lassitu.de> <20111213025041.GF3705@michelle.cdnetworks.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Am 13.12.2011 um 03:50 schrieb YongHyeon PYUN:

> On Tue, Dec 13, 2011 at 12:56:22AM +0100, Stefan Bethke wrote:
>> I'm currently writing a driver to configure an ethernet switch chip (see TL-WR1043ND on -embedded).
>> 
>> I noticed that there doesn't seem to be a way to power down a phy right now through the ifconfig media command.
>> 
>> Would there be objections to extend the media subtype definitions to include an "off", "poweroff" or "down" media subtype, and add code to the relevant phy drivers to power down the phy for this media subtype?
>> 
>> The difference between media subtype "none" and this new one would be that there will be no link, even if there is a physical connection.  With media subtype "none", a 10 MBit/s half-duplex connection is established, potentially confusing the remote end about the availability of this link.  On the local side, the link is down, so no packets are exchanged.
>> 
> 
> I think "none" means "isolated" so should have no established link
> and probably you can also power down the PHY.
> I vaguely guess the PHY of switch chip does not correctly support
> isolated mode so you may have wanted to power down.


After looking at the code a bit more, I think the common code just doesn't set the BMCR_PDOWN (but clears it when bringing up the PHY).

Index: sys/dev/mii/mii_physubr.c
===================================================================
--- sys/dev/mii/mii_physubr.c	(revision 228402)
+++ sys/dev/mii/mii_physubr.c	(working copy)
@@ -58,7 +58,7 @@
  */
 static const struct mii_media mii_media_table[MII_NMEDIA] = {
 	/* None */
-	{ BMCR_ISO,		ANAR_CSMA,
+	{ BMCR_ISO | BMCR_PDOWN,	ANAR_CSMA,
 	  0, },
 
 	/* 10baseT */

I've opened kern/163240.
http://www.freebsd.org/cgi/query-pr.cgi?pr=163240


Stefan

-- 
Stefan Bethke <stb@lassitu.de>   Fon +49 151 14070811






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45B0B859-207C-4F02-A28F-7E34B775A273>