1*5172Swnj /* if_uba.h 4.3 81/12/03 */ 25079Swnj 35079Swnj /* 45079Swnj * Structure and routine definitions 55079Swnj * for UNIBUS network interfaces. 65079Swnj */ 75079Swnj 8*5172Swnj #define IF_MAXNUBAMR 10 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 */ 32*5172Swnj short ifu_hlen; /* local net header length */ 335079Swnj struct uba_regs *ifu_uba; /* uba regs, in vm */ 345079Swnj struct ifrw { 355079Swnj int ifrw_info; /* value from ubaalloc */ 365079Swnj short ifrw_bdp; /* unibus bdp */ 375079Swnj struct pte *ifrw_mr; /* base of map registers */ 385079Swnj int ifrw_proto; /* map register prototype */ 395079Swnj caddr_t ifrw_addr; /* virt addr of header */ 405079Swnj } ifu_r, ifu_w; 41*5172Swnj struct pte ifu_wmap[IF_MAXNUBAMR]; /* base pages for output */ 42*5172Swnj short ifu_xswapd; /* mask of clusters swapped */ 43*5172Swnj struct mbuf *ifu_xtofree; /* pages being dma'd out */ 445079Swnj }; 455084Swnj 465084Swnj #ifdef KERNEL 475084Swnj struct mbuf *if_rubaget(); 485084Swnj #endif 49