Browse Source

[pxe] Improve pxe_undi debugging messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
524349c559
1 changed files with 84 additions and 76 deletions
  1. 84
    76
      src/arch/i386/interface/pxe/pxe_undi.c

+ 84
- 76
src/arch/i386/interface/pxe/pxe_undi.c View File

104
 	unsigned int i;
104
 	unsigned int i;
105
 
105
 
106
 	for ( i = 0 ; i < mcast->MCastAddrCount ; i++ ) {
106
 	for ( i = 0 ; i < mcast->MCastAddrCount ; i++ ) {
107
-		DBG ( " %s", ll_protocol->ntoa ( mcast->McastAddr[i] ) );
107
+		DBGC ( &pxe_netdev, " %s",
108
+		       ll_protocol->ntoa ( mcast->McastAddr[i] ) );
108
 	}
109
 	}
109
 }
110
 }
110
 
111
 
113
  * Status: working
114
  * Status: working
114
  */
115
  */
115
 PXENV_EXIT_t pxenv_undi_startup ( struct s_PXENV_UNDI_STARTUP *undi_startup ) {
116
 PXENV_EXIT_t pxenv_undi_startup ( struct s_PXENV_UNDI_STARTUP *undi_startup ) {
116
-	DBG ( "PXENV_UNDI_STARTUP\n" );
117
+	DBGC ( &pxe_netdev, "PXENV_UNDI_STARTUP\n" );
117
 
118
 
118
 	undi_startup->Status = PXENV_STATUS_SUCCESS;
119
 	undi_startup->Status = PXENV_STATUS_SUCCESS;
119
 	return PXENV_EXIT_SUCCESS;
120
 	return PXENV_EXIT_SUCCESS;
124
  * Status: working
125
  * Status: working
125
  */
126
  */
126
 PXENV_EXIT_t pxenv_undi_cleanup ( struct s_PXENV_UNDI_CLEANUP *undi_cleanup ) {
127
 PXENV_EXIT_t pxenv_undi_cleanup ( struct s_PXENV_UNDI_CLEANUP *undi_cleanup ) {
127
-	DBG ( "PXENV_UNDI_CLEANUP\n" );
128
+	DBGC ( &pxe_netdev, "PXENV_UNDI_CLEANUP\n" );
128
 
129
 
129
 	pxe_netdev_close();
130
 	pxe_netdev_close();
130
 
131
 
138
  */
139
  */
139
 PXENV_EXIT_t pxenv_undi_initialize ( struct s_PXENV_UNDI_INITIALIZE
140
 PXENV_EXIT_t pxenv_undi_initialize ( struct s_PXENV_UNDI_INITIALIZE
140
 				     *undi_initialize ) {
141
 				     *undi_initialize ) {
141
-	DBG ( "PXENV_UNDI_INITIALIZE protocolini %08x\n",
142
-	      undi_initialize->ProtocolIni );
142
+	DBGC ( &pxe_netdev, "PXENV_UNDI_INITIALIZE protocolini %08x\n",
143
+	       undi_initialize->ProtocolIni );
143
 
144
 
144
 	undi_initialize->Status = PXENV_STATUS_SUCCESS;
145
 	undi_initialize->Status = PXENV_STATUS_SUCCESS;
145
 	return PXENV_EXIT_SUCCESS;
146
 	return PXENV_EXIT_SUCCESS;
153
 					*undi_reset_adapter ) {
154
 					*undi_reset_adapter ) {
154
 	int rc;
155
 	int rc;
155
 
156
 
156
-	DBG ( "PXENV_UNDI_RESET_ADAPTER" );
157
+	DBGC ( &pxe_netdev, "PXENV_UNDI_RESET_ADAPTER" );
157
 	pxe_dump_mcast_list ( &undi_reset_adapter->R_Mcast_Buf );
158
 	pxe_dump_mcast_list ( &undi_reset_adapter->R_Mcast_Buf );
158
-	DBG ( "\n" );
159
+	DBGC ( &pxe_netdev, "\n" );
159
 
160
 
160
 	pxe_netdev_close();
161
 	pxe_netdev_close();
161
 	if ( ( rc = pxe_netdev_open() ) != 0 ) {
162
 	if ( ( rc = pxe_netdev_open() ) != 0 ) {
162
-		DBG ( "PXENV_UNDI_RESET_ADAPTER could not reopen %s: %s\n",
163
-		      pxe_netdev->name, strerror ( rc ) );
163
+		DBGC ( &pxe_netdev, "PXENV_UNDI_RESET_ADAPTER could not "
164
+		       "reopen %s: %s\n", pxe_netdev->name, strerror ( rc ) );
164
 		undi_reset_adapter->Status = PXENV_STATUS ( rc );
165
 		undi_reset_adapter->Status = PXENV_STATUS ( rc );
165
 		return PXENV_EXIT_FAILURE;
166
 		return PXENV_EXIT_FAILURE;
166
 	}
167
 	}
175
  */
176
  */
176
 PXENV_EXIT_t pxenv_undi_shutdown ( struct s_PXENV_UNDI_SHUTDOWN
177
 PXENV_EXIT_t pxenv_undi_shutdown ( struct s_PXENV_UNDI_SHUTDOWN
177
 				   *undi_shutdown ) {
178
 				   *undi_shutdown ) {
178
-	DBG ( "PXENV_UNDI_SHUTDOWN\n" );
179
+	DBGC ( &pxe_netdev, "PXENV_UNDI_SHUTDOWN\n" );
179
 
180
 
180
 	pxe_netdev_close();
181
 	pxe_netdev_close();
181
 
182
 
190
 PXENV_EXIT_t pxenv_undi_open ( struct s_PXENV_UNDI_OPEN *undi_open ) {
191
 PXENV_EXIT_t pxenv_undi_open ( struct s_PXENV_UNDI_OPEN *undi_open ) {
191
 	int rc;
192
 	int rc;
192
 
193
 
193
-	DBG ( "PXENV_UNDI_OPEN flag %04x filter %04x",
194
-	      undi_open->OpenFlag, undi_open->PktFilter );
194
+	DBGC ( &pxe_netdev, "PXENV_UNDI_OPEN flag %04x filter %04x",
195
+	       undi_open->OpenFlag, undi_open->PktFilter );
195
 	pxe_dump_mcast_list ( &undi_open->R_Mcast_Buf );
196
 	pxe_dump_mcast_list ( &undi_open->R_Mcast_Buf );
196
-	DBG ( "\n" );
197
+	DBGC ( &pxe_netdev, "\n" );
197
 
198
 
198
 	if ( ( rc = pxe_netdev_open() ) != 0 ) {
199
 	if ( ( rc = pxe_netdev_open() ) != 0 ) {
199
-		DBG ( "PXENV_UNDI_OPEN could not open %s: %s\n",
200
-		      pxe_netdev->name, strerror ( rc ) );
200
+		DBGC ( &pxe_netdev, "PXENV_UNDI_OPEN could not open %s: %s\n",
201
+		       pxe_netdev->name, strerror ( rc ) );
201
 		undi_open->Status = PXENV_STATUS ( rc );
202
 		undi_open->Status = PXENV_STATUS ( rc );
202
 		return PXENV_EXIT_FAILURE;
203
 		return PXENV_EXIT_FAILURE;
203
 	}
204
 	}
211
  * Status: working
212
  * Status: working
212
  */
213
  */
213
 PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close ) {
214
 PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close ) {
214
-	DBG ( "PXENV_UNDI_CLOSE\n" );
215
+	DBGC ( &pxe_netdev, "PXENV_UNDI_CLOSE\n" );
215
 
216
 
216
 	pxe_netdev_close();
217
 	pxe_netdev_close();
217
 
218
 
236
 	unsigned int i;
237
 	unsigned int i;
237
 	int rc;
238
 	int rc;
238
 
239
 
239
-	DBG2 ( "PXENV_UNDI_TRANSMIT" );
240
+	DBGC2 ( &pxe_netdev, "PXENV_UNDI_TRANSMIT" );
240
 
241
 
241
 	/* Forcibly enable interrupts and freeze receive queue
242
 	/* Forcibly enable interrupts and freeze receive queue
242
 	 * processing at this point, to work around callers that never
243
 	 * processing at this point, to work around callers that never
254
 		net_protocol = NULL;
255
 		net_protocol = NULL;
255
 		break;
256
 		break;
256
 	default:
257
 	default:
257
-		DBG2 ( " %02x invalid protocol\n", undi_transmit->Protocol );
258
+		DBGC2 ( &pxe_netdev, " %02x invalid protocol\n",
259
+			undi_transmit->Protocol );
258
 		undi_transmit->Status = PXENV_STATUS_UNDI_INVALID_PARAMETER;
260
 		undi_transmit->Status = PXENV_STATUS_UNDI_INVALID_PARAMETER;
259
 		return PXENV_EXIT_FAILURE;
261
 		return PXENV_EXIT_FAILURE;
260
 	}
262
 	}
261
-	DBG2 ( " %s", ( net_protocol ? net_protocol->name : "RAW" ) );
263
+	DBGC2 ( &pxe_netdev, " %s",
264
+		( net_protocol ? net_protocol->name : "RAW" ) );
262
 
265
 
263
 	/* Calculate total packet length */
266
 	/* Calculate total packet length */
264
 	copy_from_real ( &tbd, undi_transmit->TBD.segment,
267
 	copy_from_real ( &tbd, undi_transmit->TBD.segment,
265
 			 undi_transmit->TBD.offset, sizeof ( tbd ) );
268
 			 undi_transmit->TBD.offset, sizeof ( tbd ) );
266
 	len = tbd.ImmedLength;
269
 	len = tbd.ImmedLength;
267
-	DBG2 ( " %04x:%04x+%x", tbd.Xmit.segment, tbd.Xmit.offset,
268
-	       tbd.ImmedLength );
270
+	DBGC2 ( &pxe_netdev, " %04x:%04x+%x", tbd.Xmit.segment, tbd.Xmit.offset,
271
+		tbd.ImmedLength );
269
 	for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {
272
 	for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {
270
 		datablk = &tbd.DataBlock[i];
273
 		datablk = &tbd.DataBlock[i];
271
 		len += datablk->TDDataLen;
274
 		len += datablk->TDDataLen;
272
-		DBG2 ( " %04x:%04x+%x", datablk->TDDataPtr.segment,
273
-		       datablk->TDDataPtr.offset, datablk->TDDataLen );
275
+		DBGC2 ( &pxe_netdev, " %04x:%04x+%x",
276
+			datablk->TDDataPtr.segment, datablk->TDDataPtr.offset,
277
+			datablk->TDDataLen );
274
 	}
278
 	}
275
 
279
 
276
 	/* Allocate and fill I/O buffer */
280
 	/* Allocate and fill I/O buffer */
277
 	iobuf = alloc_iob ( MAX_LL_HEADER_LEN + len );
281
 	iobuf = alloc_iob ( MAX_LL_HEADER_LEN + len );
278
 	if ( ! iobuf ) {
282
 	if ( ! iobuf ) {
279
-		DBG2 ( " could not allocate iobuf\n" );
283
+		DBGC2 ( &pxe_netdev, " could not allocate iobuf\n" );
280
 		undi_transmit->Status = PXENV_STATUS_OUT_OF_RESOURCES;
284
 		undi_transmit->Status = PXENV_STATUS_OUT_OF_RESOURCES;
281
 		return PXENV_EXIT_FAILURE;
285
 		return PXENV_EXIT_FAILURE;
282
 	}
286
 	}
301
 					 undi_transmit->DestAddr.offset,
305
 					 undi_transmit->DestAddr.offset,
302
 					 ll_protocol->ll_addr_len );
306
 					 ll_protocol->ll_addr_len );
303
 			ll_dest = destaddr;
307
 			ll_dest = destaddr;
304
-			DBG2 ( " DEST %s", ll_protocol->ntoa ( ll_dest ) );
308
+			DBGC2 ( &pxe_netdev, " DEST %s",
309
+				ll_protocol->ntoa ( ll_dest ) );
305
 		} else {
310
 		} else {
306
 			ll_dest = pxe_netdev->ll_broadcast;
311
 			ll_dest = pxe_netdev->ll_broadcast;
307
-			DBG2 ( " BCAST" );
312
+			DBGC2 ( &pxe_netdev, " BCAST" );
308
 		}
313
 		}
309
 
314
 
310
 		/* Add link-layer header */
315
 		/* Add link-layer header */
311
 		if ( ( rc = ll_protocol->push ( pxe_netdev, iobuf, ll_dest,
316
 		if ( ( rc = ll_protocol->push ( pxe_netdev, iobuf, ll_dest,
312
 						pxe_netdev->ll_addr,
317
 						pxe_netdev->ll_addr,
313
 						net_protocol->net_proto ))!=0){
318
 						net_protocol->net_proto ))!=0){
314
-			DBG2 ( " could not add link-layer header: %s\n",
315
-			       strerror ( rc ) );
319
+			DBGC2 ( &pxe_netdev, " could not add link-layer "
320
+				"header: %s\n", strerror ( rc ) );
316
 			free_iob ( iobuf );
321
 			free_iob ( iobuf );
317
 			undi_transmit->Status = PXENV_STATUS ( rc );
322
 			undi_transmit->Status = PXENV_STATUS ( rc );
318
 			return PXENV_EXIT_FAILURE;
323
 			return PXENV_EXIT_FAILURE;
326
 	undi_tx_count++;
331
 	undi_tx_count++;
327
 
332
 
328
 	/* Transmit packet */
333
 	/* Transmit packet */
329
-	DBG2 ( "\n" );
334
+	DBGC2 ( &pxe_netdev, "\n" );
330
 	if ( ( rc = netdev_tx ( pxe_netdev, iobuf ) ) != 0 ) {
335
 	if ( ( rc = netdev_tx ( pxe_netdev, iobuf ) ) != 0 ) {
331
-		DBG2 ( "PXENV_UNDI_TRANSMIT could not transmit: %s\n",
332
-		       strerror ( rc ) );
336
+		DBGC2 ( &pxe_netdev, "PXENV_UNDI_TRANSMIT could not transmit: "
337
+			"%s\n", strerror ( rc ) );
333
 		undi_tx_count--;
338
 		undi_tx_count--;
334
 		undi_transmit->Status = PXENV_STATUS ( rc );
339
 		undi_transmit->Status = PXENV_STATUS ( rc );
335
 		return PXENV_EXIT_FAILURE;
340
 		return PXENV_EXIT_FAILURE;
346
 PXENV_EXIT_t
351
 PXENV_EXIT_t
347
 pxenv_undi_set_mcast_address ( struct s_PXENV_UNDI_SET_MCAST_ADDRESS
352
 pxenv_undi_set_mcast_address ( struct s_PXENV_UNDI_SET_MCAST_ADDRESS
348
 			       *undi_set_mcast_address ) {
353
 			       *undi_set_mcast_address ) {
349
-	DBG ( "PXENV_UNDI_SET_MCAST_ADDRESS" );
354
+	DBGC ( &pxe_netdev, "PXENV_UNDI_SET_MCAST_ADDRESS" );
350
 	pxe_dump_mcast_list ( &undi_set_mcast_address->R_Mcast_Buf );
355
 	pxe_dump_mcast_list ( &undi_set_mcast_address->R_Mcast_Buf );
351
-	DBG ( "\n" );
356
+	DBGC ( &pxe_netdev, "\n" );
352
 
357
 
353
 	undi_set_mcast_address->Status = PXENV_STATUS_SUCCESS;
358
 	undi_set_mcast_address->Status = PXENV_STATUS_SUCCESS;
354
 	return PXENV_EXIT_SUCCESS;
359
 	return PXENV_EXIT_SUCCESS;
363
 				 *undi_set_station_address ) {
368
 				 *undi_set_station_address ) {
364
 	struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol;
369
 	struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol;
365
 
370
 
366
-	DBG ( "PXENV_UNDI_SET_STATION_ADDRESS %s",
367
-	      ll_protocol->ntoa ( undi_set_station_address->StationAddress ) );
371
+	DBGC ( &pxe_netdev, "PXENV_UNDI_SET_STATION_ADDRESS %s",
372
+	       ll_protocol->ntoa ( undi_set_station_address->StationAddress ) );
368
 
373
 
369
 	/* If adapter is open, the change will have no effect; return
374
 	/* If adapter is open, the change will have no effect; return
370
 	 * an error
375
 	 * an error
371
 	 */
376
 	 */
372
 	if ( netdev_is_open ( pxe_netdev ) ) {
377
 	if ( netdev_is_open ( pxe_netdev ) ) {
373
-		DBG ( " failed: netdev is open\n" );
378
+		DBGC ( &pxe_netdev, " failed: netdev is open\n" );
374
 		undi_set_station_address->Status =
379
 		undi_set_station_address->Status =
375
 			PXENV_STATUS_UNDI_INVALID_STATE;
380
 			PXENV_STATUS_UNDI_INVALID_STATE;
376
 		return PXENV_EXIT_FAILURE;
381
 		return PXENV_EXIT_FAILURE;
381
 		 &undi_set_station_address->StationAddress,
386
 		 &undi_set_station_address->StationAddress,
382
 		 ll_protocol->ll_addr_len );
387
 		 ll_protocol->ll_addr_len );
383
 
388
 
384
-	DBG ( "\n" );
389
+	DBGC ( &pxe_netdev, "\n" );
385
 	undi_set_station_address->Status = PXENV_STATUS_SUCCESS;
390
 	undi_set_station_address->Status = PXENV_STATUS_SUCCESS;
386
 	return PXENV_EXIT_SUCCESS;
391
 	return PXENV_EXIT_SUCCESS;
387
 }
392
 }
395
 pxenv_undi_set_packet_filter ( struct s_PXENV_UNDI_SET_PACKET_FILTER
400
 pxenv_undi_set_packet_filter ( struct s_PXENV_UNDI_SET_PACKET_FILTER
396
 			       *undi_set_packet_filter ) {
401
 			       *undi_set_packet_filter ) {
397
 
402
 
398
-	DBG ( "PXENV_UNDI_SET_PACKET_FILTER %02x\n",
399
-	      undi_set_packet_filter->filter );
403
+	DBGC ( &pxe_netdev, "PXENV_UNDI_SET_PACKET_FILTER %02x\n",
404
+	       undi_set_packet_filter->filter );
400
 
405
 
401
 	/* Pretend that we succeeded, otherwise the 3Com DOS UNDI
406
 	/* Pretend that we succeeded, otherwise the 3Com DOS UNDI
402
 	 * driver refuses to load.  (We ignore the filter value in the
407
 	 * driver refuses to load.  (We ignore the filter value in the
417
 	struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol;
422
 	struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol;
418
 	size_t ll_addr_len = ll_protocol->ll_addr_len;
423
 	size_t ll_addr_len = ll_protocol->ll_addr_len;
419
 
424
 
420
-	DBG ( "PXENV_UNDI_GET_INFORMATION" );
425
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_INFORMATION" );
421
 
426
 
422
 	undi_get_information->BaseIo = dev->desc.ioaddr;
427
 	undi_get_information->BaseIo = dev->desc.ioaddr;
423
 	undi_get_information->IntNumber =
428
 	undi_get_information->IntNumber =
441
 	undi_get_information->RxBufCt = 1;
446
 	undi_get_information->RxBufCt = 1;
442
 	undi_get_information->TxBufCt = 1;
447
 	undi_get_information->TxBufCt = 1;
443
 
448
 
444
-	DBG ( " io %04x irq %d mtu %d %s %s\n",
445
-	      undi_get_information->BaseIo, undi_get_information->IntNumber,
446
-	      undi_get_information->MaxTranUnit, ll_protocol->name,
447
-	      ll_protocol->ntoa ( &undi_get_information->CurrentNodeAddress ));
449
+	DBGC ( &pxe_netdev, " io %04x irq %d mtu %d %s %s\n",
450
+	       undi_get_information->BaseIo, undi_get_information->IntNumber,
451
+	       undi_get_information->MaxTranUnit, ll_protocol->name,
452
+	       ll_protocol->ntoa ( &undi_get_information->CurrentNodeAddress ));
448
 	undi_get_information->Status = PXENV_STATUS_SUCCESS;
453
 	undi_get_information->Status = PXENV_STATUS_SUCCESS;
449
 	return PXENV_EXIT_SUCCESS;
454
 	return PXENV_EXIT_SUCCESS;
450
 }
455
 }
455
  */
460
  */
456
 PXENV_EXIT_t pxenv_undi_get_statistics ( struct s_PXENV_UNDI_GET_STATISTICS
461
 PXENV_EXIT_t pxenv_undi_get_statistics ( struct s_PXENV_UNDI_GET_STATISTICS
457
 					 *undi_get_statistics ) {
462
 					 *undi_get_statistics ) {
458
-	DBG ( "PXENV_UNDI_GET_STATISTICS" );
463
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_STATISTICS" );
459
 
464
 
460
 	undi_get_statistics->XmtGoodFrames = pxe_netdev->tx_stats.good;
465
 	undi_get_statistics->XmtGoodFrames = pxe_netdev->tx_stats.good;
461
 	undi_get_statistics->RcvGoodFrames = pxe_netdev->rx_stats.good;
466
 	undi_get_statistics->RcvGoodFrames = pxe_netdev->rx_stats.good;
462
 	undi_get_statistics->RcvCRCErrors = pxe_netdev->rx_stats.bad;
467
 	undi_get_statistics->RcvCRCErrors = pxe_netdev->rx_stats.bad;
463
 	undi_get_statistics->RcvResourceErrors = pxe_netdev->rx_stats.bad;
468
 	undi_get_statistics->RcvResourceErrors = pxe_netdev->rx_stats.bad;
464
 
469
 
465
-	DBG ( " txok %d rxok %d rxcrc %d rxrsrc %d\n",
466
-	      undi_get_statistics->XmtGoodFrames,
467
-	      undi_get_statistics->RcvGoodFrames,
468
-	      undi_get_statistics->RcvCRCErrors,
469
-	      undi_get_statistics->RcvResourceErrors );
470
+	DBGC ( &pxe_netdev, " txok %d rxok %d rxcrc %d rxrsrc %d\n",
471
+	       undi_get_statistics->XmtGoodFrames,
472
+	       undi_get_statistics->RcvGoodFrames,
473
+	       undi_get_statistics->RcvCRCErrors,
474
+	       undi_get_statistics->RcvResourceErrors );
470
 	undi_get_statistics->Status = PXENV_STATUS_SUCCESS;
475
 	undi_get_statistics->Status = PXENV_STATUS_SUCCESS;
471
 	return PXENV_EXIT_SUCCESS;
476
 	return PXENV_EXIT_SUCCESS;
472
 }
477
 }
477
  */
482
  */
478
 PXENV_EXIT_t pxenv_undi_clear_statistics ( struct s_PXENV_UNDI_CLEAR_STATISTICS
483
 PXENV_EXIT_t pxenv_undi_clear_statistics ( struct s_PXENV_UNDI_CLEAR_STATISTICS
479
 					   *undi_clear_statistics ) {
484
 					   *undi_clear_statistics ) {
480
-	DBG ( "PXENV_UNDI_CLEAR_STATISTICS\n" );
485
+	DBGC ( &pxe_netdev, "PXENV_UNDI_CLEAR_STATISTICS\n" );
481
 
486
 
482
 	memset ( &pxe_netdev->tx_stats, 0, sizeof ( pxe_netdev->tx_stats ) );
487
 	memset ( &pxe_netdev->tx_stats, 0, sizeof ( pxe_netdev->tx_stats ) );
483
 	memset ( &pxe_netdev->rx_stats, 0, sizeof ( pxe_netdev->rx_stats ) );
488
 	memset ( &pxe_netdev->rx_stats, 0, sizeof ( pxe_netdev->rx_stats ) );
493
  */
498
  */
494
 PXENV_EXIT_t pxenv_undi_initiate_diags ( struct s_PXENV_UNDI_INITIATE_DIAGS
499
 PXENV_EXIT_t pxenv_undi_initiate_diags ( struct s_PXENV_UNDI_INITIATE_DIAGS
495
 					 *undi_initiate_diags ) {
500
 					 *undi_initiate_diags ) {
496
-	DBG ( "PXENV_UNDI_INITIATE_DIAGS failed: unsupported\n" );
501
+	DBGC ( &pxe_netdev, "PXENV_UNDI_INITIATE_DIAGS failed: unsupported\n" );
497
 
502
 
498
 	undi_initiate_diags->Status = PXENV_STATUS_UNSUPPORTED;
503
 	undi_initiate_diags->Status = PXENV_STATUS_UNSUPPORTED;
499
 	return PXENV_EXIT_FAILURE;
504
 	return PXENV_EXIT_FAILURE;
506
  */
511
  */
507
 PXENV_EXIT_t pxenv_undi_force_interrupt ( struct s_PXENV_UNDI_FORCE_INTERRUPT
512
 PXENV_EXIT_t pxenv_undi_force_interrupt ( struct s_PXENV_UNDI_FORCE_INTERRUPT
508
 					  *undi_force_interrupt ) {
513
 					  *undi_force_interrupt ) {
509
-	DBG ( "PXENV_UNDI_FORCE_INTERRUPT failed: unsupported\n" );
514
+	DBGC ( &pxe_netdev,
515
+	       "PXENV_UNDI_FORCE_INTERRUPT failed: unsupported\n" );
510
 
516
 
511
 	undi_force_interrupt->Status = PXENV_STATUS_UNSUPPORTED;
517
 	undi_force_interrupt->Status = PXENV_STATUS_UNSUPPORTED;
512
 	return PXENV_EXIT_FAILURE;
518
 	return PXENV_EXIT_FAILURE;
523
 	struct in_addr ip = { .s_addr = undi_get_mcast_address->InetAddr };
529
 	struct in_addr ip = { .s_addr = undi_get_mcast_address->InetAddr };
524
 	int rc;
530
 	int rc;
525
 
531
 
526
-	DBG ( "PXENV_UNDI_GET_MCAST_ADDRESS %s", inet_ntoa ( ip ) );
532
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_MCAST_ADDRESS %s",
533
+	       inet_ntoa ( ip ) );
527
 
534
 
528
 	if ( ( rc = ll_protocol->mc_hash ( AF_INET, &ip,
535
 	if ( ( rc = ll_protocol->mc_hash ( AF_INET, &ip,
529
 				      undi_get_mcast_address->MediaAddr ))!=0){
536
 				      undi_get_mcast_address->MediaAddr ))!=0){
530
-		DBG ( " failed: %s\n", strerror ( rc ) );
537
+		DBGC ( &pxe_netdev, " failed: %s\n", strerror ( rc ) );
531
 		undi_get_mcast_address->Status = PXENV_STATUS ( rc );
538
 		undi_get_mcast_address->Status = PXENV_STATUS ( rc );
532
 		return PXENV_EXIT_FAILURE;
539
 		return PXENV_EXIT_FAILURE;
533
 	}
540
 	}
534
-	DBG ( "=>%s\n",
535
-	      ll_protocol->ntoa ( undi_get_mcast_address->MediaAddr ) );
541
+	DBGC ( &pxe_netdev, "=>%s\n",
542
+	       ll_protocol->ntoa ( undi_get_mcast_address->MediaAddr ) );
536
 
543
 
537
 	undi_get_mcast_address->Status = PXENV_STATUS_SUCCESS;
544
 	undi_get_mcast_address->Status = PXENV_STATUS_SUCCESS;
538
 	return PXENV_EXIT_SUCCESS;
545
 	return PXENV_EXIT_SUCCESS;
546
 				       *undi_get_nic_type ) {
553
 				       *undi_get_nic_type ) {
547
 	struct device *dev = pxe_netdev->dev;
554
 	struct device *dev = pxe_netdev->dev;
548
 
555
 
549
-	DBG ( "PXENV_UNDI_GET_NIC_TYPE" );
556
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_NIC_TYPE" );
550
 
557
 
551
 	memset ( &undi_get_nic_type->info, 0,
558
 	memset ( &undi_get_nic_type->info, 0,
552
 		 sizeof ( undi_get_nic_type->info ) );
559
 		 sizeof ( undi_get_nic_type->info ) );
567
 		 * is possible that some NBPs will not provide space
574
 		 * is possible that some NBPs will not provide space
568
 		 * for them, and so we must not fill them in.
575
 		 * for them, and so we must not fill them in.
569
 		 */
576
 		 */
570
-		DBG ( " PCI %02x:%02x.%x %04x:%04x ('%04x:%04x') %02x%02x%02x "
571
-		      "rev %02x\n", PCI_BUS ( info->BusDevFunc ),
572
-		      PCI_SLOT ( info->BusDevFunc ),
573
-		      PCI_FUNC ( info->BusDevFunc ), info->Vendor_ID,
574
-		      info->Dev_ID, info->SubVendor_ID, info->SubDevice_ID,
575
-		      info->Base_Class, info->Sub_Class, info->Prog_Intf,
576
-		      info->Rev );
577
+		DBGC ( &pxe_netdev, " PCI %02x:%02x.%x %04x:%04x "
578
+		       "('%04x:%04x') %02x%02x%02x rev %02x\n",
579
+		       PCI_BUS ( info->BusDevFunc ),
580
+		       PCI_SLOT ( info->BusDevFunc ),
581
+		       PCI_FUNC ( info->BusDevFunc ), info->Vendor_ID,
582
+		       info->Dev_ID, info->SubVendor_ID, info->SubDevice_ID,
583
+		       info->Base_Class, info->Sub_Class, info->Prog_Intf,
584
+		       info->Rev );
577
 		break; }
585
 		break; }
578
 	case BUS_TYPE_ISAPNP: {
586
 	case BUS_TYPE_ISAPNP: {
579
 		struct pnp_nic_info *info = &undi_get_nic_type->info.pnp;
587
 		struct pnp_nic_info *info = &undi_get_nic_type->info.pnp;
585
 		/* Cheat: remaining fields are probably unnecessary,
593
 		/* Cheat: remaining fields are probably unnecessary,
586
 		 * and would require adding extra code to isapnp.c.
594
 		 * and would require adding extra code to isapnp.c.
587
 		 */
595
 		 */
588
-		DBG ( " ISAPnP CSN %04x %08x %02x%02x%02x\n",
589
-		      info->CardSelNum, info->EISA_Dev_ID,
590
-		      info->Base_Class, info->Sub_Class, info->Prog_Intf );
596
+		DBGC ( &pxe_netdev, " ISAPnP CSN %04x %08x %02x%02x%02x\n",
597
+		       info->CardSelNum, info->EISA_Dev_ID,
598
+		       info->Base_Class, info->Sub_Class, info->Prog_Intf );
591
 		break; }
599
 		break; }
592
 	default:
600
 	default:
593
-		DBG ( " failed: unknown bus type\n" );
601
+		DBGC ( &pxe_netdev, " failed: unknown bus type\n" );
594
 		undi_get_nic_type->Status = PXENV_STATUS_FAILURE;
602
 		undi_get_nic_type->Status = PXENV_STATUS_FAILURE;
595
 		return PXENV_EXIT_FAILURE;
603
 		return PXENV_EXIT_FAILURE;
596
 	}
604
 	}
605
  */
613
  */
606
 PXENV_EXIT_t pxenv_undi_get_iface_info ( struct s_PXENV_UNDI_GET_IFACE_INFO
614
 PXENV_EXIT_t pxenv_undi_get_iface_info ( struct s_PXENV_UNDI_GET_IFACE_INFO
607
 					 *undi_get_iface_info ) {
615
 					 *undi_get_iface_info ) {
608
-	DBG ( "PXENV_UNDI_GET_IFACE_INFO" );
616
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_IFACE_INFO" );
609
 
617
 
610
 	/* Just hand back some info, doesn't really matter what it is.
618
 	/* Just hand back some info, doesn't really matter what it is.
611
 	 * Most PXE stacks seem to take this approach.
619
 	 * Most PXE stacks seem to take this approach.
622
 	memset ( undi_get_iface_info->Reserved, 0,
630
 	memset ( undi_get_iface_info->Reserved, 0,
623
 		 sizeof(undi_get_iface_info->Reserved) );
631
 		 sizeof(undi_get_iface_info->Reserved) );
624
 
632
 
625
-	DBG ( " %s %dbps flags %08x\n", undi_get_iface_info->IfaceType,
626
-	      undi_get_iface_info->LinkSpeed,
627
-	      undi_get_iface_info->ServiceFlags );
633
+	DBGC ( &pxe_netdev, " %s %dbps flags %08x\n",
634
+	       undi_get_iface_info->IfaceType, undi_get_iface_info->LinkSpeed,
635
+	       undi_get_iface_info->ServiceFlags );
628
 	undi_get_iface_info->Status = PXENV_STATUS_SUCCESS;
636
 	undi_get_iface_info->Status = PXENV_STATUS_SUCCESS;
629
 	return PXENV_EXIT_SUCCESS;
637
 	return PXENV_EXIT_SUCCESS;
630
 }
638
 }
635
  */
643
  */
636
 PXENV_EXIT_t pxenv_undi_get_state ( struct s_PXENV_UNDI_GET_STATE
644
 PXENV_EXIT_t pxenv_undi_get_state ( struct s_PXENV_UNDI_GET_STATE
637
 				    *undi_get_state ) {
645
 				    *undi_get_state ) {
638
-	DBG ( "PXENV_UNDI_GET_STATE failed: unsupported\n" );
646
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_STATE failed: unsupported\n" );
639
 
647
 
640
 	undi_get_state->Status = PXENV_STATUS_UNSUPPORTED;
648
 	undi_get_state->Status = PXENV_STATUS_UNSUPPORTED;
641
 	return PXENV_EXIT_FAILURE;
649
 	return PXENV_EXIT_FAILURE;
658
 	unsigned int prottype;
666
 	unsigned int prottype;
659
 	int rc;
667
 	int rc;
660
 
668
 
661
-	/* Use coloured debug, since UNDI ISR messages are likely to
662
-	 * be interspersed amongst other UNDI messages.
669
+	/* Use a different debug colour, since UNDI ISR messages are
670
+	 * likely to be interspersed amongst other UNDI messages.
663
 	 */
671
 	 */
664
 	DBGC2 ( &pxenv_undi_isr, "PXENV_UNDI_ISR" );
672
 	DBGC2 ( &pxenv_undi_isr, "PXENV_UNDI_ISR" );
665
 
673
 

Loading…
Cancel
Save