CVSROOT:        /cvs
Module name:    src
Changes by:     s...@cvs.openbsd.org    2017/08/12 10:40:55

Modified files:
        sys/dev/pci    : if_em_hw.c if_em_hw.h 

Log message:
em: Disable ultra-low-power mode on boot

With i219V, it sometimes happens that em fails to attach with this error:

em0: Hardware Initialization Failed
em0: Unable to initialize the hardware

This happens always if booting native Windows 10 first and then rebooting into
openbsd without switching the laptop off. But it has also been seen in other
cases.

This change ports the e1000_disable_ulp_lpt_lp() logic from the FreeBSD driver
to disable ultra-low-power (ULP) mode.  This seems to fix the problem in many
(but not all) cases.

The code has been merged in a way to make the diff from FreeBSD minimal.  For
example, the SWFW register is called H2ME on newer chips, so a new define is
introduced. Also, the em_toggle_lanphypc_pch_lpt() function is left as separate
function even if only used in one place at the moment.

ok tom@
"commit it" deraadt@

Reply via email to