Home | History | Annotate | Line # | Download | only in common
conf.c revision 1.2.2.2
      1  1.2.2.1    skrll /*	$NetBSD: conf.c,v 1.2.2.2 2004/09/18 14:39:54 skrll Exp $	*/
      2      1.1  thorpej 
      3      1.1  thorpej /*
      4      1.1  thorpej  * Copyright (c) 1992, 1993
      5      1.1  thorpej  *	The Regents of the University of California.  All rights reserved.
      6      1.1  thorpej  *
      7      1.1  thorpej  * This code is derived from software contributed to Berkeley by
      8      1.1  thorpej  * Ralph Campbell.
      9      1.1  thorpej  *
     10      1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     11      1.1  thorpej  * modification, are permitted provided that the following conditions
     12      1.1  thorpej  * are met:
     13      1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     14      1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     15      1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     17      1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     18  1.2.2.1    skrll  * 3. Neither the name of the University nor the names of its contributors
     19      1.1  thorpej  *    may be used to endorse or promote products derived from this software
     20      1.1  thorpej  *    without specific prior written permission.
     21      1.1  thorpej  *
     22      1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23      1.1  thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24      1.1  thorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25      1.1  thorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     26      1.1  thorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27      1.1  thorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28      1.1  thorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29      1.1  thorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30      1.1  thorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31      1.1  thorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32      1.1  thorpej  * SUCH DAMAGE.
     33      1.1  thorpej  *
     34      1.1  thorpej  *	@(#)conf.c	8.1 (Berkeley) 6/10/93
     35      1.1  thorpej  */
     36      1.1  thorpej 
     37      1.1  thorpej #include <sys/types.h>
     38      1.1  thorpej #include <netinet/in.h>
     39      1.1  thorpej #include <lib/libsa/stand.h>
     40      1.1  thorpej #include <lib/libsa/dev_net.h>
     41      1.1  thorpej #include <lib/libsa/ufs.h>
     42      1.1  thorpej #include <lib/libsa/lfs.h>
     43      1.1  thorpej #include <lib/libsa/nfs.h>
     44      1.1  thorpej #include <lib/libsa/cd9660.h>
     45      1.1  thorpej #if 0
     46      1.1  thorpej #include <lib/libsa/ustarfs.h>
     47      1.1  thorpej #endif
     48      1.1  thorpej #include "../common/disk.h"
     49      1.1  thorpej 
     50      1.1  thorpej #ifndef LIBSA_SINGLE_DEVICE
     51      1.1  thorpej 
     52      1.1  thorpej #ifdef LIBSA_NO_DEV_CLOSE
     53      1.1  thorpej #define diskclose /*(()(struct open_file*))*/0
     54      1.1  thorpej #endif
     55      1.1  thorpej 
     56      1.1  thorpej #ifdef LIBSA_NO_DEV_IOCTL
     57      1.1  thorpej #define diskioctl /*(()(struct open_file*, u_long, void*))*/0
     58      1.1  thorpej #else
     59      1.1  thorpej #define	diskioctl		noioctl
     60      1.1  thorpej #endif
     61      1.1  thorpej 
     62      1.1  thorpej struct devsw devsw[] = {
     63      1.1  thorpej 	{ "scsi", diskstrategy, diskopen, diskclose, diskioctl },	/* 0 */
     64      1.1  thorpej 	{ "dksc", diskstrategy, diskopen, diskclose, diskioctl },	/* 2 */
     65      1.1  thorpej #ifdef BOOTNET
     66      1.1  thorpej 	{ "tftp", net_strategy, net_open, net_close, net_ioctl },	/* 2 */
     67      1.1  thorpej #endif
     68      1.1  thorpej };
     69      1.1  thorpej 
     70      1.1  thorpej int	ndevs = (sizeof(devsw)/sizeof(devsw[0]));
     71      1.1  thorpej #endif
     72      1.1  thorpej 
     73      1.1  thorpej 
     74      1.1  thorpej #ifndef LIBSA_SINGLE_FILESYSTEM
     75      1.1  thorpej #ifdef LIBSA_NO_FS_CLOSE
     76      1.1  thorpej #define ufs_close	0
     77      1.2   simonb #define lfsv1_close	0
     78      1.2   simonb #define lfsv2_close	0
     79      1.1  thorpej #define cd9660_close	0
     80      1.1  thorpej #define ustarfs_close	0
     81      1.1  thorpej #define nfs_close	0
     82      1.1  thorpej #endif
     83      1.1  thorpej #ifdef LIBSA_NO_FS_WRITE
     84      1.1  thorpej #define ufs_write	0
     85      1.2   simonb #define lfsv1_write	0
     86      1.2   simonb #define lfsv2_write	0
     87      1.1  thorpej #define cd9660_write	0
     88      1.1  thorpej #define ustarfs_write	0
     89      1.1  thorpej #define nfs_write	0
     90      1.1  thorpej #endif
     91      1.1  thorpej 
     92      1.1  thorpej struct fs_ops file_system[] = {
     93      1.1  thorpej 	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
     94      1.2   simonb 	{ lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
     95      1.2   simonb 	    lfsv1_stat },
     96      1.2   simonb 	{ lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
     97      1.2   simonb 	    lfsv2_stat },
     98      1.1  thorpej 	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
     99      1.1  thorpej 	    cd9660_stat },
    100      1.1  thorpej #if 0
    101      1.1  thorpej 	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
    102      1.1  thorpej 	    ustarfs_seek, ustarfs_stat },
    103      1.1  thorpej #endif
    104      1.1  thorpej #ifdef BOOTNET
    105      1.1  thorpej 	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
    106      1.1  thorpej #endif
    107      1.1  thorpej };
    108      1.1  thorpej 
    109      1.1  thorpej int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
    110      1.1  thorpej #endif
    111      1.1  thorpej 
    112      1.1  thorpej #ifdef BOOTNET
    113      1.1  thorpej extern struct netif_driver prom_netif_driver;
    114      1.1  thorpej 
    115      1.1  thorpej struct netif_driver *netif_drivers[] = {
    116      1.1  thorpej 	&prom_netif_driver,
    117      1.1  thorpej };
    118      1.1  thorpej int	n_netif_drivers = (sizeof(netif_drivers) / sizeof(netif_drivers[0]));
    119      1.1  thorpej #endif
    120