对phy_device的操作,就可以调用具体phy_driver的驱动函数: staticstructphy_driver ytphy_drvs[] ={{ .phy_id=PHY_ID_YT8511, .name="YT8511 Gigabit Ethernet", .phy_id_mask=MOTORCOMM_PHY_ID_MASK, .features=PHY_GBIT_FEATURES,//.flags = PHY_HAS_INTERRUPT,.config_aneg =genphy_config_aneg,#if...
* @phy_id_mask: Defines the significant bits of @phy_id. A value of 0 * is used to terminate an array of struct mdio_device_id. */ struct mdio_device_id { __u32 phy_id; __u32 phy_id_mask; }; static struct mdio_device_id __maybe_unused realtek_tbl[] = { { 0x001cc912...
* @phy_id_mask: Defines the significant bits of @phy_id. A value of 0 * is used to terminate an array of struct mdio_device_id. */ structmdio_device_id{ __u32 phy_id; __u32 phy_id_mask; }; staticstructmdio_device_id__maybe_unusedrealtek_tbl[] ={ {0x001cc912,0x001fffff}...
.phy_id_mask =0xffffffff, .name ="Generic PHY", .get_features = genphy_read_abilities, .suspend = genphy_suspend, .resume = genphy_resume, .set_loopback = genphy_loopback, }; staticstructphy_drivertja11xx_driver[] = { { PHY_ID_MATCH_MODEL(PHY_ID_TJA1100), .name ="NXP TJA1...
.phy_id_mask = 0x001fffff, .name = "RTL820x Gigabit Ethernet", .features = 0, .config_init = rtl820x_config_init, .config_aneg = &genphy_config_aneg, .read_status = &genphy_read_status, .suspend = genphy_suspend, .resume = genphy_resume, ...
struct phy_driver{struct mdio_driver_common mdiodrv;u32 phy_id;char*name;u32 phy_id_mask;u32 features;u32 flags;constvoid*driver_data;int(*soft_reset)(struct phy_device*phydev);int(*config_init)(struct phy_device*phydev);int(*probe)(struct phy_device*phydev);int(*suspend)(struct ...
#define LAN8710_PHY_ID_MASK 0xfffffff0u if((id & LAN8710_PHY_ID_MASK) == LAN8710_PHY_ID) { printf(STMAC "LAN8710 found/n"); return phyaddr; } id为实际读出来的PHY ID值。id的获取代码如下: unsigned int id1 = stmac_mii_read (phyaddr, MII_PHYSID1); unsigned int id2 = ...
return ((phydrv->phy_id & phydrv->phy_id_mask) == (phydev->phy_id & phydrv->phy_id_mask)); } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 由log可以看出,设备dev的ID为600d8595,然后就去查找对应的驱动drv的ID,知道找到600d8595则进入probe函数。
这样找到ID后就会进行设备驱动的注册,对应的phy_driver_register()函数才能返回成功,才会执行phy_driver结构体下面的内容,如下: staticstructphy_driverbcm54210s_driver={.phy_id=PHY_ID_BCM54210S,.phy_id_mask=0xfffffff0,.name="Broadcom BCM54210S",.features=PHY_GBIT_FEATURES|SUPPORTED_Pause|SUPPORTED_As...
PHY芯片at803x驱动 /* *drivers/net/phy/at803x.c * *DriverforAtheros803xPHY * *Author:MatusUjhelyi<ujhelyi.m@gmail.com> * *Thisprogramisfreesoftware;youcanredistributeitand/ormodifyit *underthetermsoftheGNUGeneralPublicLicenseaspublishedbythe *FreeSoftwareFoundation;eitherversion2oftheLicense,or(at...