conf.c revision 1.16
11.16Ssimonb/*	$NetBSD: conf.c,v 1.16 1999/11/27 06:45:52 simonb Exp $	*/
21.4Scgd
31.1Sderaadt/*
41.2Sglass * Copyright (c) 1992, 1993
51.2Sglass *	The Regents of the University of California.  All rights reserved.
61.1Sderaadt *
71.1Sderaadt * This code is derived from software contributed to Berkeley by
81.1Sderaadt * Ralph Campbell.
91.1Sderaadt *
101.1Sderaadt * Redistribution and use in source and binary forms, with or without
111.1Sderaadt * modification, are permitted provided that the following conditions
121.1Sderaadt * are met:
131.1Sderaadt * 1. Redistributions of source code must retain the above copyright
141.1Sderaadt *    notice, this list of conditions and the following disclaimer.
151.1Sderaadt * 2. Redistributions in binary form must reproduce the above copyright
161.1Sderaadt *    notice, this list of conditions and the following disclaimer in the
171.1Sderaadt *    documentation and/or other materials provided with the distribution.
181.1Sderaadt * 3. All advertising materials mentioning features or use of this software
191.1Sderaadt *    must display the following acknowledgement:
201.1Sderaadt *	This product includes software developed by the University of
211.1Sderaadt *	California, Berkeley and its contributors.
221.1Sderaadt * 4. Neither the name of the University nor the names of its contributors
231.1Sderaadt *    may be used to endorse or promote products derived from this software
241.1Sderaadt *    without specific prior written permission.
251.1Sderaadt *
261.1Sderaadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271.1Sderaadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281.1Sderaadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291.1Sderaadt * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301.1Sderaadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311.1Sderaadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321.1Sderaadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331.1Sderaadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341.1Sderaadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351.1Sderaadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361.1Sderaadt * SUCH DAMAGE.
371.1Sderaadt *
381.4Scgd *	@(#)conf.c	8.1 (Berkeley) 6/10/93
391.1Sderaadt */
401.1Sderaadt
411.6Ssimonb#include <sys/types.h>
421.16Ssimonb#include <netinet/in.h>
431.16Ssimonb#include <lib/libsa/stand.h>
441.16Ssimonb#include <lib/libsa/dev_net.h>
451.16Ssimonb#include <lib/libsa/ufs.h>
461.16Ssimonb#include <lib/libsa/lfs.h>
471.16Ssimonb#include <lib/libsa/nfs.h>
481.16Ssimonb#include <lib/libsa/cd9660.h>
491.16Ssimonb#include <lib/libsa/ustarfs.h>
501.8Ssimonb#include <machine/dec_prom.h>
511.16Ssimonb#include "../common/rz.h"
521.1Sderaadt
531.13Ssimonb#ifndef LIBSA_SINGLE_DEVICE
541.14Ssimonb
551.14Ssimonb#ifdef LIBSA_NO_DEV_CLOSE
561.6Ssimonb#define rzclose /*(()(struct open_file*))*/0
571.14Ssimonb#endif
581.14Ssimonb
591.14Ssimonb#ifdef LIBSA_NO_DEV_IOCTL
601.9Ssimonb#define rzioctl /*(()(struct open_file*, u_long, void*))*/0
611.9Ssimonb#else
621.9Ssimonb#define	rzioctl		noioctl
631.1Sderaadt#endif
641.1Sderaadt
651.1Sderaadtstruct devsw devsw[] = {
661.16Ssimonb	{ "rz", rzstrategy, rzopen, rzclose, rzioctl },			/* 0 */
671.16Ssimonb#ifdef BOOTNET
681.16Ssimonb	{ "tftp", net_strategy, net_open, net_close, net_ioctl },	/* 1 */
691.16Ssimonb#endif
701.1Sderaadt};
711.1Sderaadt
721.1Sderaadtint	ndevs = (sizeof(devsw)/sizeof(devsw[0]));
731.13Ssimonb#endif
741.13Ssimonb
751.12Ssimonb
761.13Ssimonb#ifndef LIBSA_SINGLE_FILESYSTEM
771.12Ssimonb#ifdef LIBSA_NO_FS_CLOSE
781.12Ssimonb#define ufs_close	0
791.16Ssimonb#define lfs_close	0
801.16Ssimonb#define cd9660_close	0
811.16Ssimonb#define ustarfs_close	0
821.16Ssimonb#define nfs_close	0
831.12Ssimonb#endif
841.12Ssimonb#ifdef LIBSA_NO_FS_WRITE
851.12Ssimonb#define ufs_write	0
861.16Ssimonb#define lfs_write	0
871.16Ssimonb#define cd9660_write	0
881.16Ssimonb#define ustarfs_write	0
891.16Ssimonb#define nfs_write	0
901.12Ssimonb#endif
911.11Ssimonb
921.11Ssimonbstruct fs_ops file_system[] = {
931.16Ssimonb	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
941.16Ssimonb	{ lfs_open, lfs_close, lfs_read, lfs_write, lfs_seek, lfs_stat },
951.16Ssimonb	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
961.16Ssimonb	    cd9660_stat },
971.16Ssimonb	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
981.16Ssimonb	    ustarfs_seek, ustarfs_stat },
991.16Ssimonb#ifdef BOOTNET
1001.16Ssimonb	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
1011.16Ssimonb#endif
1021.11Ssimonb};
1031.11Ssimonb
1041.11Ssimonbint nfsys = sizeof(file_system)/sizeof(struct fs_ops);
1051.16Ssimonb#endif
1061.16Ssimonb
1071.16Ssimonb#ifdef BOOTNET
1081.16Ssimonbextern struct netif_driver prom_netif_driver;
1091.16Ssimonb
1101.16Ssimonbstruct netif_driver *netif_drivers[] = {
1111.16Ssimonb	&prom_netif_driver,
1121.16Ssimonb};
1131.16Ssimonbint	n_netif_drivers = (sizeof(netif_drivers) / sizeof(netif_drivers[0]));
1141.13Ssimonb#endif
115