plan 9 kernel history: overview | file list | diff list

1993/1124/pc/etherif.h (diff list | history)

pc/etherif.h on 1993/1113
1993/1113    
enum { 
	MaxEther	= 4, 
	Ntypes		= 8, 
}; 
 
typedef struct Ether Ether; 
struct Ether { 
	ISAConf;			/* hardware info */ 
 
	void	(*attach)(Ether*);	/* filled in by reset routine */ 
	long	(*write)(Ether*, void*, long); 
1993/1124    
	void	(*interrupt)(Ureg*, void*); 
1993/1113    
	void	*private; 
 
	Etherpkt tpkt;			/* transmit buffer */ 
	Etherpkt rpkt;			/* receive buffer */ 
 
	QLock	tlock;			/* lock for grabbing transmitter queue */ 
	Rendez	tr;			/* wait here for free xmit buffer */ 
1993/1119    
	long	tlen;			/* length of data in tpkt */ 
1993/1113    
 
	Netif; 
}; 
 
1993/1116    
typedef struct { 
	uchar	bit16;			/* true if a 16 bit interface */ 
	uchar	ram;			/* true if card has shared memory */ 
 
	ulong	dp8390;			/* I/O address of 8390 */ 
	ulong	data;			/* I/O data port if no shared memory */ 
1993/1118    
 
	uchar	nxtpkt;			/* receive: software bndry */ 
1993/1116    
	uchar	tstart;			/* 8390 ring addresses */ 
	uchar	pstart; 
	uchar	pstop; 
} Dp8390; 
1993/1118    
 
#define Dp8390BufSz	256 
 
extern int dp8390reset(Ether*); 
extern void dp8390getea(Ether*); 
extern void dp8390setea(Ether*); 
1993/1116    
 
1993/1113    
#define NEXT(x, l)	(((x)+1)%(l)) 
#define	HOWMANY(x, y)	(((x)+((y)-1))/(y)) 
#define ROUNDUP(x, y)	(HOWMANY((x), (y))*(y)) 
 
extern void addethercard(char*, int(*)(Ether*)); 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)