source: trunk/target/linux/generic-2.6/patches-2.6.34/601-phy-add-aneg-done-function.patch @ 21726

Last change on this file since 21726 was 21726, checked in by juhosg, 7 years ago

generic: add aneg_done and update_link functions for the phy_device

File size: 1.2 KB
  • include/linux/phy.h

    a b struct phy_driver { 
    393393         */ 
    394394        int (*config_aneg)(struct phy_device *phydev); 
    395395 
     396        /* Determine if autonegotiation is done */ 
     397        int (*aneg_done)(struct phy_device *phydev); 
     398 
    396399        /* Determines the negotiated speed and duplex */ 
    397400        int (*read_status)(struct phy_device *phydev); 
    398401 
     402        /*  
     403         * Update the value in phydev->link to reflect the  
     404         * current link value 
     405         */ 
     406        int (*update_link)(struct phy_device *phydev); 
     407 
    399408        /* Clears any pending interrupts */ 
    400409        int (*ack_interrupt)(struct phy_device *phydev); 
    401410 
  • drivers/net/phy/phy_device.c

    a b int genphy_update_link(struct phy_device 
    695695{ 
    696696        int status; 
    697697 
     698        if (phydev->drv->update_link) 
     699                return phydev->drv->update_link(phydev); 
     700 
    698701        /* Do a fake read */ 
    699702        status = phy_read(phydev, MII_BMSR); 
    700703 
  • drivers/net/phy/phy.c

    a b static inline int phy_aneg_done(struct p 
    107107{ 
    108108        int retval; 
    109109 
     110        if (phydev->drv->aneg_done) 
     111                return phydev->drv->aneg_done(phydev); 
     112 
    110113        retval = phy_read(phydev, MII_BMSR); 
    111114 
    112115        return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE); 
Note: See TracBrowser for help on using the repository browser.