1 #ifndef _SERVERS_DEVMAN_DEVMAN_H
2 #define _SERVERS_DEVMAN_DEVMAN_H
3 #define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */
4 #define _MINIX 1 /* tell headers to include MINIX stuff */
5 #define _SYSTEM 1 /* tell headers that this is the kernel */
6 #define DEVMAN_SERVER 1
8 #include <minix/config.h>
17 #include <minix/callnr.h>
18 #include <minix/type.h>
19 #include <minix/const.h>
20 #include <minix/com.h>
21 #include <minix/syslib.h>
22 #include <minix/sysutil.h>
23 #include <minix/vfsif.h>
24 #include <minix/endpoint.h>
25 #include <minix/sysinfo.h>
26 #include <minix/u64.h>
27 #include <minix/sysinfo.h>
28 #include <minix/type.h>
29 #include <minix/ipc.h>
32 #include <sys/times.h>
33 #include <sys/types.h>
36 #include <minix/vtreefs.h>
38 #include <minix/devman.h>
39 #include <sys/queue.h>
41 #define DEVMAN_DEFAULT_MODE (S_IRUSR | S_IRGRP | S_IROTH)
42 #define DEVMAN_STRING_LEN 128
44 #define ADD_STRING "ADD "
45 #define REMOVE_STRING "REMOVE "
47 enum devman_inode_type
{
48 DEVMAN_DEVINFO_STATIC
,
49 DEVMAN_DEVINFO_DYNAMIC
,
53 typedef int (*devman_read_fn
)
54 (char **ptr
, size_t *len
, off_t offset
, void *data
);
56 struct devman_device_file
{
61 struct devman_static_info_inode
{
62 struct devman_device
*dev
;
63 char data
[DEVMAN_STRING_LEN
];
67 char data
[DEVMAN_STRING_LEN
];
68 TAILQ_ENTRY(devman_event
) events
;
71 struct devman_event_inode
{
72 TAILQ_HEAD(event_head
, devman_event
) event_queue
;
77 devman_read_fn read_fn
;
79 TAILQ_ENTRY(devman_inode
) inode_list
;
82 struct devman_device
{
89 #define DEVMAN_DEVICE_ZOMBIE 2
90 #define DEVMAN_DEVICE_BOUND 1
91 #define DEVMAN_DEVICE_UNBOUND 0
96 struct devman_inode inode
;
97 struct devman_device
*parent
;
99 /* the serialized information on this device */
100 struct devman_device_info
*info
;
102 TAILQ_ENTRY(devman_device
) siblings
;
104 /* devices attached to the this device */
105 TAILQ_HEAD(children_head
, devman_device
) children
;
106 TAILQ_HEAD(info_head
, devman_inode
) infos
;