xref: /netbsd-src/sys/arch/sgimips/stand/common/conf.c (revision fc91c355170c0d92b96bc65237d6a7654e32839f)
1*fc91c355Stsutsui /*	$NetBSD: conf.c,v 1.6 2007/12/15 14:21:40 tsutsui Exp $	*/
24e63f44fSthorpej 
34e63f44fSthorpej /*
44e63f44fSthorpej  * Copyright (c) 1992, 1993
54e63f44fSthorpej  *	The Regents of the University of California.  All rights reserved.
64e63f44fSthorpej  *
74e63f44fSthorpej  * This code is derived from software contributed to Berkeley by
84e63f44fSthorpej  * Ralph Campbell.
94e63f44fSthorpej  *
104e63f44fSthorpej  * Redistribution and use in source and binary forms, with or without
114e63f44fSthorpej  * modification, are permitted provided that the following conditions
124e63f44fSthorpej  * are met:
134e63f44fSthorpej  * 1. Redistributions of source code must retain the above copyright
144e63f44fSthorpej  *    notice, this list of conditions and the following disclaimer.
154e63f44fSthorpej  * 2. Redistributions in binary form must reproduce the above copyright
164e63f44fSthorpej  *    notice, this list of conditions and the following disclaimer in the
174e63f44fSthorpej  *    documentation and/or other materials provided with the distribution.
18aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
194e63f44fSthorpej  *    may be used to endorse or promote products derived from this software
204e63f44fSthorpej  *    without specific prior written permission.
214e63f44fSthorpej  *
224e63f44fSthorpej  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
234e63f44fSthorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
244e63f44fSthorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
254e63f44fSthorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
264e63f44fSthorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
274e63f44fSthorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
284e63f44fSthorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
294e63f44fSthorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
304e63f44fSthorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
314e63f44fSthorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
324e63f44fSthorpej  * SUCH DAMAGE.
334e63f44fSthorpej  *
344e63f44fSthorpej  *	@(#)conf.c	8.1 (Berkeley) 6/10/93
354e63f44fSthorpej  */
364e63f44fSthorpej 
374e63f44fSthorpej #include <sys/types.h>
384e63f44fSthorpej #include <netinet/in.h>
394e63f44fSthorpej #include <lib/libsa/stand.h>
404e63f44fSthorpej #include <lib/libsa/dev_net.h>
414e63f44fSthorpej #include <lib/libsa/ufs.h>
424e63f44fSthorpej #include <lib/libsa/lfs.h>
434e63f44fSthorpej #include <lib/libsa/nfs.h>
444e63f44fSthorpej #include <lib/libsa/cd9660.h>
454e63f44fSthorpej #if 0
464e63f44fSthorpej #include <lib/libsa/ustarfs.h>
474e63f44fSthorpej #endif
484e63f44fSthorpej #include "../common/disk.h"
494e63f44fSthorpej 
504e63f44fSthorpej #ifndef LIBSA_SINGLE_DEVICE
514e63f44fSthorpej 
524e63f44fSthorpej #ifdef LIBSA_NO_DEV_CLOSE
534e63f44fSthorpej #define diskclose /*(()(struct open_file*))*/0
544e63f44fSthorpej #endif
554e63f44fSthorpej 
564e63f44fSthorpej #ifdef LIBSA_NO_DEV_IOCTL
574e63f44fSthorpej #define diskioctl /*(()(struct open_file*, u_long, void*))*/0
584e63f44fSthorpej #else
594e63f44fSthorpej #define	diskioctl		noioctl
604e63f44fSthorpej #endif
614e63f44fSthorpej 
624e63f44fSthorpej struct devsw devsw[] = {
634e63f44fSthorpej 	{ "scsi", diskstrategy, diskopen, diskclose, diskioctl },	/* 0 */
644e63f44fSthorpej 	{ "dksc", diskstrategy, diskopen, diskclose, diskioctl },	/* 2 */
654e63f44fSthorpej #ifdef BOOTNET
664e63f44fSthorpej 	{ "tftp", net_strategy, net_open, net_close, net_ioctl },	/* 2 */
674e63f44fSthorpej #endif
684e63f44fSthorpej };
694e63f44fSthorpej 
70*fc91c355Stsutsui int	ndevs = __arraycount(devsw);
714e63f44fSthorpej #endif
724e63f44fSthorpej 
734e63f44fSthorpej 
744e63f44fSthorpej #ifndef LIBSA_SINGLE_FILESYSTEM
754e63f44fSthorpej #ifdef LIBSA_NO_FS_CLOSE
76*fc91c355Stsutsui #define ffsv1_close	0
77*fc91c355Stsutsui #define ffsv2_close	0
783a93f292Ssimonb #define lfsv1_close	0
793a93f292Ssimonb #define lfsv2_close	0
804e63f44fSthorpej #define cd9660_close	0
814e63f44fSthorpej #define ustarfs_close	0
824e63f44fSthorpej #define nfs_close	0
834e63f44fSthorpej #endif
844e63f44fSthorpej #ifdef LIBSA_NO_FS_WRITE
85*fc91c355Stsutsui #define ffsv1_write	0
86*fc91c355Stsutsui #define ffsv2_write	0
873a93f292Ssimonb #define lfsv1_write	0
883a93f292Ssimonb #define lfsv2_write	0
894e63f44fSthorpej #define cd9660_write	0
904e63f44fSthorpej #define ustarfs_write	0
914e63f44fSthorpej #define nfs_write	0
924e63f44fSthorpej #endif
934e63f44fSthorpej 
944e63f44fSthorpej struct fs_ops file_system[] = {
95*fc91c355Stsutsui 	FS_OPS(ffsv1),
96*fc91c355Stsutsui 	FS_OPS(ffsv2),
9717670568Sjunyoung 	FS_OPS(lfsv1),
9817670568Sjunyoung 	FS_OPS(lfsv2),
9917670568Sjunyoung 	FS_OPS(cd9660),
1004e63f44fSthorpej #if 0
10117670568Sjunyoung 	FS_OPS(ustarfs),
1024e63f44fSthorpej #endif
1034e63f44fSthorpej #ifdef BOOTNET
10417670568Sjunyoung 	FS_OPS(nfs),
1054e63f44fSthorpej #endif
1064e63f44fSthorpej };
1074e63f44fSthorpej 
108*fc91c355Stsutsui int nfsys = __arraycount(file_system);
1094e63f44fSthorpej #endif
1104e63f44fSthorpej 
1114e63f44fSthorpej #ifdef BOOTNET
1124e63f44fSthorpej extern struct netif_driver prom_netif_driver;
1134e63f44fSthorpej 
1144e63f44fSthorpej struct netif_driver *netif_drivers[] = {
1154e63f44fSthorpej 	&prom_netif_driver,
1164e63f44fSthorpej };
117*fc91c355Stsutsui int	n_netif_drivers = __arraycount(netif_drivers);
1184e63f44fSthorpej #endif
119