From owner-cvs-all@FreeBSD.ORG Thu Jan 27 16:40:16 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B70416A4CE; Thu, 27 Jan 2005 16:40:16 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 739A643D3F; Thu, 27 Jan 2005 16:40:16 +0000 (GMT) (envelope-from ambrisko@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j0RGeDxY041880; Thu, 27 Jan 2005 16:40:13 GMT (envelope-from ambrisko@repoman.freebsd.org) Received: (from ambrisko@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j0RGeDUX041879; Thu, 27 Jan 2005 16:40:13 GMT (envelope-from ambrisko) Message-Id: <200501271640.j0RGeDUX041879@repoman.freebsd.org> From: Doug Ambrisko Date: Thu, 27 Jan 2005 16:40:13 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sbin/ifconfig ifmedia.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2005 16:40:16 -0000 ambrisko 2005-01-27 16:40:12 UTC FreeBSD src repository Modified files: sbin/ifconfig ifmedia.c Log: Change the ifr_media operation to only get its value and only set its value once per ifconfig run. Use Sam's new callback operation to set it when everything is done. The purpose for this is that if you did something like ifconfig bge0 media 100baseTX mediaopt full-duplex multiple times it would end up causing the PHY to re-sync since it would send the IOCTLs: ifconfig bge0 media 100baseTX -mediaopt full-duplex ifconfig bge0 media 100baseTX mediaopt full-duplex This would cause the PHY to be updated twice even though there really wasn't any change since the check in sys/net/if_media.c would always fail. Caveat is that this doesn't fix the case of: ifconfig bge0 media autoselect etc. since in sys/net/if_media.c it forces an autoselect to go through the entire process in ifmedia_ioctl :-( : /* * If no change, we're done. * XXX Automedia may invole software intervention. * Keep going in case the the connected media changed. * Similarly, if best match changed (kernel debugger?). */ if ((IFM_SUBTYPE(newmedia) != IFM_AUTO) && (newmedia == ifm->ifm_media) && (match == ifm->ifm_cur)) return 0; Briefly looked at by: sam Revision Changes Path 1.19 +81 -79 src/sbin/ifconfig/ifmedia.c