git: 78c63ed260fa - main - net: if_media for 1000Base-BX BiDi

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Wed, 13 Nov 2024 05:27:50 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=78c63ed260fa20b3500aedfe41dc0dcae9593f51

commit 78c63ed260fa20b3500aedfe41dc0dcae9593f51
Author:     Tore Amundsen <tore@amundsen.org>
AuthorDate: 2024-11-13 05:08:06 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2024-11-13 05:27:32 +0000

    net: if_media for 1000Base-BX BiDi
    
    1000Base-BX uses two wavelengths, commonly 1310nm, 1490nm, 1550nm, or
    1590nm, in a Coarse Wavelength Division Multiplexing (CWDM) arrangement
    so that a single fiber strand may carry both upstream and downstream.
    It is sometimes referred to as BiDi for bi-directional usage of one
    fiber.
    
    Optics must be paired such that the RX and TX wavelengths cross over,
    with one side often called U(pstream) and the other D(ownstream).
    
    This technology is useful for increasing link density or working around
    construction issues, and is also frequently used as a last mile delivery
    technology for FTTx.
    
    MFC after:      3 days
    Sponsored by:   BBOX.io (review/commits)
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1518
---
 sys/net/ieee8023ad_lacp.c | 1 +
 sys/net/if_media.h        | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index c1e91f7fcb3e..be047c4913fc 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -1146,6 +1146,7 @@ lacp_compose_key(struct lacp_port *lp)
 		case IFM_1000_KX:
 		case IFM_1000_SGMII:
 		case IFM_1000_CX_SGMII:
+		case IFM_1000_BX:
 			key = IFM_1000_SX;
 			break;
 		case IFM_10G_LR:
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index c03a4c87b355..2b308ccfea25 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -258,6 +258,7 @@ uint64_t	ifmedia_baudrate(int);
 #define	IFM_400G_AUI8	IFM_X(117)	/* 400G-AUI8 */
 #define	IFM_50G_KR4	IFM_X(118)	/* 50GBase-KR4 */
 #define	IFM_40G_LM4	IFM_X(119)	/* 40GBase-LM4 */
+#define	IFM_1000_BX	IFM_X(120)	/* 1000Base-BX */
 
 /*
  * Please update ieee8023ad_lacp.c:lacp_compose_key()
@@ -442,6 +443,7 @@ struct ifmedia_description {
 	{ IFM_1000_SX,	"1000baseSX" },					\
 	{ IFM_1000_LX,	"1000baseLX" },					\
 	{ IFM_1000_CX,	"1000baseCX" },					\
+	{ IFM_1000_BX,	"1000baseBX" },					\
 	{ IFM_1000_T,	"1000baseT" },					\
 	{ IFM_HPNA_1,	"homePNA" },					\
 	{ IFM_10G_LR,	"10Gbase-LR" },					\
@@ -789,6 +791,7 @@ struct ifmedia_baudrate {
 	{ IFM_ETHER | IFM_10_FL,	IF_Mbps(10) },			\
 	{ IFM_ETHER | IFM_1000_LX,	IF_Mbps(1000) },		\
 	{ IFM_ETHER | IFM_1000_CX,	IF_Mbps(1000) },		\
+	{ IFM_ETHER | IFM_1000_BX,	IF_Mbps(1000) },		\
 	{ IFM_ETHER | IFM_1000_T,	IF_Mbps(1000) },		\
 	{ IFM_ETHER | IFM_HPNA_1,	IF_Mbps(1) },			\
 	{ IFM_ETHER | IFM_10G_LR,	IF_Gbps(10ULL) },		\