History log of /openbsd-current/sys/dev/mii/miivar.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.38 08-Jul-2023 kettenis

Add support for the Motorcomm YT8521/YT8531 PHYs. Since these PHYs may
need various board-dependent tweaks, pass the device tree node down
to the PHY driver such that we can look at various properties to make
the necessary tweaks. Enable ytphy(4) on riscv64.

ok jsing@, patrick@


# 1.37 05-Apr-2023 kettenis

Implement software control for the internal delays of the RTL8211F PHY.
Since we need to retain the hardware/firmware configuration of the delays
in most existing hardware that uses rgephy(4) (such as PCIe NICs), add a
bew MIIF_SETDELAY flag that controls the software configuration of the
delays.

ok dlg@, jsg@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.36 03-Nov-2020 patrick

The Marvell 88E1512 supports multiple modes between MAC to PHY and PHY
to Media. The mode can be configured in the General Control Register 1.
On the 88E1512 and 88E1514 this mode defaults to 111 (invalid). Thus we
need to change the mode if we want SGMII-to-Copper. For this, allow the
interface to pass an SGMII flag, indicating that the interface between
MAC and PHY is SGMII.

ok kettenis@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.35 14-Apr-2020 kettenis

Add flags to specify whether internal delays should be configured for RGMII.

ok patrick@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.34 12-Sep-2015 miod

mii_softc's view of the current mii state need to use the proper types
(ifmedia64).


# 1.33 11-Sep-2015 stsp

Make room for media types of the future. Extend the ifmedia word to 64 bits.
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.

Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.

There may be some MD fallout but that will be cleared up later.

ok deraadt miod
with help and suggestions from several sharks attending l2k15


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.32 28-Dec-2013 deraadt

mii drivers no longer need activate functions. Repair of the PHY
configuration setting is done at resume time because all networks
drivers which were previously up, do an IFF_UP operation which
hits PHY_RESET.
This was in snapshots for about 2 weeks.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.31 20-Apr-2010 deraadt

mii_activate() is unused


Revision tags: OPENBSD_4_7_BASE
# 1.30 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.29 08-Nov-2008 brad

Add a softc field mii_oui to store the OUI.


Revision tags: OPENBSD_4_4_BASE
# 1.28 26-Jun-2008 ray

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.27 28-Dec-2006 kettenis

Add function to detect flow control status. From NetBSD.

ok brad@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.26 06-Nov-2005 brad

move some macros from mii.h to miivar.h


Revision tags: OPENBSD_3_8_BASE
# 1.25 23-Jul-2005 brad

back out last commit, this causes problems on some systems.


# 1.24 22-Jul-2005 brad

Reading the IEEE specs shows that the bits have to be reversed when
mapping an OUI to the MII id registers.

From drochner NetBSD


# 1.23 26-Mar-2005 krw

Cleanup. Use defines, standard names, consistant comparison operators, etc.
for auto negotiation ticks code. No functional change.

ok brad@


Revision tags: OPENBSD_3_7_BASE
# 1.22 16-Dec-2004 brad

Make sure ifp->if_baudrate is valid when the parent's statchg
callback is made.

From NetBSD


# 1.21 18-Nov-2004 brad

add mii_phy_match() for table-driven lookup.

From NetBSD


# 1.20 27-Sep-2004 brad

ANSI protos and some minor cleanup

ok henning@


# 1.19 26-Sep-2004 brad

Restructure the PHY entry points to use a structure of
entry points instead of descrete function pointers, and
extend this to include a "reset" entry point. Make sure
any PHY-specific reset routine is always used.

From NetBSD

ok mcbride@


Revision tags: OPENBSD_3_6_BASE
# 1.18 02-Aug-2004 brad

more MII flags

From NetBSD


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 13-Oct-2003 krw

Bring bge and brgphy more up to date with changes from FreeBSD and NetBSD.

Some bug fixes, support for new hardware like the 5704 and 5705.

Testing by deraadt@, danh@, and drahn@ amoung others.

ok deraadt@.


# 1.16 26-Sep-2003 miod

Typos: defintion -> definition, proccess -> process

There are more occurences hiding in binutils, lynx and afs but I am too
lazy to report them upstream at the moment.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE UBC_SYNC_A UBC_SYNC_B
# 1.15 04-May-2002 fgsch

some space and tab cleanup.


Revision tags: OPENBSD_3_1_BASE
# 1.14 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.13 05-Oct-2001 nate

branches: 1.13.4;
Differentiate between 1000baseT and 1000baseX.
Add some support for gigabit control/status regs.


# 1.12 19-Aug-2001 miod

More old timeouts removal, mainly affected unused/unmaintained code.


# 1.11 25-Jun-2001 nate

Change autonegotiation timeout for devices with a gigabit phy to 10s. All
other devices default to 5 seconds. ok deraadt. from NetBSD.


# 1.10 08-Jun-2001 nate

Add some general support info for gigabit phys
Fix some comments
Remove some dead code
From NetBSD


# 1.9 03-May-2001 aaron

Add an MIIF_AUTOTSLEEP flag, needed by new aue(4) code. From NetBSD.


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.8 16-Oct-2000 aaron

Do not pass any flags to mii_attach() through the mii_phy_probe() wrapper.


# 1.7 26-Aug-2000 nate

sync mii code with netbsd
adds detach functionality for phys
some code cleanup

Nobody really had time to test all of this out, but theo said commit anyway


# 1.6 30-Jun-2000 art

Convert to new timeouts.


Revision tags: OPENBSD_2_7_BASE
# 1.5 24-Apr-2000 niklas

Add simple mii detach routine while waiting for the post-2.7
merge of NetBSD mii work


Revision tags: SMP_BASE kame_19991208
# 1.4 07-Dec-1999 jason

branches: 1.4.2;
Merge with NetBSD:
o move common support functions for phy drivers from mii.c to mii_physubr.c,
so that they are not includes if no PHY is configured
o Clean up the code that adds media a little, and make media selection
table-driven in preparation for some other changes to be made.
o Don't add any loopback versions of media, for now.
o Add mii_down(), which is used by MAC drivers to inform PHYs that the
interface is now down. PHYs use this to cancel pending asynchronous
operations.
o Add OUI for Enable Semiconductor.
o New Driver for TDK TSC78Q2120 PHY


Revision tags: OPENBSD_2_6_BASE
# 1.3 16-Jul-1999 jason

Sync with NetBSD:
o Implement asynchronous autonegotiation when driven by the MII tick
(one-second clock). Prevents .5s delays every 5 seconds when the interface
is up but there is no link.
o Correct the sense of the PCR_FLINK100 bit in nsphy.c.


Revision tags: OPENBSD_2_5_BASE
# 1.2 11-Nov-1998 jason

Merge with NetBSD:
o additional phy drivers (seeq, ics, level1)
o "unknown phy" driver for unsupported phys
o collected common code into mii_physubr
o exphy isn't the only phy that doesn't have valid id registers


Revision tags: OPENBSD_2_4_BASE
# 1.1 10-Sep-1998 jason

OpenBSD gets sys/dev/mii layer from NetBSD


# 1.37 05-Apr-2023 kettenis

Implement software control for the internal delays of the RTL8211F PHY.
Since we need to retain the hardware/firmware configuration of the delays
in most existing hardware that uses rgephy(4) (such as PCIe NICs), add a
bew MIIF_SETDELAY flag that controls the software configuration of the
delays.

ok dlg@, jsg@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.36 03-Nov-2020 patrick

The Marvell 88E1512 supports multiple modes between MAC to PHY and PHY
to Media. The mode can be configured in the General Control Register 1.
On the 88E1512 and 88E1514 this mode defaults to 111 (invalid). Thus we
need to change the mode if we want SGMII-to-Copper. For this, allow the
interface to pass an SGMII flag, indicating that the interface between
MAC and PHY is SGMII.

ok kettenis@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.35 14-Apr-2020 kettenis

Add flags to specify whether internal delays should be configured for RGMII.

ok patrick@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.34 12-Sep-2015 miod

mii_softc's view of the current mii state need to use the proper types
(ifmedia64).


# 1.33 11-Sep-2015 stsp

Make room for media types of the future. Extend the ifmedia word to 64 bits.
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.

Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.

There may be some MD fallout but that will be cleared up later.

ok deraadt miod
with help and suggestions from several sharks attending l2k15


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.32 28-Dec-2013 deraadt

mii drivers no longer need activate functions. Repair of the PHY
configuration setting is done at resume time because all networks
drivers which were previously up, do an IFF_UP operation which
hits PHY_RESET.
This was in snapshots for about 2 weeks.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.31 20-Apr-2010 deraadt

mii_activate() is unused


Revision tags: OPENBSD_4_7_BASE
# 1.30 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.29 08-Nov-2008 brad

Add a softc field mii_oui to store the OUI.


Revision tags: OPENBSD_4_4_BASE
# 1.28 26-Jun-2008 ray

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.27 28-Dec-2006 kettenis

Add function to detect flow control status. From NetBSD.

ok brad@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.26 06-Nov-2005 brad

move some macros from mii.h to miivar.h


Revision tags: OPENBSD_3_8_BASE
# 1.25 23-Jul-2005 brad

back out last commit, this causes problems on some systems.


# 1.24 22-Jul-2005 brad

Reading the IEEE specs shows that the bits have to be reversed when
mapping an OUI to the MII id registers.

From drochner NetBSD


# 1.23 26-Mar-2005 krw

Cleanup. Use defines, standard names, consistant comparison operators, etc.
for auto negotiation ticks code. No functional change.

ok brad@


Revision tags: OPENBSD_3_7_BASE
# 1.22 16-Dec-2004 brad

Make sure ifp->if_baudrate is valid when the parent's statchg
callback is made.

From NetBSD


# 1.21 18-Nov-2004 brad

add mii_phy_match() for table-driven lookup.

From NetBSD


# 1.20 27-Sep-2004 brad

ANSI protos and some minor cleanup

ok henning@


# 1.19 26-Sep-2004 brad

Restructure the PHY entry points to use a structure of
entry points instead of descrete function pointers, and
extend this to include a "reset" entry point. Make sure
any PHY-specific reset routine is always used.

From NetBSD

ok mcbride@


Revision tags: OPENBSD_3_6_BASE
# 1.18 02-Aug-2004 brad

more MII flags

From NetBSD


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 13-Oct-2003 krw

Bring bge and brgphy more up to date with changes from FreeBSD and NetBSD.

Some bug fixes, support for new hardware like the 5704 and 5705.

Testing by deraadt@, danh@, and drahn@ amoung others.

ok deraadt@.


# 1.16 26-Sep-2003 miod

Typos: defintion -> definition, proccess -> process

There are more occurences hiding in binutils, lynx and afs but I am too
lazy to report them upstream at the moment.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE UBC_SYNC_A UBC_SYNC_B
# 1.15 04-May-2002 fgsch

some space and tab cleanup.


Revision tags: OPENBSD_3_1_BASE
# 1.14 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.13 05-Oct-2001 nate

branches: 1.13.4;
Differentiate between 1000baseT and 1000baseX.
Add some support for gigabit control/status regs.


# 1.12 19-Aug-2001 miod

More old timeouts removal, mainly affected unused/unmaintained code.


# 1.11 25-Jun-2001 nate

Change autonegotiation timeout for devices with a gigabit phy to 10s. All
other devices default to 5 seconds. ok deraadt. from NetBSD.


# 1.10 08-Jun-2001 nate

Add some general support info for gigabit phys
Fix some comments
Remove some dead code
From NetBSD


# 1.9 03-May-2001 aaron

Add an MIIF_AUTOTSLEEP flag, needed by new aue(4) code. From NetBSD.


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.8 16-Oct-2000 aaron

Do not pass any flags to mii_attach() through the mii_phy_probe() wrapper.


# 1.7 26-Aug-2000 nate

sync mii code with netbsd
adds detach functionality for phys
some code cleanup

Nobody really had time to test all of this out, but theo said commit anyway


# 1.6 30-Jun-2000 art

Convert to new timeouts.


Revision tags: OPENBSD_2_7_BASE
# 1.5 24-Apr-2000 niklas

Add simple mii detach routine while waiting for the post-2.7
merge of NetBSD mii work


Revision tags: SMP_BASE kame_19991208
# 1.4 07-Dec-1999 jason

branches: 1.4.2;
Merge with NetBSD:
o move common support functions for phy drivers from mii.c to mii_physubr.c,
so that they are not includes if no PHY is configured
o Clean up the code that adds media a little, and make media selection
table-driven in preparation for some other changes to be made.
o Don't add any loopback versions of media, for now.
o Add mii_down(), which is used by MAC drivers to inform PHYs that the
interface is now down. PHYs use this to cancel pending asynchronous
operations.
o Add OUI for Enable Semiconductor.
o New Driver for TDK TSC78Q2120 PHY


Revision tags: OPENBSD_2_6_BASE
# 1.3 16-Jul-1999 jason

Sync with NetBSD:
o Implement asynchronous autonegotiation when driven by the MII tick
(one-second clock). Prevents .5s delays every 5 seconds when the interface
is up but there is no link.
o Correct the sense of the PCR_FLINK100 bit in nsphy.c.


Revision tags: OPENBSD_2_5_BASE
# 1.2 11-Nov-1998 jason

Merge with NetBSD:
o additional phy drivers (seeq, ics, level1)
o "unknown phy" driver for unsupported phys
o collected common code into mii_physubr
o exphy isn't the only phy that doesn't have valid id registers


Revision tags: OPENBSD_2_4_BASE
# 1.1 10-Sep-1998 jason

OpenBSD gets sys/dev/mii layer from NetBSD


# 1.36 03-Nov-2020 patrick

The Marvell 88E1512 supports multiple modes between MAC to PHY and PHY
to Media. The mode can be configured in the General Control Register 1.
On the 88E1512 and 88E1514 this mode defaults to 111 (invalid). Thus we
need to change the mode if we want SGMII-to-Copper. For this, allow the
interface to pass an SGMII flag, indicating that the interface between
MAC and PHY is SGMII.

ok kettenis@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.35 14-Apr-2020 kettenis

Add flags to specify whether internal delays should be configured for RGMII.

ok patrick@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.34 12-Sep-2015 miod

mii_softc's view of the current mii state need to use the proper types
(ifmedia64).


# 1.33 11-Sep-2015 stsp

Make room for media types of the future. Extend the ifmedia word to 64 bits.
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.

Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.

There may be some MD fallout but that will be cleared up later.

ok deraadt miod
with help and suggestions from several sharks attending l2k15


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.32 28-Dec-2013 deraadt

mii drivers no longer need activate functions. Repair of the PHY
configuration setting is done at resume time because all networks
drivers which were previously up, do an IFF_UP operation which
hits PHY_RESET.
This was in snapshots for about 2 weeks.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.31 20-Apr-2010 deraadt

mii_activate() is unused


Revision tags: OPENBSD_4_7_BASE
# 1.30 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.29 08-Nov-2008 brad

Add a softc field mii_oui to store the OUI.


Revision tags: OPENBSD_4_4_BASE
# 1.28 26-Jun-2008 ray

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.27 28-Dec-2006 kettenis

Add function to detect flow control status. From NetBSD.

ok brad@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.26 06-Nov-2005 brad

move some macros from mii.h to miivar.h


Revision tags: OPENBSD_3_8_BASE
# 1.25 23-Jul-2005 brad

back out last commit, this causes problems on some systems.


# 1.24 22-Jul-2005 brad

Reading the IEEE specs shows that the bits have to be reversed when
mapping an OUI to the MII id registers.

From drochner NetBSD


# 1.23 26-Mar-2005 krw

Cleanup. Use defines, standard names, consistant comparison operators, etc.
for auto negotiation ticks code. No functional change.

ok brad@


Revision tags: OPENBSD_3_7_BASE
# 1.22 16-Dec-2004 brad

Make sure ifp->if_baudrate is valid when the parent's statchg
callback is made.

From NetBSD


# 1.21 18-Nov-2004 brad

add mii_phy_match() for table-driven lookup.

From NetBSD


# 1.20 27-Sep-2004 brad

ANSI protos and some minor cleanup

ok henning@


# 1.19 26-Sep-2004 brad

Restructure the PHY entry points to use a structure of
entry points instead of descrete function pointers, and
extend this to include a "reset" entry point. Make sure
any PHY-specific reset routine is always used.

From NetBSD

ok mcbride@


Revision tags: OPENBSD_3_6_BASE
# 1.18 02-Aug-2004 brad

more MII flags

From NetBSD


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 13-Oct-2003 krw

Bring bge and brgphy more up to date with changes from FreeBSD and NetBSD.

Some bug fixes, support for new hardware like the 5704 and 5705.

Testing by deraadt@, danh@, and drahn@ amoung others.

ok deraadt@.


# 1.16 26-Sep-2003 miod

Typos: defintion -> definition, proccess -> process

There are more occurences hiding in binutils, lynx and afs but I am too
lazy to report them upstream at the moment.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE UBC_SYNC_A UBC_SYNC_B
# 1.15 04-May-2002 fgsch

some space and tab cleanup.


Revision tags: OPENBSD_3_1_BASE
# 1.14 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.13 05-Oct-2001 nate

branches: 1.13.4;
Differentiate between 1000baseT and 1000baseX.
Add some support for gigabit control/status regs.


# 1.12 19-Aug-2001 miod

More old timeouts removal, mainly affected unused/unmaintained code.


# 1.11 25-Jun-2001 nate

Change autonegotiation timeout for devices with a gigabit phy to 10s. All
other devices default to 5 seconds. ok deraadt. from NetBSD.


# 1.10 08-Jun-2001 nate

Add some general support info for gigabit phys
Fix some comments
Remove some dead code
From NetBSD


# 1.9 03-May-2001 aaron

Add an MIIF_AUTOTSLEEP flag, needed by new aue(4) code. From NetBSD.


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.8 16-Oct-2000 aaron

Do not pass any flags to mii_attach() through the mii_phy_probe() wrapper.


# 1.7 26-Aug-2000 nate

sync mii code with netbsd
adds detach functionality for phys
some code cleanup

Nobody really had time to test all of this out, but theo said commit anyway


# 1.6 30-Jun-2000 art

Convert to new timeouts.


Revision tags: OPENBSD_2_7_BASE
# 1.5 24-Apr-2000 niklas

Add simple mii detach routine while waiting for the post-2.7
merge of NetBSD mii work


Revision tags: SMP_BASE kame_19991208
# 1.4 07-Dec-1999 jason

branches: 1.4.2;
Merge with NetBSD:
o move common support functions for phy drivers from mii.c to mii_physubr.c,
so that they are not includes if no PHY is configured
o Clean up the code that adds media a little, and make media selection
table-driven in preparation for some other changes to be made.
o Don't add any loopback versions of media, for now.
o Add mii_down(), which is used by MAC drivers to inform PHYs that the
interface is now down. PHYs use this to cancel pending asynchronous
operations.
o Add OUI for Enable Semiconductor.
o New Driver for TDK TSC78Q2120 PHY


Revision tags: OPENBSD_2_6_BASE
# 1.3 16-Jul-1999 jason

Sync with NetBSD:
o Implement asynchronous autonegotiation when driven by the MII tick
(one-second clock). Prevents .5s delays every 5 seconds when the interface
is up but there is no link.
o Correct the sense of the PCR_FLINK100 bit in nsphy.c.


Revision tags: OPENBSD_2_5_BASE
# 1.2 11-Nov-1998 jason

Merge with NetBSD:
o additional phy drivers (seeq, ics, level1)
o "unknown phy" driver for unsupported phys
o collected common code into mii_physubr
o exphy isn't the only phy that doesn't have valid id registers


Revision tags: OPENBSD_2_4_BASE
# 1.1 10-Sep-1998 jason

OpenBSD gets sys/dev/mii layer from NetBSD


# 1.35 14-Apr-2020 kettenis

Add flags to specify whether internal delays should be configured for RGMII.

ok patrick@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.34 12-Sep-2015 miod

mii_softc's view of the current mii state need to use the proper types
(ifmedia64).


# 1.33 11-Sep-2015 stsp

Make room for media types of the future. Extend the ifmedia word to 64 bits.
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.

Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.

There may be some MD fallout but that will be cleared up later.

ok deraadt miod
with help and suggestions from several sharks attending l2k15


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.32 28-Dec-2013 deraadt

mii drivers no longer need activate functions. Repair of the PHY
configuration setting is done at resume time because all networks
drivers which were previously up, do an IFF_UP operation which
hits PHY_RESET.
This was in snapshots for about 2 weeks.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.31 20-Apr-2010 deraadt

mii_activate() is unused


Revision tags: OPENBSD_4_7_BASE
# 1.30 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.29 08-Nov-2008 brad

Add a softc field mii_oui to store the OUI.


Revision tags: OPENBSD_4_4_BASE
# 1.28 26-Jun-2008 ray

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.27 28-Dec-2006 kettenis

Add function to detect flow control status. From NetBSD.

ok brad@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.26 06-Nov-2005 brad

move some macros from mii.h to miivar.h


Revision tags: OPENBSD_3_8_BASE
# 1.25 23-Jul-2005 brad

back out last commit, this causes problems on some systems.


# 1.24 22-Jul-2005 brad

Reading the IEEE specs shows that the bits have to be reversed when
mapping an OUI to the MII id registers.

From drochner NetBSD


# 1.23 26-Mar-2005 krw

Cleanup. Use defines, standard names, consistant comparison operators, etc.
for auto negotiation ticks code. No functional change.

ok brad@


Revision tags: OPENBSD_3_7_BASE
# 1.22 16-Dec-2004 brad

Make sure ifp->if_baudrate is valid when the parent's statchg
callback is made.

From NetBSD


# 1.21 18-Nov-2004 brad

add mii_phy_match() for table-driven lookup.

From NetBSD


# 1.20 27-Sep-2004 brad

ANSI protos and some minor cleanup

ok henning@


# 1.19 26-Sep-2004 brad

Restructure the PHY entry points to use a structure of
entry points instead of descrete function pointers, and
extend this to include a "reset" entry point. Make sure
any PHY-specific reset routine is always used.

From NetBSD

ok mcbride@


Revision tags: OPENBSD_3_6_BASE
# 1.18 02-Aug-2004 brad

more MII flags

From NetBSD


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 13-Oct-2003 krw

Bring bge and brgphy more up to date with changes from FreeBSD and NetBSD.

Some bug fixes, support for new hardware like the 5704 and 5705.

Testing by deraadt@, danh@, and drahn@ amoung others.

ok deraadt@.


# 1.16 26-Sep-2003 miod

Typos: defintion -> definition, proccess -> process

There are more occurences hiding in binutils, lynx and afs but I am too
lazy to report them upstream at the moment.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE UBC_SYNC_A UBC_SYNC_B
# 1.15 04-May-2002 fgsch

some space and tab cleanup.


Revision tags: OPENBSD_3_1_BASE
# 1.14 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.13 05-Oct-2001 nate

branches: 1.13.4;
Differentiate between 1000baseT and 1000baseX.
Add some support for gigabit control/status regs.


# 1.12 19-Aug-2001 miod

More old timeouts removal, mainly affected unused/unmaintained code.


# 1.11 25-Jun-2001 nate

Change autonegotiation timeout for devices with a gigabit phy to 10s. All
other devices default to 5 seconds. ok deraadt. from NetBSD.


# 1.10 08-Jun-2001 nate

Add some general support info for gigabit phys
Fix some comments
Remove some dead code
From NetBSD


# 1.9 03-May-2001 aaron

Add an MIIF_AUTOTSLEEP flag, needed by new aue(4) code. From NetBSD.


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.8 16-Oct-2000 aaron

Do not pass any flags to mii_attach() through the mii_phy_probe() wrapper.


# 1.7 26-Aug-2000 nate

sync mii code with netbsd
adds detach functionality for phys
some code cleanup

Nobody really had time to test all of this out, but theo said commit anyway


# 1.6 30-Jun-2000 art

Convert to new timeouts.


Revision tags: OPENBSD_2_7_BASE
# 1.5 24-Apr-2000 niklas

Add simple mii detach routine while waiting for the post-2.7
merge of NetBSD mii work


Revision tags: SMP_BASE kame_19991208
# 1.4 07-Dec-1999 jason

branches: 1.4.2;
Merge with NetBSD:
o move common support functions for phy drivers from mii.c to mii_physubr.c,
so that they are not includes if no PHY is configured
o Clean up the code that adds media a little, and make media selection
table-driven in preparation for some other changes to be made.
o Don't add any loopback versions of media, for now.
o Add mii_down(), which is used by MAC drivers to inform PHYs that the
interface is now down. PHYs use this to cancel pending asynchronous
operations.
o Add OUI for Enable Semiconductor.
o New Driver for TDK TSC78Q2120 PHY


Revision tags: OPENBSD_2_6_BASE
# 1.3 16-Jul-1999 jason

Sync with NetBSD:
o Implement asynchronous autonegotiation when driven by the MII tick
(one-second clock). Prevents .5s delays every 5 seconds when the interface
is up but there is no link.
o Correct the sense of the PCR_FLINK100 bit in nsphy.c.


Revision tags: OPENBSD_2_5_BASE
# 1.2 11-Nov-1998 jason

Merge with NetBSD:
o additional phy drivers (seeq, ics, level1)
o "unknown phy" driver for unsupported phys
o collected common code into mii_physubr
o exphy isn't the only phy that doesn't have valid id registers


Revision tags: OPENBSD_2_4_BASE
# 1.1 10-Sep-1998 jason

OpenBSD gets sys/dev/mii layer from NetBSD


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.34 12-Sep-2015 miod

mii_softc's view of the current mii state need to use the proper types
(ifmedia64).


# 1.33 11-Sep-2015 stsp

Make room for media types of the future. Extend the ifmedia word to 64 bits.
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.

Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.

There may be some MD fallout but that will be cleared up later.

ok deraadt miod
with help and suggestions from several sharks attending l2k15


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.32 28-Dec-2013 deraadt

mii drivers no longer need activate functions. Repair of the PHY
configuration setting is done at resume time because all networks
drivers which were previously up, do an IFF_UP operation which
hits PHY_RESET.
This was in snapshots for about 2 weeks.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.31 20-Apr-2010 deraadt

mii_activate() is unused


Revision tags: OPENBSD_4_7_BASE
# 1.30 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.29 08-Nov-2008 brad

Add a softc field mii_oui to store the OUI.


Revision tags: OPENBSD_4_4_BASE
# 1.28 26-Jun-2008 ray

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.27 28-Dec-2006 kettenis

Add function to detect flow control status. From NetBSD.

ok brad@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.26 06-Nov-2005 brad

move some macros from mii.h to miivar.h


Revision tags: OPENBSD_3_8_BASE
# 1.25 23-Jul-2005 brad

back out last commit, this causes problems on some systems.


# 1.24 22-Jul-2005 brad

Reading the IEEE specs shows that the bits have to be reversed when
mapping an OUI to the MII id registers.

From drochner NetBSD


# 1.23 26-Mar-2005 krw

Cleanup. Use defines, standard names, consistant comparison operators, etc.
for auto negotiation ticks code. No functional change.

ok brad@


Revision tags: OPENBSD_3_7_BASE
# 1.22 16-Dec-2004 brad

Make sure ifp->if_baudrate is valid when the parent's statchg
callback is made.

From NetBSD


# 1.21 18-Nov-2004 brad

add mii_phy_match() for table-driven lookup.

From NetBSD


# 1.20 27-Sep-2004 brad

ANSI protos and some minor cleanup

ok henning@


# 1.19 26-Sep-2004 brad

Restructure the PHY entry points to use a structure of
entry points instead of descrete function pointers, and
extend this to include a "reset" entry point. Make sure
any PHY-specific reset routine is always used.

From NetBSD

ok mcbride@


Revision tags: OPENBSD_3_6_BASE
# 1.18 02-Aug-2004 brad

more MII flags

From NetBSD


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 13-Oct-2003 krw

Bring bge and brgphy more up to date with changes from FreeBSD and NetBSD.

Some bug fixes, support for new hardware like the 5704 and 5705.

Testing by deraadt@, danh@, and drahn@ amoung others.

ok deraadt@.


# 1.16 26-Sep-2003 miod

Typos: defintion -> definition, proccess -> process

There are more occurences hiding in binutils, lynx and afs but I am too
lazy to report them upstream at the moment.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE UBC_SYNC_A UBC_SYNC_B
# 1.15 04-May-2002 fgsch

some space and tab cleanup.


Revision tags: OPENBSD_3_1_BASE
# 1.14 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.13 05-Oct-2001 nate

branches: 1.13.4;
Differentiate between 1000baseT and 1000baseX.
Add some support for gigabit control/status regs.


# 1.12 19-Aug-2001 miod

More old timeouts removal, mainly affected unused/unmaintained code.


# 1.11 25-Jun-2001 nate

Change autonegotiation timeout for devices with a gigabit phy to 10s. All
other devices default to 5 seconds. ok deraadt. from NetBSD.


# 1.10 08-Jun-2001 nate

Add some general support info for gigabit phys
Fix some comments
Remove some dead code
From NetBSD


# 1.9 03-May-2001 aaron

Add an MIIF_AUTOTSLEEP flag, needed by new aue(4) code. From NetBSD.


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.8 16-Oct-2000 aaron

Do not pass any flags to mii_attach() through the mii_phy_probe() wrapper.


# 1.7 26-Aug-2000 nate

sync mii code with netbsd
adds detach functionality for phys
some code cleanup

Nobody really had time to test all of this out, but theo said commit anyway


# 1.6 30-Jun-2000 art

Convert to new timeouts.


Revision tags: OPENBSD_2_7_BASE
# 1.5 24-Apr-2000 niklas

Add simple mii detach routine while waiting for the post-2.7
merge of NetBSD mii work


Revision tags: SMP_BASE kame_19991208
# 1.4 07-Dec-1999 jason

branches: 1.4.2;
Merge with NetBSD:
o move common support functions for phy drivers from mii.c to mii_physubr.c,
so that they are not includes if no PHY is configured
o Clean up the code that adds media a little, and make media selection
table-driven in preparation for some other changes to be made.
o Don't add any loopback versions of media, for now.
o Add mii_down(), which is used by MAC drivers to inform PHYs that the
interface is now down. PHYs use this to cancel pending asynchronous
operations.
o Add OUI for Enable Semiconductor.
o New Driver for TDK TSC78Q2120 PHY


Revision tags: OPENBSD_2_6_BASE
# 1.3 16-Jul-1999 jason

Sync with NetBSD:
o Implement asynchronous autonegotiation when driven by the MII tick
(one-second clock). Prevents .5s delays every 5 seconds when the interface
is up but there is no link.
o Correct the sense of the PCR_FLINK100 bit in nsphy.c.


Revision tags: OPENBSD_2_5_BASE
# 1.2 11-Nov-1998 jason

Merge with NetBSD:
o additional phy drivers (seeq, ics, level1)
o "unknown phy" driver for unsupported phys
o collected common code into mii_physubr
o exphy isn't the only phy that doesn't have valid id registers


Revision tags: OPENBSD_2_4_BASE
# 1.1 10-Sep-1998 jason

OpenBSD gets sys/dev/mii layer from NetBSD