Browse Source

[efi] Poll for TX completions only when there is an outstanding TX buffer

At least one NII implementation (in a Microsoft Surface tablet) seems
to fail to report the absence (sic) of TX completions properly.  Work
around this by checking for TX completions only when we expect to see
one.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
c6c7e78c42
1 changed files with 4 additions and 8 deletions
  1. 4
    8
      src/drivers/net/efi/nii.c

+ 4
- 8
src/drivers/net/efi/nii.c View File

@@ -785,12 +785,7 @@ static void nii_poll_tx ( struct net_device *netdev, unsigned int stat ) {
785 785
 		return;
786 786
 
787 787
 	/* Sanity check */
788
-	if ( ! nii->txbuf ) {
789
-		DBGC ( nii, "NII %s reported spurious TX completion\n",
790
-		       nii->dev.name );
791
-		netdev_tx_err ( netdev, NULL, -EPIPE );
792
-		return;
793
-	}
788
+	assert ( nii->txbuf != NULL );
794 789
 
795 790
 	/* Complete transmission */
796 791
 	iobuf = nii->txbuf;
@@ -888,7 +883,7 @@ static void nii_poll ( struct net_device *netdev ) {
888 883
 	/* Get status */
889 884
 	op = NII_OP ( PXE_OPCODE_GET_STATUS,
890 885
 		      ( PXE_OPFLAGS_GET_INTERRUPT_STATUS |
891
-			PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS |
886
+			( nii->txbuf ? PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS : 0)|
892 887
 			( nii->media ? PXE_OPFLAGS_GET_MEDIA_STATUS : 0 ) ) );
893 888
 	if ( ( stat = nii_issue_db ( nii, op, &db, sizeof ( db ) ) ) < 0 ) {
894 889
 		rc = -EIO_STAT ( stat );
@@ -898,7 +893,8 @@ static void nii_poll ( struct net_device *netdev ) {
898 893
 	}
899 894
 
900 895
 	/* Process any TX completions */
901
-	nii_poll_tx ( netdev, stat );
896
+	if ( nii->txbuf )
897
+		nii_poll_tx ( netdev, stat );
902 898
 
903 899
 	/* Process any RX completions */
904 900
 	nii_poll_rx ( netdev );

Loading…
Cancel
Save