Browse Source

When an UNDI API call fails, print everything there is to know about it.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
5817c9f114
1 changed files with 20 additions and 3 deletions
  1. 20
    3
      src/arch/i386/drivers/net/undinet.c

+ 20
- 3
src/arch/i386/drivers/net/undinet.c View File

182
 	 */	
182
 	 */	
183
 	gateA20_set();
183
 	gateA20_set();
184
 
184
 
185
-	/* Copy parameter block back */
186
-	memcpy ( params, &undinet_params, params_len );
187
-
188
 	/* Determine return status code based on PXENV_EXIT and
185
 	/* Determine return status code based on PXENV_EXIT and
189
 	 * PXENV_STATUS
186
 	 * PXENV_STATUS
190
 	 */
187
 	 */
199
 			rc = -EIO;
196
 			rc = -EIO;
200
 	}
197
 	}
201
 
198
 
199
+	/* If anything goes wrong, print as much debug information as
200
+	 * it's possible to give.
201
+	 */
202
 	if ( rc != 0 ) {
202
 	if ( rc != 0 ) {
203
+		SEGOFF16_t rm_params = {
204
+			.segment = rm_ds,
205
+			.offset = (intptr_t) &__from_data16 ( undinet_params ),
206
+		};
207
+
203
 		DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
208
 		DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
204
 		       undinet_function_name ( function ), strerror ( rc ) );
209
 		       undinet_function_name ( function ), strerror ( rc ) );
210
+		DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
211
+		       "%#02x, entry point at %04x:%04x\n", undinic,
212
+		       rm_params.segment, rm_params.offset, params_len,
213
+		       undinic->entry.segment, undinic->entry.offset );
214
+		DBGC ( undinic, "UNDINIC %p parameters provided:\n", undinic );
215
+		DBGC_HDA ( undinic, rm_params, params, params_len );
216
+		DBGC ( undinic, "UNDINIC %p parameters returned:\n", undinic );
217
+		DBGC_HDA ( undinic, rm_params, &undinet_params, params_len );
205
 	}
218
 	}
219
+
220
+	/* Copy parameter block back */
221
+	memcpy ( params, &undinet_params, params_len );
222
+
206
 	return rc;
223
 	return rc;
207
 }
224
 }
208
 
225
 

Loading…
Cancel
Save