kernels/linux-2.4.0/drivers/net/tokenring/tms380tr.c
/*
 * Processes adapter hardware reset, halts adapter and downloads firmware,
 * clears the halt bit.
 */
Processes adapter hardware reset, halts adapter and downloads firmware,
clears the halt bit.
Processes adapter hardware reset halts adapter and downloads firmware clears the halt bit .
static int tms380tr_reset_adapter(struct net_device *dev)
{
	struct net_local *tp = (struct net_local *)dev->priv;
	unsigned short *fw_ptr = (unsigned short *)&tms380tr_code;
	unsigned short count, c;
	SIFWRITEW(ACL_ARESET, SIFACL);
	tms380tr_wait(40);
	c = SIFREADW(SIFACL);
	tms380tr_wait(20);
	if(dev->dma == 0)	
	{
		c &= ~(ACL_NSELOUT0 | ACL_NSELOUT1);	
		if(tp->setnselout)
		  c |= (*tp->setnselout)(dev);
	}
	tp->ScbInUse = 0;
	c &= ~ACL_ARESET;		
	c |=  ACL_CPHALT;		
	c |= ACL_BOOT;
	c |= ACL_SINTEN;
	c &= ~ACL_PSDMAEN;		
	SIFWRITEW(c, SIFACL);
	tms380tr_wait(40);
	do {
		SIFWRITEW(*fw_ptr, SIFADX);
		fw_ptr++;
		SIFWRITEW(*fw_ptr, SIFADD);
		fw_ptr++;
		if((count = *fw_ptr) != 0)	
		{
			fw_ptr++;	
			for(; count > 0; count--)
			{
				SIFWRITEW(*fw_ptr, SIFINC);
				fw_ptr++;
			}
		}
		else	
		{
			c = SIFREADW(SIFACL);
			c &= (~ACL_CPHALT | ACL_SINTEN);
			SIFWRITEW(c, SIFACL);
			return (1);
		}
	} while(count == 0);
	return (-1);
}
static int tms380tr_reset_adapter ( struct net_device * dev ) { struct net_local * tp = ( struct net_local * ) dev -> priv ; unsigned short * fw_ptr = ( unsigned short * ) & tms380tr_code ; unsigned short count , c ; SIFWRITEW ( ACL_ARESET , SIFACL ) ; tms380tr_wait ( 40 ) ; c = SIFREADW ( SIFACL ) ; tms380tr_wait ( 20 ) ; if ( dev -> dma == 0 ) { c &= ~ ( ACL_NSELOUT0 | ACL_NSELOUT1 ) ; if ( tp -> setnselout ) c |= ( * tp -> setnselout ) ( dev ) ; } tp -> ScbInUse = 0 ; c &= ~ ACL_ARESET ; c |= ACL_CPHALT ; c |= ACL_BOOT ; c |= ACL_SINTEN ; c &= ~ ACL_PSDMAEN ; SIFWRITEW ( c , SIFACL ) ; tms380tr_wait ( 40 ) ; do { SIFWRITEW ( * fw_ptr , SIFADX ) ; fw_ptr ++ ; SIFWRITEW ( * fw_ptr , SIFADD ) ; fw_ptr ++ ; if ( ( count = * fw_ptr ) != 0 ) { fw_ptr ++ ; for ( ; count > 0 ; count -- ) { SIFWRITEW ( * fw_ptr , SIFINC ) ; fw_ptr ++ ; } } else { c = SIFREADW ( SIFACL ) ; c &= ( ~ ACL_CPHALT | ACL_SINTEN ) ; SIFWRITEW ( c , SIFACL ) ; return ( 1 ) ; } } while ( count == 0 ) ; return ( -1 ) ; }
Processes adapter hardware reset, halts adapter and downloads firmware,
 clears the halt bit.
Processes adapter hardware reset halts adapter and downloads firmware clears the halt bit .
/* Hardware adapter reset */ /* For PCI adapters */ /* Clear bits */ /* In case a command is pending - forget it */ /* Clear adapter reset bit */ /* Halt adapter CPU, allow download */ /* Clear pseudo dma bit */ /* Download firmware via DIO interface: */ /* Download first address part */ /* Download second address part */ /* Load loop counter */ /* Download block data */ /* Stop, if last block downloaded */ /* Clear CPHALT and start BUD */