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