kernels/linux-2.4.0/drivers/net/tlan.c
/***************************************************************
	 *	TLan_ResetLists
	 *  
	 *	Returns:
	 *		Nothing
	 *	Parms:
	 *		dev	The device structure with the list
	 *			stuctures to be reset.
	 *
	 *	This routine sets the variables associated with managing
	 *	the TLAN lists to their initial values.
	 *
	 **************************************************************/


Nothing
Parms:
dev     The device structure with the list
stuctures to be reset.

This routine sets the variables associated with managing
the TLAN lists to their initial values.
Nothing Parms : dev The device structure with the list stuctures to be reset . This routine sets the variables associated with managing the TLAN lists to their initial values .
void TLan_ResetLists( struct net_device *dev )
{
	TLanPrivateInfo *priv = (TLanPrivateInfo *) dev->priv;
	int		i;
	TLanList	*list;
	struct sk_buff	*skb;
	void		*t = NULL;
	priv->txHead = 0;
	priv->txTail = 0;
	for ( i = 0; i < TLAN_NUM_TX_LISTS; i++ ) {
		list = priv->txList + i;
		list->cStat = TLAN_CSTAT_UNUSED;
		if ( bbuf ) {
			list->buffer[0].address = virt_to_bus( priv->txBuffer + ( i * TLAN_MAX_FRAME_SIZE ) );
		} else {
			list->buffer[0].address = 0;
		}
		list->buffer[2].count = 0;
		list->buffer[2].address = 0;
	}
	priv->rxHead = 0;
	priv->rxTail = TLAN_NUM_RX_LISTS - 1;
	for ( i = 0; i < TLAN_NUM_RX_LISTS; i++ ) {
		list = priv->rxList + i;
		list->cStat = TLAN_CSTAT_READY;
		list->frameSize = TLAN_MAX_FRAME_SIZE;
		list->buffer[0].count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER;
		if ( bbuf ) {
			list->buffer[0].address = virt_to_bus( priv->rxBuffer + ( i * TLAN_MAX_FRAME_SIZE ) );
		} else {
			skb = dev_alloc_skb( TLAN_MAX_FRAME_SIZE + 7 );
			if ( skb == NULL ) {
				printk( "TLAN:  Couldn't allocate memory for received data.\n" );
			} else {
				skb->dev = dev;
				skb_reserve( skb, 2 );
				t = (void *) skb_put( skb, TLAN_MAX_FRAME_SIZE );
			}
			list->buffer[0].address = virt_to_bus( t );
			list->buffer[9].address = (u32) skb;
		}
		list->buffer[1].count = 0;
		list->buffer[1].address = 0;
		if ( i < TLAN_NUM_RX_LISTS - 1 )
			list->forward = virt_to_bus( list + 1 );
		else
			list->forward = 0;
	}
}
void TLan_ResetLists ( struct net_device * dev ) { TLanPrivateInfo * priv = ( TLanPrivateInfo * ) dev -> priv ; int i ; TLanList * list ; struct sk_buff * skb ; void * t = NULL ; priv -> txHead = 0 ; priv -> txTail = 0 ; for ( i = 0 ; i < TLAN_NUM_TX_LISTS ; i ++ ) { list = priv -> txList + i ; list -> cStat = TLAN_CSTAT_UNUSED ; if ( bbuf ) { list -> buffer [ 0 ] . address = virt_to_bus ( priv -> txBuffer + ( i * TLAN_MAX_FRAME_SIZE ) ) ; } else { list -> buffer [ 0 ] . address = 0 ; } list -> buffer [ 2 ] . count = 0 ; list -> buffer [ 2 ] . address = 0 ; } priv -> rxHead = 0 ; priv -> rxTail = TLAN_NUM_RX_LISTS - 1 ; for ( i = 0 ; i < TLAN_NUM_RX_LISTS ; i ++ ) { list = priv -> rxList + i ; list -> cStat = TLAN_CSTAT_READY ; list -> frameSize = TLAN_MAX_FRAME_SIZE ; list -> buffer [ 0 ] . count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER ; if ( bbuf ) { list -> buffer [ 0 ] . address = virt_to_bus ( priv -> rxBuffer + ( i * TLAN_MAX_FRAME_SIZE ) ) ; } else { skb = dev_alloc_skb ( TLAN_MAX_FRAME_SIZE + 7 ) ; if ( skb == NULL ) { printk ( " \n " ) ; } else { skb -> dev = dev ; skb_reserve ( skb , 2 ) ; t = ( void * ) skb_put ( skb , TLAN_MAX_FRAME_SIZE ) ; } list -> buffer [ 0 ] . address = virt_to_bus ( t ) ; list -> buffer [ 9 ] . address = ( u32 ) skb ; } list -> buffer [ 1 ] . count = 0 ; list -> buffer [ 1 ] . address = 0 ; if ( i < TLAN_NUM_RX_LISTS - 1 ) list -> forward = virt_to_bus ( list + 1 ) ; else list -> forward = 0 ; } }
TLan_ResetLists
TLan_ResetLists
/* If this ever happened it would be a problem */