1 /* if_uba.h 4.2 81/11/26 */ 2 3 /* 4 * Structure and routine definitions 5 * for UNIBUS network interfaces. 6 */ 7 8 #define IF_NUBAMR 6 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 struct uba_regs *ifu_uba; /* uba regs, in vm */ 33 struct ifrw { 34 int ifrw_info; /* value from ubaalloc */ 35 short ifrw_bdp; /* unibus bdp */ 36 struct pte *ifrw_mr; /* base of map registers */ 37 int ifrw_proto; /* map register prototype */ 38 caddr_t ifrw_addr; /* virt addr of header */ 39 } ifu_r, ifu_w; 40 struct pte ifu_wmap[IF_NUBAMR]; /* base pages for output */ 41 short ifu_hlen; 42 /* ifu_xswapd is set when we have swapped write pte's to do direct output */ 43 /* bit i of ifu_xswapd */ 44 short ifu_xswapd; /* bit map of pages swapped */ 45 int ifu_ierrors; 46 int ifu_oerrors; 47 int ifu_collisions; 48 }; 49 50 #ifdef KERNEL 51 struct mbuf *if_rubaget(); 52 #endif 53