Commit | Line | Data |
---|---|---|
59d7261a | 1 | /* if_uba.h 4.4 81/12/09 */ |
4ad6429c BJ |
2 | |
3 | /* | |
4 | * Structure and routine definitions | |
5 | * for UNIBUS network interfaces. | |
6 | */ | |
7 | ||
b454c3ea | 8 | #define IF_MAXNUBAMR 10 |
4ad6429c BJ |
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 */ | |
b454c3ea | 32 | short ifu_hlen; /* local net header length */ |
4ad6429c BJ |
33 | struct uba_regs *ifu_uba; /* uba regs, in vm */ |
34 | struct ifrw { | |
59d7261a BJ |
35 | caddr_t ifrw_addr; /* virt addr of header */ |
36 | int ifrw_bdp; /* unibus bdp */ | |
4ad6429c | 37 | int ifrw_info; /* value from ubaalloc */ |
4ad6429c | 38 | int ifrw_proto; /* map register prototype */ |
59d7261a | 39 | struct pte *ifrw_mr; /* base of map registers */ |
4ad6429c | 40 | } ifu_r, ifu_w; |
b454c3ea BJ |
41 | struct pte ifu_wmap[IF_MAXNUBAMR]; /* base pages for output */ |
42 | short ifu_xswapd; /* mask of clusters swapped */ | |
43 | struct mbuf *ifu_xtofree; /* pages being dma'd out */ | |
4ad6429c | 44 | }; |
8a13b737 BJ |
45 | |
46 | #ifdef KERNEL | |
47 | struct mbuf *if_rubaget(); | |
48 | #endif |