Browse Source

[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 years ago
parent
commit
b71037989d
1 changed files with 21 additions and 10 deletions
  1. 21
    10
      src/drivers/net/efi/nii.c

+ 21
- 10
src/drivers/net/efi/nii.c View File

415
 	cdb.IFnum = nii->nii->IfNum;
415
 	cdb.IFnum = nii->nii->IfNum;
416
 
416
 
417
 	/* Issue command */
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
 	nii->issue ( ( intptr_t ) &cdb );
425
 	nii->issue ( ( intptr_t ) &cdb );
419
 
426
 
420
 	/* Check completion status */
427
 	/* Check completion status */
710
  * @ret rc		Return status code
717
  * @ret rc		Return status code
711
  */
718
  */
712
 static int nii_set_rx_filters ( struct nii_nic *nii ) {
719
 static int nii_set_rx_filters ( struct nii_nic *nii ) {
720
+	unsigned int flags;
713
 	unsigned int op;
721
 	unsigned int op;
714
 	int stat;
722
 	int stat;
715
 	int rc;
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
 	/* Issue command */
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
 	if ( ( stat = nii_issue ( nii, op ) ) < 0 ) {
734
 	if ( ( stat = nii_issue ( nii, op ) ) < 0 ) {
725
 		rc = -EIO_STAT ( stat );
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
 		return rc;
738
 		return rc;
729
 	}
739
 	}
730
 
740
 
1036
 		nii->issue = ( ( ( void * ) nii->undi ) +
1046
 		nii->issue = ( ( ( void * ) nii->undi ) +
1037
 			       nii->undi->EntryPoint );
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
 	/* Open PCI I/O protocols and locate BARs */
1053
 	/* Open PCI I/O protocols and locate BARs */
1043
 	if ( ( rc = nii_pci_open ( nii ) ) != 0 )
1054
 	if ( ( rc = nii_pci_open ( nii ) ) != 0 )

Loading…
Cancel
Save