diff --git a/doc/connectivity/networking/api/8021Qav.rst b/doc/connectivity/networking/api/8021Qav.rst index dced6817ec25..094714f4939b 100644 --- a/doc/connectivity/networking/api/8021Qav.rst +++ b/doc/connectivity/networking/api/8021Qav.rst @@ -28,8 +28,8 @@ also priority queues ``ETHERNET_PRIORITY_QUEUES`` need to be supported. ARG_UNUSED(dev); return ETHERNET_QAV | ETHERNET_PRIORITY_QUEUES | - ETHERNET_HW_VLAN | ETHERNET_LINK_10BASE_T | - ETHERNET_LINK_100BASE_T; + ETHERNET_HW_VLAN | ETHERNET_LINK_10BASE | + ETHERNET_LINK_100BASE; } See ``sam-e70-xplained`` board Ethernet driver diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index 64beaab34c48..342e0c2d90f5 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -146,6 +146,20 @@ Ethernet :zephyr_file:`include/zephyr/net/ethernet.h` have been renamed to ``ETHERNET_DSA_CONDUIT_PORT`` and ``ETHERNET_DSA_USER_PORT``. +* Enums for the Ethernet speed have been renamed to be more indepedent of the used medium. + ``LINK_HALF_10BASE_T``, ``LINK_FULL_10BASE_T``, ``LINK_HALF_100BASE_T``, ``LINK_FULL_100BASE_T``, + ``LINK_HALF_1000BASE_T``, ``LINK_FULL_1000BASE_T``, ``LINK_FULL_2500BASE_T`` and + ``LINK_FULL_5000BASE_T`` have been renamed to :c:enumerator:`LINK_HALF_10BASE`, + :c:enumerator:`LINK_FULL_10BASE`, :c:enumerator:`LINK_HALF_100BASE`, + :c:enumerator:`LINK_FULL_100BASE`, :c:enumerator:`LINK_HALF_1000BASE`, + :c:enumerator:`LINK_FULL_1000BASE`, :c:enumerator:`LINK_FULL_2500BASE` and + :c:enumerator:`LINK_FULL_5000BASE`. + ``ETHERNET_LINK_10BASE_T``, ``ETHERNET_LINK_100BASE_T``, ``ETHERNET_LINK_1000BASE_T``, + ``ETHERNET_LINK_2500BASE_T`` and ``ETHERNET_LINK_5000BASE_T`` have been renamed to + :c:enumerator:`ETHERNET_LINK_10BASE`, :c:enumerator:`ETHERNET_LINK_100BASE`, + :c:enumerator:`ETHERNET_LINK_1000BASE`, :c:enumerator:`ETHERNET_LINK_2500BASE` and + :c:enumerator:`ETHERNET_LINK_5000BASE` respectively (:github:`87194`). + Enhanced Serial Peripheral Interface (eSPI) =========================================== diff --git a/drivers/ethernet/dsa/dsa_ksz8xxx.c b/drivers/ethernet/dsa/dsa_ksz8xxx.c index 41b3f45d3557..2c9a9b6337dd 100644 --- a/drivers/ethernet/dsa/dsa_ksz8xxx.c +++ b/drivers/ethernet/dsa/dsa_ksz8xxx.c @@ -1114,8 +1114,8 @@ static enum ethernet_hw_caps dsa_port_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_DSA_USER_PORT | ETHERNET_LINK_10BASE_T | - ETHERNET_LINK_100BASE_T; + return ETHERNET_DSA_USER_PORT | ETHERNET_LINK_10BASE | + ETHERNET_LINK_100BASE; } const struct ethernet_api dsa_eth_api_funcs = { diff --git a/drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c b/drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c index bc370eda2057..f76ad5a57795 100644 --- a/drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c +++ b/drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c @@ -1029,16 +1029,16 @@ static void phy_link_state_change_callback(const struct device *phy_dev, if (is_up) { /* Announce link up status */ switch (state->speed) { - case LINK_HALF_1000BASE_T: - case LINK_FULL_1000BASE_T: + case LINK_HALF_1000BASE: + case LINK_FULL_1000BASE: dev_data->link_speed = LINK_1GBIT; break; - case LINK_HALF_100BASE_T: - case LINK_FULL_100BASE_T: + case LINK_HALF_100BASE: + case LINK_FULL_100BASE: dev_data->link_speed = LINK_100MBIT; break; - case LINK_HALF_10BASE_T: - case LINK_FULL_10BASE_T: + case LINK_HALF_10BASE: + case LINK_FULL_10BASE: default: dev_data->link_speed = LINK_10MBIT; } @@ -1484,30 +1484,30 @@ static enum phy_link_speed get_phy_adv_speeds(bool auto_neg, bool duplex_mode, enum phy_link_speed adv_speeds = 0u; if (auto_neg) { - adv_speeds = LINK_HALF_1000BASE_T | LINK_HALF_1000BASE_T | LINK_HALF_100BASE_T | - LINK_FULL_100BASE_T | LINK_HALF_10BASE_T | LINK_FULL_10BASE_T; + adv_speeds = LINK_HALF_1000BASE | LINK_HALF_1000BASE | LINK_HALF_100BASE | + LINK_FULL_100BASE | LINK_HALF_10BASE | LINK_FULL_10BASE; } else { if (duplex_mode) { switch (link_speed) { case LINK_1GBIT: - adv_speeds = LINK_FULL_1000BASE_T; + adv_speeds = LINK_FULL_1000BASE; break; case LINK_100MBIT: - adv_speeds = LINK_FULL_100BASE_T; + adv_speeds = LINK_FULL_100BASE; break; default: - adv_speeds = LINK_FULL_10BASE_T; + adv_speeds = LINK_FULL_10BASE; } } else { switch (link_speed) { case LINK_1GBIT: - adv_speeds = LINK_HALF_1000BASE_T; + adv_speeds = LINK_HALF_1000BASE; break; case LINK_100MBIT: - adv_speeds = LINK_HALF_100BASE_T; + adv_speeds = LINK_HALF_100BASE; break; default: - adv_speeds = LINK_HALF_10BASE_T; + adv_speeds = LINK_HALF_10BASE; } } } @@ -1727,7 +1727,7 @@ static enum ethernet_hw_caps eth_dwc_xgmac_get_capabilities(const struct device ARG_UNUSED(dev); enum ethernet_hw_caps caps = (enum ethernet_hw_caps)0; - caps = (ETHERNET_LINK_1000BASE_T | ETHERNET_LINK_100BASE_T | ETHERNET_LINK_10BASE_T | + caps = (ETHERNET_LINK_1000BASE | ETHERNET_LINK_100BASE | ETHERNET_LINK_10BASE | ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_DUPLEX_SET); #ifdef CONFIG_ETH_DWC_XGMAC_RX_CS_OFFLOAD diff --git a/drivers/ethernet/eth_adin2111.c b/drivers/ethernet/eth_adin2111.c index 0f125fabc2d4..e4407d6cc1a5 100644 --- a/drivers/ethernet/eth_adin2111.c +++ b/drivers/ethernet/eth_adin2111.c @@ -1217,7 +1217,7 @@ static void adin2111_port_iface_init(struct net_if *iface) static enum ethernet_hw_caps adin2111_port_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | + return ETHERNET_LINK_10BASE | ETHERNET_HW_FILTERING #if defined(CONFIG_NET_LLDP) | ETHERNET_LLDP diff --git a/drivers/ethernet/eth_cyclonev.c b/drivers/ethernet/eth_cyclonev.c index 483516e684ab..a23e23c682b3 100644 --- a/drivers/ethernet/eth_cyclonev.c +++ b/drivers/ethernet/eth_cyclonev.c @@ -366,11 +366,11 @@ static enum ethernet_hw_caps eth_cyclonev_caps(const struct device *dev) enum ethernet_hw_caps caps = 0; if (p->feature & EMAC_DMA_HW_FEATURE_MIISEL) { - caps |= ETHERNET_LINK_10BASE_T; - caps |= ETHERNET_LINK_100BASE_T; + caps |= ETHERNET_LINK_10BASE; + caps |= ETHERNET_LINK_100BASE; } if (p->feature & EMAC_DMA_HW_FEATURE_GMIISEL) { - caps |= ETHERNET_LINK_1000BASE_T; + caps |= ETHERNET_LINK_1000BASE; } if (p->feature & EMAC_DMA_HW_FEATURE_RXTYP2COE) { caps |= ETHERNET_HW_RX_CHKSUM_OFFLOAD; diff --git a/drivers/ethernet/eth_dwmac.c b/drivers/ethernet/eth_dwmac.c index bc2f82e5a536..01cd84916aa5 100644 --- a/drivers/ethernet/eth_dwmac.c +++ b/drivers/ethernet/eth_dwmac.c @@ -102,11 +102,11 @@ static enum ethernet_hw_caps dwmac_caps(const struct device *dev) enum ethernet_hw_caps caps = 0; if (p->feature0 & MAC_HW_FEATURE0_GMIISEL) { - caps |= ETHERNET_LINK_1000BASE_T; + caps |= ETHERNET_LINK_1000BASE; } if (p->feature0 & MAC_HW_FEATURE0_MIISEL) { - caps |= ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + caps |= ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; } caps |= ETHERNET_PROMISC_MODE; diff --git a/drivers/ethernet/eth_e1000.c b/drivers/ethernet/eth_e1000.c index 178ceb5380d0..4de3ad8df9b1 100644 --- a/drivers/ethernet/eth_e1000.c +++ b/drivers/ethernet/eth_e1000.c @@ -82,8 +82,8 @@ static enum ethernet_hw_caps e1000_caps(const struct device *dev) #if defined(CONFIG_ETH_E1000_PTP_CLOCK) ETHERNET_PTP | #endif - ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | - ETHERNET_LINK_1000BASE_T | + ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | + ETHERNET_LINK_1000BASE | /* The driver does not really support TXTIME atm but mark * it to support it so that we can test the txtime sample. */ diff --git a/drivers/ethernet/eth_enc28j60.c b/drivers/ethernet/eth_enc28j60.c index e3c73c0ca4d7..0268661784f7 100644 --- a/drivers/ethernet/eth_enc28j60.c +++ b/drivers/ethernet/eth_enc28j60.c @@ -750,7 +750,7 @@ static enum ethernet_hw_caps eth_enc28j60_get_capabilities(const struct device * { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T + return ETHERNET_LINK_10BASE #if defined(CONFIG_NET_VLAN) | ETHERNET_HW_VLAN #endif diff --git a/drivers/ethernet/eth_enc424j600.c b/drivers/ethernet/eth_enc424j600.c index 0e317c3d8ba9..3f04022fe0e0 100644 --- a/drivers/ethernet/eth_enc424j600.c +++ b/drivers/ethernet/eth_enc424j600.c @@ -553,7 +553,7 @@ static enum ethernet_hw_caps enc424j600_get_capabilities(const struct device *de { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; } static int enc424j600_set_config(const struct device *dev, diff --git a/drivers/ethernet/eth_esp32.c b/drivers/ethernet/eth_esp32.c index c3fe85063d1c..4cd3d5b13d72 100644 --- a/drivers/ethernet/eth_esp32.c +++ b/drivers/ethernet/eth_esp32.c @@ -56,7 +56,7 @@ static const struct device *eth_esp32_phy_dev = DEVICE_DT_GET( static enum ethernet_hw_caps eth_esp32_caps(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; } static int eth_esp32_set_config(const struct device *dev, diff --git a/drivers/ethernet/eth_gecko.c b/drivers/ethernet/eth_gecko.c index 82c6e07b3f9a..5f2cbf34ad9e 100644 --- a/drivers/ethernet/eth_gecko.c +++ b/drivers/ethernet/eth_gecko.c @@ -631,8 +631,8 @@ static enum ethernet_hw_caps eth_gecko_get_capabilities(const struct device *dev { ARG_UNUSED(dev); - return (ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_LINK_10BASE_T | - ETHERNET_LINK_100BASE_T | ETHERNET_DUPLEX_SET); + return (ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_LINK_10BASE | + ETHERNET_LINK_100BASE | ETHERNET_DUPLEX_SET); } static const struct ethernet_api eth_api = { diff --git a/drivers/ethernet/eth_ivshmem.c b/drivers/ethernet/eth_ivshmem.c index ae8135f2e222..742d8e6089fe 100644 --- a/drivers/ethernet/eth_ivshmem.c +++ b/drivers/ethernet/eth_ivshmem.c @@ -88,7 +88,7 @@ static int eth_ivshmem_stop(const struct device *dev) static enum ethernet_hw_caps eth_ivshmem_caps(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | ETHERNET_LINK_1000BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | ETHERNET_LINK_1000BASE; } static int eth_ivshmem_send(const struct device *dev, struct net_pkt *pkt) diff --git a/drivers/ethernet/eth_lan865x.c b/drivers/ethernet/eth_lan865x.c index 3a3a0421e5d3..bdcb2ec553ed 100644 --- a/drivers/ethernet/eth_lan865x.c +++ b/drivers/ethernet/eth_lan865x.c @@ -112,7 +112,7 @@ static void lan865x_iface_init(struct net_if *iface) static enum ethernet_hw_caps lan865x_port_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_PROMISC_MODE; + return ETHERNET_LINK_10BASE | ETHERNET_PROMISC_MODE; } static int lan865x_gpio_reset(const struct device *dev); diff --git a/drivers/ethernet/eth_lan9250.c b/drivers/ethernet/eth_lan9250.c index 0e1d3d6e7445..1315c9325ac0 100644 --- a/drivers/ethernet/eth_lan9250.c +++ b/drivers/ethernet/eth_lan9250.c @@ -615,7 +615,7 @@ static enum ethernet_hw_caps lan9250_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; } static void lan9250_iface_init(struct net_if *iface) diff --git a/drivers/ethernet/eth_litex_liteeth.c b/drivers/ethernet/eth_litex_liteeth.c index 1a2b60098321..2eb8cbef2552 100644 --- a/drivers/ethernet/eth_litex_liteeth.c +++ b/drivers/ethernet/eth_litex_liteeth.c @@ -294,7 +294,7 @@ static enum ethernet_hw_caps eth_caps(const struct device *dev) #ifdef CONFIG_NET_VLAN ETHERNET_HW_VLAN | #endif - ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | ETHERNET_LINK_1000BASE_T; + ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | ETHERNET_LINK_1000BASE; } static const struct ethernet_api eth_api = { diff --git a/drivers/ethernet/eth_numaker.c b/drivers/ethernet/eth_numaker.c index 80b807e8f8bd..8e6aa6bf2eec 100644 --- a/drivers/ethernet/eth_numaker.c +++ b/drivers/ethernet/eth_numaker.c @@ -552,9 +552,9 @@ static enum ethernet_hw_caps numaker_eth_get_cap(const struct device *dev) { ARG_UNUSED(dev); #if defined(NU_USING_HW_CHECKSUM) - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | ETHERNET_HW_RX_CHKSUM_OFFLOAD; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | ETHERNET_HW_RX_CHKSUM_OFFLOAD; #else - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; #endif } diff --git a/drivers/ethernet/eth_nxp_enet.c b/drivers/ethernet/eth_nxp_enet.c index df5588a4b051..839f40f39639 100644 --- a/drivers/ethernet/eth_nxp_enet.c +++ b/drivers/ethernet/eth_nxp_enet.c @@ -252,7 +252,7 @@ static enum ethernet_hw_caps eth_nxp_enet_get_capabilities(const struct device * #endif enum ethernet_hw_caps caps; - caps = ETHERNET_LINK_10BASE_T | + caps = ETHERNET_LINK_10BASE | ETHERNET_HW_FILTERING | #if defined(CONFIG_NET_VLAN) ETHERNET_HW_VLAN | @@ -267,11 +267,11 @@ static enum ethernet_hw_caps eth_nxp_enet_get_capabilities(const struct device * ETHERNET_HW_TX_CHKSUM_OFFLOAD | ETHERNET_HW_RX_CHKSUM_OFFLOAD | #endif - ETHERNET_LINK_100BASE_T; + ETHERNET_LINK_100BASE; if (COND_CODE_1(IS_ENABLED(CONFIG_ETH_NXP_ENET_1G), (config->phy_mode == NXP_ENET_RGMII_MODE), (0))) { - caps |= ETHERNET_LINK_1000BASE_T; + caps |= ETHERNET_LINK_1000BASE; } return caps; @@ -459,14 +459,14 @@ static void eth_nxp_enet_rx_thread(struct k_work *work) static int nxp_enet_phy_configure(const struct device *phy, uint8_t phy_mode) { - enum phy_link_speed speeds = LINK_HALF_10BASE_T | LINK_FULL_10BASE_T | - LINK_HALF_100BASE_T | LINK_FULL_100BASE_T; + enum phy_link_speed speeds = LINK_HALF_10BASE | LINK_FULL_10BASE | + LINK_HALF_100BASE | LINK_FULL_100BASE; int ret; struct phy_link_state state; if (COND_CODE_1(IS_ENABLED(CONFIG_ETH_NXP_ENET_1G), (phy_mode == NXP_ENET_RGMII_MODE), (0))) { - speeds |= (LINK_HALF_1000BASE_T | LINK_FULL_1000BASE_T); + speeds |= (LINK_HALF_1000BASE | LINK_FULL_1000BASE); } /* Configure the PHY */ diff --git a/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c b/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c index bd2b4f59de23..c90e96f309ee 100644 --- a/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c +++ b/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c @@ -161,7 +161,7 @@ static void tx_dma_done(struct k_work *work) static enum ethernet_hw_caps eth_nxp_enet_qos_get_capabilities(const struct device *dev) { - return ETHERNET_LINK_100BASE_T | ETHERNET_LINK_10BASE_T | ENET_MAC_PACKET_FILTER_PM_MASK; + return ETHERNET_LINK_100BASE | ETHERNET_LINK_10BASE | ENET_MAC_PACKET_FILTER_PM_MASK; } static void eth_nxp_enet_qos_rx(struct k_work *work) diff --git a/drivers/ethernet/eth_nxp_s32_gmac.c b/drivers/ethernet/eth_nxp_s32_gmac.c index f6eaa950a98f..e81713db736f 100644 --- a/drivers/ethernet/eth_nxp_s32_gmac.c +++ b/drivers/ethernet/eth_nxp_s32_gmac.c @@ -71,27 +71,27 @@ static inline struct net_if *get_iface(struct eth_nxp_s32_data *ctx) static void convert_phy_to_mac_config(Gmac_Ip_ConfigType *gmac_cfg, enum phy_link_speed phy_speed) { switch (phy_speed) { - case LINK_HALF_10BASE_T: + case LINK_HALF_10BASE: gmac_cfg->Speed = GMAC_SPEED_10M; gmac_cfg->Duplex = GMAC_HALF_DUPLEX; break; - case LINK_FULL_10BASE_T: + case LINK_FULL_10BASE: gmac_cfg->Speed = GMAC_SPEED_10M; gmac_cfg->Duplex = GMAC_FULL_DUPLEX; break; - case LINK_HALF_100BASE_T: + case LINK_HALF_100BASE: gmac_cfg->Speed = GMAC_SPEED_100M; gmac_cfg->Duplex = GMAC_HALF_DUPLEX; break; - case LINK_FULL_100BASE_T: + case LINK_FULL_100BASE: gmac_cfg->Speed = GMAC_SPEED_100M; gmac_cfg->Duplex = GMAC_FULL_DUPLEX; break; - case LINK_HALF_1000BASE_T: + case LINK_HALF_1000BASE: gmac_cfg->Speed = GMAC_SPEED_1G; gmac_cfg->Duplex = GMAC_HALF_DUPLEX; break; - case LINK_FULL_1000BASE_T: + case LINK_FULL_1000BASE: __fallthrough; default: gmac_cfg->Speed = GMAC_SPEED_1G; @@ -559,10 +559,10 @@ static enum ethernet_hw_caps eth_nxp_s32_get_capabilities(const struct device *d { ARG_UNUSED(dev); - return (ETHERNET_LINK_10BASE_T - | ETHERNET_LINK_100BASE_T + return (ETHERNET_LINK_10BASE + | ETHERNET_LINK_100BASE #if (FEATURE_GMAC_RGMII_EN == 1U) - | ETHERNET_LINK_1000BASE_T + | ETHERNET_LINK_1000BASE #endif | ETHERNET_DUPLEX_SET | ETHERNET_HW_TX_CHKSUM_OFFLOAD diff --git a/drivers/ethernet/eth_nxp_s32_netc.c b/drivers/ethernet/eth_nxp_s32_netc.c index 852d37b43435..9a5ddd745d3d 100644 --- a/drivers/ethernet/eth_nxp_s32_netc.c +++ b/drivers/ethernet/eth_nxp_s32_netc.c @@ -267,9 +267,9 @@ enum ethernet_hw_caps nxp_s32_eth_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return (ETHERNET_LINK_10BASE_T - | ETHERNET_LINK_100BASE_T - | ETHERNET_LINK_1000BASE_T + return (ETHERNET_LINK_10BASE + | ETHERNET_LINK_100BASE + | ETHERNET_LINK_1000BASE | ETHERNET_HW_RX_CHKSUM_OFFLOAD | ETHERNET_HW_FILTERING #if defined(CONFIG_NET_VLAN) diff --git a/drivers/ethernet/eth_renesas_ra.c b/drivers/ethernet/eth_renesas_ra.c index 809d0d189e67..84dcad293e9f 100644 --- a/drivers/ethernet/eth_renesas_ra.c +++ b/drivers/ethernet/eth_renesas_ra.c @@ -134,7 +134,7 @@ static enum ethernet_hw_caps renesas_ra_eth_get_capabilities(const struct device { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; } void renesas_ra_eth_callback(ether_callback_args_t *p_args) @@ -187,23 +187,23 @@ static void phy_link_state_changed(const struct device *pdev, struct phy_link_st switch (state->speed) { /* Half duplex link */ - case LINK_HALF_100BASE_T: { + case LINK_HALF_100BASE: { ctx->ctrl.link_speed_duplex = ETHER_PHY_LINK_SPEED_100H; break; } - case LINK_HALF_10BASE_T: { + case LINK_HALF_10BASE: { ctx->ctrl.link_speed_duplex = ETHER_PHY_LINK_SPEED_10H; break; } /* Full duplex link */ - case LINK_FULL_100BASE_T: { + case LINK_FULL_100BASE: { ctx->ctrl.link_speed_duplex = ETHER_PHY_LINK_SPEED_100F; break; } - case LINK_FULL_10BASE_T: { + case LINK_FULL_10BASE: { ctx->ctrl.link_speed_duplex = ETHER_PHY_LINK_SPEED_10F; break; } diff --git a/drivers/ethernet/eth_sam_gmac.c b/drivers/ethernet/eth_sam_gmac.c index e81edb7daea6..884f0caf425c 100644 --- a/drivers/ethernet/eth_sam_gmac.c +++ b/drivers/ethernet/eth_sam_gmac.c @@ -1917,7 +1917,7 @@ static enum ethernet_hw_caps eth_sam_gmac_get_capabilities(const struct device * { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | + return ETHERNET_LINK_10BASE | #if defined(CONFIG_NET_VLAN) ETHERNET_HW_VLAN | #endif @@ -1928,7 +1928,7 @@ static enum ethernet_hw_caps eth_sam_gmac_get_capabilities(const struct device * #if GMAC_ACTIVE_PRIORITY_QUEUE_NUM >= 1 ETHERNET_QAV | #endif - ETHERNET_LINK_100BASE_T; + ETHERNET_LINK_100BASE; } #if GMAC_ACTIVE_PRIORITY_QUEUE_NUM >= 1 diff --git a/drivers/ethernet/eth_sensry_sy1xx_mac.c b/drivers/ethernet/eth_sensry_sy1xx_mac.c index 6a885cbc9134..c35833837639 100644 --- a/drivers/ethernet/eth_sensry_sy1xx_mac.c +++ b/drivers/ethernet/eth_sensry_sy1xx_mac.c @@ -261,19 +261,19 @@ static void phy_link_state_changed(const struct device *pdev, struct phy_link_st (SY1XX_MAC_CTRL_CLK_DIV_MASK << SY1XX_MAC_CTRL_CLK_DIV_OFFS)); switch (speed) { - case LINK_FULL_10BASE_T: + case LINK_FULL_10BASE: LOG_INF("link speed FULL_10BASE_T"); /* 2.5MHz, MAC is clock source */ v |= (SY1XX_MAC_CTRL_CLK_SEL_MII_CLK << SY1XX_MAC_CTRL_CLK_SEL_OFFS) | (SY1XX_MAC_CTRL_CLK_DIV_10 << SY1XX_MAC_CTRL_CLK_DIV_OFFS); break; - case LINK_FULL_100BASE_T: + case LINK_FULL_100BASE: LOG_INF("link speed FULL_100BASE_T"); /* 25MHz, MAC is clock source */ v |= (SY1XX_MAC_CTRL_CLK_SEL_MII_CLK << SY1XX_MAC_CTRL_CLK_SEL_OFFS) | (SY1XX_MAC_CTRL_CLK_DIV_1 << SY1XX_MAC_CTRL_CLK_DIV_OFFS); break; - case LINK_FULL_1000BASE_T: + case LINK_FULL_1000BASE: LOG_INF("link speed FULL_1000BASE_T"); /* 125MHz, Phy is clock source */ v |= BIT(SY1XX_MAC_CTRL_GMII_OFFS) | @@ -346,7 +346,7 @@ static enum ethernet_hw_caps sy1xx_mac_get_caps(const struct device *dev) /* basic implemented features */ supported |= ETHERNET_PROMISC_MODE; - supported |= ETHERNET_LINK_1000BASE_T; + supported |= ETHERNET_LINK_1000BASE; supported |= ETHERNET_PROMISC_MODE; return supported; diff --git a/drivers/ethernet/eth_smsc911x.c b/drivers/ethernet/eth_smsc911x.c index b1a9fbd4341a..39e93951bba1 100644 --- a/drivers/ethernet/eth_smsc911x.c +++ b/drivers/ethernet/eth_smsc911x.c @@ -416,7 +416,7 @@ static enum ethernet_hw_caps eth_smsc911x_get_capabilities(const struct device * { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T; + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE; } #if defined(CONFIG_NET_STATISTICS_ETHERNET) diff --git a/drivers/ethernet/eth_smsc91x.c b/drivers/ethernet/eth_smsc91x.c index c04e625ede2e..a21c28804268 100644 --- a/drivers/ethernet/eth_smsc91x.c +++ b/drivers/ethernet/eth_smsc91x.c @@ -688,8 +688,8 @@ static enum ethernet_hw_caps eth_smsc_get_caps(const struct device *dev) { ARG_UNUSED(dev); - return (ETHERNET_LINK_10BASE_T - | ETHERNET_LINK_100BASE_T + return (ETHERNET_LINK_10BASE + | ETHERNET_LINK_100BASE #if defined(CONFIG_NET_PROMISCUOUS_MODE) | ETHERNET_PROMISC_MODE #endif diff --git a/drivers/ethernet/eth_stm32_hal.c b/drivers/ethernet/eth_stm32_hal.c index 0b7286b663eb..dafa4e9dab6a 100644 --- a/drivers/ethernet/eth_stm32_hal.c +++ b/drivers/ethernet/eth_stm32_hal.c @@ -1264,7 +1264,7 @@ static enum ethernet_hw_caps eth_stm32_hal_get_capabilities(const struct device { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE #if defined(CONFIG_NET_VLAN) | ETHERNET_HW_VLAN #endif diff --git a/drivers/ethernet/eth_w5500.c b/drivers/ethernet/eth_w5500.c index d7a06b6ec5c1..61ed576e9c97 100644 --- a/drivers/ethernet/eth_w5500.c +++ b/drivers/ethernet/eth_w5500.c @@ -370,7 +370,7 @@ static enum ethernet_hw_caps w5500_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T + return ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE #if defined(CONFIG_NET_PROMISCUOUS_MODE) | ETHERNET_PROMISC_MODE #endif diff --git a/drivers/ethernet/eth_xilinx_axienet.c b/drivers/ethernet/eth_xilinx_axienet.c index 0292fd95eb9d..a9f7dbc0786b 100644 --- a/drivers/ethernet/eth_xilinx_axienet.c +++ b/drivers/ethernet/eth_xilinx_axienet.c @@ -356,8 +356,8 @@ static void xilinx_axienet_isr(const struct device *dev) static enum ethernet_hw_caps xilinx_axienet_caps(const struct device *dev) { const struct xilinx_axienet_config *config = dev->config; - enum ethernet_hw_caps ret = ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | - ETHERNET_LINK_1000BASE_T; + enum ethernet_hw_caps ret = ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | + ETHERNET_LINK_1000BASE; if (config->have_rx_csum_offload) { ret |= ETHERNET_HW_RX_CHKSUM_OFFLOAD; @@ -529,8 +529,8 @@ static int xilinx_axienet_probe(const struct device *dev) XILINX_AXIENET_RECEIVER_CONFIGURATION_FLOW_CONTROL_EN_MASK); /* at time of writing, hardware does not support half duplex */ - err = phy_configure_link(config->phy, LINK_FULL_10BASE_T | LINK_FULL_100BASE_T | - LINK_FULL_1000BASE_T); + err = phy_configure_link(config->phy, LINK_FULL_10BASE | LINK_FULL_100BASE | + LINK_FULL_1000BASE); if (err) { LOG_WRN("Could not configure PHY: %d", -err); } diff --git a/drivers/ethernet/eth_xlnx_gem.c b/drivers/ethernet/eth_xlnx_gem.c index 499781c78797..79c3f005497a 100644 --- a/drivers/ethernet/eth_xlnx_gem.c +++ b/drivers/ethernet/eth_xlnx_gem.c @@ -622,21 +622,19 @@ static enum ethernet_hw_caps eth_xlnx_gem_get_capabilities( if (dev_conf->max_link_speed == LINK_1GBIT) { if (dev_conf->phy_advertise_lower) { - caps |= (ETHERNET_LINK_1000BASE_T | - ETHERNET_LINK_100BASE_T | - ETHERNET_LINK_10BASE_T); + caps |= (ETHERNET_LINK_1000BASE | ETHERNET_LINK_100BASE | + ETHERNET_LINK_10BASE); } else { - caps |= ETHERNET_LINK_1000BASE_T; + caps |= ETHERNET_LINK_1000BASE; } } else if (dev_conf->max_link_speed == LINK_100MBIT) { if (dev_conf->phy_advertise_lower) { - caps |= (ETHERNET_LINK_100BASE_T | - ETHERNET_LINK_10BASE_T); + caps |= (ETHERNET_LINK_100BASE | ETHERNET_LINK_10BASE); } else { - caps |= ETHERNET_LINK_100BASE_T; + caps |= ETHERNET_LINK_100BASE; } } else { - caps |= ETHERNET_LINK_10BASE_T; + caps |= ETHERNET_LINK_10BASE; } if (dev_conf->enable_rx_chksum_offload) { diff --git a/drivers/ethernet/eth_xmc4xxx.c b/drivers/ethernet/eth_xmc4xxx.c index 02382e681d79..2a4637a9c71c 100644 --- a/drivers/ethernet/eth_xmc4xxx.c +++ b/drivers/ethernet/eth_xmc4xxx.c @@ -884,7 +884,7 @@ static int eth_xmc4xxx_init(const struct device *dev) static enum ethernet_hw_caps eth_xmc4xxx_capabilities(const struct device *dev) { ARG_UNUSED(dev); - enum ethernet_hw_caps caps = ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | + enum ethernet_hw_caps caps = ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | ETHERNET_HW_TX_CHKSUM_OFFLOAD | ETHERNET_HW_RX_CHKSUM_OFFLOAD; #if defined(CONFIG_PTP_CLOCK_XMC4XXX) diff --git a/drivers/ethernet/nxp_imx_netc/eth_nxp_imx_netc.c b/drivers/ethernet/nxp_imx_netc/eth_nxp_imx_netc.c index 97c8463135c7..8e8d4bf0b9e3 100644 --- a/drivers/ethernet/nxp_imx_netc/eth_nxp_imx_netc.c +++ b/drivers/ethernet/nxp_imx_netc/eth_nxp_imx_netc.c @@ -340,7 +340,7 @@ enum ethernet_hw_caps netc_eth_get_capabilities(const struct device *dev) { uint32_t caps; - caps = (ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T | ETHERNET_LINK_1000BASE_T | + caps = (ETHERNET_LINK_10BASE | ETHERNET_LINK_100BASE | ETHERNET_LINK_1000BASE | ETHERNET_HW_RX_CHKSUM_OFFLOAD | ETHERNET_HW_FILTERING #if defined(CONFIG_NET_VLAN) | ETHERNET_HW_VLAN diff --git a/drivers/ethernet/phy/phy_adin2111.c b/drivers/ethernet/phy/phy_adin2111.c index 1b7a042d9d44..0ded18cf90c5 100644 --- a/drivers/ethernet/phy/phy_adin2111.c +++ b/drivers/ethernet/phy/phy_adin2111.c @@ -353,7 +353,7 @@ static int phy_adin2111_cfg_link(const struct device *dev, { ARG_UNUSED(dev); - if (!!(adv_speeds & LINK_FULL_10BASE_T)) { + if (!!(adv_speeds & LINK_FULL_10BASE)) { return 0; } @@ -449,7 +449,7 @@ static int phy_adin2111_init(const struct device *dev) data->dev = dev; data->state.is_up = false; - data->state.speed = LINK_FULL_10BASE_T; + data->state.speed = LINK_FULL_10BASE; /* * For adin1100 and further mii stuff, diff --git a/drivers/ethernet/phy/phy_dm8806.c b/drivers/ethernet/phy/phy_dm8806.c index 34f09bb975f8..b53daecf7fa3 100644 --- a/drivers/ethernet/phy/phy_dm8806.c +++ b/drivers/ethernet/phy/phy_dm8806.c @@ -498,16 +498,16 @@ static int phy_dm8806_get_link_state(const struct device *dev, struct phy_link_s status >>= DM8806_SPEED_AND_DUPLEX_OFFSET; switch (status & DM8806_SPEED_AND_DUPLEX_MASK) { case DM8806_SPEED_10MBPS_HALF_DUPLEX: - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; break; case DM8806_SPEED_10MBPS_FULL_DUPLEX: - state->speed = LINK_FULL_10BASE_T; + state->speed = LINK_FULL_10BASE; break; case DM8806_SPEED_100MBPS_HALF_DUPLEX: - state->speed = LINK_HALF_100BASE_T; + state->speed = LINK_HALF_100BASE; break; case DM8806_SPEED_100MBPS_FULL_DUPLEX: - state->speed = LINK_FULL_100BASE_T; + state->speed = LINK_FULL_100BASE; break; } /* Extract link status from Switch Per-Port Register: Per Port Status Data @@ -531,19 +531,19 @@ static int phy_dm8806_cfg_link(const struct device *dev, enum phy_link_speed adv req_speed = adv_speeds; switch (req_speed) { - case LINK_HALF_10BASE_T: + case LINK_HALF_10BASE: req_speed = DM8806_MODE_10_BASET_HALF_DUPLEX; break; - case LINK_FULL_10BASE_T: + case LINK_FULL_10BASE: req_speed = DM8806_MODE_10_BASET_FULL_DUPLEX; break; - case LINK_HALF_100BASE_T: + case LINK_HALF_100BASE: req_speed = DM8806_MODE_100_BASET_HALF_DUPLEX; break; - case LINK_FULL_100BASE_T: + case LINK_FULL_100BASE: req_speed = DM8806_MODE_100_BASET_FULL_DUPLEX; break; } diff --git a/drivers/ethernet/phy/phy_microchip_ksz8081.c b/drivers/ethernet/phy/phy_microchip_ksz8081.c index d580ffd42a0f..04ffafef7633 100644 --- a/drivers/ethernet/phy/phy_microchip_ksz8081.c +++ b/drivers/ethernet/phy/phy_microchip_ksz8081.c @@ -186,13 +186,13 @@ static int phy_mc_ksz8081_get_link(const struct device *dev, uint32_t mutual_capabilities = anar & anlpar; if (mutual_capabilities & MII_ADVERTISE_100_FULL) { - state->speed = LINK_FULL_100BASE_T; + state->speed = LINK_FULL_100BASE; } else if (mutual_capabilities & MII_ADVERTISE_100_HALF) { - state->speed = LINK_HALF_100BASE_T; + state->speed = LINK_HALF_100BASE; } else if (mutual_capabilities & MII_ADVERTISE_10_FULL) { - state->speed = LINK_FULL_10BASE_T; + state->speed = LINK_FULL_10BASE; } else if (mutual_capabilities & MII_ADVERTISE_10_HALF) { - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; } else { ret = -EIO; } @@ -365,22 +365,22 @@ static int phy_mc_ksz8081_cfg_link(const struct device *dev, } /* Setup advertising register */ - if (speeds & LINK_FULL_100BASE_T) { + if (speeds & LINK_FULL_100BASE) { anar |= MII_ADVERTISE_100_FULL; } else { anar &= ~MII_ADVERTISE_100_FULL; } - if (speeds & LINK_HALF_100BASE_T) { + if (speeds & LINK_HALF_100BASE) { anar |= MII_ADVERTISE_100_HALF; } else { anar &= ~MII_ADVERTISE_100_HALF; } - if (speeds & LINK_FULL_10BASE_T) { + if (speeds & LINK_FULL_10BASE) { anar |= MII_ADVERTISE_10_FULL; } else { anar &= ~MII_ADVERTISE_10_FULL; } - if (speeds & LINK_HALF_10BASE_T) { + if (speeds & LINK_HALF_10BASE) { anar |= MII_ADVERTISE_10_HALF; } else { anar &= ~MII_ADVERTISE_10_HALF; diff --git a/drivers/ethernet/phy/phy_microchip_t1s.c b/drivers/ethernet/phy/phy_microchip_t1s.c index 98ab971545fc..39489ac0df60 100644 --- a/drivers/ethernet/phy/phy_microchip_t1s.c +++ b/drivers/ethernet/phy/phy_microchip_t1s.c @@ -193,7 +193,7 @@ static int phy_mc_t1s_get_link(const struct device *dev, struct phy_link_state * } state->is_up = value & MII_BMSR_LINK_STATUS; - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; if (memcmp(&old_state, state, sizeof(struct phy_link_state)) != 0) { if (state->is_up) { @@ -424,7 +424,7 @@ static int phy_mc_t1s_cfg_link(const struct device *dev, enum phy_link_speed spe { ARG_UNUSED(dev); - if (speeds & LINK_HALF_10BASE_T) { + if (speeds & LINK_HALF_10BASE) { return 0; } diff --git a/drivers/ethernet/phy/phy_microchip_vsc8541.c b/drivers/ethernet/phy/phy_microchip_vsc8541.c index 9a0c3267f6b1..121418fd52b1 100644 --- a/drivers/ethernet/phy/phy_microchip_vsc8541.c +++ b/drivers/ethernet/phy/phy_microchip_vsc8541.c @@ -297,22 +297,22 @@ static int phy_mc_vsc8541_get_speed(const struct device *dev, struct phy_link_st if ((status & (1 << 2)) == 0) { /* no link */ - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; } if ((status & (1 << 5)) == 0) { /* auto negotiation not yet complete */ - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; } if ((link1000_status & (1 << 12))) { - state->speed = LINK_FULL_1000BASE_T; + state->speed = LINK_FULL_1000BASE; } if (link100_status & (1 << 12)) { - state->speed = LINK_FULL_100BASE_T; + state->speed = LINK_FULL_100BASE; } if (link10_status & (1 << 6)) { - state->speed = LINK_FULL_10BASE_T; + state->speed = LINK_FULL_10BASE; } return 0; @@ -329,7 +329,7 @@ static int phy_mc_vsc8541_init(const struct device *dev) data->cb = NULL; data->cb_data = NULL; data->state.is_up = false; - data->state.speed = LINK_HALF_10BASE_T; + data->state.speed = LINK_HALF_10BASE; data->active_page = -1; /* Reset PHY */ @@ -392,7 +392,7 @@ static int phy_mc_vsc8541_get_link(const struct device *dev, struct phy_link_sta } } else { state->is_up = 0; - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; } return 0; diff --git a/drivers/ethernet/phy/phy_mii.c b/drivers/ethernet/phy/phy_mii.c index b2abf474d9e1..ba56dd95942e 100644 --- a/drivers/ethernet/phy/phy_mii.c +++ b/drivers/ethernet/phy/phy_mii.c @@ -261,18 +261,18 @@ static int check_autonegotiation_completion(const struct device *dev) if (data->gigabit_supported && ((c1kt_reg & s1kt_reg) & MII_ADVERTISE_1000_FULL)) { - data->state.speed = LINK_FULL_1000BASE_T; + data->state.speed = LINK_FULL_1000BASE; } else if (data->gigabit_supported && ((c1kt_reg & s1kt_reg) & MII_ADVERTISE_1000_HALF)) { - data->state.speed = LINK_HALF_1000BASE_T; + data->state.speed = LINK_HALF_1000BASE; } else if ((anar_reg & anlpar_reg) & MII_ADVERTISE_100_FULL) { - data->state.speed = LINK_FULL_100BASE_T; + data->state.speed = LINK_FULL_100BASE; } else if ((anar_reg & anlpar_reg) & MII_ADVERTISE_100_HALF) { - data->state.speed = LINK_HALF_100BASE_T; + data->state.speed = LINK_HALF_100BASE; } else if ((anar_reg & anlpar_reg) & MII_ADVERTISE_10_FULL) { - data->state.speed = LINK_FULL_10BASE_T; + data->state.speed = LINK_FULL_10BASE; } else { - data->state.speed = LINK_HALF_10BASE_T; + data->state.speed = LINK_HALF_10BASE; } LOG_INF("PHY (%d) Link speed %s Mb, %s duplex", @@ -411,38 +411,38 @@ static int phy_mii_cfg_link(const struct device *dev, } } - if (adv_speeds & LINK_FULL_10BASE_T) { + if (adv_speeds & LINK_FULL_10BASE) { anar_reg |= MII_ADVERTISE_10_FULL; } else { anar_reg &= ~MII_ADVERTISE_10_FULL; } - if (adv_speeds & LINK_HALF_10BASE_T) { + if (adv_speeds & LINK_HALF_10BASE) { anar_reg |= MII_ADVERTISE_10_HALF; } else { anar_reg &= ~MII_ADVERTISE_10_HALF; } - if (adv_speeds & LINK_FULL_100BASE_T) { + if (adv_speeds & LINK_FULL_100BASE) { anar_reg |= MII_ADVERTISE_100_FULL; } else { anar_reg &= ~MII_ADVERTISE_100_FULL; } - if (adv_speeds & LINK_HALF_100BASE_T) { + if (adv_speeds & LINK_HALF_100BASE) { anar_reg |= MII_ADVERTISE_100_HALF; } else { anar_reg &= ~MII_ADVERTISE_100_HALF; } if (data->gigabit_supported) { - if (adv_speeds & LINK_FULL_1000BASE_T) { + if (adv_speeds & LINK_FULL_1000BASE) { c1kt_reg |= MII_ADVERTISE_1000_FULL; } else { c1kt_reg &= ~MII_ADVERTISE_1000_FULL; } - if (adv_speeds & LINK_HALF_1000BASE_T) { + if (adv_speeds & LINK_HALF_1000BASE) { c1kt_reg |= MII_ADVERTISE_1000_HALF; } else { c1kt_reg &= ~MII_ADVERTISE_1000_HALF; @@ -515,12 +515,12 @@ static int phy_mii_initialize(const struct device *dev) */ if (cfg->fixed) { const static int speed_to_phy_link_speed[] = { - LINK_HALF_10BASE_T, - LINK_FULL_10BASE_T, - LINK_HALF_100BASE_T, - LINK_FULL_100BASE_T, - LINK_HALF_1000BASE_T, - LINK_FULL_1000BASE_T, + LINK_HALF_10BASE, + LINK_FULL_10BASE, + LINK_HALF_100BASE, + LINK_FULL_100BASE, + LINK_HALF_1000BASE, + LINK_FULL_1000BASE, }; data->state.speed = speed_to_phy_link_speed[cfg->fixed_speed]; @@ -548,12 +548,12 @@ static int phy_mii_initialize(const struct device *dev) data->gigabit_supported = is_gigabit_supported(dev); /* Advertise all speeds */ - phy_mii_cfg_link(dev, LINK_HALF_10BASE_T | - LINK_FULL_10BASE_T | - LINK_HALF_100BASE_T | - LINK_FULL_100BASE_T | - LINK_HALF_1000BASE_T | - LINK_FULL_1000BASE_T); + phy_mii_cfg_link(dev, LINK_HALF_10BASE | + LINK_FULL_10BASE | + LINK_HALF_100BASE | + LINK_FULL_100BASE | + LINK_HALF_1000BASE | + LINK_FULL_1000BASE); k_work_init_delayable(&data->monitor_work, monitor_work_handler); diff --git a/drivers/ethernet/phy/phy_qualcomm_ar8031.c b/drivers/ethernet/phy/phy_qualcomm_ar8031.c index a342a0e1e045..04cf0feb4b34 100644 --- a/drivers/ethernet/phy/phy_qualcomm_ar8031.c +++ b/drivers/ethernet/phy/phy_qualcomm_ar8031.c @@ -188,22 +188,22 @@ static int qc_ar8031_update_link_state(const struct device *dev) switch (speed | duplex) { case PHY_SPEED_10M | PHY_DUPLEX_FULL: - data->state.speed = LINK_FULL_10BASE_T; + data->state.speed = LINK_FULL_10BASE; break; case PHY_SPEED_10M | PHY_DUPLEX_HALF: - data->state.speed = LINK_HALF_10BASE_T; + data->state.speed = LINK_HALF_10BASE; break; case PHY_SPEED_100M | PHY_DUPLEX_FULL: - data->state.speed = LINK_FULL_100BASE_T; + data->state.speed = LINK_FULL_100BASE; break; case PHY_SPEED_100M | PHY_DUPLEX_HALF: - data->state.speed = LINK_HALF_100BASE_T; + data->state.speed = LINK_HALF_100BASE; break; case PHY_SPEED_1000M | PHY_DUPLEX_FULL: - data->state.speed = LINK_FULL_1000BASE_T; + data->state.speed = LINK_FULL_1000BASE; break; case PHY_SPEED_1000M | PHY_DUPLEX_HALF: - data->state.speed = LINK_HALF_1000BASE_T; + data->state.speed = LINK_HALF_1000BASE; break; } @@ -271,37 +271,37 @@ static int qc_ar8031_cfg_link(const struct device *dev, enum phy_link_speed adv_ return -EIO; } - if (adv_speeds & LINK_FULL_10BASE_T) { + if (adv_speeds & LINK_FULL_10BASE) { anar_reg |= MII_ADVERTISE_10_FULL; } else { anar_reg &= ~MII_ADVERTISE_10_FULL; } - if (adv_speeds & LINK_HALF_10BASE_T) { + if (adv_speeds & LINK_HALF_10BASE) { anar_reg |= MII_ADVERTISE_10_HALF; } else { anar_reg &= ~MII_ADVERTISE_10_HALF; } - if (adv_speeds & LINK_FULL_100BASE_T) { + if (adv_speeds & LINK_FULL_100BASE) { anar_reg |= MII_ADVERTISE_100_FULL; } else { anar_reg &= ~MII_ADVERTISE_100_FULL; } - if (adv_speeds & LINK_HALF_100BASE_T) { + if (adv_speeds & LINK_HALF_100BASE) { anar_reg |= MII_ADVERTISE_100_HALF; } else { anar_reg &= ~MII_ADVERTISE_100_HALF; } - if (adv_speeds & LINK_FULL_1000BASE_T) { + if (adv_speeds & LINK_FULL_1000BASE) { c1kt_reg |= MII_ADVERTISE_1000_FULL; } else { c1kt_reg &= ~MII_ADVERTISE_1000_FULL; } - if (adv_speeds & LINK_HALF_1000BASE_T) { + if (adv_speeds & LINK_HALF_1000BASE) { c1kt_reg |= MII_ADVERTISE_1000_HALF; } else { c1kt_reg &= ~MII_ADVERTISE_1000_HALF; @@ -463,17 +463,17 @@ static int qc_ar8031_init(const struct device *dev) } const static int speed_to_phy_link_speed[] = { - LINK_HALF_10BASE_T, LINK_FULL_10BASE_T, LINK_HALF_100BASE_T, - LINK_FULL_100BASE_T, LINK_HALF_1000BASE_T, LINK_FULL_1000BASE_T, + LINK_HALF_10BASE, LINK_FULL_10BASE, LINK_HALF_100BASE, + LINK_FULL_100BASE, LINK_HALF_1000BASE, LINK_FULL_1000BASE, }; data->state.speed = speed_to_phy_link_speed[cfg->fixed_speed]; data->state.is_up = true; } else { /* Auto negotiation */ /* Advertise all speeds */ - qc_ar8031_cfg_link(dev, LINK_HALF_10BASE_T | LINK_FULL_10BASE_T | - LINK_HALF_100BASE_T | LINK_FULL_100BASE_T | - LINK_HALF_1000BASE_T | LINK_FULL_1000BASE_T); + qc_ar8031_cfg_link(dev, LINK_HALF_10BASE | LINK_FULL_10BASE | + LINK_HALF_100BASE | LINK_FULL_100BASE | + LINK_HALF_1000BASE | LINK_FULL_1000BASE); k_work_init_delayable(&data->monitor_work, monitor_work_handler); diff --git a/drivers/ethernet/phy/phy_realtek_rtl8211f.c b/drivers/ethernet/phy/phy_realtek_rtl8211f.c index 7a05cc3ba0d7..9ce8bfdfa265 100644 --- a/drivers/ethernet/phy/phy_realtek_rtl8211f.c +++ b/drivers/ethernet/phy/phy_realtek_rtl8211f.c @@ -241,24 +241,24 @@ static int phy_rt_rtl8211f_get_link(const struct device *dev, >> PHY_RT_RTL8211F_PHYSR_LINKSPEED_SHIFT) { case PHY_RT_RTL8211F_PHYSR_LINKSPEED_100M: if (duplex) { - new_state.speed = LINK_FULL_100BASE_T; + new_state.speed = LINK_FULL_100BASE; } else { - new_state.speed = LINK_HALF_100BASE_T; + new_state.speed = LINK_HALF_100BASE; } break; case PHY_RT_RTL8211F_PHYSR_LINKSPEED_1000M: if (duplex) { - new_state.speed = LINK_FULL_1000BASE_T; + new_state.speed = LINK_FULL_1000BASE; } else { - new_state.speed = LINK_HALF_1000BASE_T; + new_state.speed = LINK_HALF_1000BASE; } break; case PHY_RT_RTL8211F_PHYSR_LINKSPEED_10M: default: if (duplex) { - new_state.speed = LINK_FULL_10BASE_T; + new_state.speed = LINK_FULL_10BASE; } else { - new_state.speed = LINK_HALF_10BASE_T; + new_state.speed = LINK_HALF_10BASE; } break; } @@ -318,29 +318,29 @@ static int phy_rt_rtl8211f_cfg_link(const struct device *dev, } /* Setup advertising register */ - if (speeds & LINK_FULL_100BASE_T) { + if (speeds & LINK_FULL_100BASE) { anar |= MII_ADVERTISE_100_FULL; } else { anar &= ~MII_ADVERTISE_100_FULL; } - if (speeds & LINK_HALF_100BASE_T) { + if (speeds & LINK_HALF_100BASE) { anar |= MII_ADVERTISE_100_HALF; } else { anar &= ~MII_ADVERTISE_100_HALF; } - if (speeds & LINK_FULL_10BASE_T) { + if (speeds & LINK_FULL_10BASE) { anar |= MII_ADVERTISE_10_FULL; } else { anar &= ~MII_ADVERTISE_10_FULL; } - if (speeds & LINK_HALF_10BASE_T) { + if (speeds & LINK_HALF_10BASE) { anar |= MII_ADVERTISE_10_HALF; } else { anar &= ~MII_ADVERTISE_10_HALF; } /* Setup 1000Base-T control register */ - if (speeds & LINK_FULL_1000BASE_T) { + if (speeds & LINK_FULL_1000BASE) { gbcr |= MII_ADVERTISE_1000_FULL; } else { gbcr &= ~MII_ADVERTISE_1000_FULL; diff --git a/drivers/ethernet/phy/phy_ti_dp83825.c b/drivers/ethernet/phy/phy_ti_dp83825.c index 9359358e7559..6c03da428051 100644 --- a/drivers/ethernet/phy/phy_ti_dp83825.c +++ b/drivers/ethernet/phy/phy_ti_dp83825.c @@ -213,13 +213,13 @@ static int phy_ti_dp83825_get_link(const struct device *dev, struct phy_link_sta mutual_capabilities = anar & anlpar; if (mutual_capabilities & MII_ADVERTISE_100_FULL) { - state->speed = LINK_FULL_100BASE_T; + state->speed = LINK_FULL_100BASE; } else if (mutual_capabilities & MII_ADVERTISE_100_HALF) { - state->speed = LINK_HALF_100BASE_T; + state->speed = LINK_HALF_100BASE; } else if (mutual_capabilities & MII_ADVERTISE_10_FULL) { - state->speed = LINK_FULL_10BASE_T; + state->speed = LINK_FULL_10BASE; } else if (mutual_capabilities & MII_ADVERTISE_10_HALF) { - state->speed = LINK_HALF_10BASE_T; + state->speed = LINK_HALF_10BASE; } else { return -EIO; } @@ -401,25 +401,25 @@ static int phy_ti_dp83825_cfg_link(const struct device *dev, enum phy_link_speed } /* Setup advertising register */ - if (speeds & LINK_FULL_100BASE_T) { + if (speeds & LINK_FULL_100BASE) { anar |= MII_ADVERTISE_100_FULL; } else { anar &= ~MII_ADVERTISE_100_FULL; } - if (speeds & LINK_HALF_100BASE_T) { + if (speeds & LINK_HALF_100BASE) { anar |= MII_ADVERTISE_100_HALF; } else { anar &= ~MII_ADVERTISE_100_HALF; } - if (speeds & LINK_FULL_10BASE_T) { + if (speeds & LINK_FULL_10BASE) { anar |= MII_ADVERTISE_10_FULL; } else { anar &= ~MII_ADVERTISE_10_FULL; } - if (speeds & LINK_HALF_10BASE_T) { + if (speeds & LINK_HALF_10BASE) { anar |= MII_ADVERTISE_10_HALF; } else { anar &= ~MII_ADVERTISE_10_HALF; diff --git a/drivers/ethernet/phy/phy_ti_dp83867.c b/drivers/ethernet/phy/phy_ti_dp83867.c index 84b3b4d14d93..3b910020707e 100644 --- a/drivers/ethernet/phy/phy_ti_dp83867.c +++ b/drivers/ethernet/phy/phy_ti_dp83867.c @@ -193,24 +193,24 @@ static int phy_ti_dp83867_get_link(const struct device *dev, struct phy_link_sta PHY_TI_DP83867_PHYSTS_LINKSPEED_SHIFT) { case PHY_TI_DP83867_PHYSTS_LINKSPEED_1000M: if (duplex) { - new_state.speed = LINK_FULL_1000BASE_T; + new_state.speed = LINK_FULL_1000BASE; } else { - new_state.speed = LINK_HALF_1000BASE_T; + new_state.speed = LINK_HALF_1000BASE; } break; case PHY_TI_DP83867_PHYSTS_LINKSPEED_100M: if (duplex) { - new_state.speed = LINK_FULL_100BASE_T; + new_state.speed = LINK_FULL_100BASE; } else { - new_state.speed = LINK_HALF_100BASE_T; + new_state.speed = LINK_HALF_100BASE; } break; case PHY_TI_DP83867_PHYSTS_LINKSPEED_10M: default: if (duplex) { - new_state.speed = LINK_FULL_10BASE_T; + new_state.speed = LINK_FULL_10BASE; } else { - new_state.speed = LINK_HALF_10BASE_T; + new_state.speed = LINK_HALF_10BASE; } break; } @@ -345,29 +345,29 @@ static int phy_ti_dp83867_cfg_link(const struct device *dev, enum phy_link_speed } /* Setup advertising register */ - if (speeds & LINK_FULL_100BASE_T) { + if (speeds & LINK_FULL_100BASE) { anar |= MII_ADVERTISE_100_FULL; } else { anar &= ~MII_ADVERTISE_100_FULL; } - if (speeds & LINK_HALF_100BASE_T) { + if (speeds & LINK_HALF_100BASE) { anar |= MII_ADVERTISE_100_HALF; } else { anar &= ~MII_ADVERTISE_100_HALF; } - if (speeds & LINK_FULL_10BASE_T) { + if (speeds & LINK_FULL_10BASE) { anar |= MII_ADVERTISE_10_FULL; } else { anar &= ~MII_ADVERTISE_10_FULL; } - if (speeds & LINK_HALF_10BASE_T) { + if (speeds & LINK_HALF_10BASE) { anar |= MII_ADVERTISE_10_HALF; } else { anar &= ~MII_ADVERTISE_10_HALF; } /* Setup 1000Base-T control register */ - if (speeds & LINK_FULL_1000BASE_T) { + if (speeds & LINK_FULL_1000BASE) { cfg1 |= MII_ADVERTISE_1000_FULL; } else { cfg1 &= ~MII_ADVERTISE_1000_FULL; diff --git a/drivers/ethernet/phy/phy_tja1103.c b/drivers/ethernet/phy/phy_tja1103.c index c9a3bbb6751a..8bdd2d4a9143 100644 --- a/drivers/ethernet/phy/phy_tja1103.c +++ b/drivers/ethernet/phy/phy_tja1103.c @@ -342,7 +342,7 @@ static int phy_tja1103_cfg_link(const struct device *dev, enum phy_link_speed ad { ARG_UNUSED(dev); - if (adv_speeds & LINK_FULL_100BASE_T) { + if (adv_speeds & LINK_FULL_100BASE) { return 0; } @@ -360,7 +360,7 @@ static int phy_tja1103_init(const struct device *dev) data->dev = dev; data->cb = NULL; data->state.is_up = false; - data->state.speed = LINK_FULL_100BASE_T; + data->state.speed = LINK_FULL_100BASE; ret = WAIT_FOR(!phy_tja1103_id(dev, &phy_id) && phy_id == TJA1103_ID, TJA1103_AWAIT_RETRY_COUNT * TJA1103_AWAIT_DELAY_POLL_US, diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 633ee48f9013..0a4c189e6898 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -331,8 +331,8 @@ static bool is_eapol(struct net_pkt *pkt) enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev) { - enum ethernet_hw_caps caps = (ETHERNET_LINK_10BASE_T | - ETHERNET_LINK_100BASE_T | ETHERNET_LINK_1000BASE_T); + enum ethernet_hw_caps caps = (ETHERNET_LINK_10BASE | + ETHERNET_LINK_100BASE | ETHERNET_LINK_1000BASE); #ifdef CONFIG_NRF70_TCP_IP_CHECKSUM_OFFLOAD caps |= ETHERNET_HW_TX_CHKSUM_OFFLOAD | diff --git a/include/zephyr/net/ethernet.h b/include/zephyr/net/ethernet.h index f245fa94a38a..5f3a8f2eca99 100644 --- a/include/zephyr/net/ethernet.h +++ b/include/zephyr/net/ethernet.h @@ -153,13 +153,13 @@ enum ethernet_hw_caps { ETHERNET_AUTO_NEGOTIATION_SET = BIT(3), /** 10 Mbits link supported */ - ETHERNET_LINK_10BASE_T = BIT(4), + ETHERNET_LINK_10BASE = BIT(4), /** 100 Mbits link supported */ - ETHERNET_LINK_100BASE_T = BIT(5), + ETHERNET_LINK_100BASE = BIT(5), /** 1 Gbits link supported */ - ETHERNET_LINK_1000BASE_T = BIT(6), + ETHERNET_LINK_1000BASE = BIT(6), /** Changing duplex (half/full) supported */ ETHERNET_DUPLEX_SET = BIT(7), @@ -204,10 +204,10 @@ enum ethernet_hw_caps { ETHERNET_TXINJECTION_MODE = BIT(20), /** 2.5 Gbits link supported */ - ETHERNET_LINK_2500BASE_T = BIT(21), + ETHERNET_LINK_2500BASE = BIT(21), /** 5 Gbits link supported */ - ETHERNET_LINK_5000BASE_T = BIT(22), + ETHERNET_LINK_5000BASE = BIT(22), }; /** @cond INTERNAL_HIDDEN */ diff --git a/include/zephyr/net/phy.h b/include/zephyr/net/phy.h index 24201d915dee..89624854664f 100644 --- a/include/zephyr/net/phy.h +++ b/include/zephyr/net/phy.h @@ -32,22 +32,22 @@ extern "C" { /** @brief Ethernet link speeds. */ enum phy_link_speed { - /** 10Base-T Half-Duplex */ - LINK_HALF_10BASE_T = BIT(0), - /** 10Base-T Full-Duplex */ - LINK_FULL_10BASE_T = BIT(1), - /** 100Base-T Half-Duplex */ - LINK_HALF_100BASE_T = BIT(2), - /** 100Base-T Full-Duplex */ - LINK_FULL_100BASE_T = BIT(3), - /** 1000Base-T Half-Duplex */ - LINK_HALF_1000BASE_T = BIT(4), - /** 1000Base-T Full-Duplex */ - LINK_FULL_1000BASE_T = BIT(5), - /** 2.5GBase-T Full-Duplex */ - LINK_FULL_2500BASE_T = BIT(6), - /** 5GBase-T Full-Duplex */ - LINK_FULL_5000BASE_T = BIT(7), + /** 10Base Half-Duplex */ + LINK_HALF_10BASE = BIT(0), + /** 10Base Full-Duplex */ + LINK_FULL_10BASE = BIT(1), + /** 100Base Half-Duplex */ + LINK_HALF_100BASE = BIT(2), + /** 100Base Full-Duplex */ + LINK_FULL_100BASE = BIT(3), + /** 1000Base Half-Duplex */ + LINK_HALF_1000BASE = BIT(4), + /** 1000Base Full-Duplex */ + LINK_FULL_1000BASE = BIT(5), + /** 2.5GBase Full-Duplex */ + LINK_FULL_2500BASE = BIT(6), + /** 5GBase Full-Duplex */ + LINK_FULL_5000BASE = BIT(7), }; /** @@ -57,7 +57,9 @@ enum phy_link_speed { * * @return True if link is full duplex, false if not. */ -#define PHY_LINK_IS_FULL_DUPLEX(x) (x & (BIT(1) | BIT(3) | BIT(5) | BIT(6) | BIT(7))) +#define PHY_LINK_IS_FULL_DUPLEX(x) \ + (x & (LINK_FULL_10BASE | LINK_FULL_100BASE | LINK_FULL_1000BASE | LINK_FULL_2500BASE | \ + LINK_FULL_5000BASE)) /** * @brief Check if phy link speed is 1 Gbit/sec. @@ -66,16 +68,25 @@ enum phy_link_speed { * * @return True if link is 1 Gbit/sec, false if not. */ -#define PHY_LINK_IS_SPEED_1000M(x) (x & (BIT(4) | BIT(5))) +#define PHY_LINK_IS_SPEED_1000M(x) (x & (LINK_HALF_1000BASE | LINK_FULL_1000BASE)) /** * @brief Check if phy link speed is 100 Mbit/sec. * * @param x Link capabilities * - * @return True if link is 1 Mbit/sec, false if not. + * @return True if link is 100 Mbit/sec, false if not. */ -#define PHY_LINK_IS_SPEED_100M(x) (x & (BIT(2) | BIT(3))) +#define PHY_LINK_IS_SPEED_100M(x) (x & (LINK_HALF_100BASE | LINK_FULL_100BASE)) + +/** + * @brief Check if phy link speed is 10 Mbit/sec. + * + * @param x Link capabilities + * + * @return True if link is 10 Mbit/sec, false if not. + */ +#define PHY_LINK_IS_SPEED_10M(x) (x & (LINK_HALF_10BASE | LINK_FULL_10BASE)) /** @brief Link state */ struct phy_link_state { diff --git a/subsys/net/l2/ethernet/ethernet_mgmt.c b/subsys/net/l2/ethernet/ethernet_mgmt.c index 3979ef88a325..3f1b6735318a 100644 --- a/subsys/net/l2/ethernet/ethernet_mgmt.c +++ b/subsys/net/l2/ethernet/ethernet_mgmt.c @@ -57,22 +57,19 @@ static int ethernet_set_config(uint32_t mgmt_request, type = ETHERNET_CONFIG_TYPE_AUTO_NEG; } else if (mgmt_request == NET_REQUEST_ETHERNET_SET_LINK) { if (params->l.link_10bt) { - if (!is_hw_caps_supported(dev, - ETHERNET_LINK_10BASE_T)) { + if (!is_hw_caps_supported(dev, ETHERNET_LINK_10BASE)) { return -ENOTSUP; } config.l.link_10bt = true; } else if (params->l.link_100bt) { - if (!is_hw_caps_supported(dev, - ETHERNET_LINK_100BASE_T)) { + if (!is_hw_caps_supported(dev, ETHERNET_LINK_100BASE)) { return -ENOTSUP; } config.l.link_100bt = true; } else if (params->l.link_1000bt) { - if (!is_hw_caps_supported(dev, - ETHERNET_LINK_1000BASE_T)) { + if (!is_hw_caps_supported(dev, ETHERNET_LINK_1000BASE)) { return -ENOTSUP; } diff --git a/subsys/net/lib/shell/iface.c b/subsys/net/lib/shell/iface.c index 8d54ae1ae5da..f54a3a55ac96 100644 --- a/subsys/net/lib/shell/iface.c +++ b/subsys/net/lib/shell/iface.c @@ -45,9 +45,9 @@ static struct ethernet_capabilities eth_hw_caps[] = { EC(ETHERNET_HW_VLAN, "Virtual LAN"), EC(ETHERNET_HW_VLAN_TAG_STRIP, "VLAN Tag stripping"), EC(ETHERNET_AUTO_NEGOTIATION_SET, "Auto negotiation"), - EC(ETHERNET_LINK_10BASE_T, "10 Mbits"), - EC(ETHERNET_LINK_100BASE_T, "100 Mbits"), - EC(ETHERNET_LINK_1000BASE_T, "1 Gbits"), + EC(ETHERNET_LINK_10BASE, "10 Mbits"), + EC(ETHERNET_LINK_100BASE, "100 Mbits"), + EC(ETHERNET_LINK_1000BASE, "1 Gbits"), EC(ETHERNET_DUPLEX_SET, "Half/full duplex"), EC(ETHERNET_PTP, "IEEE 802.1AS gPTP clock"), EC(ETHERNET_QAV, "IEEE 802.1Qav (credit shaping)"), @@ -61,8 +61,8 @@ static struct ethernet_capabilities eth_hw_caps[] = { EC(ETHERNET_DSA_CONDUIT_PORT, "DSA conduit port"), EC(ETHERNET_TXTIME, "TXTIME supported"), EC(ETHERNET_TXINJECTION_MODE, "TX-Injection supported"), - EC(ETHERNET_LINK_2500BASE_T, "2.5 Gbits"), - EC(ETHERNET_LINK_5000BASE_T, "5 Gbits"), + EC(ETHERNET_LINK_2500BASE, "2.5 Gbits"), + EC(ETHERNET_LINK_5000BASE, "5 Gbits"), }; static void print_supported_ethernet_capabilities( diff --git a/subsys/usb/device_next/class/usbd_cdc_ecm.c b/subsys/usb/device_next/class/usbd_cdc_ecm.c index 55aa2798a647..abc37f90bea0 100644 --- a/subsys/usb/device_next/class/usbd_cdc_ecm.c +++ b/subsys/usb/device_next/class/usbd_cdc_ecm.c @@ -557,7 +557,7 @@ static enum ethernet_hw_caps cdc_ecm_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T; + return ETHERNET_LINK_10BASE; } static int cdc_ecm_iface_start(const struct device *dev) diff --git a/subsys/usb/device_next/class/usbd_cdc_ncm.c b/subsys/usb/device_next/class/usbd_cdc_ncm.c index c92754f72f83..b35495bd788b 100644 --- a/subsys/usb/device_next/class/usbd_cdc_ncm.c +++ b/subsys/usb/device_next/class/usbd_cdc_ncm.c @@ -1110,7 +1110,7 @@ static enum ethernet_hw_caps cdc_ncm_get_capabilities(const struct device *dev) { ARG_UNUSED(dev); - return ETHERNET_LINK_10BASE_T; + return ETHERNET_LINK_10BASE; } static int cdc_ncm_iface_start(const struct device *dev) diff --git a/tests/net/ethernet_mgmt/src/main.c b/tests/net/ethernet_mgmt/src/main.c index f020480ae811..447b58344d35 100644 --- a/tests/net/ethernet_mgmt/src/main.c +++ b/tests/net/ethernet_mgmt/src/main.c @@ -101,8 +101,8 @@ static int eth_fake_send(const struct device *dev, static enum ethernet_hw_caps eth_fake_get_capabilities(const struct device *dev) { - return ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_LINK_10BASE_T | - ETHERNET_LINK_100BASE_T | ETHERNET_DUPLEX_SET | ETHERNET_QAV | + return ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_LINK_10BASE | + ETHERNET_LINK_100BASE | ETHERNET_DUPLEX_SET | ETHERNET_QAV | ETHERNET_PROMISC_MODE | ETHERNET_PRIORITY_QUEUES | ETHERNET_QBV | ETHERNET_QBU | ETHERNET_TXTIME; } diff --git a/tests/net/socket/net_mgmt/src/main.c b/tests/net/socket/net_mgmt/src/main.c index 455ae3e0d049..a5d6ead46793 100644 --- a/tests/net/socket/net_mgmt/src/main.c +++ b/tests/net/socket/net_mgmt/src/main.c @@ -221,8 +221,8 @@ static int eth_fake_get_config(const struct device *dev, static enum ethernet_hw_caps eth_fake_get_capabilities(const struct device *dev) { - return ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_LINK_10BASE_T | - ETHERNET_LINK_100BASE_T | ETHERNET_DUPLEX_SET | ETHERNET_QAV | + return ETHERNET_AUTO_NEGOTIATION_SET | ETHERNET_LINK_10BASE | + ETHERNET_LINK_100BASE | ETHERNET_DUPLEX_SET | ETHERNET_QAV | ETHERNET_PROMISC_MODE | ETHERNET_PRIORITY_QUEUES; }