freebsd-dev/sys/dev/mii
Marcel Moolenaar 62d76917b8 Introduce a procedural interface to the ifnet structure. The new
interface allows the ifnet structure to be defined as an opaque
type in NIC drivers.  This then allows the ifnet structure to be
changed without a need to change or recompile NIC drivers.

Put differently, NIC drivers can be written and compiled once and
be used with different network stack implementations, provided of
course that those network stack implementations have an API and
ABI compatible interface.

This commit introduces the 'if_t' type to replace 'struct ifnet *'
as the type of a network interface. The 'if_t' type is defined as
'void *' to enable the compiler to perform type conversion to
'struct ifnet *' and vice versa where needed and without warnings.
The functions that implement the API are the only functions that
need to have an explicit cast.

The MII code has been converted to use the driver API to avoid
unnecessary code churn. Code churn comes from having to work with
both converted and unconverted drivers in correlation with having
callback functions that take an interface. By converting the MII
code first, the callback functions can be defined so that the
compiler will perform the typecasts automatically.

As soon as all drivers have been converted, the if_t type can be
redefined as needed and the API functions can be fix to not need
an explicit cast.

The immediate benefactors of this change are:
1.  Juniper Networks - The network stack implementation in Junos
    is entirely different from FreeBSD's one and this change
    allows Juniper to build "stock" NIC drivers that can be used
    in combination with both the FreeBSD and Junos stacks.
2.  FreeBSD - This change opens the door towards changing ifnet
    and implementing new features and optimizations in the network
    stack without it requiring a change in the many NIC drivers
    FreeBSD has.

Submitted by:	Anuranjan Shukla <anshukla@juniper.net>
Reviewed by:	glebius@
Obtained from:	Juniper Networks, Inc.
2014-06-02 17:54:39 +00:00
..
acphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
acphyreg.h
amphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
amphyreg.h
atphy.c Add definition for the Atheros 8021 gigabit PHY. 2013-11-06 16:28:26 +00:00
atphyreg.h
axphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
bmtphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
bmtphyreg.h
brgphy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
brgphyreg.h
ciphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
ciphyreg.h
e1000phy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
e1000phyreg.h
gentbi.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
icsphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
icsphyreg.h
ip1000phy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
ip1000phyreg.h
jmphy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
jmphyreg.h
lxtphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
lxtphyreg.h
mii_bitbang.c
mii_bitbang.h
mii_physubr.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
mii.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
mii.h
miibus_if.m
miidevs Add definition for the Atheros 8021 gigabit PHY. 2013-11-06 16:28:26 +00:00
miivar.h Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
mlphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
nsgphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
nsgphyreg.h
nsphy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
nsphyreg.h
nsphyter.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
nsphyterreg.h
pnaphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
qsphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
qsphyreg.h
rdcphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
rdcphyreg.h
rgephy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
rgephyreg.h
rlphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
rlswitch.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
smcphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
smscphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
tdkphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
tdkphyreg.h
tlphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
tlphyreg.h
truephy.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
truephyreg.h
ukphy_subr.c
ukphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
xmphy.c The MII layer shouldn't care about administrative status of an 2013-10-26 18:40:17 +00:00
xmphyreg.h