Pārlūkot izejas kodu

[efi] Improve NII driver logging

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Fabrice Bacchella 9 gadus atpakaļ
vecāks
revīzija
b71037989d
1 mainītis faili ar 21 papildinājumiem un 10 dzēšanām
  1. 21
    10
      src/drivers/net/efi/nii.c

+ 21
- 10
src/drivers/net/efi/nii.c Parādīt failu

@@ -415,6 +415,13 @@ static int nii_issue_cpb_db ( struct nii_nic *nii, unsigned int op, void *cpb,
415 415
 	cdb.IFnum = nii->nii->IfNum;
416 416
 
417 417
 	/* Issue command */
418
+	DBGC2 ( nii, "NII %s issuing %02x:%04x ifnum %d%s%s\n",
419
+		nii->dev.name, cdb.OpCode, cdb.OpFlags, cdb.IFnum,
420
+		( cpb ? " cpb" : "" ), ( db ? " db" : "" ) );
421
+	if ( cpb )
422
+		DBGC2_HD ( nii, cpb, cpb_len );
423
+	if ( db )
424
+		DBGC2_HD ( nii, db, db_len );
418 425
 	nii->issue ( ( intptr_t ) &cdb );
419 426
 
420 427
 	/* Check completion status */
@@ -710,21 +717,24 @@ static int nii_set_station_address ( struct nii_nic *nii,
710 717
  * @ret rc		Return status code
711 718
  */
712 719
 static int nii_set_rx_filters ( struct nii_nic *nii ) {
720
+	unsigned int flags;
713 721
 	unsigned int op;
714 722
 	int stat;
715 723
 	int rc;
716 724
 
725
+	/* Construct receive filter set */
726
+	flags = ( PXE_OPFLAGS_RECEIVE_FILTER_ENABLE |
727
+		  PXE_OPFLAGS_RECEIVE_FILTER_UNICAST |
728
+		  PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST |
729
+		  PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS |
730
+		  PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST );
731
+
717 732
 	/* Issue command */
718
-	op = NII_OP ( PXE_OPCODE_RECEIVE_FILTERS,
719
-		      ( PXE_OPFLAGS_RECEIVE_FILTER_ENABLE |
720
-			PXE_OPFLAGS_RECEIVE_FILTER_UNICAST |
721
-			PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST |
722
-			PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS |
723
-			PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST ) );
733
+	op = NII_OP ( PXE_OPCODE_RECEIVE_FILTERS, flags );
724 734
 	if ( ( stat = nii_issue ( nii, op ) ) < 0 ) {
725 735
 		rc = -EIO_STAT ( stat );
726
-		DBGC ( nii, "NII %s could not set receive filters: %s\n",
727
-		       nii->dev.name, strerror ( rc ) );
736
+		DBGC ( nii, "NII %s could not set receive filters %#04x: %s\n",
737
+		       nii->dev.name, flags, strerror ( rc ) );
728 738
 		return rc;
729 739
 	}
730 740
 
@@ -1036,8 +1046,9 @@ int nii_start ( struct efi_device *efidev ) {
1036 1046
 		nii->issue = ( ( ( void * ) nii->undi ) +
1037 1047
 			       nii->undi->EntryPoint );
1038 1048
 	}
1039
-	DBGC ( nii, "NII %s using UNDI v%x.%x at %p entry %p\n", nii->dev.name,
1040
-	       nii->nii->MajorVer, nii->nii->MinorVer, nii->undi, nii->issue );
1049
+	DBGC ( nii, "NII %s using UNDI v%x.%x at %p entry %p impl %#08x\n",
1050
+	       nii->dev.name, nii->nii->MajorVer, nii->nii->MinorVer,
1051
+	       nii->undi, nii->issue, nii->undi->Implementation );
1041 1052
 
1042 1053
 	/* Open PCI I/O protocols and locate BARs */
1043 1054
 	if ( ( rc = nii_pci_open ( nii ) ) != 0 )

Notiek ielāde…
Atcelt
Saglabāt