From: rlfnb Date: Thu, 1 Jun 2017 09:02:25 +0000 (+0200) Subject: replace tickdelay with micro_delay to be quantum-agnostic X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/man.7.ps?a=commitdiff_plain;h=d4dd6511b9dc029206ce2c925ed135e16555aae4;p=minix.git replace tickdelay with micro_delay to be quantum-agnostic Change-Id: Ie449d797389a178372035d797c84b02d636788cd --- diff --git a/minix/drivers/net/dp8390/3c503.c b/minix/drivers/net/dp8390/3c503.c index d88505fd9..aca86c88b 100644 --- a/minix/drivers/net/dp8390/3c503.c +++ b/minix/drivers/net/dp8390/3c503.c @@ -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 **/ diff --git a/minix/drivers/net/dp8390/ne2000.c b/minix/drivers/net/dp8390/ne2000.c index 4aa990c5b..65c541b73 100644 --- a/minix/drivers/net/dp8390/ne2000.c +++ b/minix/drivers/net/dp8390/ne2000.c @@ -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 */ /* diff --git a/minix/drivers/net/e1000/e1000.c b/minix/drivers/net/e1000/e1000.c index b8a30691c..3f309c1b8 100644 --- a/minix/drivers/net/e1000/e1000.c +++ b/minix/drivers/net/e1000/e1000.c @@ -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); diff --git a/minix/drivers/net/fxp/fxp.c b/minix/drivers/net/fxp/fxp.c index bc70627d9..9d664d504 100644 --- a/minix/drivers/net/fxp/fxp.c +++ b/minix/drivers/net/fxp/fxp.c @@ -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); diff --git a/minix/drivers/net/lan8710a/lan8710a.c b/minix/drivers/net/lan8710a/lan8710a.c index ed34c940c..f25a0fb47 100644 --- a/minix/drivers/net/lan8710a/lan8710a.c +++ b/minix/drivers/net/lan8710a/lan8710a.c @@ -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. */