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
 		return;
785
 		return;
786
 
786
 
787
 	/* Sanity check */
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
 	/* Complete transmission */
790
 	/* Complete transmission */
796
 	iobuf = nii->txbuf;
791
 	iobuf = nii->txbuf;
888
 	/* Get status */
883
 	/* Get status */
889
 	op = NII_OP ( PXE_OPCODE_GET_STATUS,
884
 	op = NII_OP ( PXE_OPCODE_GET_STATUS,
890
 		      ( PXE_OPFLAGS_GET_INTERRUPT_STATUS |
885
 		      ( PXE_OPFLAGS_GET_INTERRUPT_STATUS |
891
-			PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS |
886
+			( nii->txbuf ? PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS : 0)|
892
 			( nii->media ? PXE_OPFLAGS_GET_MEDIA_STATUS : 0 ) ) );
887
 			( nii->media ? PXE_OPFLAGS_GET_MEDIA_STATUS : 0 ) ) );
893
 	if ( ( stat = nii_issue_db ( nii, op, &db, sizeof ( db ) ) ) < 0 ) {
888
 	if ( ( stat = nii_issue_db ( nii, op, &db, sizeof ( db ) ) ) < 0 ) {
894
 		rc = -EIO_STAT ( stat );
889
 		rc = -EIO_STAT ( stat );
898
 	}
893
 	}
899
 
894
 
900
 	/* Process any TX completions */
895
 	/* Process any TX completions */
901
-	nii_poll_tx ( netdev, stat );
896
+	if ( nii->txbuf )
897
+		nii_poll_tx ( netdev, stat );
902
 
898
 
903
 	/* Process any RX completions */
899
 	/* Process any RX completions */
904
 	nii_poll_rx ( netdev );
900
 	nii_poll_rx ( netdev );

Loading…
Cancel
Save