kernels/linux-2.4.0/drivers/net/tlan.c
/***************************************************************
	 *	TLan_HandleTxEOF
	 *
	 *	Returns:
	 *		1
	 *	Parms:
	 *		dev		Device assigned the IRQ that was
	 *				raised.
	 *		host_int	The contents of the HOST_INT
	 *				port.
	 *
	 *	This function handles Tx EOF interrupts which are raised
	 *	by the adapter when it has completed sending the
	 *	contents of a buffer.  If detemines which list/buffer
	 *	was completed and resets it.  If the buffer was the last
	 *	in the channel (EOC), then the function checks to see if
	 *	another buffer is ready to send, and if so, sends a Tx
	 *	Go command.  Finally, the driver activates/continues the
	 *	activity LED.
	 *
	 **************************************************************/
TLan_HandleTxEOF
Returns:
1
Parms:
dev             Device assigned the IRQ that was
raised.
host_int        The contents of the HOST_INT
port.

This function handles Tx EOF interrupts which are raised
by the adapter when it has completed sending the
contents of a buffer.  If detemines which list/buffer
was completed and resets it.  If the buffer was the last
in the channel (EOC), then the function checks to see if
another buffer is ready to send, and if so, sends a Tx
Go command.  Finally, the driver activates/continues the
activity LED.
TLan_HandleTxEOF Returns : 1 Parms : dev Device assigned the IRQ that was raised . host_int The contents of the HOST_INT port . This function handles Tx EOF interrupts which are raised by the adapter when it has completed sending the contents of a buffer . If detemines which list / buffer was completed and resets it . If the buffer was the last in the channel ( EOC ) then the function checks to see if another buffer is ready to send and if so sends a Tx Go command . Finally the driver activates / continues the activity LED .
u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
{
	TLanPrivateInfo	*priv = (TLanPrivateInfo *) dev->priv;
	int		eoc = 0;
	TLanList	*head_list;
	u32		ack = 1;
	TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Handling TX EOF (Head=%d Tail=%d)\n", priv->txHead, priv->txTail );
	host_int = 0;
	head_list = priv->txList + priv->txHead;
	if ( ! bbuf ) {
		dev_kfree_skb_irq( (struct sk_buff *) head_list->buffer[9].address );		
		head_list->buffer[9].address = 0;
	}
	if ( head_list->cStat & TLAN_CSTAT_EOC )
		eoc = 1;
	if ( ! head_list->cStat & TLAN_CSTAT_FRM_CMP ) {
		printk( "TLAN:  Received interrupt for uncompleted TX frame.\n" );
	}
	priv->stats.tx_bytes += head_list->frameSize;
	head_list->cStat = TLAN_CSTAT_UNUSED;
	netif_start_queue(dev);
	CIRC_INC( priv->txHead, TLAN_NUM_TX_LISTS );
	if ( eoc ) {
		TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Handling TX EOC (Head=%d Tail=%d)\n", priv->txHead, priv->txTail );
		head_list = priv->txList + priv->txHead;
		if ( ( head_list->cStat & TLAN_CSTAT_READY ) == TLAN_CSTAT_READY ) {
			outl( virt_to_bus( head_list ), dev->base_addr + TLAN_CH_PARM );
			ack |= TLAN_HC_GO;
		} else {
			priv->txInProgress = 0;
		}
	}
	if ( priv->adapter->flags & TLAN_ADAPTER_ACTIVITY_LED ) {
		TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK | TLAN_LED_ACT );
		if ( priv->timer.function == NULL ) {
			 priv->timer.function = &TLan_Timer;
			 priv->timer.data = (unsigned long) dev;
			 priv->timer.expires = jiffies + TLAN_TIMER_ACT_DELAY;
			 priv->timerSetAt = jiffies;
			 priv->timerType = TLAN_TIMER_ACTIVITY;
			 add_timer(&priv->timer);
		} else if ( priv->timerType == TLAN_TIMER_ACTIVITY ) {
			priv->timerSetAt = jiffies;
		}
	}
	return ack;
}
u32 TLan_HandleTxEOF ( struct net_device * dev , u16 host_int ) { TLanPrivateInfo * priv = ( TLanPrivateInfo * ) dev -> priv ; int eoc = 0 ; TLanList * head_list ; u32 ack = 1 ; TLAN_DBG ( TLAN_DEBUG_TX , " \n " , priv -> txHead , priv -> txTail ) ; host_int = 0 ; head_list = priv -> txList + priv -> txHead ; if ( ! bbuf ) { dev_kfree_skb_irq ( ( struct sk_buff * ) head_list -> buffer [ 9 ] . address ) ; head_list -> buffer [ 9 ] . address = 0 ; } if ( head_list -> cStat & TLAN_CSTAT_EOC ) eoc = 1 ; if ( ! head_list -> cStat & TLAN_CSTAT_FRM_CMP ) { printk ( " \n " ) ; } priv -> stats . tx_bytes += head_list -> frameSize ; head_list -> cStat = TLAN_CSTAT_UNUSED ; netif_start_queue ( dev ) ; CIRC_INC ( priv -> txHead , TLAN_NUM_TX_LISTS ) ; if ( eoc ) { TLAN_DBG ( TLAN_DEBUG_TX , " \n " , priv -> txHead , priv -> txTail ) ; head_list = priv -> txList + priv -> txHead ; if ( ( head_list -> cStat & TLAN_CSTAT_READY ) == TLAN_CSTAT_READY ) { outl ( virt_to_bus ( head_list ) , dev -> base_addr + TLAN_CH_PARM ) ; ack |= TLAN_HC_GO ; } else { priv -> txInProgress = 0 ; } } if ( priv -> adapter -> flags & TLAN_ADAPTER_ACTIVITY_LED ) { TLan_DioWrite8 ( dev -> base_addr , TLAN_LED_REG , TLAN_LED_LINK | TLAN_LED_ACT ) ; if ( priv -> timer . function == NULL ) { priv -> timer . function = & TLan_Timer ; priv -> timer . data = ( unsigned long ) dev ; priv -> timer . expires = jiffies + TLAN_TIMER_ACT_DELAY ; priv -> timerSetAt = jiffies ; priv -> timerType = TLAN_TIMER_ACTIVITY ; add_timer ( & priv -> timer ) ; } else if ( priv -> timerType == TLAN_TIMER_ACTIVITY ) { priv -> timerSetAt = jiffies ; } } return ack ; }
TLan_HandleTxEOF
      Returns:
              1
      Parms:
              dev             Device assigned the IRQ that was
                              raised.
TLan_HandleTxEOF Returns : 1 Parms : dev Device assigned the IRQ that was raised .