kernels/linux-2.4.0/drivers/net/tokenring/tms380tr.c
/*
 * Reads a number of bytes from adapter to system memory.
 */
Reads a number of bytes from adapter to system memory.
Reads a number of bytes from adapter to system memory .
static void tms380tr_read_ram(struct net_device *dev, unsigned char *Data,
				unsigned short Address, int Length)
{
	int i;
	unsigned short old_sifadx, old_sifadr, InWord;
	old_sifadx = SIFREADW(SIFADX);
	old_sifadr = SIFREADW(SIFADR);
	SIFWRITEW(0x0001, SIFADX);
        SIFWRITEW(Address, SIFADR);
	i = 0;
	for(;;)
	{
		InWord = SIFREADW(SIFINC);
		*(Data + i) = HIBYTE(InWord);	
		if(++i == Length)		
			break;
		*(Data + i) = LOBYTE(InWord);	
		if (++i == Length)		
			break;
	}
	SIFWRITEW(old_sifadx, SIFADX);
	SIFWRITEW(old_sifadr, SIFADR);
	return;
}
static void tms380tr_read_ram ( struct net_device * dev , unsigned char * Data , unsigned short Address , int Length ) { int i ; unsigned short old_sifadx , old_sifadr , InWord ; old_sifadx = SIFREADW ( SIFADX ) ; old_sifadr = SIFREADW ( SIFADR ) ; SIFWRITEW ( 0x0001 , SIFADX ) ; SIFWRITEW ( Address , SIFADR ) ; i = 0 ; for ( ; ; ) { InWord = SIFREADW ( SIFINC ) ; * ( Data + i ) = HIBYTE ( InWord ) ; if ( ++ i == Length ) break ; * ( Data + i ) = LOBYTE ( InWord ) ; if ( ++ i == Length ) break ; } SIFWRITEW ( old_sifadx , SIFADX ) ; SIFWRITEW ( old_sifadr , SIFADR ) ; return ; }
Reads a number of bytes from adapter to system memory.
Reads a number of bytes from adapter to system memory .
/* Save the current values */ /* Page number of adapter memory */ /* Address offset in adapter RAM */ /* Copy len byte from adapter memory to system data area. */ /* Write first byte */ /* All is done break */ /* Write second byte */ /* All is done break */ /* Restore original values */