Pārlūkot izejas kodu

[pxe] Tidy up debugging output

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 gadus atpakaļ
vecāks
revīzija
61944ed602
1 mainītis faili ar 16 papildinājumiem un 13 dzēšanām
  1. 16
    13
      src/arch/i386/interface/pxe/pxe_undi.c

+ 16
- 13
src/arch/i386/interface/pxe/pxe_undi.c Parādīt failu

306
 	unsigned int i;
306
 	unsigned int i;
307
 	int rc;
307
 	int rc;
308
 
308
 
309
-	DBGC2 ( &pxe_netdev, "PXENV_UNDI_TRANSMIT" );
310
-
311
 	/* Sanity check */
309
 	/* Sanity check */
312
 	if ( ! pxe_netdev ) {
310
 	if ( ! pxe_netdev ) {
313
 		DBGC ( &pxe_netdev, "PXENV_UNDI_TRANSMIT called with no "
311
 		DBGC ( &pxe_netdev, "PXENV_UNDI_TRANSMIT called with no "
316
 		return PXENV_EXIT_FAILURE;
314
 		return PXENV_EXIT_FAILURE;
317
 	}
315
 	}
318
 
316
 
317
+	DBGC2 ( &pxe_netdev, "PXENV_UNDI_TRANSMIT" );
318
+
319
 	/* Forcibly enable interrupts and freeze receive queue
319
 	/* Forcibly enable interrupts and freeze receive queue
320
 	 * processing at this point, to work around callers that never
320
 	 * processing at this point, to work around callers that never
321
 	 * call PXENV_UNDI_OPEN before attempting to use the UNDI API.
321
 	 * call PXENV_UNDI_OPEN before attempting to use the UNDI API.
527
 	struct device *dev;
527
 	struct device *dev;
528
 	struct ll_protocol *ll_protocol;
528
 	struct ll_protocol *ll_protocol;
529
 
529
 
530
-	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_INFORMATION" );
531
-
532
 	/* Sanity check */
530
 	/* Sanity check */
533
 	if ( ! pxe_netdev ) {
531
 	if ( ! pxe_netdev ) {
534
 		DBGC ( &pxe_netdev, "PXENV_UNDI_GET_INFORMATION called with no "
532
 		DBGC ( &pxe_netdev, "PXENV_UNDI_GET_INFORMATION called with no "
537
 		return PXENV_EXIT_FAILURE;
535
 		return PXENV_EXIT_FAILURE;
538
 	}
536
 	}
539
 
537
 
538
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_INFORMATION" );
539
+
540
 	/* Fill in information */
540
 	/* Fill in information */
541
 	dev = pxe_netdev->dev;
541
 	dev = pxe_netdev->dev;
542
 	ll_protocol = pxe_netdev->ll_protocol;
542
 	ll_protocol = pxe_netdev->ll_protocol;
576
  */
576
  */
577
 PXENV_EXIT_t pxenv_undi_get_statistics ( struct s_PXENV_UNDI_GET_STATISTICS
577
 PXENV_EXIT_t pxenv_undi_get_statistics ( struct s_PXENV_UNDI_GET_STATISTICS
578
 					 *undi_get_statistics ) {
578
 					 *undi_get_statistics ) {
579
-	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_STATISTICS" );
580
 
579
 
581
 	/* Sanity check */
580
 	/* Sanity check */
582
 	if ( ! pxe_netdev ) {
581
 	if ( ! pxe_netdev ) {
586
 		return PXENV_EXIT_FAILURE;
585
 		return PXENV_EXIT_FAILURE;
587
 	}
586
 	}
588
 
587
 
588
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_STATISTICS" );
589
+
589
 	/* Report statistics */
590
 	/* Report statistics */
590
 	undi_get_statistics->XmtGoodFrames = pxe_netdev->tx_stats.good;
591
 	undi_get_statistics->XmtGoodFrames = pxe_netdev->tx_stats.good;
591
 	undi_get_statistics->RcvGoodFrames = pxe_netdev->rx_stats.good;
592
 	undi_get_statistics->RcvGoodFrames = pxe_netdev->rx_stats.good;
679
 	struct in_addr ip = { .s_addr = undi_get_mcast_address->InetAddr };
680
 	struct in_addr ip = { .s_addr = undi_get_mcast_address->InetAddr };
680
 	int rc;
681
 	int rc;
681
 
682
 
682
-	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_MCAST_ADDRESS %s",
683
-	       inet_ntoa ( ip ) );
684
-
685
 	/* Sanity check */
683
 	/* Sanity check */
686
 	if ( ! pxe_netdev ) {
684
 	if ( ! pxe_netdev ) {
687
 		DBGC ( &pxe_netdev, "PXENV_UNDI_GET_MCAST_ADDRESS called with "
685
 		DBGC ( &pxe_netdev, "PXENV_UNDI_GET_MCAST_ADDRESS called with "
691
 		return PXENV_EXIT_FAILURE;
689
 		return PXENV_EXIT_FAILURE;
692
 	}
690
 	}
693
 
691
 
692
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_MCAST_ADDRESS %s",
693
+	       inet_ntoa ( ip ) );
694
+
694
 	/* Hash address using the network device's link-layer protocol */
695
 	/* Hash address using the network device's link-layer protocol */
695
 	ll_protocol = pxe_netdev->ll_protocol;
696
 	ll_protocol = pxe_netdev->ll_protocol;
696
 	if ( ( rc = ll_protocol->mc_hash ( AF_INET, &ip,
697
 	if ( ( rc = ll_protocol->mc_hash ( AF_INET, &ip,
714
 				       *undi_get_nic_type ) {
715
 				       *undi_get_nic_type ) {
715
 	struct device *dev;
716
 	struct device *dev;
716
 
717
 
717
-	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_NIC_TYPE" );
718
-
719
 	/* Sanity check */
718
 	/* Sanity check */
720
 	if ( ! pxe_netdev ) {
719
 	if ( ! pxe_netdev ) {
721
 		DBGC ( &pxe_netdev, "PXENV_UNDI_GET_NIC_TYPE called with "
720
 		DBGC ( &pxe_netdev, "PXENV_UNDI_GET_NIC_TYPE called with "
724
 		return PXENV_EXIT_FAILURE;
723
 		return PXENV_EXIT_FAILURE;
725
 	}
724
 	}
726
 
725
 
726
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_NIC_TYPE" );
727
+
727
 	/* Fill in information */
728
 	/* Fill in information */
728
 	memset ( &undi_get_nic_type->info, 0,
729
 	memset ( &undi_get_nic_type->info, 0,
729
 		 sizeof ( undi_get_nic_type->info ) );
730
 		 sizeof ( undi_get_nic_type->info ) );
783
  */
784
  */
784
 PXENV_EXIT_t pxenv_undi_get_iface_info ( struct s_PXENV_UNDI_GET_IFACE_INFO
785
 PXENV_EXIT_t pxenv_undi_get_iface_info ( struct s_PXENV_UNDI_GET_IFACE_INFO
785
 					 *undi_get_iface_info ) {
786
 					 *undi_get_iface_info ) {
786
-	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_IFACE_INFO" );
787
 
787
 
788
 	/* Sanity check */
788
 	/* Sanity check */
789
 	if ( ! pxe_netdev ) {
789
 	if ( ! pxe_netdev ) {
793
 		return PXENV_EXIT_FAILURE;
793
 		return PXENV_EXIT_FAILURE;
794
 	}
794
 	}
795
 
795
 
796
+	DBGC ( &pxe_netdev, "PXENV_UNDI_GET_IFACE_INFO" );
797
+
796
 	/* Just hand back some info, doesn't really matter what it is.
798
 	/* Just hand back some info, doesn't really matter what it is.
797
 	 * Most PXE stacks seem to take this approach.
799
 	 * Most PXE stacks seem to take this approach.
798
 	 */
800
 	 */
855
 	/* Use a different debug colour, since UNDI ISR messages are
857
 	/* Use a different debug colour, since UNDI ISR messages are
856
 	 * likely to be interspersed amongst other UNDI messages.
858
 	 * likely to be interspersed amongst other UNDI messages.
857
 	 */
859
 	 */
858
-	DBGC2 ( &pxenv_undi_isr, "PXENV_UNDI_ISR" );
859
 
860
 
860
 	/* Sanity check */
861
 	/* Sanity check */
861
 	if ( ! pxe_netdev ) {
862
 	if ( ! pxe_netdev ) {
862
-		DBGC ( &pxe_netdev, "PXENV_UNDI_ISR called with "
863
+		DBGC ( &pxenv_undi_isr, "PXENV_UNDI_ISR called with "
863
 		       "no network device\n" );
864
 		       "no network device\n" );
864
 		undi_isr->Status = PXENV_STATUS_UNDI_INVALID_STATE;
865
 		undi_isr->Status = PXENV_STATUS_UNDI_INVALID_STATE;
865
 		return PXENV_EXIT_FAILURE;
866
 		return PXENV_EXIT_FAILURE;
866
 	}
867
 	}
867
 
868
 
869
+	DBGC2 ( &pxenv_undi_isr, "PXENV_UNDI_ISR" );
870
+
868
 	/* Just in case some idiot actually looks at these fields when
871
 	/* Just in case some idiot actually looks at these fields when
869
 	 * we weren't meant to fill them in...
872
 	 * we weren't meant to fill them in...
870
 	 */
873
 	 */

Notiek ielāde…
Atcelt
Saglabāt