diff --git a/sys/dev/e1000/e1000_osdep.h b/sys/dev/e1000/e1000_osdep.h --- a/sys/dev/e1000/e1000_osdep.h +++ b/sys/dev/e1000/e1000_osdep.h @@ -79,9 +79,11 @@ } } +extern int e1000_use_pause_delay; + static inline void safe_pause_us(int x) { - if (cold) { + if (!e1000_use_pause_delay) { DELAY(x); } else { pause("e1000_delay", max(1, x/(1000000/hz))); @@ -90,7 +92,7 @@ static inline void safe_pause_ms(int x) { - if (cold) { + if (!e1000_use_pause_delay) { DELAY(x*1000); } else { pause("e1000_delay", ms_scale(x)); diff --git a/sys/dev/e1000/e1000_osdep.c b/sys/dev/e1000/e1000_osdep.c --- a/sys/dev/e1000/e1000_osdep.c +++ b/sys/dev/e1000/e1000_osdep.c @@ -34,6 +34,16 @@ #include "e1000_api.h" +int e1000_use_pause_delay = 0; + +static void +e1000_enable_pause_delay(void *use_pause_delay) +{ + *((int *)use_pause_delay) = 1; +} + +SYSINIT(enable_pause_delay, SI_SUB_CLOCKS, SI_ORDER_ANY, e1000_enable_pause_delay, &e1000_use_pause_delay); + /* * NOTE: the following routines using the e1000 * naming style are provided to the shared