How is it possible to detect if the ethernet cable is connected ? I try to use NAIfconfigIsDeviceUp, but this functions always returns TRUE. Thanks Gregory
The easiest way would be to connect the “link detect LED”-signal of the PHY to a GPIO of the NetARM.
It looks like you could call customizeMiiCheckLink().
You can read out the current setting over the phyter. See code example below: /* check which phyter present / if (mii_identify_phy() == ENABLE_PHY) { / LUCENT / / get interrupt status register of phyter / mii_reg_status = mii_phy_get_reg(0x1e); / save interrupt status register / fixdata_interrupt_stat_reg = mii_reg_status; / save content of control & status register / fixdata_contr_stat_reg = mii_phy_get_reg(0x17); / autonegotiation complete ? / if((mii_reg_status & 0x0800 ) != 0) { / autonegotiation is completed / fixdata_autonegotiation_completed = 1; } / endif / / link has gone down / if((mii_reg_status & 0x0200 ) != 0) { / / / link transient handling / link_act = 0x00; zioledco_link_down(); / 2004-04-16 FA change / ziointph_link_change(SAT_NOK); } / endif / / link has gone up / if((mii_reg_status & 0x0400 ) != 0) { / / / link transient handling / link_act = 0x01; zioledco_link_up(); / 2004-04-16 FA change / ziointph_link_change(SAT_OK); } / endif / } else { / INTEL / / get interrupt status register of phyter / mii_int_status_reg = mii_phy_get_reg(0x13); / get content of phyter status register #2 / mii_reg_status = mii_phy_get_reg(0x11); / save interrupt status register / fixdata_interrupt_stat_reg = mii_int_status_reg; / save content of control & status register / fixdata_contr_stat_reg = mii_reg_status; / autonegotiation complete ? 2004-04-16 FA mask was incorrect, changed from 0800 to 0080 / if((mii_reg_status & 0x0080 ) != 0) { / autonegotiation is completed / fixdata_autonegotiation_completed = 1; } / endif / / check link status / if ((mii_reg_status & 0x0400) != 0) { / link is up / / link transient handling / link_act = 0x01; zioledco_link_up(); / 2004-04-16 FA change / ziointph_link_change(SAT_OK); } else { / link is down / / link transient handling / link_act = 0x00; zioledco_link_down(); / 2004-04-16 FA change / ziointph_link_change(SAT_NOK); } / endif check link status / / 2004-04-16 FA check duplex / if ((mii_reg_status & 0x0200) != 0) { / full duplex / zioledco_duplex_full(); } else { / half duplex / zioledco_duplex_half(); } / endif check duplex / / 2004-04-16 FA check speed / if ((mii_reg_status & 0x4000) != 0) { / 100 MBit / zioledco_speed_100(); } else { / 10 Mbit / zioledco_speed_10(); } / endif check speed / } / endif check which phyter present */