From owner-freebsd-net@FreeBSD.ORG Tue Dec 13 16:12:33 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6EC01065676 for ; Tue, 13 Dec 2011 16:12:33 +0000 (UTC) (envelope-from egrosbein@rdtc.ru) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13::5]) by mx1.freebsd.org (Postfix) with ESMTP id 23FE08FC15 for ; Tue, 13 Dec 2011 16:12:32 +0000 (UTC) Received: from eg.sd.rdtc.ru (localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.14.5/8.14.5) with ESMTP id pBDGCT6u045756; Tue, 13 Dec 2011 23:12:29 +0700 (NOVT) (envelope-from egrosbein@rdtc.ru) Message-ID: <4EE77968.9040001@rdtc.ru> Date: Tue, 13 Dec 2011 23:12:24 +0700 From: Eugene Grosbein User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; ru-RU; rv:1.9.2.13) Gecko/20110112 Thunderbird/3.1.7 MIME-Version: 1.0 To: Stefan Bethke References: <600A8C6C-DAB4-4E22-A034-38224017166B@lassitu.de> In-Reply-To: <600A8C6C-DAB4-4E22-A034-38224017166B@lassitu.de> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit Cc: FreeBSD Net Subject: Re: "ifconfig media off"? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2011 16:12:33 -0000 13.12.2011 06:56, Stefan Bethke пишет: > 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. Some network drivers do not use our 'miibus' code, for example Intel em(4) and igb(4) drivers. I run lots of FreeBSD routers with em/igb interfaces bundled as lagg(4) trunks connected to Cisco core routers using PortChannels in LACP mode. As I do not want to abide huge LACP timeouts when one of lagg ports should be brought down, I've patched em/igb drivers to bring link down with "ifconfig down" command: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/net/2010-12/msg00058.html http://unix.derkeiler.com/Mailing-Lists/FreeBSD/net/2010-12/msg00081.html Eugene Grosbein