1*23304Smckusick /* 2*23304Smckusick * Copyright (c) 1982 Regents of the University of California. 3*23304Smckusick * All rights reserved. The Berkeley software License Agreement 4*23304Smckusick * specifies the terms and conditions for redistribution. 5*23304Smckusick * 6*23304Smckusick * @(#)if_uba.h 6.2 (Berkeley) 06/08/85 7*23304Smckusick */ 85079Swnj 95079Swnj /* 105079Swnj * Structure and routine definitions 115079Swnj * for UNIBUS network interfaces. 125079Swnj */ 135079Swnj 145172Swnj #define IF_MAXNUBAMR 10 155079Swnj /* 165079Swnj * Each interface has one of these structures giving information 175079Swnj * about UNIBUS resources held by the interface. 185079Swnj * 195079Swnj * We hold IF_NUBAMR map registers for datagram data, starting 205079Swnj * at ifr_mr. Map register ifr_mr[-1] maps the local network header 215079Swnj * ending on the page boundary. Bdp's are reserved for read and for 225079Swnj * write, given by ifr_bdp. The prototype of the map register for 235079Swnj * read and for write is saved in ifr_proto. 245079Swnj * 255079Swnj * When write transfers are not full pages on page boundaries we just 265079Swnj * copy the data into the pages mapped on the UNIBUS and start the 275079Swnj * transfer. If a write transfer is of a (1024 byte) page on a page 285079Swnj * boundary, we swap in UNIBUS pte's to reference the pages, and then 295079Swnj * remap the initial pages (from ifu_wmap) when the transfer completes. 305079Swnj * 315079Swnj * When read transfers give whole pages of data to be input, we 325079Swnj * allocate page frames from a network page list and trade them 335079Swnj * with the pages already containing the data, mapping the allocated 345079Swnj * pages to replace the input pages for the next UNIBUS data input. 355079Swnj */ 365079Swnj struct ifuba { 375079Swnj short ifu_uban; /* uba number */ 385172Swnj short ifu_hlen; /* local net header length */ 395079Swnj struct uba_regs *ifu_uba; /* uba regs, in vm */ 405079Swnj struct ifrw { 415229Swnj caddr_t ifrw_addr; /* virt addr of header */ 425229Swnj int ifrw_bdp; /* unibus bdp */ 435079Swnj int ifrw_info; /* value from ubaalloc */ 445229Swnj int ifrw_proto; /* map register prototype */ 455079Swnj struct pte *ifrw_mr; /* base of map registers */ 465079Swnj } ifu_r, ifu_w; 475172Swnj struct pte ifu_wmap[IF_MAXNUBAMR]; /* base pages for output */ 485172Swnj short ifu_xswapd; /* mask of clusters swapped */ 495688Ssam short ifu_flags; /* used during uballoc's */ 505172Swnj struct mbuf *ifu_xtofree; /* pages being dma'd out */ 515079Swnj }; 525084Swnj 535084Swnj #ifdef KERNEL 545084Swnj struct mbuf *if_rubaget(); 555084Swnj #endif 56