int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,void (*handler)(struct net_device *), u32 flags,phy_interface_t interface); //PHY直接连接网络设备 struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,void (*handler)(struct net_device *)...
这个过程主要的函数如下: 1.cpsw_ndo_open 2.-> cpsw_slave_open 3.-> phy_connect (传递cpsw_adjust_link) 4.-> phy_connect_direct (PHY_READY) 5.-> phy_prepare_link (赋值cpsw_adjust_link为adjust_link) 6.-> phy_start_machine 7.-> phy_start (PHY_READY变成PHY_UP) ...
软件上可通过在phy复位之后,设置寄存器0 固定为100M全双工,可link成功。目前可这样解决问题:在drivers/net/ethernet/allwinner/sunxi-gmac.c 中 geth_phy_init函数中 phy_connect_direct 之前加入phy_write(phydev, 0x0, 0x2100)。以上是我们在A40i开发过程中常见网卡设计问题,有些可能是因为大家在参考方案时出...
22.phy_connect(dev, dev_name(&phydev->dev), &adjust_link, PHY_INTERFACE_MODE_RMII); 23.phy_connect_direct 24.phy_prepare_link 25.phydev->adjust_link = handler; //handler = adjust_link 26.phy_start_machine 27.phydev->adjust_state = handler; //handler = NULL ...
phy_connect(dev,dev_name(&phydev->dev),&adjust_link,PHY_INTERFACE_MODE_RMII); phy_connect_direct phy_prepare_link phydev->adjust_link=handler;//handler = adjust_link phy_start_machine phydev->adjust_state=handler;//handler = NULL
`-| phylink_of_phy_connect() `-| phy_attach_direct() | phylink_bringup_phy() `-| { | phy->phylink = pl; | phy->phy_link_change = phylink_phy_change;// (1) 设置 phy_device 的通知函数 | timer_setup(&pl->link_poll, phylink_fixed_poll,0); ...
-> phy_connect_direct (PHY_READY) -> phy_prepare_link (赋值cpsw_adjust_link为adjust_link) -> phy_start_machine -> phy_start (PHY_READY变成PHY_UP) 当系统启动时,经过上述的步骤,一切已经准备妥当。就等着迎接PHY的状态变更了。在这里,需要提及的函数是cpsw_adjust_link,它调用了_cpsw_adjust_link...
--> phy_connect_direct (传递handler,初始化 ***) --> phy_attach_direct()-->d->driver = &genphy_driver[GENPHY_DRV_1G].driver;(通用驱动赋值,3.17支持1G和10G)-->d->driver->probe(这里就调用到Generic PHY的检测函数phy_probe)-->device_bind_driver(绑定驱动到设备)-->phydev->attached_dev...
=phydrv->features;//phydrv->features = PHY_BASIC_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pausephydev->advertising=phydrv->features;phydev->state=PHY_READY;//设置phy的状态 ---2---phy_connect(dev,dev_name(&phydev->dev),&adjust_link,PHY_INTERFACE_MODE_RMII);phy_connect_direct phy...
在get_phy_device中,会调用get_phy_id来读取对应地址上的phy_id,然后如果满足((phy_id & 0x1fffffff) == 0x1fffffff),则认识该phy不存在。 然后在port的probe中会调用phy_connect来连接phy; 在phy_connect中,会调用bus_find_device_by_name来查找对应的phy是否存在。存在则connect_direct。