diff options
| author | Simon Rettberg | 2023-10-06 18:37:21 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2023-10-06 18:37:21 +0200 |
| commit | 95a57769874a70456670984debc05084feb75f6b (patch) | |
| tree | 9943c86b682e1b1d21a0439637b3849840a50137 /src/drivers/net/efi | |
| parent | [efi] Remove old RDRAND hack; now officially supported (diff) | |
| parent | [libc] Use wall clock time as seed for the (non-cryptographic) RNG (diff) | |
| download | ipxe-95a57769874a70456670984debc05084feb75f6b.tar.gz ipxe-95a57769874a70456670984debc05084feb75f6b.tar.xz ipxe-95a57769874a70456670984debc05084feb75f6b.zip | |
Merge branch 'master' into openslx
Diffstat (limited to 'src/drivers/net/efi')
| -rw-r--r-- | src/drivers/net/efi/nii.c | 10 | ||||
| -rw-r--r-- | src/drivers/net/efi/snpnet.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/drivers/net/efi/nii.c b/src/drivers/net/efi/nii.c index be5bce4b4..8dd17e4b5 100644 --- a/src/drivers/net/efi/nii.c +++ b/src/drivers/net/efi/nii.c @@ -1032,8 +1032,9 @@ static void nii_poll_tx ( struct net_device *netdev, unsigned int stat ) { if ( stat & PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN ) return; - /* Sanity check */ - assert ( nii->txbuf != NULL ); + /* Ignore spurious completions reported by some devices */ + if ( ! nii->txbuf ) + return; /* Complete transmission */ iobuf = nii->txbuf; @@ -1131,7 +1132,7 @@ static void nii_poll ( struct net_device *netdev ) { /* Get status */ op = NII_OP ( PXE_OPCODE_GET_STATUS, ( PXE_OPFLAGS_GET_INTERRUPT_STATUS | - ( nii->txbuf ? PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS : 0)| + PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS | ( nii->media ? PXE_OPFLAGS_GET_MEDIA_STATUS : 0 ) ) ); if ( ( stat = nii_issue_db ( nii, op, &db, sizeof ( db ) ) ) < 0 ) { rc = -EIO_STAT ( stat ); @@ -1141,8 +1142,7 @@ static void nii_poll ( struct net_device *netdev ) { } /* Process any TX completions */ - if ( nii->txbuf ) - nii_poll_tx ( netdev, stat ); + nii_poll_tx ( netdev, stat ); /* Process any RX completions */ nii_poll_rx ( netdev ); diff --git a/src/drivers/net/efi/snpnet.c b/src/drivers/net/efi/snpnet.c index 69ec6f5e5..3b09d4918 100644 --- a/src/drivers/net/efi/snpnet.c +++ b/src/drivers/net/efi/snpnet.c @@ -97,7 +97,7 @@ static const char * snpnet_mac_text ( EFI_MAC_ADDRESS *mac, size_t len ) { * @v netdev Network device */ static void snpnet_dump_mode ( struct net_device *netdev ) { - struct snp_nic *snp = netdev_priv ( netdev ); + struct snp_nic *snp = netdev->priv; EFI_SIMPLE_NETWORK_MODE *mode = snp->snp->Mode; size_t mac_len = mode->HwAddressSize; unsigned int i; @@ -136,7 +136,7 @@ static void snpnet_dump_mode ( struct net_device *netdev ) { * @v netdev Network device */ static void snpnet_check_link ( struct net_device *netdev ) { - struct snp_nic *snp = netdev_priv ( netdev ); + struct snp_nic *snp = netdev->priv; EFI_SIMPLE_NETWORK_MODE *mode = snp->snp->Mode; /* Do nothing unless media presence detection is supported */ @@ -160,7 +160,7 @@ static void snpnet_check_link ( struct net_device *netdev ) { */ static int snpnet_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) { - struct snp_nic *snp = netdev_priv ( netdev ); + struct snp_nic *snp = netdev->priv; EFI_STATUS efirc; int rc; |
