Browse Source

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).
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
d393e61d8a
1 changed files with 3 additions and 20 deletions
  1. 3
    20
      src/drivers/net/etherfabric.c

+ 3
- 20
src/drivers/net/etherfabric.c View File

173
 	unsigned int eventq_read_ptr;	/* Falcon only */
173
 	unsigned int eventq_read_ptr;	/* Falcon only */
174
 	unsigned int tx_write_ptr;
174
 	unsigned int tx_write_ptr;
175
 	unsigned int rx_write_ptr;
175
 	unsigned int rx_write_ptr;
176
-	int tx_in_progress;
177
 
176
 
178
 	/** Port 0/1 on the NIC */
177
 	/** Port 0/1 on the NIC */
179
 	int port;
178
 	int port;
2706
 			/* TX completed - mark as done */
2705
 			/* TX completed - mark as done */
2707
 			DBG ( "TX id %x complete\n",
2706
 			DBG ( "TX id %x complete\n",
2708
 			      efab->tx_buf.id );
2707
 			      efab->tx_buf.id );
2709
-			efab->tx_in_progress = 0;
2710
 		} else if ( event.type == EFAB_EV_RX ) {
2708
 		} else if ( event.type == EFAB_EV_RX ) {
2711
 			/* RX - find corresponding buffer */
2709
 			/* RX - find corresponding buffer */
2712
 			for ( i = 0 ; i < EFAB_RX_BUFS ; i++ ) {
2710
 			for ( i = 0 ; i < EFAB_RX_BUFS ; i++ ) {
2766
 	struct efab_nic *efab = nic->priv_data;
2764
 	struct efab_nic *efab = nic->priv_data;
2767
 	unsigned int nstype = htons ( type );
2765
 	unsigned int nstype = htons ( type );
2768
 
2766
 
2769
-	/* We can only transmit one packet at a time; a TX completion
2770
-	 * event must be received before we can transmit the next
2771
-	 * packet.  Since there is only one static TX buffer, we don't
2772
-	 * worry unduly about overflow, but we report it anyway.
2773
-	 */
2774
-	if ( efab->tx_in_progress ) {
2775
-		printf ( "TX overflow!\n" );
2776
-	}
2777
-
2778
 	/* Fill TX buffer, pad to ETH_ZLEN */
2767
 	/* Fill TX buffer, pad to ETH_ZLEN */
2779
 	memcpy ( efab->tx_buf.addr, dest, ETH_ALEN );
2768
 	memcpy ( efab->tx_buf.addr, dest, ETH_ALEN );
2780
 	memcpy ( efab->tx_buf.addr + ETH_ALEN, nic->node_addr, ETH_ALEN );
2769
 	memcpy ( efab->tx_buf.addr + ETH_ALEN, nic->node_addr, ETH_ALEN );
2789
 	/* Push TX descriptor */
2778
 	/* Push TX descriptor */
2790
 	efab_push_tx_buffer ( efab, &efab->tx_buf );
2779
 	efab_push_tx_buffer ( efab, &efab->tx_buf );
2791
 
2780
 
2792
-	/* There is no way to wait for TX complete (i.e. TX buffer
2793
-	 * available to re-use for the next transmit) without reading
2794
-	 * from the event queue.  We therefore simply leave the TX
2795
-	 * buffer marked as "in use" until a TX completion event
2796
-	 * happens to be picked up by a call to etherfabric_poll().
2781
+	/* Allow enough time for the packet to be transmitted.  This
2782
+	 * is a temporary hack until we update to the new driver API.
2797
 	 */
2783
 	 */
2798
-	efab->tx_in_progress = 1;
2784
+	udelay ( 20 );
2799
 
2785
 
2800
 	return;
2786
 	return;
2801
 }
2787
 }
2892
 		return 0;
2878
 		return 0;
2893
 	memcpy ( nic->node_addr, efab.mac_addr, ETH_ALEN );
2879
 	memcpy ( nic->node_addr, efab.mac_addr, ETH_ALEN );
2894
 
2880
 
2895
-	/* hello world */
2896
-	printf ( "Found EtherFabric %s NIC %!\n", pci->name, nic->node_addr );
2897
-
2898
 	/* point to NIC specific routines */
2881
 	/* point to NIC specific routines */
2899
 	nic->nic_op = &etherfabric_operations;
2882
 	nic->nic_op = &etherfabric_operations;
2900
 
2883
 

Loading…
Cancel
Save