1 #ifndef _MINIX_CHARDRIVER_H
2 #define _MINIX_CHARDRIVER_H
4 #include <minix/driver.h>
6 /* Entry points into the device dependent code of character drivers. */
8 int(*cdr_open
) (message
*m_ptr
);
9 int(*cdr_close
) (message
*m_ptr
);
10 int(*cdr_ioctl
) (message
*m_ptr
);
11 struct device
*(*cdr_prepare
)(dev_t device
);
12 int(*cdr_transfer
) (endpoint_t endpt
, int opcode
, u64_t position
,
13 iovec_t
*iov
, unsigned int nr_req
, endpoint_t user_endpt
, unsigned int
15 void(*cdr_cleanup
) (void);
16 void(*cdr_alarm
) (message
*m_ptr
);
17 int(*cdr_cancel
) (message
*m_ptr
);
18 int(*cdr_select
) (message
*m_ptr
);
19 int(*cdr_other
) (message
*m_ptr
);
22 #define CHARDRIVER_SYNC 0 /* use the synchronous protocol */
23 #define CHARDRIVER_ASYNC 1 /* use the asynchronous protocol */
25 #define IS_CDEV_MINOR_RQ(type) (IS_DEV_RQ(type) && (type) != DEV_STATUS)
27 /* Functions defined by libchardriver. */
28 void chardriver_announce(void);
29 void chardriver_process(struct chardriver
*cdp
, int driver_type
, message
30 *m_ptr
, int ipc_status
);
31 void chardriver_terminate(void);
32 void chardriver_task(struct chardriver
*cdp
, int driver_type
);
34 int do_nop(message
*m_ptr
);
35 void nop_cleanup(void);
36 void nop_alarm(message
*m_ptr
);
37 int nop_cancel(message
*m_ptr
);
38 int nop_select(message
*m_ptr
);
39 int nop_ioctl(message
*m_ptr
);
41 #endif /* _MINIX_CHARDRIVER_H */