]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq/x_emacpsif_physpeed.c
Update TCP/IP tack to latest form Git.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / portable / NetworkInterface / Zynq / x_emacpsif_physpeed.c
index dd0cf0ab75723fef3e646efa46b1dc7fd359f519..d1999a73e8041c2dca776272d5333b21b17f7042 100644 (file)
@@ -234,8 +234,8 @@ unsigned get_IEEE_phy_speed(XEmacPs *xemacpsp)
                if (partner_capabilities & IEEE_AN1_ABILITY_MASK_10MBPS)\r
                        return 10;\r
 \r
-               xil_printf("%s: unknown PHY link speed, setting TEMAC speed to be 10 Mbps\n",\r
-                               __FUNCTION__);\r
+               FreeRTOS_printf( ( "%s: unknown PHY link speed, setting TEMAC speed to be 10 Mbps\n",\r
+                               __FUNCTION__ ) );\r
                return 10;\r
 \r
        } else {\r
@@ -253,8 +253,8 @@ unsigned get_IEEE_phy_speed(XEmacPs *xemacpsp)
                                case (IEEE_CTRL_LINKSPEED_10M):\r
                                        return 10;\r
                                default:\r
-                                       xil_printf("%s: unknown PHY link speed (%d), setting TEMAC speed to be 10 Mbps\n",\r
-                                                       __FUNCTION__, phylinkspeed);\r
+                                       FreeRTOS_printf( ( "%s: unknown PHY link speed (%d), setting TEMAC speed to be 10 Mbps\n",\r
+                                                       __FUNCTION__, phylinkspeed ) );\r
                                        return 10;\r
                        }\r
 \r
@@ -278,7 +278,7 @@ unsigned get_IEEE_phy_speed(XEmacPs *xemacpsp)
 #else\r
        u32 phy_addr = detect_phy(xemacpsp);\r
 #endif\r
-       xil_printf("Start PHY autonegotiation \n");\r
+       FreeRTOS_printf( ( "Start PHY autonegotiation \n" ) );\r
 \r
 #if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1\r
 #else\r
@@ -334,24 +334,24 @@ unsigned get_IEEE_phy_speed(XEmacPs *xemacpsp)
                        break;\r
        }\r
 #endif\r
-       xil_printf("Waiting for PHY to complete autonegotiation.\n");\r
+       FreeRTOS_printf( ( "Waiting for PHY to complete autonegotiation.\n" ) );\r
 \r
        XEmacPs_PhyRead(xemacpsp, phy_addr, IEEE_STATUS_REG_OFFSET, &status);\r
        while ( !(status & IEEE_STAT_AUTONEGOTIATE_COMPLETE) ) {\r
-               sleep(1);\r
+               vTaskDelay(1);\r
 #if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1\r
 #else\r
                XEmacPs_PhyRead(xemacpsp, phy_addr, IEEE_COPPER_SPECIFIC_STATUS_REG_2,\r
                                                                                                                                        &temp);\r
                if (temp & IEEE_AUTONEG_ERROR_MASK) {\r
-                       xil_printf("Auto negotiation error \n");\r
+                       FreeRTOS_printf( ( "Auto negotiation error \n" ) );\r
                }\r
 #endif\r
                XEmacPs_PhyRead(xemacpsp, phy_addr, IEEE_STATUS_REG_OFFSET,\r
                                                                                                                                &status);\r
                }\r
 \r
-       xil_printf("autonegotiation complete \n");\r
+       FreeRTOS_printf( ( "autonegotiation complete \n" ) );\r
 \r
 #if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1\r
 #else\r
@@ -359,7 +359,7 @@ unsigned get_IEEE_phy_speed(XEmacPs *xemacpsp)
 #endif\r
 \r
 #if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1\r
-       xil_printf("Waiting for Link to be up; Polling for SGMII core Reg \n");\r
+       FreeRTOS_printf( ( "Waiting for Link to be up; Polling for SGMII core Reg \n" ) );\r
        XEmacPs_PhyRead(xemacpsp, phy_addr, 5, &temp);\r
        while(!(temp & 0x8000)) {\r
                XEmacPs_PhyRead(xemacpsp, phy_addr, 5, &temp);\r
@@ -376,7 +376,7 @@ unsigned get_IEEE_phy_speed(XEmacPs *xemacpsp)
                XEmacPs_PhyRead(xemacpsp, phy_addr, 0, &temp);\r
                return 10;\r
        } else {\r
-               xil_printf("get_IEEE_phy_speed(): Invalid speed bit value, Deafulting to Speed = 10 Mbps\n");\r
+               FreeRTOS_printf( ( "get_IEEE_phy_speed(): Invalid speed bit value, Deafulting to Speed = 10 Mbps\n" ) );\r
                XEmacPs_PhyRead(xemacpsp, phy_addr, 0, &temp);\r
                XEmacPs_PhyWrite(xemacpsp, phy_addr, 0, 0x0100);\r
                return 10;\r
@@ -556,26 +556,26 @@ unsigned Phy_Setup (XEmacPs *xemacpsp)
        link_speed = 1000;\r
        configure_IEEE_phy_speed(xemacpsp, link_speed);\r
        convspeeddupsetting = XEMACPS_GMII2RGMII_SPEED1000_FD;\r
-       sleep(1);\r
+       vTaskDelay(1);\r
 #elif  defined(ipconfigNIC_LINKSPEED100)\r
        SetUpSLCRDivisors(xemacpsp->Config.BaseAddress,100);\r
        link_speed = 100;\r
        configure_IEEE_phy_speed(xemacpsp, link_speed);\r
        convspeeddupsetting = XEMACPS_GMII2RGMII_SPEED100_FD;\r
-       sleep(1);\r
+       vTaskDelay(1);\r
 #elif  defined(ipconfigNIC_LINKSPEED10)\r
        SetUpSLCRDivisors(xemacpsp->Config.BaseAddress,10);\r
        link_speed = 10;\r
        configure_IEEE_phy_speed(xemacpsp, link_speed);\r
        convspeeddupsetting = XEMACPS_GMII2RGMII_SPEED10_FD;\r
-       sleep(1);\r
+       vTaskDelay(1);\r
 #endif\r
        if (conv_present) {\r
                XEmacPs_PhyWrite(xemacpsp, convphyaddr,\r
                XEMACPS_GMII2RGMII_REG_NUM, convspeeddupsetting);\r
        }\r
 \r
-       xil_printf("link speed: %d\n", link_speed);\r
+       FreeRTOS_printf( ( "link speed: %d\n", link_speed ) );\r
        return link_speed;\r
 }\r
 \r