david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Temporary hack to work around the "TX overflow" problem in the interim

period before updating to the new driver API (which can cope with
having TX packets in progress).
This commit is contained in:
Michael Brown 2006-06-16 14:38:16 +00:00
parent 52de4935f9
commit d393e61d8a
1 changed files with 3 additions and 20 deletions

View File

@ -173,7 +173,6 @@ struct efab_nic {
unsigned int eventq_read_ptr; /* Falcon only */ unsigned int eventq_read_ptr; /* Falcon only */
unsigned int tx_write_ptr; unsigned int tx_write_ptr;
unsigned int rx_write_ptr; unsigned int rx_write_ptr;
int tx_in_progress;
/** Port 0/1 on the NIC */ /** Port 0/1 on the NIC */
int port; int port;
@ -2706,7 +2705,6 @@ static int etherfabric_poll ( struct nic *nic, int retrieve ) {
/* TX completed - mark as done */ /* TX completed - mark as done */
DBG ( "TX id %x complete\n", DBG ( "TX id %x complete\n",
efab->tx_buf.id ); efab->tx_buf.id );
efab->tx_in_progress = 0;
} else if ( event.type == EFAB_EV_RX ) { } else if ( event.type == EFAB_EV_RX ) {
/* RX - find corresponding buffer */ /* RX - find corresponding buffer */
for ( i = 0 ; i < EFAB_RX_BUFS ; i++ ) { for ( i = 0 ; i < EFAB_RX_BUFS ; i++ ) {
@ -2766,15 +2764,6 @@ static void etherfabric_transmit ( struct nic *nic, const char *dest,
struct efab_nic *efab = nic->priv_data; struct efab_nic *efab = nic->priv_data;
unsigned int nstype = htons ( type ); unsigned int nstype = htons ( type );
/* We can only transmit one packet at a time; a TX completion
* event must be received before we can transmit the next
* packet. Since there is only one static TX buffer, we don't
* worry unduly about overflow, but we report it anyway.
*/
if ( efab->tx_in_progress ) {
printf ( "TX overflow!\n" );
}
/* Fill TX buffer, pad to ETH_ZLEN */ /* Fill TX buffer, pad to ETH_ZLEN */
memcpy ( efab->tx_buf.addr, dest, ETH_ALEN ); memcpy ( efab->tx_buf.addr, dest, ETH_ALEN );
memcpy ( efab->tx_buf.addr + ETH_ALEN, nic->node_addr, ETH_ALEN ); memcpy ( efab->tx_buf.addr + ETH_ALEN, nic->node_addr, ETH_ALEN );
@ -2789,13 +2778,10 @@ static void etherfabric_transmit ( struct nic *nic, const char *dest,
/* Push TX descriptor */ /* Push TX descriptor */
efab_push_tx_buffer ( efab, &efab->tx_buf ); efab_push_tx_buffer ( efab, &efab->tx_buf );
/* There is no way to wait for TX complete (i.e. TX buffer /* Allow enough time for the packet to be transmitted. This
* available to re-use for the next transmit) without reading * is a temporary hack until we update to the new driver API.
* from the event queue. We therefore simply leave the TX
* buffer marked as "in use" until a TX completion event
* happens to be picked up by a call to etherfabric_poll().
*/ */
efab->tx_in_progress = 1; udelay ( 20 );
return; return;
} }
@ -2892,9 +2878,6 @@ static int etherfabric_probe ( struct nic *nic, struct pci_device *pci ) {
return 0; return 0;
memcpy ( nic->node_addr, efab.mac_addr, ETH_ALEN ); memcpy ( nic->node_addr, efab.mac_addr, ETH_ALEN );
/* hello world */
printf ( "Found EtherFabric %s NIC %!\n", pci->name, nic->node_addr );
/* point to NIC specific routines */ /* point to NIC specific routines */
nic->nic_op = &etherfabric_operations; nic->nic_op = &etherfabric_operations;