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