summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2007-01-13 17:53:55 +0100
committerMichael Brown2007-01-13 17:53:55 +0100
commit5817c9f11499a24d9b3b21e0fa9ddfef7aa7ff70 (patch)
treec79617c0ea4a3d2267884659b486b380a2c1e0e3 /src
parentHex dumps are now integrated into the DBG() framework. (diff)
downloadipxe-5817c9f11499a24d9b3b21e0fa9ddfef7aa7ff70.tar.gz
ipxe-5817c9f11499a24d9b3b21e0fa9ddfef7aa7ff70.tar.xz
ipxe-5817c9f11499a24d9b3b21e0fa9ddfef7aa7ff70.zip
When an UNDI API call fails, print everything there is to know about it.
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/drivers/net/undinet.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/arch/i386/drivers/net/undinet.c b/src/arch/i386/drivers/net/undinet.c
index a98d09d64..822afa7b7 100644
--- a/src/arch/i386/drivers/net/undinet.c
+++ b/src/arch/i386/drivers/net/undinet.c
@@ -182,9 +182,6 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
*/
gateA20_set();
- /* Copy parameter block back */
- memcpy ( params, &undinet_params, params_len );
-
/* Determine return status code based on PXENV_EXIT and
* PXENV_STATUS
*/
@@ -199,10 +196,30 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
rc = -EIO;
}
+ /* If anything goes wrong, print as much debug information as
+ * it's possible to give.
+ */
if ( rc != 0 ) {
+ SEGOFF16_t rm_params = {
+ .segment = rm_ds,
+ .offset = (intptr_t) &__from_data16 ( undinet_params ),
+ };
+
DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
undinet_function_name ( function ), strerror ( rc ) );
+ DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
+ "%#02x, entry point at %04x:%04x\n", undinic,
+ rm_params.segment, rm_params.offset, params_len,
+ undinic->entry.segment, undinic->entry.offset );
+ DBGC ( undinic, "UNDINIC %p parameters provided:\n", undinic );
+ DBGC_HDA ( undinic, rm_params, params, params_len );
+ DBGC ( undinic, "UNDINIC %p parameters returned:\n", undinic );
+ DBGC_HDA ( undinic, rm_params, &undinet_params, params_len );
}
+
+ /* Copy parameter block back */
+ memcpy ( params, &undinet_params, params_len );
+
return rc;
}