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

1997/0327/pc/etherif.h (diff list | history)

1996/0622/sys/src/9/pc/etherif.h:7,571997/0327/sys/src/9/pc/etherif.h:7,29 (short | long | prev | next)
In Ether: add ea, replace write with transmit and oq; remove explicit buffers. Add etheriq. Move Dp8390 code to etherdp8390.h XXX.
rsc Fri Mar 4 12:44:25 2005
1993/1113    
struct Ether { 
	ISAConf;			/* hardware info */ 
1995/0721    
	int	ctlrno; 
1997/0327    
	int	tbdf;			/* type+busno+devno+funcno */ 
1996/0601    
	int	mbps;			/* Mbps */ 
1997/0327    
	uchar	ea[Eaddrlen]; 
1993/1113    
 
	void	(*attach)(Ether*);	/* filled in by reset routine */ 
	long	(*write)(Ether*, void*, long); 
1997/0327    
	void	(*transmit)(Ether*); 
1993/1124    
	void	(*interrupt)(Ureg*, void*); 
1996/0607    
	long	(*ifstat)(Ether*, void*, long, ulong); 
1995/0721    
	void	*ctlr; 
1993/1113    
 
	Etherpkt tpkt;			/* transmit buffer */ 
	Etherpkt rpkt;			/* receive buffer */ 
1997/0327    
	Queue*	oq; 
1993/1113    
 
	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; 
}; 
 
1995/0721    
extern void etherrloop(Ether*, Etherpkt*, long); 
1997/0327    
extern Block* etheriq(Ether*, Block*, int); 
1994/0202    
extern void addethercard(char*, int(*)(Ether*)); 
                 
/* 
 * Stuff for the boards using the National Semiconductor DP8390 
 * and SMC 83C90 Network Interface Controller. 
 * Common code is in ether8390.c. 
 */ 
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*); 
1994/0128    
extern void *dp8390read(Dp8390*, void*, ulong, ulong); 
extern void *dp8390write(Dp8390*, ulong, void*, ulong); 
1994/0130    
extern void dp8390setea(Ether*); 
1993/1116    
 
1993/1113    
#define NEXT(x, l)	(((x)+1)%(l)) 
1996/0622    
#define PREV(x, l)	(((x) == 0) ? (l)-1: (x)-1) 


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