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