1*5688Ssam /* if_uba.h 4.5 82/02/03 */ 25079Swnj 35079Swnj /* 45079Swnj * Structure and routine definitions 55079Swnj * for UNIBUS network interfaces. 65079Swnj */ 75079Swnj 85172Swnj #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 */ 325172Swnj short ifu_hlen; /* local net header length */ 335079Swnj struct uba_regs *ifu_uba; /* uba regs, in vm */ 345079Swnj struct ifrw { 355229Swnj caddr_t ifrw_addr; /* virt addr of header */ 365229Swnj int ifrw_bdp; /* unibus bdp */ 375079Swnj int ifrw_info; /* value from ubaalloc */ 385229Swnj int ifrw_proto; /* map register prototype */ 395079Swnj struct pte *ifrw_mr; /* base of map registers */ 405079Swnj } ifu_r, ifu_w; 415172Swnj struct pte ifu_wmap[IF_MAXNUBAMR]; /* base pages for output */ 425172Swnj short ifu_xswapd; /* mask of clusters swapped */ 43*5688Ssam short ifu_flags; /* used during uballoc's */ 445172Swnj struct mbuf *ifu_xtofree; /* pages being dma'd out */ 455079Swnj }; 465084Swnj 475084Swnj #ifdef KERNEL 485084Swnj struct mbuf *if_rubaget(); 495084Swnj #endif 50