From owner-cvs-all@FreeBSD.ORG Sat Sep 15 10:45:35 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C70C616A420; Sat, 15 Sep 2007 10:45:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BED0713C428; Sat, 15 Sep 2007 10:45:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l8FAjZHb037897; Sat, 15 Sep 2007 10:45:35 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l8FAjZt0037896; Sat, 15 Sep 2007 10:45:35 GMT (envelope-from marius) Message-Id: <200709151045.l8FAjZt0037896@repoman.freebsd.org> From: Marius Strobl Date: Sat, 15 Sep 2007 10:45:34 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/dev/hme if_hme.c if_hmevar.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 15 Sep 2007 10:45:35 -0000 marius 2007-09-15 10:45:34 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/dev/hme if_hme.c if_hmevar.h Log: MFC: if_hme.c 1.50, 1.51, 1.52, 1.53; if_hmevar.h 1.10 o Revised MII support: - In hme_stop() mask all interrupts. - In hme_eint() print MIF register contents on MIF interrupts. - In hme_mifinit() don't bother to preserve the previous MIF config. This was mainly done in order to preserve the PHY select bit (external or internal PHY) but which only needs to be set as appropriate when reading from or writing to the desired PHY in hme_mii_{read,write}reg(). Similarly don't bother to set the PHY select bit in hme_mii_statchg(). - In hme_mii_{read,write}reg() ignore requests to PHYs other than the external and internal PHY one. - Move enabling/disabling the MII drivers of the external transceiver from hme_init_locked() and based on the sheer presence of an external one to hme_mifinit() and based on the currently selected media, defaulting to the internal transceiver when the media hasn't been set, yet. Invoke hme_mifinit() from the newly added hme_mediachange_locked() so the setting of the MII drivers is updated when changing media. These changes keep the MII bus from wedging (which manifests in the HME and the PHYs no longer being able to communicate with each other) when the PHY device drivers isolate the unused PHY in two-PHY configurations as present in f.e. Netra t1 100 while changing media, either from hme_init_locked() (see also below) or via ifconfig(8) (not with the RELENG_6 ifconfig(8) and miibus(4) though). They also allow for using both transceivers/PHYs. - In the newly added hme_mediachange_locked() also reset the PHYs in two- PHY configurations before invoking mii_mediachg(). This is required for successfully unisolating the previously unused PHY when switching between PHYs. - Now that changing media should no longer cause problems back out rev. 1.27 and re-enable setting the current media in hme_init_locked() (see the commit message of rev. 1.23 for more info). These changes are roughly a merge of NetBSD hme.c rev. 1.32 - 1.35 (1.30 was already fixed differently in our 1.36; 1.31 and 1.32 were wrong) with some parts reworked and things that don't make sense like setting the MII drivers and restoring the previous MIF and XIF settings in hme_mii_{read, write}reg() omitted. o Use the hme_tick() callout instead of if_slowtimo() for driving hme_watchdog() in order to avoid races accessing if_timer. o Use bus_get_dma_tag() so hme(4) works on platforms requiring it. o Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that. o Remove invalid BUS_DMA_ALLOCNOW when creating a tag which is used for a "static" memory allocation only. Revision Changes Path 1.37.2.10 +112 -63 src/sys/dev/hme/if_hme.c 1.8.2.2 +1 -0 src/sys/dev/hme/if_hmevar.h