Skip to content

Commit aa2af2e

Browse files
hkallweitdavem330
authored andcommitted
net: phy: add macros for PHYID matching
Add macros for PHYID matching to be used in PHY driver configs. By using these macros some boilerplate code can be avoided. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fa28a2b commit aa2af2e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/phy.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,10 @@ struct phy_driver {
651651
#define PHY_ANY_ID "MATCH ANY PHY"
652652
#define PHY_ANY_UID 0xffffffff
653653

654+
#define PHY_ID_MATCH_EXACT(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 0)
655+
#define PHY_ID_MATCH_MODEL(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 4)
656+
#define PHY_ID_MATCH_VENDOR(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 10)
657+
654658
/* A Structure for boards to register fixups with the PHY Lib */
655659
struct phy_fixup {
656660
struct list_head list;

0 commit comments

Comments
 (0)