xref: /csrg-svn/sys/vax/if/if_uba.h (revision 5079)
1*5079Swnj /*	if_uba.h	4.1	81/11/25	*/
2*5079Swnj 
3*5079Swnj /*
4*5079Swnj  * Structure and routine definitions
5*5079Swnj  * for UNIBUS network interfaces.
6*5079Swnj  */
7*5079Swnj 
8*5079Swnj #define	IF_NUBAMR	6
9*5079Swnj /*
10*5079Swnj  * Each interface has one of these structures giving information
11*5079Swnj  * about UNIBUS resources held by the interface.
12*5079Swnj  *
13*5079Swnj  * We hold IF_NUBAMR map registers for datagram data, starting
14*5079Swnj  * at ifr_mr.  Map register ifr_mr[-1] maps the local network header
15*5079Swnj  * ending on the page boundary.  Bdp's are reserved for read and for
16*5079Swnj  * write, given by ifr_bdp.  The prototype of the map register for
17*5079Swnj  * read and for write is saved in ifr_proto.
18*5079Swnj  *
19*5079Swnj  * When write transfers are not full pages on page boundaries we just
20*5079Swnj  * copy the data into the pages mapped on the UNIBUS and start the
21*5079Swnj  * transfer.  If a write transfer is of a (1024 byte) page on a page
22*5079Swnj  * boundary, we swap in UNIBUS pte's to reference the pages, and then
23*5079Swnj  * remap the initial pages (from ifu_wmap) when the transfer completes.
24*5079Swnj  *
25*5079Swnj  * When read transfers give whole pages of data to be input, we
26*5079Swnj  * allocate page frames from a network page list and trade them
27*5079Swnj  * with the pages already containing the data, mapping the allocated
28*5079Swnj  * pages to replace the input pages for the next UNIBUS data input.
29*5079Swnj  */
30*5079Swnj struct	ifuba {
31*5079Swnj 	short	ifu_uban;			/* uba number */
32*5079Swnj 	struct	uba_regs *ifu_uba;		/* uba regs, in vm */
33*5079Swnj 	struct ifrw {
34*5079Swnj 		int	ifrw_info;		/* value from ubaalloc */
35*5079Swnj 		short	ifrw_bdp;		/* unibus bdp */
36*5079Swnj 		struct	pte *ifrw_mr;		/* base of map registers */
37*5079Swnj 		int	ifrw_proto;		/* map register prototype */
38*5079Swnj 		caddr_t	ifrw_addr;		/* virt addr of header */
39*5079Swnj 	} ifu_r, ifu_w;
40*5079Swnj 	struct	pte ifu_wmap[IF_NUBAMR];	/* base pages for output */
41*5079Swnj /* ifu_xswapd is set when we have swapped write pte's to do direct output */
42*5079Swnj /* bit i of ifu_xswapd
43*5079Swnj 	short	ifu_xswapd;			/* bit map of pages swapped */
44*5079Swnj };
45