FreeBSD/Linux Kernel Cross Reference
sys/sys/devfsext.h
1 /*
2 * Copyright 1997,1998 Julian Elischer. All rights reserved.
3 * julian@freebsd.org
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
15 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL THE HOLDER OR CONTRIBUTORS BE LIABLE FOR
18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD$
27 */
28
29 #ifndef _SYS_DEVFSEXT_H_
30 #define _SYS_DEVFSEXT_H_
31
32 /*
33 * Make a device at a path, and get a cookie for it in return.
34 * Specify the type, the minor number and the devsw entry to use,
35 * and the initial default perms/ownerships.
36 */
37 void *devfs_add_devswf __P((void *devsw, int minor, int chrblk, uid_t uid,
38 gid_t gid, int perms, char *fmt, ...))
39 __printflike(7, 8);
40 /*
41 * Make a link to a device you already made, and have the cookie for
42 * We get another cookie, but for now, it can be discarded, as
43 * at the moment there is nothing you can do with it that you couldn't do
44 * with the original cookie. ( XXX this might be something I should change )
45 */
46 void *devfs_makelink __P((void *original, char *fmt, ...)) __printflike(2, 3);
47
48 /*
49 * Remove all instances of a device you have made. INCLUDING LINKS.
50 * I.e. either the cookie from the original device or the cookie
51 * from a link will have the effect of removing both entries.
52 * Removing with BOTH an original cookie and one from a link is
53 * likely to cause a panic.
54 */
55 void devfs_remove_dev __P((void *devnmp));
56
57 /*
58 * Check if a device exists and is the type you need. Returns NULL or a
59 * cookie that can be used to try 'open' the device. XXX This is a bit
60 * of a duplication of devfs_lookup(). I might one day try merge them a bit.
61 * Used for mountroot under DEVFS. Path is relative to the base of the devfs.
62 */
63 struct vnode *devfs_open_device __P((char *path, int devtype));
64 void devfs_close_device __P((struct vnode *vn));
65
66 dev_t devfs_vntodev __P((struct vnode *vn)); /* extract dev_t from devfs vn */
67
68 #define DV_CHR 0
69 #define DV_BLK 1
70 #define DV_DEV 2
71
72 /* XXX */
73 #define UID_ROOT 0
74 #define UID_BIN 3
75 #define UID_UUCP 66
76
77 /* XXX */
78 #define GID_WHEEL 0
79 #define GID_KMEM 2
80 #define GID_OPERATOR 5
81 #define GID_BIN 7
82 #define GID_GAMES 13
83 #define GID_DIALER 68
84
85 #endif /* !_SYS_DEVFSEXT_H_ */
Cache object: 6f0b91d67c6235391fd497a0eb19f2d2
|