/* XEmacPs_GetOperatingSpeed gets the current operating link speed. This may be the value set by  */
u16 XEmacPs_GetOperatingSpeed(XEmacPs *InstancePtr)
/* XEmacPs_GetOperatingSpeed gets the current operating link speed. This may be the value set by  */
u16 XEmacPs_GetOperatingSpeed(XEmacPs *InstancePtr)
{
	u32 Reg;
	u16 Status;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == (u32)XIL_COMPONENT_IS_READY);
	Reg = XEmacPs_ReadReg(InstancePtr->Config.BaseAddress,
			XEMACPS_NWCFG_OFFSET);
	if ((Reg & XEMACPS_NWCFG_1000_MASK) != 0x00000000U) {
		Status = (u16)(1000);
	} else {
		if ((Reg & XEMACPS_NWCFG_100_MASK) != 0x00000000U) {
			Status = (u16)(100);
		} else {
			Status = (u16)(10);
		}
	}
	return Status;
}