id1 = read_PHY (PHY_REG_IDR1); id2 = read_PHY (PHY_REG_IDR2); if (((id1 << 16) | (id2 & 0xFFF0)) == DP83848C_ID) {
write_PHY (PHY_REG_BMCR, PHY_AUTO_NEG);// Use autonegotiation about the link speed for (tout = 0; tout < 0x100000; tout++) { regv = read_PHY (PHY_REG_BMSR); if (regv & 0x0020) {
break; } } } /* Check the link status. */ for (tout = 0; tout < 0x10000; tout++) { regv = read_PHY (PHY_REG_STS); if (PHY_REG_STS & 0x0021) {
break; } }
if (regv & 0x0004) { /* Full duplex is enabled. */ LPC_EMAC->MAC2 |= MAC2_FULL_DUP; LPC_EMAC->Command |= CR_FULL_DUP; LPC_EMAC->IPGT = IPGT_FULL_DUP; } else { /* Half duplex mode. */ LPC_EMAC->IPGT = IPGT_HALF_DUP; } I am New to Ethernet ....
above code snap what i am trying to do link status,but my status just ON the Led on RJ45 Connector ,It Wont blink while i am querring....request...
Can Someone give me the Idea