uPD60620.c (552c69b36ebd966186573b9c7a286b390935cce1) | uPD60620.c (c0ec3c2736774c69bf5c641aea7712132c0f0eba) |
---|---|
1/* 2 * Driver for the Renesas PHY uPD60620. 3 * 4 * Copyright (C) 2015 Softing Industrial Automation GmbH 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 33 unchanged lines hidden (view full) --- 42 int phy_state; 43 44 /* Read negotiated state */ 45 phy_state = phy_read(phydev, MII_BMSR); 46 if (phy_state < 0) 47 return phy_state; 48 49 phydev->link = 0; | 1/* 2 * Driver for the Renesas PHY uPD60620. 3 * 4 * Copyright (C) 2015 Softing Industrial Automation GmbH 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 33 unchanged lines hidden (view full) --- 42 int phy_state; 43 44 /* Read negotiated state */ 45 phy_state = phy_read(phydev, MII_BMSR); 46 if (phy_state < 0) 47 return phy_state; 48 49 phydev->link = 0; |
50 phydev->lp_advertising = 0; | 50 linkmode_zero(phydev->lp_advertising); |
51 phydev->pause = 0; 52 phydev->asym_pause = 0; 53 54 if (phy_state & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS)) { 55 phy_state = phy_read(phydev, PHY_PHYSCR); 56 if (phy_state < 0) 57 return phy_state; 58 --- 6 unchanged lines hidden (view full) --- 65 phydev->speed = SPEED_100; 66 if (phy_state & PHY_PHYSCR_DUPLEX) 67 phydev->duplex = DUPLEX_FULL; 68 69 phy_state = phy_read(phydev, MII_LPA); 70 if (phy_state < 0) 71 return phy_state; 72 | 51 phydev->pause = 0; 52 phydev->asym_pause = 0; 53 54 if (phy_state & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS)) { 55 phy_state = phy_read(phydev, PHY_PHYSCR); 56 if (phy_state < 0) 57 return phy_state; 58 --- 6 unchanged lines hidden (view full) --- 65 phydev->speed = SPEED_100; 66 if (phy_state & PHY_PHYSCR_DUPLEX) 67 phydev->duplex = DUPLEX_FULL; 68 69 phy_state = phy_read(phydev, MII_LPA); 70 if (phy_state < 0) 71 return phy_state; 72 |
73 phydev->lp_advertising 74 = mii_lpa_to_ethtool_lpa_t(phy_state); | 73 mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising, 74 phy_state); |
75 76 if (phydev->duplex == DUPLEX_FULL) { 77 if (phy_state & LPA_PAUSE_CAP) 78 phydev->pause = 1; 79 if (phy_state & LPA_PAUSE_ASYM) 80 phydev->asym_pause = 1; 81 } 82 } --- 26 unchanged lines hidden --- | 75 76 if (phydev->duplex == DUPLEX_FULL) { 77 if (phy_state & LPA_PAUSE_CAP) 78 phydev->pause = 1; 79 if (phy_state & LPA_PAUSE_ASYM) 80 phydev->asym_pause = 1; 81 } 82 } --- 26 unchanged lines hidden --- |