1*f866ee08Stsutsui /* $NetBSD: conf.c,v 1.25 2009/04/21 16:08:40 tsutsui Exp $ */ 2b02cf094Ssimonb 3b02cf094Ssimonb /* 4b02cf094Ssimonb * Copyright (c) 1992, 1993 5b02cf094Ssimonb * The Regents of the University of California. All rights reserved. 6b02cf094Ssimonb * 7b02cf094Ssimonb * This code is derived from software contributed to Berkeley by 8b02cf094Ssimonb * Ralph Campbell. 9b02cf094Ssimonb * 10b02cf094Ssimonb * Redistribution and use in source and binary forms, with or without 11b02cf094Ssimonb * modification, are permitted provided that the following conditions 12b02cf094Ssimonb * are met: 13b02cf094Ssimonb * 1. Redistributions of source code must retain the above copyright 14b02cf094Ssimonb * notice, this list of conditions and the following disclaimer. 15b02cf094Ssimonb * 2. Redistributions in binary form must reproduce the above copyright 16b02cf094Ssimonb * notice, this list of conditions and the following disclaimer in the 17b02cf094Ssimonb * documentation and/or other materials provided with the distribution. 18aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 19b02cf094Ssimonb * may be used to endorse or promote products derived from this software 20b02cf094Ssimonb * without specific prior written permission. 21b02cf094Ssimonb * 22b02cf094Ssimonb * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23b02cf094Ssimonb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24b02cf094Ssimonb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25b02cf094Ssimonb * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26b02cf094Ssimonb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27b02cf094Ssimonb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28b02cf094Ssimonb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29b02cf094Ssimonb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30b02cf094Ssimonb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31b02cf094Ssimonb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32b02cf094Ssimonb * SUCH DAMAGE. 33b02cf094Ssimonb * 34b02cf094Ssimonb * @(#)conf.c 8.1 (Berkeley) 6/10/93 35b02cf094Ssimonb */ 36b02cf094Ssimonb 37b02cf094Ssimonb #include <sys/types.h> 388160906eSsimonb #include <netinet/in.h> 398160906eSsimonb #include <lib/libsa/stand.h> 408160906eSsimonb #include <lib/libsa/dev_net.h> 418160906eSsimonb #include <lib/libsa/ufs.h> 428160906eSsimonb #include <lib/libsa/lfs.h> 438160906eSsimonb #include <lib/libsa/nfs.h> 448160906eSsimonb #include <lib/libsa/cd9660.h> 458160906eSsimonb #include <lib/libsa/ustarfs.h> 46b02cf094Ssimonb #include <machine/dec_prom.h> 478160906eSsimonb #include "../common/rz.h" 48b02cf094Ssimonb 4902383cdeSsimonb #ifdef NET_DEBUG 5002383cdeSsimonb /* only used for network debugging for now */ 51feb0773eSgmcgarry #ifdef DEBUG_VAL 52feb0773eSgmcgarry int debug = DEBUG_VAL; 53feb0773eSgmcgarry #else 54feb0773eSgmcgarry int debug = 0; 55feb0773eSgmcgarry #endif 5602383cdeSsimonb #endif /* NET_DEBUG */ 57feb0773eSgmcgarry 58b02cf094Ssimonb #ifndef LIBSA_SINGLE_DEVICE 59b02cf094Ssimonb 60b02cf094Ssimonb #ifdef LIBSA_NO_DEV_CLOSE 61b02cf094Ssimonb #define rzclose /*(()(struct open_file*))*/0 62b02cf094Ssimonb #endif 63b02cf094Ssimonb 64b02cf094Ssimonb #ifdef LIBSA_NO_DEV_IOCTL 65b02cf094Ssimonb #define rzioctl /*(()(struct open_file*, u_long, void*))*/0 66b02cf094Ssimonb #else 67b02cf094Ssimonb #define rzioctl noioctl 68b02cf094Ssimonb #endif 69b02cf094Ssimonb 70b02cf094Ssimonb struct devsw devsw[] = { 71d3706e51Ssimonb { "rz", rzstrategy, rzopen, rzclose, rzioctl }, 728160906eSsimonb #ifdef BOOTNET 73d3706e51Ssimonb { "tftp", net_strategy, net_open, net_close, net_ioctl }, 74d3706e51Ssimonb { "mop", net_strategy, net_open, net_close, net_ioctl }, 758160906eSsimonb #endif 76b02cf094Ssimonb }; 77b02cf094Ssimonb 78b02cf094Ssimonb int ndevs = (sizeof(devsw)/sizeof(devsw[0])); 79b02cf094Ssimonb #endif 80b02cf094Ssimonb 81b02cf094Ssimonb 82b02cf094Ssimonb #ifndef LIBSA_SINGLE_FILESYSTEM 83b02cf094Ssimonb #ifdef LIBSA_NO_FS_CLOSE 84*f866ee08Stsutsui #define ffsv1_close 0 85*f866ee08Stsutsui #define ffsv2_close 0 863a93f292Ssimonb #define lfsv1_close 0 873a93f292Ssimonb #define lfsv2_close 0 888160906eSsimonb #define cd9660_close 0 898160906eSsimonb #define ustarfs_close 0 908160906eSsimonb #define nfs_close 0 91b02cf094Ssimonb #endif 92b02cf094Ssimonb #ifdef LIBSA_NO_FS_WRITE 93*f866ee08Stsutsui #define ffsv1_write 0 94*f866ee08Stsutsui #define ffsv2_write 0 953a93f292Ssimonb #define lfsv1_write 0 963a93f292Ssimonb #define lfsv2_write 0 978160906eSsimonb #define cd9660_write 0 988160906eSsimonb #define ustarfs_write 0 998160906eSsimonb #define nfs_write 0 100b02cf094Ssimonb #endif 101b02cf094Ssimonb 102b02cf094Ssimonb struct fs_ops file_system[] = { 103*f866ee08Stsutsui FS_OPS(ffsv1), 104*f866ee08Stsutsui FS_OPS(ffsv2), 10517670568Sjunyoung FS_OPS(lfsv1), 10617670568Sjunyoung FS_OPS(lfsv2), 10717670568Sjunyoung FS_OPS(cd9660), 10817670568Sjunyoung FS_OPS(ustarfs), 1098160906eSsimonb #ifdef BOOTNET 11017670568Sjunyoung FS_OPS(nfs), 1118160906eSsimonb #endif 112b02cf094Ssimonb }; 113b02cf094Ssimonb 114b02cf094Ssimonb int nfsys = sizeof(file_system)/sizeof(struct fs_ops); 115b02cf094Ssimonb #endif 1168160906eSsimonb 1178160906eSsimonb #ifdef BOOTNET 1188160906eSsimonb extern struct netif_driver prom_netif_driver; 1198160906eSsimonb 1208160906eSsimonb struct netif_driver *netif_drivers[] = { 1218160906eSsimonb &prom_netif_driver, 1228160906eSsimonb }; 1238160906eSsimonb int n_netif_drivers = (sizeof(netif_drivers) / sizeof(netif_drivers[0])); 1248160906eSsimonb #endif 125