conf.c revision 1.3.2.2 1 1.3.2.2 yamt /* $NetBSD: conf.c,v 1.3.2.2 2013/01/23 00:05:53 yamt Exp $ */
2 1.3.2.2 yamt
3 1.3.2.2 yamt /*
4 1.3.2.2 yamt * Copyright (c) 1982, 1986, 1990, 1993
5 1.3.2.2 yamt * The Regents of the University of California. All rights reserved.
6 1.3.2.2 yamt *
7 1.3.2.2 yamt * Redistribution and use in source and binary forms, with or without
8 1.3.2.2 yamt * modification, are permitted provided that the following conditions
9 1.3.2.2 yamt * are met:
10 1.3.2.2 yamt * 1. Redistributions of source code must retain the above copyright
11 1.3.2.2 yamt * notice, this list of conditions and the following disclaimer.
12 1.3.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
13 1.3.2.2 yamt * notice, this list of conditions and the following disclaimer in the
14 1.3.2.2 yamt * documentation and/or other materials provided with the distribution.
15 1.3.2.2 yamt * 3. Neither the name of the University nor the names of its contributors
16 1.3.2.2 yamt * may be used to endorse or promote products derived from this software
17 1.3.2.2 yamt * without specific prior written permission.
18 1.3.2.2 yamt *
19 1.3.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.3.2.2 yamt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.3.2.2 yamt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.3.2.2 yamt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.3.2.2 yamt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.3.2.2 yamt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.3.2.2 yamt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.3.2.2 yamt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.3.2.2 yamt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.3.2.2 yamt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.3.2.2 yamt * SUCH DAMAGE.
30 1.3.2.2 yamt *
31 1.3.2.2 yamt * @(#)conf.c 8.1 (Berkeley) 6/10/93
32 1.3.2.2 yamt */
33 1.3.2.2 yamt
34 1.3.2.2 yamt #include <sys/param.h>
35 1.3.2.2 yamt #include <sys/socket.h>
36 1.3.2.2 yamt
37 1.3.2.2 yamt #include <net/if.h>
38 1.3.2.2 yamt #include <netinet/in.h>
39 1.3.2.2 yamt #include <netinet/in_systm.h>
40 1.3.2.2 yamt
41 1.3.2.2 yamt #include <lib/libsa/stand.h>
42 1.3.2.2 yamt #include <lib/libsa/dev_net.h>
43 1.3.2.2 yamt #include <lib/libsa/nfs.h>
44 1.3.2.2 yamt #include <lib/libsa/ufs.h>
45 1.3.2.2 yamt
46 1.3.2.2 yamt #include <luna68k/stand/boot/samachdep.h>
47 1.3.2.2 yamt
48 1.3.2.2 yamt #define xxstrategy \
49 1.3.2.2 yamt (int (*)(void *, int, daddr_t, size_t, void *, size_t *))nullsys
50 1.3.2.2 yamt #define xxopen (int (*)(struct open_file *, ...))nodev
51 1.3.2.2 yamt #define xxclose (int (*)(struct open_file *))nullsys
52 1.3.2.2 yamt
53 1.3.2.2 yamt /*
54 1.3.2.2 yamt * Device configuration
55 1.3.2.2 yamt */
56 1.3.2.2 yamt #ifndef SUPPORT_ETHERNET
57 1.3.2.2 yamt #define netstrategy xxstrategy
58 1.3.2.2 yamt #define netopen xxopen
59 1.3.2.2 yamt #define netclose xxclose
60 1.3.2.2 yamt #else
61 1.3.2.2 yamt #define netstrategy net_strategy
62 1.3.2.2 yamt #define netopen net_open
63 1.3.2.2 yamt #define netclose net_close
64 1.3.2.2 yamt #endif
65 1.3.2.2 yamt #define netioctl noioctl
66 1.3.2.2 yamt
67 1.3.2.2 yamt #ifndef SUPPORT_DISK
68 1.3.2.2 yamt #define sdstrategy xxstrategy
69 1.3.2.2 yamt #define sdopen xxopen
70 1.3.2.2 yamt #define sdclose xxclose
71 1.3.2.2 yamt #endif
72 1.3.2.2 yamt #define sdioctl noioctl
73 1.3.2.2 yamt
74 1.3.2.2 yamt /*
75 1.3.2.2 yamt * Note: "le" isn't a major offset.
76 1.3.2.2 yamt */
77 1.3.2.2 yamt struct devsw devsw[] = {
78 1.3.2.2 yamt { "sd", sdstrategy, sdopen, sdclose, sdioctl },
79 1.3.2.2 yamt { "le", netstrategy, netopen, netclose, netioctl },
80 1.3.2.2 yamt };
81 1.3.2.2 yamt int ndevs = __arraycount(devsw);
82 1.3.2.2 yamt
83 1.3.2.2 yamt #ifdef SUPPORT_ETHERNET
84 1.3.2.2 yamt extern struct netif_driver le_netif_driver;
85 1.3.2.2 yamt struct netif_driver *netif_drivers[] = {
86 1.3.2.2 yamt &le_netif_driver,
87 1.3.2.2 yamt };
88 1.3.2.2 yamt int n_netif_drivers = __arraycount(netif_drivers);
89 1.3.2.2 yamt #endif
90 1.3.2.2 yamt
91 1.3.2.2 yamt /*
92 1.3.2.2 yamt * Filesystem configuration
93 1.3.2.2 yamt */
94 1.3.2.2 yamt #ifdef SUPPORT_DISK
95 1.3.2.2 yamt struct fs_ops file_system_disk[] = {
96 1.3.2.2 yamt FS_OPS(ffsv1),
97 1.3.2.2 yamt FS_OPS(ffsv2)
98 1.3.2.2 yamt };
99 1.3.2.2 yamt int nfsys_disk = __arraycount(file_system_disk);
100 1.3.2.2 yamt #endif
101 1.3.2.2 yamt #ifdef SUPPORT_ETHERNET
102 1.3.2.2 yamt struct fs_ops file_system_nfs[] = { FS_OPS(nfs) };
103 1.3.2.2 yamt #endif
104 1.3.2.2 yamt
105 1.3.2.2 yamt #define MAX_NFSYS 5
106 1.3.2.2 yamt struct fs_ops file_system[MAX_NFSYS];
107 1.3.2.2 yamt int nfsys = 1; /* we always know which one we want */
108