[hermon] Ensure hardware is quiescent when no interfaces are open

WinPE has been observed to call PXENV_UNDI_SHUTDOWN but not
PXENV_STOP_UNDI.  This means that Hermon hardware is left partially
active (firmware running and one event queue mapped) when WinPE starts
up, which can cause a Blue Screen of Death.

Fix by ensuring that the hardware is left quiescent (with the firmware
stopped) when no interfaces are open.

Reported-by: Itay Gazit <itayg@mellanox.co.il>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-11-15 04:12:07 +00:00
parent a02f9e0ca5
commit 6dd4ac77e5
2 changed files with 217 additions and 81 deletions
+23 -2
View File
@@ -829,6 +829,8 @@ struct hermon_port {
/** A Hermon device */
struct hermon {
/** PCI device */
struct pci_device *pci;
/** PCI configuration registers */
void *config;
/** PCI user Access Region */
@@ -841,11 +843,30 @@ struct hermon {
/** Command output mailbox */
void *mailbox_out;
/** Firmware area in external memory */
/** Device open request counter */
unsigned int open_count;
/** Firmware size */
size_t firmware_len;
/** Firmware area in external memory
*
* This is allocated when first needed, and freed only on
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t firmware_area;
/** ICM map */
struct hermon_icm_map icm_map[HERMON_ICM_NUM_REGIONS];
/** ICM area */
/** ICM size */
size_t icm_len;
/** ICM AUX size */
size_t icm_aux_len;
/** ICM area
*
* This is allocated when first needed, and freed only on
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t icm;
/** Event queue */