]> Zhao Yanbai Git Server - minix.git/commitdiff
replace tickdelay with micro_delay to be quantum-agnostic 03/3503/1
authorrlfnb <rlfnb@rlfnb.de>
Thu, 1 Jun 2017 09:02:25 +0000 (11:02 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Thu, 1 Jun 2017 17:48:56 +0000 (19:48 +0200)
Change-Id: Ie449d797389a178372035d797c84b02d636788cd

minix/drivers/net/dp8390/3c503.c
minix/drivers/net/dp8390/ne2000.c
minix/drivers/net/e1000/e1000.c
minix/drivers/net/fxp/fxp.c
minix/drivers/net/lan8710a/lan8710a.c

index d88505fd98079d757b64d454b11165266e808cf9..aca86c88b7ceac0bc6d17a7f8c1311602e5f0d84 100644 (file)
@@ -26,7 +26,6 @@ extern u32_t system_hz;
 
 static void el2_init(dpeth_t *dep);
 static void el2_stop(dpeth_t *dep);
-static void milli_delay(unsigned long millis);
 
 /*===========================================================================*
  *                             el2_init                                     *
@@ -154,9 +153,9 @@ dpeth_t * dep;
 
   /* Resets board */
   outb_el2(dep, EL2_CNTR, ECNTR_RESET | thin);
-  milli_delay(1);
+  micro_delay(1000);
   outb_el2(dep, EL2_CNTR, thin);
-  milli_delay(5);
+  micro_delay(5000);
 
   /* Map the address PROM to lower I/O address range */
   outb_el2(dep, EL2_CNTR, ECNTR_SAPROM | thin);
@@ -184,11 +183,6 @@ dpeth_t * dep;
   return 1;
 }
 
-static void milli_delay(unsigned long millis)
-{
-       tickdelay(MILLIS_TO_TICKS(millis));
-}
-
 #endif /* ENABLE_3C503 */
 
 /** 3c503.c **/
index 4aa990c5b7a99e9fbd0a1b58aca0d9aac4f90722..65c541b7374984cfed4e013c023a80c0ed2664aa 100644 (file)
@@ -32,7 +32,6 @@ static u8_t   pat3[]= { 0x96, 0x69, 0x5A, 0xA5 };
 static int test_8(dpeth_t *dep, int pos, u8_t *pat);
 static int test_16(dpeth_t *dep, int pos, u8_t *pat);
 static void ne_stop(dpeth_t *dep);
-static void milli_delay(unsigned long millis);
 
 /*===========================================================================*
  *                             ne_probe                                     *
@@ -56,9 +55,9 @@ int ne_probe(dpeth_t *dep)
        {
                /* Reset the ethernet card */
                byte= inb_ne(dep, NE_RESET);
-               milli_delay(2);
+               micro_delay(2000);
                outb_ne(dep, NE_RESET, byte);
-               milli_delay(2);
+               micro_delay(2000);
 
                /* Reset the dp8390 */
                outb_reg0(dep, DP_CR, CR_STP | CR_DM_ABORT);
@@ -310,15 +309,10 @@ dpeth_t *dep;
 
        /* Reset the ethernet card */
        byte= inb_ne(dep, NE_RESET);
-       milli_delay(2);
+       micro_delay(2000);
        outb_ne(dep, NE_RESET, byte);
 }
 
-static void milli_delay(unsigned long millis)
-{
-       tickdelay(MILLIS_TO_TICKS(millis));
-}
-
 #endif /* ENABLE_NE2000 */
 
 /*
index b8a30691c5eb13099c7506b34092b2b0f2a8c868..3f309c1b8cb8fef3635282e163895f41a7b89e2a 100644 (file)
@@ -239,7 +239,7 @@ e1000_reset_hw(e1000_t * e)
        e1000_reg_set(e, E1000_REG_CTRL, E1000_REG_CTRL_RST);
 
        /* Wait one microsecond. */
-       tickdelay(1);
+       micro_delay(16000);
 }
 
 /*
@@ -792,7 +792,7 @@ eeprom_ich_init(e1000_t * e)
                                ret_val = 0;
                                break;
                        }
-                       tickdelay(1);
+                       micro_delay(16000);
                }
                if (ret_val == 0) {
                        /*
@@ -834,7 +834,7 @@ eeprom_ich_cycle(e1000_t * e, u32_t timeout)
                hsfsts.regval = E1000_READ_FLASH_REG16(e, ICH_FLASH_HSFSTS);
                if (hsfsts.hsf_status.flcdone == 1)
                        break;
-               tickdelay(1);
+               micro_delay(16000);
        } while (i++ < timeout);
 
        if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0)
@@ -867,7 +867,7 @@ eeprom_ich(e1000_t * e, int reg)
            e->flash_base_addr;
 
        do {
-               tickdelay(1);
+               micro_delay(16000);
 
                /* Steps */
                ret_val = eeprom_ich_init(e);
index bc70627d9fa1e2ffe02d0b23581dfc63894f6290..9d664d504dc5eb8a76fdfb42cc506029fdcadce8 100644 (file)
@@ -607,7 +607,7 @@ fxp_t *fp;
 
        /* Reset device */
        fxp_outl(port, CSR_PORT, CP_CMD_SOFT_RESET);
-       tickdelay(micros_to_ticks(CSR_PORT_RESET_DELAY));
+       micro_delay(CSR_PORT_RESET_DELAY);
 
        /* Disable interrupts */
        fxp_outb(port, SCB_INT_MASK, SIM_M);
index ed34c940c89443e46e7fcb0cc073a85bb6d8b712..f25a0fb477d6d68a58a0ffa1457b13e39a6f5e58 100644 (file)
@@ -655,7 +655,7 @@ lan8710a_init_hw(netdriver_addr_t * addr, unsigned int instance)
                        LAN8710A_DEBUG_PRINT(("Autonegotiation failed"));
                        break;
                }
-               tickdelay(100);
+               micro_delay(1666666);
        }
 
        /* GMII RX and TX release from reset. */