History

net: pcs: xpcs: Fix PMA identifier handling in XPCS

The XPCS driver was mangling the PMA identifier as the original code appears to have been focused on just capturing the OUI. Rather than store a mangled ID it is better to work with the actual PMA ID and instead just mask out the values that don't apply rather than shifting them and reordering them as you still don't get the original OUI for the NIC without having to bitswap the values as per the definition of the layout in IEEE 802.3-2022 22.2.4.3.1. By laying it out as it was in the hardware it is also less likely for us to have an unintentional collision as the enum values will occupy the revision number area while the OUI occupies the upper 22 bits.

Alexander Duyck committed 11 months ago

Commit 39e13811 parent 7622d553 files · +10 −6Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/mdio.h+5−0
@@ -147,6 +147,11 @@ · 146 unmodified lines
147#define MDIO_AN_STAT1_PAGE 0x0040 /* Page received */147#define MDIO_AN_STAT1_PAGE 0x0040 /* Page received */
148#define MDIO_AN_STAT1_XNP 0x0080 /* Extended next page status */148#define MDIO_AN_STAT1_XNP 0x0080 /* Extended next page status */
149 149
150/* Device Identifier 2 */
151#define MDIO_DEVID2_OUI 0xfc00 /* OUI Portion of PHY ID */
152#define MDIO_DEVID2_MODEL_NUM 0x03f0 /* Manufacturer's Model Number */
153#define MDIO_DEVID2_REV_NUM 0x000f /* Revision Number */
154
150/* Speed register. */155/* Speed register. */
151#define MDIO_SPEED_10G 0x0001 /* 10G capable */156#define MDIO_SPEED_10G 0x0001 /* 10G capable */
152#define MDIO_PMA_SPEED_2B 0x0002 /* 2BASE-TL capable */157#define MDIO_PMA_SPEED_2B 0x0002 /* 2BASE-TL capable */