kernel: port b53 to use kernel 4.5+ API
[openwrt/staging/lynxis.git] / target / linux / generic / files / drivers / net / phy / b53 / b53_phy_fixup.c
index 447f30b649f5acd8054ab7e1400a57eef8477156..e2f8a39ab658cf3433f662c3e021a8405b19364e 100644 (file)
 
 #define B53_BRCM_OUI_1 0x0143bc00
 #define B53_BRCM_OUI_2 0x03625c00
+#define B53_BRCM_OUI_3 0x00406000
 
 static int b53_phy_fixup(struct phy_device *dev)
 {
+       struct mii_bus *bus = dev->mdio.bus;
        u32 phy_id;
-       struct mii_bus *bus = dev->bus;
 
-       if (dev->addr != B53_PSEUDO_PHY)
+       if (dev->mdio.addr != B53_PSEUDO_PHY)
                return 0;
 
        /* read the first port's id */
@@ -38,7 +39,8 @@ static int b53_phy_fixup(struct phy_device *dev)
        phy_id |= mdiobus_read(bus, 0, 3);
 
        if ((phy_id & 0xfffffc00) == B53_BRCM_OUI_1 ||
-           (phy_id & 0xfffffc00) == B53_BRCM_OUI_2) {
+           (phy_id & 0xfffffc00) == B53_BRCM_OUI_2 ||
+           (phy_id & 0xfffffc00) == B53_BRCM_OUI_3) {
                dev->phy_id = phy_id;
        }