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