xref: /csrg-svn/sys/vax/if/if_uba.h (revision 5084)
1*5084Swnj /*	if_uba.h	4.2	81/11/26	*/
25079Swnj 
35079Swnj /*
45079Swnj  * Structure and routine definitions
55079Swnj  * for UNIBUS network interfaces.
65079Swnj  */
75079Swnj 
85079Swnj #define	IF_NUBAMR	6
95079Swnj /*
105079Swnj  * Each interface has one of these structures giving information
115079Swnj  * about UNIBUS resources held by the interface.
125079Swnj  *
135079Swnj  * We hold IF_NUBAMR map registers for datagram data, starting
145079Swnj  * at ifr_mr.  Map register ifr_mr[-1] maps the local network header
155079Swnj  * ending on the page boundary.  Bdp's are reserved for read and for
165079Swnj  * write, given by ifr_bdp.  The prototype of the map register for
175079Swnj  * read and for write is saved in ifr_proto.
185079Swnj  *
195079Swnj  * When write transfers are not full pages on page boundaries we just
205079Swnj  * copy the data into the pages mapped on the UNIBUS and start the
215079Swnj  * transfer.  If a write transfer is of a (1024 byte) page on a page
225079Swnj  * boundary, we swap in UNIBUS pte's to reference the pages, and then
235079Swnj  * remap the initial pages (from ifu_wmap) when the transfer completes.
245079Swnj  *
255079Swnj  * When read transfers give whole pages of data to be input, we
265079Swnj  * allocate page frames from a network page list and trade them
275079Swnj  * with the pages already containing the data, mapping the allocated
285079Swnj  * pages to replace the input pages for the next UNIBUS data input.
295079Swnj  */
305079Swnj struct	ifuba {
315079Swnj 	short	ifu_uban;			/* uba number */
325079Swnj 	struct	uba_regs *ifu_uba;		/* uba regs, in vm */
335079Swnj 	struct ifrw {
345079Swnj 		int	ifrw_info;		/* value from ubaalloc */
355079Swnj 		short	ifrw_bdp;		/* unibus bdp */
365079Swnj 		struct	pte *ifrw_mr;		/* base of map registers */
375079Swnj 		int	ifrw_proto;		/* map register prototype */
385079Swnj 		caddr_t	ifrw_addr;		/* virt addr of header */
395079Swnj 	} ifu_r, ifu_w;
405079Swnj 	struct	pte ifu_wmap[IF_NUBAMR];	/* base pages for output */
41*5084Swnj 	short	ifu_hlen;
425079Swnj /* ifu_xswapd is set when we have swapped write pte's to do direct output */
43*5084Swnj /* bit i of ifu_xswapd */
445079Swnj 	short	ifu_xswapd;			/* bit map of pages swapped */
45*5084Swnj 	int	ifu_ierrors;
46*5084Swnj 	int	ifu_oerrors;
47*5084Swnj 	int	ifu_collisions;
485079Swnj };
49*5084Swnj 
50*5084Swnj #ifdef 	KERNEL
51*5084Swnj struct	mbuf *if_rubaget();
52*5084Swnj #endif
53