1*7c32f470SVitaly Bordug #ifndef __PHY_FIXED_H 2*7c32f470SVitaly Bordug #define __PHY_FIXED_H 3*7c32f470SVitaly Bordug 4*7c32f470SVitaly Bordug #define MII_REGS_NUM 29 5*7c32f470SVitaly Bordug 6*7c32f470SVitaly Bordug /* max number of virtual phy stuff */ 7*7c32f470SVitaly Bordug #define MAX_PHY_AMNT 10 8*7c32f470SVitaly Bordug /* 9*7c32f470SVitaly Bordug The idea is to emulate normal phy behavior by responding with 10*7c32f470SVitaly Bordug pre-defined values to mii BMCR read, so that read_status hook could 11*7c32f470SVitaly Bordug take all the needed info. 12*7c32f470SVitaly Bordug */ 13*7c32f470SVitaly Bordug 14*7c32f470SVitaly Bordug struct fixed_phy_status { 15*7c32f470SVitaly Bordug u8 link; 16*7c32f470SVitaly Bordug u16 speed; 17*7c32f470SVitaly Bordug u8 duplex; 18*7c32f470SVitaly Bordug }; 19*7c32f470SVitaly Bordug 20*7c32f470SVitaly Bordug /*----------------------------------------------------------------------------- 21*7c32f470SVitaly Bordug * Private information hoder for mii_bus 22*7c32f470SVitaly Bordug *-----------------------------------------------------------------------------*/ 23*7c32f470SVitaly Bordug struct fixed_info { 24*7c32f470SVitaly Bordug u16 *regs; 25*7c32f470SVitaly Bordug u8 regs_num; 26*7c32f470SVitaly Bordug struct fixed_phy_status phy_status; 27*7c32f470SVitaly Bordug struct phy_device *phydev; /* pointer to the container */ 28*7c32f470SVitaly Bordug /* link & speed cb */ 29*7c32f470SVitaly Bordug int (*link_update) (struct net_device *, struct fixed_phy_status *); 30*7c32f470SVitaly Bordug 31*7c32f470SVitaly Bordug }; 32*7c32f470SVitaly Bordug 33*7c32f470SVitaly Bordug 34*7c32f470SVitaly Bordug int fixed_mdio_set_link_update(struct phy_device *, 35*7c32f470SVitaly Bordug int (*link_update) (struct net_device *, struct fixed_phy_status *)); 36*7c32f470SVitaly Bordug struct fixed_info *fixed_mdio_get_phydev (int phydev_ind); 37*7c32f470SVitaly Bordug 38*7c32f470SVitaly Bordug #endif /* __PHY_FIXED_H */ 39