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