|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1982, 1986 Regents of the University of California. ! 3: * All rights reserved. The Berkeley software License Agreement ! 4: * specifies the terms and conditions for redistribution. ! 5: * ! 6: * @(#)if_uba.h 7.2 (Berkeley) 8/9/86 ! 7: */ ! 8: ! 9: /* ! 10: * Structure and routine definitions ! 11: * for UNIBUS network interfaces. ! 12: */ ! 13: ! 14: #define IF_MAXNUBAMR 10 ! 15: /* ! 16: * Each interface has structures giving information ! 17: * about UNIBUS resources held by the interface ! 18: * for each send and receive buffer. ! 19: * ! 20: * We hold IF_NUBAMR map registers for datagram data, starting ! 21: * at ifr_mr. Map register ifr_mr[-1] maps the local network header ! 22: * ending on the page boundary. Bdp's are reserved for read and for ! 23: * write, given by ifr_bdp. The prototype of the map register for ! 24: * read and for write is saved in ifr_proto. ! 25: * ! 26: * When write transfers are not full pages on page boundaries we just ! 27: * copy the data into the pages mapped on the UNIBUS and start the ! 28: * transfer. If a write transfer is of a (1024 byte) page on a page ! 29: * boundary, we swap in UNIBUS pte's to reference the pages, and then ! 30: * remap the initial pages (from ifu_wmap) when the transfer completes. ! 31: * ! 32: * When read transfers give whole pages of data to be input, we ! 33: * allocate page frames from a network page list and trade them ! 34: * with the pages already containing the data, mapping the allocated ! 35: * pages to replace the input pages for the next UNIBUS data input. ! 36: */ ! 37: ! 38: /* ! 39: * Information per interface. ! 40: */ ! 41: struct ifubinfo { ! 42: short iff_uban; /* uba number */ ! 43: short iff_hlen; /* local net header length */ ! 44: struct uba_regs *iff_uba; /* uba adaptor regs, in vm */ ! 45: struct pte *iff_ubamr; /* uba map regs, in vm */ ! 46: short iff_flags; /* used during uballoc's */ ! 47: }; ! 48: ! 49: /* ! 50: * Information per buffer. ! 51: */ ! 52: struct ifrw { ! 53: caddr_t ifrw_addr; /* virt addr of header */ ! 54: short ifrw_bdp; /* unibus bdp */ ! 55: short ifrw_flags; /* type, etc. */ ! 56: #define IFRW_W 0x01 /* is a transmit buffer */ ! 57: int ifrw_info; /* value from ubaalloc */ ! 58: int ifrw_proto; /* map register prototype */ ! 59: struct pte *ifrw_mr; /* base of map registers */ ! 60: }; ! 61: ! 62: /* ! 63: * Information per transmit buffer, including the above. ! 64: */ ! 65: struct ifxmt { ! 66: struct ifrw ifrw; ! 67: caddr_t ifw_base; /* virt addr of buffer */ ! 68: struct pte ifw_wmap[IF_MAXNUBAMR]; /* base pages for output */ ! 69: struct mbuf *ifw_xtofree; /* pages being dma'd out */ ! 70: short ifw_xswapd; /* mask of clusters swapped */ ! 71: short ifw_nmr; /* number of entries in wmap */ ! 72: }; ! 73: #define ifw_addr ifrw.ifrw_addr ! 74: #define ifw_bdp ifrw.ifrw_bdp ! 75: #define ifw_flags ifrw.ifrw_flags ! 76: #define ifw_info ifrw.ifrw_info ! 77: #define ifw_proto ifrw.ifrw_proto ! 78: #define ifw_mr ifrw.ifrw_mr ! 79: ! 80: /* ! 81: * Most interfaces have a single receive and a single transmit buffer, ! 82: * and use struct ifuba to store all of the unibus information. ! 83: */ ! 84: struct ifuba { ! 85: struct ifubinfo ifu_info; ! 86: struct ifrw ifu_r; ! 87: struct ifxmt ifu_xmt; ! 88: }; ! 89: ! 90: #define ifu_uban ifu_info.iff_uban ! 91: #define ifu_hlen ifu_info.iff_hlen ! 92: #define ifu_uba ifu_info.iff_uba ! 93: #define ifu_ubamr ifu_info.iff_ubamr ! 94: #define ifu_flags ifu_info.iff_flags ! 95: #define ifu_w ifu_xmt.ifrw ! 96: #define ifu_xtofree ifu_xmt.ifw_xtofree ! 97: ! 98: #ifdef KERNEL ! 99: #define if_ubainit(ifuba, uban, hlen, nmr) \ ! 100: if_ubaminit(&(ifuba)->ifu_info, uban, hlen, nmr, \ ! 101: &(ifuba)->ifu_r, 1, &(ifuba)->ifu_xmt, 1) ! 102: #define if_rubaget(ifu, totlen, off0, ifp) \ ! 103: if_ubaget(&(ifu)->ifu_info, &(ifu)->ifu_r, totlen, off0, ifp) ! 104: #define if_wubaput(ifu, m) \ ! 105: if_ubaput(&(ifu)->ifu_info, &(ifu)->ifu_xmt, m) ! 106: struct mbuf *if_ubaget(); ! 107: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.