Преглед на файлове

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

tags/v0.9.3
Michael Brown преди 18 години
родител
ревизия
5817c9f114
променени са 1 файла, в които са добавени 20 реда и са изтрити 3 реда
  1. 20
    3
      src/arch/i386/drivers/net/undinet.c

+ 20
- 3
src/arch/i386/drivers/net/undinet.c Целия файл

@@ -182,9 +182,6 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
182 182
 	 */	
183 183
 	gateA20_set();
184 184
 
185
-	/* Copy parameter block back */
186
-	memcpy ( params, &undinet_params, params_len );
187
-
188 185
 	/* Determine return status code based on PXENV_EXIT and
189 186
 	 * PXENV_STATUS
190 187
 	 */
@@ -199,10 +196,30 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
199 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 202
 	if ( rc != 0 ) {
203
+		SEGOFF16_t rm_params = {
204
+			.segment = rm_ds,
205
+			.offset = (intptr_t) &__from_data16 ( undinet_params ),
206
+		};
207
+
203 208
 		DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
204 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 223
 	return rc;
207 224
 }
208 225
 

Loading…
Отказ
Запис