From fbdebac5f4ad3c921fbee7091cec6f44db045c78 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 8 Jan 2007 05:06:26 +0000 Subject: [PATCH] Copy pxelinux's shutdown sequence: use UNLOAD_STACK without STOP_BASE, and call UNDI_SHUTDOWN first to make sure the NIC is in a safe state. --- src/arch/i386/prefix/pxeprefix.S | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/arch/i386/prefix/pxeprefix.S b/src/arch/i386/prefix/pxeprefix.S index 28e2716e5..a34bf5f86 100644 --- a/src/arch/i386/prefix/pxeprefix.S +++ b/src/arch/i386/prefix/pxeprefix.S @@ -1,6 +1,6 @@ +#define PXENV_UNDI_SHUTDOWN 0x05 #define PXENV_STOP_UNDI 0x15 #define PXENV_UNLOAD_STACK 0x70 -#define PXENV_STOP_BASE 0x76 #define PXE_STACK_MAGIC 0x57ac /* 'STac' */ @@ -138,13 +138,19 @@ find_undi_basemem_usage: shrw $6, %cx movw %cx, undi_fbms_end +/***************************************************************************** + * Leave NIC in a safe state + ***************************************************************************** + */ +shutdown_nic: + movw $PXENV_UNDI_SHUTDOWN, %bx + call pxe_call + /***************************************************************************** * Unload PXE base code ***************************************************************************** */ unload_base_code: - movw $PXENV_STOP_BASE, %bx - call pxe_call movw $PXENV_UNLOAD_STACK, %bx call pxe_call jnz do_not_free_base_code