Skip to content

Commit

Permalink
Revert "At least some versions of Emulex SNP driver differ from other…
Browse files Browse the repository at this point in the history
… vendors by never returning a NULL txbuf in GetStatus."

This reverts commit 9dd1a8f.
  • Loading branch information
Jarrod Johnson committed Jan 14, 2012
1 parent 7263af7 commit 4a5f40e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/drivers/net/efi/snpnet.c
Expand Up @@ -43,9 +43,6 @@ struct snpnet_device {

/** State that the SNP should be in after close */
UINT32 close_state;

/** Count of packets awaiting confirmed transmit */
UINT32 txpending;
};

/**
Expand All @@ -61,7 +58,6 @@ static int snpnet_transmit ( struct net_device *netdev,
EFI_SIMPLE_NETWORK_PROTOCOL *snp = snpnetdev->snp;
EFI_STATUS efirc;
size_t len = iob_len ( iobuf );
snpnetdev->txpending++;

efirc = snp->Transmit ( snp, 0, len, iobuf->data, NULL, NULL, NULL );
return EFIRC_TO_RC ( efirc );
Expand All @@ -79,8 +75,6 @@ static void snpnet_complete ( struct net_device *netdev, void *txbuf ) {

list_for_each_entry_safe ( iobuf, tmp, &netdev->tx_queue, list ) {
if ( iobuf->data == txbuf ) {
struct snpnet_device *snpnetdev = netdev->priv;
snpnetdev->txpending--;
netdev_tx_complete ( netdev, iobuf );
break;
}
Expand All @@ -101,16 +95,18 @@ static void snpnet_poll ( struct net_device *netdev ) {
void *txbuf;

/* Process Tx completions */
while ( snpnetdev->txpending ) {
while ( 1 ) {
efirc = snp->GetStatus ( snp, NULL, &txbuf );
if ( efirc ) {
DBGC ( snp, "SNP %p could not get status %s\n", snp,
efi_strerror ( efirc ) );
break;
}

if ( txbuf != NULL )
snpnet_complete ( netdev, txbuf );
if ( txbuf == NULL )
break;

snpnet_complete ( netdev, txbuf );
}

/* Process received packets */
Expand Down

0 comments on commit 4a5f40e

Please sign in to comment.