//-------------------------------------------------------------------------- // smsc911x_mac_read() // // Reads a register mapped through the MAC_CSR register //-------------------------------------------------------------------------- static ulong smsc911x_mac_read(int reg) { while(MAC_CSR_CMD & MAC_CSR_CMD_CSR_BUSY) { continue; } MAC_CSR_CMD = MAC_RD_CMD(reg); while(MAC_CSR_CMD & MAC_CSR_CMD_CSR_BUSY) { continue; } return MAC_CSR_DATA; }
static ulong GetMacReg(int Reg) { ulong RegVal = 0xffffffff; if (*MAC_CSR_CMD & MAC_CSR_CMD_CSR_BUSY) { LAN9118_WARN("GetMacReg: previous command not complete\n"); goto done; } *MAC_CSR_CMD = MAC_RD_CMD(Reg); DELAY(1); if (MacBusy(MAC_TIMEOUT) == TRUE) { LAN9118_WARN("GetMacReg: timeout waiting for response " "from MAC\n"); goto done; } RegVal = *MAC_CSR_DATA; done: return (RegVal); }