Skip to content

Commit fc585db

Browse files
committed
drivers: ethernet: phy: add PHY_LINK_IS_BASE_T macro
add PHY_LINK_IS_BASE_T macro to check if the link is BASE-T. Signed-off-by: Fin Maaß <[email protected]>
1 parent 758a528 commit fc585db

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/zephyr/net/phy.h

+12
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ enum phy_link_speed {
5656
LINK_FULL_5000BASE_T = BIT(11),
5757
};
5858

59+
/**
60+
* @brief Check if phy link is BASE-T.
61+
*
62+
* @param x Link capabilities
63+
*
64+
* @return True if link is BASE-T, false if not.
65+
*/
66+
#define PHY_LINK_IS_BASE_T(x) \
67+
(x & (LINK_HALF_10BASE_T | LINK_FULL_10BASE_T | LINK_HALF_100BASE_T | \
68+
LINK_FULL_100BASE_T | LINK_HALF_1000BASE_T | LINK_FULL_1000BASE_T | \
69+
LINK_FULL_2500BASE_T | LINK_FULL_5000BASE_T))
70+
5971
/**
6072
* @brief Check if phy link is full duplex.
6173
*

0 commit comments

Comments
 (0)