From owner-cvs-src-old@FreeBSD.ORG Tue May 3 19:51:54 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 418CF1065680 for ; Tue, 3 May 2011 19:51:54 +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 115098FC1F for ; Tue, 3 May 2011 19:51:54 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p43JprCY018222 for ; Tue, 3 May 2011 19:51:53 GMT (envelope-from marius@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p43JprRa018221 for cvs-src-old@freebsd.org; Tue, 3 May 2011 19:51:53 GMT (envelope-from marius@repoman.freebsd.org) Message-Id: <201105031951.p43JprRa018221@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marius@repoman.freebsd.org using -f From: Marius Strobl Date: Tue, 3 May 2011 19:51:29 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/ae if_ae.c src/sys/dev/age if_age.c src/sys/dev/alc if_alc.c src/sys/dev/ale if_ale.c src/sys/dev/bce if_bce.c src/sys/dev/bfe if_bfe.c src/sys/dev/bge if_bge.c src/sys/dev/dc dcphy.c pnphy.c src/sys/dev/ed if_ed_pccard.c ... X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 19:51:54 -0000 marius 2011-05-03 19:51:29 UTC FreeBSD src repository Modified files: sys/dev/ae if_ae.c sys/dev/age if_age.c sys/dev/alc if_alc.c sys/dev/ale if_ale.c sys/dev/bce if_bce.c sys/dev/bfe if_bfe.c sys/dev/bge if_bge.c sys/dev/dc dcphy.c pnphy.c sys/dev/ed if_ed_pccard.c sys/dev/et if_et.c sys/dev/fxp if_fxp.c sys/dev/hme if_hme.c sys/dev/jme if_jme.c sys/dev/lge if_lge.c sys/dev/mii acphy.c amphy.c atphy.c axphy.c bmtphy.c brgphy.c ciphy.c e1000phy.c exphy.c gentbi.c icsphy.c inphy.c ip1000phy.c jmphy.c lxtphy.c mii.c mii.h mii_physubr.c miidevs miivar.h mlphy.c nsgphy.c nsphy.c nsphyter.c pnaphy.c qsphy.c rdcphy.c rgephy.c rlphy.c rlswitch.c ruephy.c smcphy.c tdkphy.c tlphy.c truephy.c ukphy.c xmphy.c sys/dev/nfe if_nfe.c sys/dev/nge if_nge.c sys/dev/nve if_nve.c sys/dev/pcn if_pcn.c sys/dev/sf if_sf.c sys/dev/sge if_sge.c sys/dev/sis if_sis.c sys/dev/ste if_ste.c sys/dev/tx if_tx.c sys/dev/usb/net if_aue.c if_axe.c if_rue.c if_udav.c sys/dev/vr if_vr.c sys/dev/vte if_vte.c sys/dev/wb if_wb.c sys/mips/atheros if_arge.c sys/mips/cavium/octe octe.c sys/mips/idt if_kr.c sys/modules/mii Makefile Log: SVN rev 221407 on 2011-05-03 19:51:29Z by marius - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers it was unclear whether the PHYs driven by them actually support loopback or not. Moreover, typically loopback mode also needs to be activated on the MAC, which none of the Ethernet drivers using mii(4) implements. Given that loopback media has no real use (and obviously hardly had a chance to actually work) besides for driver development (which just loopback mode should be sufficient for though, i.e one doesn't necessary need support for loopback media) support for it is just dropped as both NetBSD and OpenBSD already did quite some time ago. - Let mii_phy_add_media() also announce the support of IFM_NONE. - Restructure the PHY entry points to use a structure of entry points instead of discrete function pointers, and extend this to include a "reset" entry point. Make sure any PHY-specific reset routine is always used, and provide one for lxtphy(4) which disables MII interrupts (as is done for a few other PHYs we have drivers for). This includes changing NIC drivers which previously just called the generic mii_phy_reset() to now actually call the PHY-specific reset routine, which might be crucial in some cases. While at it, the redundant checks in these NIC drivers for mii->mii_instance not being zero before calling the reset routines were removed because as soon as one PHY driver attaches mii->mii_instance is incremented and we hardly can end up in their media change callbacks etc if no PHY driver has attached as mii_attach() would have failed in that case and not attach a miibus(4) instance. Consequently, NIC drivers now no longer should call mii_phy_reset() directly, so it was removed from EXPORT_SYMS. - Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe(). The purpose of that function is to perform the common steps to attach a PHY driver instance and to hook it up to the miibus(4) instance and to optionally also handle the probing, addition and initialization of the supported media. So all a PHY driver without any special requirements has to do in its bus attach method is to call mii_phy_dev_attach() along with PHY-specific MIIF_* flags, a pointer to its PHY functions and the add_media set to one. All PHY drivers were updated to take advantage of mii_phy_dev_attach() as appropriate. Along with these changes the capability mask was added to the mii_softc structure so PHY drivers taking advantage of mii_phy_dev_attach() but still handling media on their own do not need to fiddle with the MII attach arguments anyway. - Keep track of the PHY offset in the mii_softc structure. This is done for compatibility with NetBSD/OpenBSD. - Keep track of the PHY's OUI, model and revision in the mii_softc structure. Several PHY drivers require this information also after attaching and previously had to wrap their own softc around mii_softc. NetBSD/OpenBSD also keep track of the model and revision on their mii_softc structure. All PHY drivers were updated to take advantage as appropriate. - Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD. - According to IEEE 802.3-2002 the bits actually have to be reversed when mapping an OUI to the MII ID registers. All PHY drivers and miidevs where changed as necessary. Actually this now again allows to largely share miidevs with NetBSD, which fixed this problem already 9 years ago. Consequently miidevs was synced as far as possible. - Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that weren't explicitly converted to support flow control before. It's unclear whether flow control actually works with these but typically it should and their net behavior should be more correct with these changes in place than without if the MAC driver sets MIIF_DOPAUSE. Obtained from: NetBSD (partially) Reviewed by: yongari (earlier version), silence on arch@ and net@ Revision Changes Path 1.16 +2 -4 src/sys/dev/ae/if_ae.c 1.22 +2 -4 src/sys/dev/age/if_age.c 1.32 +2 -4 src/sys/dev/alc/if_alc.c 1.18 +2 -4 src/sys/dev/ale/if_ale.c 1.89 +3 -6 src/sys/dev/bce/if_bce.c 1.57 +3 -6 src/sys/dev/bfe/if_bfe.c 1.345 +2 -3 src/sys/dev/bge/if_bge.c 1.41 +15 -23 src/sys/dev/dc/dcphy.c 1.29 +17 -18 src/sys/dev/dc/pnphy.c 1.158 +4 -12 src/sys/dev/ed/if_ed_pccard.c 1.22 +3 -6 src/sys/dev/et/if_et.c 1.316 +3 -5 src/sys/dev/fxp/if_fxp.c 1.59 +1 -1 src/sys/dev/hme/if_hme.c 1.27 +2 -4 src/sys/dev/jme/if_jme.c 1.58 +3 -6 src/sys/dev/lge/if_lge.c 1.27 +17 -20 src/sys/dev/mii/acphy.c 1.29 +13 -34 src/sys/dev/mii/amphy.c 1.11 +12 -49 src/sys/dev/mii/atphy.c 1.7 +12 -25 src/sys/dev/mii/axphy.c 1.20 +17 -48 src/sys/dev/mii/bmtphy.c 1.103 +66 -108 src/sys/dev/mii/brgphy.c 1.23 +24 -43 src/sys/dev/mii/ciphy.c 1.46 +51 -70 src/sys/dev/mii/e1000phy.c 1.28 +11 -33 src/sys/dev/mii/exphy.c 1.12 +10 -21 src/sys/dev/mii/gentbi.c 1.6 +20 -50 src/sys/dev/mii/icsphy.c 1.24 +13 -36 src/sys/dev/mii/inphy.c 1.15 +19 -51 src/sys/dev/mii/ip1000phy.c 1.8 +14 -52 src/sys/dev/mii/jmphy.c 1.26 +24 -17 src/sys/dev/mii/lxtphy.c 1.42 +35 -11 src/sys/dev/mii/mii.c 1.9 +0 -10 src/sys/dev/mii/mii.h 1.38 +48 -5 src/sys/dev/mii/mii_physubr.c 1.81 +205 -168 src/sys/dev/mii/miidevs 1.29 +57 -27 src/sys/dev/mii/miivar.h 1.30 +21 -31 src/sys/dev/mii/mlphy.c 1.32 +13 -22 src/sys/dev/mii/nsgphy.c 1.36 +16 -42 src/sys/dev/mii/nsphy.c 1.7 +13 -45 src/sys/dev/mii/nsphyter.c 1.23 +10 -27 src/sys/dev/mii/pnaphy.c 1.24 +11 -25 src/sys/dev/mii/qsphy.c 1.2 +8 -35 src/sys/dev/mii/rdcphy.c 1.27 +23 -56 src/sys/dev/mii/rgephy.c 1.38 +21 -56 src/sys/dev/mii/rlphy.c 1.5 +13 -25 src/sys/dev/mii/rlswitch.c 1.11 +12 -31 src/sys/dev/mii/ruephy.c 1.7 +19 -39 src/sys/dev/mii/smcphy.c 1.29 +11 -34 src/sys/dev/mii/tdkphy.c 1.30 +35 -44 src/sys/dev/mii/tlphy.c 1.7 +18 -23 src/sys/dev/mii/truephy.c 1.26 +8 -30 src/sys/dev/mii/ukphy.c 1.27 +15 -20 src/sys/dev/mii/xmphy.c 1.48 +4 -8 src/sys/dev/nfe/if_nfe.c 1.106 +2 -4 src/sys/dev/nge/if_nge.c 1.37 +3 -7 src/sys/dev/nve/if_nve.c 1.7 +2 -3 src/sys/dev/pcn/if_pcn.c 1.104 +3 -5 src/sys/dev/sf/if_sf.c 1.20 +3 -5 src/sys/dev/sge/if_sge.c 1.33 +3 -5 src/sys/dev/sis/if_sis.c 1.37 +2 -4 src/sys/dev/ste/if_ste.c 1.103 +5 -6 src/sys/dev/tx/if_tx.c 1.19 +3 -6 src/sys/dev/usb/net/if_aue.c 1.35 +3 -6 src/sys/dev/usb/net/if_axe.c 1.17 +3 -6 src/sys/dev/usb/net/if_rue.c 1.17 +3 -6 src/sys/dev/usb/net/if_udav.c 1.141 +2 -4 src/sys/dev/vr/if_vr.c 1.4 +2 -4 src/sys/dev/vte/if_vte.c 1.8 +3 -15 src/sys/dev/wb/if_wb.c 1.18 +2 -4 src/sys/mips/atheros/if_arge.c 1.9 +3 -7 src/sys/mips/cavium/octe/octe.c 1.6 +2 -4 src/sys/mips/idt/if_kr.c 1.40 +0 -1 src/sys/modules/mii/Makefile