From owner-svn-src-all@freebsd.org Sat Dec 26 02:31:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270FCA5109A; Sat, 26 Dec 2015 02:31:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E593B1773; Sat, 26 Dec 2015 02:31:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQ2VgZW037333; Sat, 26 Dec 2015 02:31:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ2VdPH037312; Sat, 26 Dec 2015 02:31:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512260231.tBQ2VdPH037312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 26 Dec 2015 02:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292738 - in head: share/man/man4 sys/conf sys/dev/etherswitch sys/dev/etherswitch/arswitch sys/dev/etherswitch/e6000sw sys/dev/etherswitch/ip17x sys/dev/etherswitch/ukswitch sys/dev/md... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 02:31:43 -0000 Author: adrian Date: Sat Dec 26 02:31:39 2015 New Revision: 292738 URL: https://svnweb.freebsd.org/changeset/base/292738 Log: [mdio] migrate mdiobus out of etherswitch and into a top-level device of its own. The mdio driver interface is generally useful for devices that require MDIO without the full MII bus interface. This lifts the driver/interface out of etherswitch(4), and adds a mdio(4) man page. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D4606 Added: head/share/man/man4/mdio.4 (contents, props changed) head/sys/dev/mdio/ head/sys/dev/mdio/mdio.c - copied, changed from r292734, head/sys/dev/etherswitch/mdio.c head/sys/dev/mdio/mdio.h - copied, changed from r292734, head/sys/dev/etherswitch/mdio.h head/sys/dev/mdio/mdio_if.m - copied unchanged from r292734, head/sys/dev/etherswitch/mdio_if.m head/sys/modules/mdio/ head/sys/modules/mdio/Makefile (contents, props changed) Deleted: head/sys/dev/etherswitch/mdio.c head/sys/dev/etherswitch/mdio.h head/sys/dev/etherswitch/mdio_if.m Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_8216.c head/sys/dev/etherswitch/arswitch/arswitch_8226.c head/sys/dev/etherswitch/arswitch/arswitch_8316.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_9340.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/etherswitch/ip17x/ip17x.c head/sys/dev/etherswitch/ukswitch/ukswitch.c head/sys/dev/mge/if_mge.c head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Dec 26 00:31:19 2015 (r292737) +++ head/share/man/man4/Makefile Sat Dec 26 02:31:39 2015 (r292738) @@ -266,6 +266,7 @@ MAN= aac.4 \ malo.4 \ mcd.4 \ md.4 \ + mdio.4 \ me.4 \ mem.4 \ meteor.4 \ Added: head/share/man/man4/mdio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mdio.4 Sat Dec 26 02:31:39 2015 (r292738) @@ -0,0 +1,53 @@ +.\" Written by Landon Fuller for the FreeBSD Project. +.\" Based on the miibus(4) manual page written by Tom Rhodes. +.\" Please see the /usr/src/COPYRIGHT file for copyright information. +.\" +.\" $FreeBSD$ +.\" +.Dd December 17, 2015 +.Dt MDIO 4 +.Os +.Sh NAME +.Nm mdio +.Nd IEEE 802.3 Management Data Input/Output interface +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mdio" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides an interconnection between the Media Access Control (MAC) +sublayer and Physical Layer (PHY) entities' control and status registers, +as defined by the IEEE 802.3 Standard. +.Pp +The +.Nm +layer allows device drivers to share common support code for various +external PHY devices. +.Pp +.Tn MDIO +is one of two signal interfaces that comprise the +Media Independent Interface (MII) defined by the IEEE 802.3 +Standard. The +.Xr miibus 4 +driver provides support for devices that require full +.Tn MII +support. +.Sh SEE ALSO +.Xr miibus 4 +.Sh STANDARDS +More information on +.Tn MDIO +can be found in the IEEE 802.3 Standard. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The driver was written by +.An Stefan Bethke Aq Mt stb@lassitu.de . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/conf/files Sat Dec 26 02:31:39 2015 (r292738) @@ -1404,8 +1404,6 @@ dev/etherswitch/ip17x/ip175c.c optional dev/etherswitch/ip17x/ip175d.c optional ip17x dev/etherswitch/ip17x/ip17x_phy.c optional ip17x dev/etherswitch/ip17x/ip17x_vlans.c optional ip17x -dev/etherswitch/mdio_if.m optional miiproxy | mdio -dev/etherswitch/mdio.c optional miiproxy | mdio dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb dev/etherswitch/ukswitch/ukswitch.c optional ukswitch @@ -1908,6 +1906,8 @@ dev/mca/mca_bus.c optional mca dev/mcd/mcd.c optional mcd isa nowerror dev/mcd/mcd_isa.c optional mcd isa nowerror dev/md/md.c optional md +dev/mdio/mdio_if.m optional miiproxy | mdio +dev/mdio/mdio.c optional miiproxy | mdio dev/mem/memdev.c optional mem dev/mem/memutil.c optional mem dev/mfi/mfi.c optional mfi Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sat Dec 26 02:31:39 2015 (r292738) @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8216.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8216.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8216.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8226.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8226.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8226.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8316.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8316.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8316.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sat Dec 26 02:31:39 2015 (r292738) @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sat Dec 26 02:31:39 2015 (r292738) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Sat Dec 26 02:31:39 2015 (r292738) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Sat Dec 26 02:31:39 2015 (r292738) @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c ============================================================================== --- head/sys/dev/etherswitch/ukswitch/ukswitch.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/ukswitch/ukswitch.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Copied and modified: head/sys/dev/mdio/mdio.c (from r292734, head/sys/dev/etherswitch/mdio.c) ============================================================================== --- head/sys/dev/etherswitch/mdio.c Fri Dec 25 18:11:40 2015 (r292734, copy source) +++ head/sys/dev/mdio/mdio.c Sat Dec 26 02:31:39 2015 (r292738) @@ -29,8 +29,9 @@ #include #include #include +#include -#include +#include #include "mdio_if.h" @@ -115,3 +116,5 @@ driver_t mdio_driver = { }; devclass_t mdio_devclass; + +MODULE_VERSION(mdio, 1); Copied and modified: head/sys/dev/mdio/mdio.h (from r292734, head/sys/dev/etherswitch/mdio.h) ============================================================================== --- head/sys/dev/etherswitch/mdio.h Fri Dec 25 18:11:40 2015 (r292734, copy source) +++ head/sys/dev/mdio/mdio.h Sat Dec 26 02:31:39 2015 (r292738) @@ -26,10 +26,10 @@ * $FreeBSD$ */ -#ifndef __DEV_ETHERSWITCH_MDIO_H__ -#define __DEV_ETHERSWITCH_MDIO_H__ +#ifndef __DEV_MDIO_MDIO_H__ +#define __DEV_MDIO_MDIO_H__ extern driver_t mdio_driver; extern devclass_t mdio_devclass; -#endif /* __DEV_ETHERSWITCH_MDIO_H__ */ +#endif /* __DEV_MDIO_MDIO_H__ */ Copied: head/sys/dev/mdio/mdio_if.m (from r292734, head/sys/dev/etherswitch/mdio_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mdio/mdio_if.m Sat Dec 26 02:31:39 2015 (r292738, copy of r292734, head/sys/dev/etherswitch/mdio_if.m) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +#include + +INTERFACE mdio; + +# +# Read register from device on MDIO bus +# +METHOD int readreg { + device_t dev; + int phy; + int reg; +}; + +# +# Write register to device on MDIO bus +# +METHOD int writereg { + device_t dev; + int phy; + int reg; + int val; +}; Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/mge/if_mge.c Sat Dec 26 02:31:39 2015 (r292738) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/modules/Makefile Sat Dec 26 02:31:39 2015 (r292738) @@ -220,6 +220,7 @@ SUBDIR= \ malo \ mcd \ md \ + mdio \ mem \ mfi \ mii \ Added: head/sys/modules/mdio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mdio/Makefile Sat Dec 26 02:31:39 2015 (r292738) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/mdio + +KMOD= mdio +SRCS= mdio.c +SRCS+= mdio_if.c mdio_if.h +SRCS+= device_if.h bus_if.h + +.include