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