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

1991/0910/pc/io.h (diff list | history)

1991/0703/sys/src/9/pc/io.h:1,201991/0704/sys/src/9/pc/io.h:1,50 (short | long)
1991/0703    
/* 
 *  interrupt levels 
1991/0704    
 *  8259 interrupt controllers 
1991/0703    
 */ 
enum { 
	Clockvec=	8, 
	Kbdvec=		9, 
	Floppyvec=	14, 
1991/0704    
enum 
{ 
	Int0ctl=	0x20,		/* control port */ 
	Int0aux=	0x21,		/* everything else port */ 
	Int1ctl=	0xA0,		/* control port */ 
	Int1aux=	0xA1,		/* everything else port */ 
 
	Intena=		0x20,		/* written to Intctlport, enables next int */ 
 
	Int0vec=	17,		/* first interrupt vector used by the 8259 */ 
	Clockvec=	Int0vec+0,	/* clock interrupts */ 
	Kbdvec=		Int0vec+1,	/* keyboard interrupts */ 
1991/0703    
}; 
1991/0704    
#define	INT0ENABLE	outb(Int0ctl, Intena) 
#define	INT1ENABLE	outb(Int1ctl, Intena) 
1991/0703    
 
/* 
 *  damned 8259, assume DOS sets it up for us 
1991/0704    
 *  8253 timer 
1991/0703    
 */ 
enum { 
	Intctlport=	0x20,	/* 8259 control port */ 
	Intctlmask=	0x21,	/* interrupt mask */ 
1991/0704    
enum 
{ 
	Timerctl=	0x43,		/* control port */ 
	Timercnt=	0x40,		/* timer count port (outb count-1) */ 
	Timericnt=	0x41,		/* timer count input port */ 
1991/0703    
 
	Intenable=	0x20,	/* written to Intctlport, enables next int */ 
1991/0704    
	Timerlatch=	0x40,		/* latch count into Timericnt */ 
1991/0703    
}; 
 
#define	INTENABLE	outb(Intctlport, Intenable) 
1991/0704    
/* 
 *  8237 dma controllers 
 */ 
enum 
{ 
	/* 
	 *  the byte registers for DMA0 are all one byte apart 
	 */ 
	Dma0=		0x00, 
	Dma0status=	Dma0+0x8,	/* status port */ 
	Dma0reset=	Dma0+0xD,	/* reset port */ 
 
	/* 
	 *  the byte registers for DMA1 are all two bytes apart (why?) 
	 */ 
	Dma1=		0xC0, 
	Dma1status=	Dma1+2*0x8,	/* status port */ 
	Dma0reset=	Dma1+2*0xD,	/* reset port */ 
}; 
1991/0704/sys/src/9/pc/io.h:18,351991/0705/sys/src/9/pc/io.h:18,23 (short | long)
1991/0704    
#define	INT1ENABLE	outb(Int1ctl, Intena) 
1991/0703    
 
/* 
1991/0704    
 *  8253 timer 
1991/0703    
 */ 
1991/0704    
enum 
{ 
	Timerctl=	0x43,		/* control port */ 
	Timercnt=	0x40,		/* timer count port (outb count-1) */ 
	Timericnt=	0x41,		/* timer count input port */ 
1991/0703    
                 
1991/0704    
	Timerlatch=	0x40,		/* latch count into Timericnt */ 
1991/0703    
}; 
                 
1991/0704    
/* 
 *  8237 dma controllers 
 */ 
enum 
1991/0704/sys/src/9/pc/io.h:46,501991/0705/sys/src/9/pc/io.h:34,38
1991/0704    
	 */ 
	Dma1=		0xC0, 
	Dma1status=	Dma1+2*0x8,	/* status port */ 
	Dma0reset=	Dma1+2*0xD,	/* reset port */ 
1991/0705    
	Dma1reset=	Dma1+2*0xD,	/* reset port */ 
1991/0704    
}; 
1991/0705/sys/src/9/pc/io.h:10,161991/0706/sys/src/9/pc/io.h:10,16 (short | long)
1991/0704    
 
	Intena=		0x20,		/* written to Intctlport, enables next int */ 
 
	Int0vec=	17,		/* first interrupt vector used by the 8259 */ 
1991/0706    
	Int0vec=	16,		/* first interrupt vector used by the 8259 */ 
1991/0704    
	Clockvec=	Int0vec+0,	/* clock interrupts */ 
	Kbdvec=		Int0vec+1,	/* keyboard interrupts */ 
1991/0703    
}; 
1991/0706/sys/src/9/pc/io.h:1,211991/0709/sys/src/9/pc/io.h:1,12 (short | long)
1991/0703    
/* 
1991/0704    
 *  8259 interrupt controllers 
1991/0709    
 *  programmable interrupt vectors (for the 8259) 
1991/0703    
 */ 
1991/0704    
enum 
{ 
	Int0ctl=	0x20,		/* control port */ 
	Int0aux=	0x21,		/* everything else port */ 
	Int1ctl=	0xA0,		/* control port */ 
	Int1aux=	0xA1,		/* everything else port */ 
                 
	Intena=		0x20,		/* written to Intctlport, enables next int */ 
                 
1991/0706    
	Int0vec=	16,		/* first interrupt vector used by the 8259 */ 
1991/0704    
	Clockvec=	Int0vec+0,	/* clock interrupts */ 
	Kbdvec=		Int0vec+1,	/* keyboard interrupts */ 
1991/0703    
}; 
1991/0704    
#define	INT0ENABLE	outb(Int0ctl, Intena) 
#define	INT1ENABLE	outb(Int1ctl, Intena) 
1991/0703    
 
/* 
1991/0704    
 *  8237 dma controllers 
1991/0709/sys/src/9/pc/io.h:3,81991/0710/sys/src/9/pc/io.h:3,9 (short | long)
1991/0703    
 */ 
1991/0704    
enum 
{ 
1991/0710    
	Faultvec=	14,		/* page fault */ 
1991/0706    
	Int0vec=	16,		/* first interrupt vector used by the 8259 */ 
1991/0704    
	Clockvec=	Int0vec+0,	/* clock interrupts */ 
	Kbdvec=		Int0vec+1,	/* keyboard interrupts */ 
1991/0710/sys/src/9/pc/io.h:7,121991/0730/sys/src/9/pc/io.h:7,13 (short | long)
1991/0706    
	Int0vec=	16,		/* first interrupt vector used by the 8259 */ 
1991/0704    
	Clockvec=	Int0vec+0,	/* clock interrupts */ 
	Kbdvec=		Int0vec+1,	/* keyboard interrupts */ 
1991/0730    
	Mousevec=	Int0vec+12,	/* mouse interrupt */ 
1991/0703    
}; 
 
/* 
1991/0730/sys/src/9/pc/io.h:1,311991/0731/sys/src/9/pc/io.h:1,16 (short | long)
1991/0703    
/* 
1991/0709    
 *  programmable interrupt vectors (for the 8259) 
1991/0731    
 *  programmable interrupt vectors (for the 8259's) 
1991/0703    
 */ 
1991/0704    
enum 
{ 
1991/0710    
	Faultvec=	14,		/* page fault */ 
1991/0706    
	Int0vec=	16,		/* first interrupt vector used by the 8259 */ 
1991/0704    
	Clockvec=	Int0vec+0,	/* clock interrupts */ 
	Kbdvec=		Int0vec+1,	/* keyboard interrupts */ 
1991/0730    
	Mousevec=	Int0vec+12,	/* mouse interrupt */ 
1991/0703    
}; 
                 
/* 
1991/0704    
 *  8237 dma controllers 
 */ 
enum 
{ 
	/* 
	 *  the byte registers for DMA0 are all one byte apart 
	 */ 
	Dma0=		0x00, 
	Dma0status=	Dma0+0x8,	/* status port */ 
	Dma0reset=	Dma0+0xD,	/* reset port */ 
                 
	/* 
	 *  the byte registers for DMA1 are all two bytes apart (why?) 
	 */ 
	Dma1=		0xC0, 
	Dma1status=	Dma1+2*0x8,	/* status port */ 
1991/0705    
	Dma1reset=	Dma1+2*0xD,	/* reset port */ 
1991/0731    
	Int0vec=	16,		/* first 8259 */ 
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
	 ComBvec=	Int0vec+3,	/*  inerrupt from uart b */ 
	 ComAvec=	Int0vec+4,	/*  inerrupt from uart a */ 
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
	 Hardvec=	Int1vec+6,	/*  hard disk */ 
1991/0704    
}; 
1991/0731/sys/src/9/pc/io.h:7,141991/0801/sys/src/9/pc/io.h:7,14 (short | long)
1991/0731    
	Int0vec=	16,		/* first 8259 */ 
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
	 ComBvec=	Int0vec+3,	/*  inerrupt from uart b */ 
	 ComAvec=	Int0vec+4,	/*  inerrupt from uart a */ 
1991/0801    
	 Uart0vec=	Int0vec+3,	/*  inerrupt from uart b */ 
	 Uart1vec=	Int0vec+4,	/*  inerrupt from uart a */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0801/sys/src/9/pc/io.h:7,141991/0806/sys/src/9/pc/io.h:7,14 (short | long)
1991/0731    
	Int0vec=	16,		/* first 8259 */ 
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0801    
	 Uart0vec=	Int0vec+3,	/*  inerrupt from uart b */ 
	 Uart1vec=	Int0vec+4,	/*  inerrupt from uart a */ 
1991/0806    
	 Uart0vec=	Int0vec+3,	/*  serial line */ 
	 Uart1vec=	Int0vec+4,	/*  modem line */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0806/sys/src/9/pc/io.h:7,141991/0810/sys/src/9/pc/io.h:7,14 (short | long)
1991/0731    
	Int0vec=	16,		/* first 8259 */ 
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0806    
	 Uart0vec=	Int0vec+3,	/*  serial line */ 
	 Uart1vec=	Int0vec+4,	/*  modem line */ 
1991/0810    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0810/sys/src/9/pc/io.h:7,141991/0811/sys/src/9/pc/io.h:7,14 (short | long)
1991/0731    
	Int0vec=	16,		/* first 8259 */ 
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0810    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0811    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0811/sys/src/9/pc/io.h:4,101991/0904/sys/src/9/pc/io.h:4,10 (short | long)
1991/0704    
enum 
{ 
1991/0710    
	Faultvec=	14,		/* page fault */ 
1991/0731    
	Int0vec=	16,		/* first 8259 */ 
1991/0904    
	Int0vec=	24,		/* first 8259 */ 
1991/0731    
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0810    
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0904/sys/src/9/pc/io.h:3,91991/0905/sys/src/9/pc/io.h:3,11 (short | long)
1991/0703    
 */ 
1991/0704    
enum 
{ 
1991/0905    
	Coprocvec=	7,		/* math coprocessor interrupt */ 
1991/0710    
	Faultvec=	14,		/* page fault */ 
1991/0905    
 
1991/0904    
	Int0vec=	24,		/* first 8259 */ 
1991/0731    
	 Clockvec=	Int0vec+0,	/*  clock interrupts */ 
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0905/sys/src/9/pc/io.h:3,91991/0906/sys/src/9/pc/io.h:3,11 (short | long)
1991/0703    
 */ 
1991/0704    
enum 
{ 
1991/0905    
	Coprocvec=	7,		/* math coprocessor interrupt */ 
1991/0906    
	Mathemuvec=	7,		/* math coprocessor emulation interrupt */ 
	Mathovervec=	9,		/* math coprocessor overrun interrupt */ 
	Matherrorvec=	9,		/* math coprocessor error interrupt */ 
1991/0710    
	Faultvec=	14,		/* page fault */ 
1991/0905    
 
1991/0904    
	Int0vec=	24,		/* first 8259 */ 
1991/0906/sys/src/9/pc/io.h:17,201991/0910/sys/src/9/pc/io.h:17,22 (short | long)
1991/0731    
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
	 Hardvec=	Int1vec+6,	/*  hard disk */ 
1991/0910    
 
	Syscallvec=	64, 
1991/0704    
}; 
1991/0910/sys/src/9/pc/io.h:5,111991/0912/sys/src/9/pc/io.h:5,11 (short | long)
1991/0704    
{ 
1991/0906    
	Mathemuvec=	7,		/* math coprocessor emulation interrupt */ 
	Mathovervec=	9,		/* math coprocessor overrun interrupt */ 
	Matherrorvec=	9,		/* math coprocessor error interrupt */ 
1991/0912    
	Matherr1vec=	16,		/* math coprocessor error interrupt */ 
1991/0710    
	Faultvec=	14,		/* page fault */ 
1991/0905    
 
1991/0904    
	Int0vec=	24,		/* first 8259 */ 
1991/0910/sys/src/9/pc/io.h:16,211991/0912/sys/src/9/pc/io.h:16,22
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0912    
	 Matherr2vec=	Int1vec+5,	/*  math coprocessor */ 
1991/0731    
	 Hardvec=	Int1vec+6,	/*  hard disk */ 
1991/0910    
 
	Syscallvec=	64, 
1991/0912/sys/src/9/pc/io.h:3,81991/1112/sys/src/9/pc/io.h:3,9 (short | long)
1991/0703    
 */ 
1991/0704    
enum 
{ 
1991/1112    
	Bptvec=		3,		/* breakpoints */ 
1991/0906    
	Mathemuvec=	7,		/* math coprocessor emulation interrupt */ 
	Mathovervec=	9,		/* math coprocessor overrun interrupt */ 
1991/0912    
	Matherr1vec=	16,		/* math coprocessor error interrupt */ 
1991/1112/sys/src/9/pc/io.h:15,201991/1127/sys/src/9/pc/io.h:15,21 (short | long)
1991/0810    
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0811    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
1991/1127    
	 Parallelvec=	Int0vec+7,	/*  parallel port interrupts */ 
1991/0731    
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0912    
	 Matherr2vec=	Int1vec+5,	/*  math coprocessor */ 
1991/1127/sys/src/9/pc/io.h:14,191992/0403/sys/src/9/pc/io.h:14,20 (short | long)
1991/0731    
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0810    
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0811    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
1992/0403    
	 Ethervec=	Int0vec+5,	/*  ethernet interrupt */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
1991/1127    
	 Parallelvec=	Int0vec+7,	/*  parallel port interrupts */ 
1991/0731    
	Int1vec=	Int0vec+8,	/* second 8259 */ 
1992/0403/sys/src/9/pc/io.h:14,261992/0904/sys/src/9/pc/io.h:14,26 (short | long)
Change Ethervec. Clarify values of Mousevec, Matherr2vec, and Hardvec.
rsc Fri Mar 4 12:44:25 2005
1991/0731    
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0810    
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0811    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
1992/0403    
	 Ethervec=	Int0vec+5,	/*  ethernet interrupt */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
1991/1127    
	 Parallelvec=	Int0vec+7,	/*  parallel port interrupts */ 
1991/0731    
	Int1vec=	Int0vec+8,	/* second 8259 */ 
	 Mousevec=	Int1vec+4,	/*  mouse interrupt */ 
1991/0912    
	 Matherr2vec=	Int1vec+5,	/*  math coprocessor */ 
1991/0731    
	 Hardvec=	Int1vec+6,	/*  hard disk */ 
1992/0904    
	Int1vec=	Int0vec+8, 
	 Ethervec=	Int0vec+10,	/*  ethernet interrupt */ 
	 Mousevec=	Int0vec+12,	/*  mouse interrupt */ 
	 Matherr2vec=	Int0vec+13,	/*  math coprocessor */ 
	 Hardvec=	Int0vec+14,	/*  hard disk */ 
1991/0910    
 
	Syscallvec=	64, 
1991/0704    
}; 
1992/0904/sys/src/9/pc/io.h:24,261992/0922/sys/src/9/pc/io.h:24,120 (short | long)
Add generic ethernet structures.
rsc Fri Mar 4 12:44:25 2005
1991/0910    
 
	Syscallvec=	64, 
1991/0704    
}; 
1992/0922    
 
typedef struct EtherHw EtherHw; 
typedef struct EtherBuf EtherBuf; 
typedef struct EtherType EtherType; 
typedef struct EtherCtlr EtherCtlr; 
 
struct EtherHw { 
	int	(*reset)(EtherCtlr*); 
	void	(*init)(EtherCtlr*); 
	void	(*mode)(EtherCtlr*, int); 
	void	(*online)(EtherCtlr*, int); 
	void	(*receive)(EtherCtlr*); 
	void	(*transmit)(EtherCtlr*); 
	void	(*intr)(EtherCtlr*); 
	void	(*tweak)(EtherCtlr*); 
	int	addr;			/* interface address */ 
	uchar	*ram;			/* interface shared memory address */ 
	int	bt16;			/* true if a 16 bit interface */ 
	int	irq;			/* interrupt level */ 
	int	size; 
	uchar	tstart; 
	uchar	pstart; 
	uchar	pstop; 
}; 
 
struct EtherBuf { 
	uchar	owner; 
	uchar	busy; 
	ushort	len; 
	uchar	pkt[sizeof(Etherpkt)]; 
}; 
 
enum { 
	Host		= 0,		/* buffer owned by host */ 
	Interface	= 1,		/* buffer owned by interface */ 
 
	NType		= 9,		/* types/interface */ 
}; 
 
/* 
 * one per ethernet packet type 
 */ 
struct EtherType { 
	QLock; 
	Netprot;			/* stat info */ 
	int	type;			/* ethernet type */ 
	int	prom;			/* promiscuous mode */ 
	Queue	*q; 
	int	inuse; 
	EtherCtlr *ctlr; 
}; 
 
/* 
 * per ethernet 
 */ 
struct EtherCtlr { 
	QLock; 
 
	EtherHw	*hw; 
	int	present; 
 
	ushort	nrb;		/* number of software receive buffers */ 
	ushort	ntb;		/* number of software transmit buffers */ 
	EtherBuf *rb;		/* software receive buffers */ 
	EtherBuf *tb;		/* software transmit buffers */ 
 
	uchar	ea[6];		/* ethernet address */ 
	uchar	ba[6];		/* broadcast address */ 
 
	Rendez	rr;		/* rendezvous for a receive buffer */ 
	ushort	rh;		/* first receive buffer belonging to host */ 
	ushort	ri;		/* first receive buffer belonging to interface */	 
 
	Rendez	tr;		/* rendezvous for a transmit buffer */ 
	QLock	tlock;		/* semaphore on th */ 
	ushort	th;		/* first transmit buffer belonging to host */	 
	ushort	ti;		/* first transmit buffer belonging to interface */	 
 
	EtherType type[NType]; 
	uchar	prom;		/* true if promiscuous mode */ 
	uchar	kproc;		/* true if kproc started */ 
	char	name[NAMELEN];	/* name of kproc */ 
	Network	net; 
 
	Queue	lbq;		/* software loopback packet queue */ 
 
	int	inpackets; 
	int	outpackets; 
	int	crcs;		/* input crc errors */ 
	int	oerrs;		/* output errors */ 
	int	frames;		/* framing errors */ 
	int	overflows;	/* packet overflows */ 
	int	buffs;		/* buffering errors */ 
}; 
1992/0922/sys/src/9/pc/io.h:14,191992/0929/sys/src/9/pc/io.h:14,20 (short | long)
Add PCMCIAvec.
rsc Fri Mar 4 12:44:25 2005
1991/0731    
	 Kbdvec=	Int0vec+1,	/*  keyboard interrupts */ 
1991/0810    
	 Uart1vec=	Int0vec+3,	/*  modem line */ 
1991/0811    
	 Uart0vec=	Int0vec+4,	/*  serial line */ 
1992/0929    
	 PCMCIAvec=	Int0vec+5,	/*  PCMCIA card change */ 
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
1991/1127    
	 Parallelvec=	Int0vec+7,	/*  parallel port interrupts */ 
1992/0904    
	Int1vec=	Int0vec+8, 
1992/0929/sys/src/9/pc/io.h:25,1211992/1222/sys/src/9/pc/io.h:25,27 (short | long)
Remove generic ethernet structures.
rsc Fri Mar 4 12:44:25 2005
1991/0910    
 
	Syscallvec=	64, 
1991/0704    
}; 
1992/0922    
                 
typedef struct EtherHw EtherHw; 
typedef struct EtherBuf EtherBuf; 
typedef struct EtherType EtherType; 
typedef struct EtherCtlr EtherCtlr; 
                 
struct EtherHw { 
	int	(*reset)(EtherCtlr*); 
	void	(*init)(EtherCtlr*); 
	void	(*mode)(EtherCtlr*, int); 
	void	(*online)(EtherCtlr*, int); 
	void	(*receive)(EtherCtlr*); 
	void	(*transmit)(EtherCtlr*); 
	void	(*intr)(EtherCtlr*); 
	void	(*tweak)(EtherCtlr*); 
	int	addr;			/* interface address */ 
	uchar	*ram;			/* interface shared memory address */ 
	int	bt16;			/* true if a 16 bit interface */ 
	int	irq;			/* interrupt level */ 
	int	size; 
	uchar	tstart; 
	uchar	pstart; 
	uchar	pstop; 
}; 
                 
struct EtherBuf { 
	uchar	owner; 
	uchar	busy; 
	ushort	len; 
	uchar	pkt[sizeof(Etherpkt)]; 
}; 
                 
enum { 
	Host		= 0,		/* buffer owned by host */ 
	Interface	= 1,		/* buffer owned by interface */ 
                 
	NType		= 9,		/* types/interface */ 
}; 
                 
/* 
 * one per ethernet packet type 
 */ 
struct EtherType { 
	QLock; 
	Netprot;			/* stat info */ 
	int	type;			/* ethernet type */ 
	int	prom;			/* promiscuous mode */ 
	Queue	*q; 
	int	inuse; 
	EtherCtlr *ctlr; 
}; 
                 
/* 
 * per ethernet 
 */ 
struct EtherCtlr { 
	QLock; 
                 
	EtherHw	*hw; 
	int	present; 
                 
	ushort	nrb;		/* number of software receive buffers */ 
	ushort	ntb;		/* number of software transmit buffers */ 
	EtherBuf *rb;		/* software receive buffers */ 
	EtherBuf *tb;		/* software transmit buffers */ 
                 
	uchar	ea[6];		/* ethernet address */ 
	uchar	ba[6];		/* broadcast address */ 
                 
	Rendez	rr;		/* rendezvous for a receive buffer */ 
	ushort	rh;		/* first receive buffer belonging to host */ 
	ushort	ri;		/* first receive buffer belonging to interface */	 
                 
	Rendez	tr;		/* rendezvous for a transmit buffer */ 
	QLock	tlock;		/* semaphore on th */ 
	ushort	th;		/* first transmit buffer belonging to host */	 
	ushort	ti;		/* first transmit buffer belonging to interface */	 
                 
	EtherType type[NType]; 
	uchar	prom;		/* true if promiscuous mode */ 
	uchar	kproc;		/* true if kproc started */ 
	char	name[NAMELEN];	/* name of kproc */ 
	Network	net; 
                 
	Queue	lbq;		/* software loopback packet queue */ 
                 
	int	inpackets; 
	int	outpackets; 
	int	crcs;		/* input crc errors */ 
	int	oerrs;		/* output errors */ 
	int	frames;		/* framing errors */ 
	int	overflows;	/* packet overflows */ 
	int	buffs;		/* buffering errors */ 
}; 
1992/1222/sys/src/9/pc/io.h:18,271994/0908/sys/src/9/pc/io.h:18,34 (short | long)
Remove Ethervec, add names for unassigned vectors. Add MaxEISA.
rsc Fri Mar 4 12:44:25 2005
1991/0731    
	 Floppyvec=	Int0vec+6,	/*  floppy interrupts */ 
1991/1127    
	 Parallelvec=	Int0vec+7,	/*  parallel port interrupts */ 
1992/0904    
	Int1vec=	Int0vec+8, 
	 Ethervec=	Int0vec+10,	/*  ethernet interrupt */ 
1994/0908    
	 Vector9=	Int0vec+9,	/*  unassigned */ 
	 Vector10=	Int0vec+10,	/*  unassigned, usually ethernet */ 
	 Vector11=	Int0vec+11,	/*  unassigned, usually scsi */ 
1992/0904    
	 Mousevec=	Int0vec+12,	/*  mouse interrupt */ 
	 Matherr2vec=	Int0vec+13,	/*  math coprocessor */ 
	 Hardvec=	Int0vec+14,	/*  hard disk */ 
1994/0908    
	 Vector15=	Int0vec+15,	/*  unassigned */ 
1991/0910    
 
	Syscallvec=	64, 
1994/0908    
}; 
 
enum { 
	MaxEISA		= 16, 
1991/0704    
}; 
1994/0908/sys/src/9/pc/io.h:31,341995/0126/sys/src/9/pc/io.h:31,35 (short | long)
Add EISAconfig.
rsc Fri Mar 4 12:44:25 2005
1994/0908    
 
enum { 
	MaxEISA		= 16, 
1995/0126    
	EISAconfig	= 0xC80, 
1991/0704    
}; 
Too many diffs (26 > 25). Stopping.


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