Skip to content

drivers: ethernet: drop _T from ethernet speed types #87194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/connectivity/networking/api/8021Qav.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions doc/releases/migration-guide-4.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
===========================================

Expand Down
4 changes: 2 additions & 2 deletions drivers/ethernet/dsa/dsa_ksz8xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
30 changes: 15 additions & 15 deletions drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,16 +1029,16 @@ static void phy_link_state_change_callback(const struct device *phy_dev,
if (is_up) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the first commit drivers: ethernet: phy: rename LINK_*_*BASE_T of this set, the commit description is missing the "why this change" part. Could you add the text in the PR description to the commit message too.

/* 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;
}
Expand Down Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_adin2111.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions drivers/ethernet/eth_cyclonev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/ethernet/eth_dwmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/ethernet/eth_e1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_enc424j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions drivers/ethernet/eth_gecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_ivshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_lan865x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_lan9250.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_litex_liteeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/ethernet/eth_numaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
12 changes: 6 additions & 6 deletions drivers/ethernet/eth_nxp_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 9 additions & 9 deletions drivers/ethernet/eth_nxp_s32_gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions drivers/ethernet/eth_nxp_s32_netc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions drivers/ethernet/eth_renesas_ra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
Loading