1 /*	$OpenBSD$	*/
2 /*
3  * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 #ifndef SIOFILE_H
18 #define SIOFILE_H
19 
20 #include "file.h"
21 
22 struct dev;
23 
24 struct dev_sio {
25 	struct sio_hdl *hdl;
26 	unsigned int todo;
27 #ifdef DEBUG
28 	long long wtime, utime;
29 	long long sum_wtime, sum_utime;
30 	int pused, rused, events;
31 #endif
32 	struct file *file;
33 #define DEV_SIO_READ	0
34 #define DEV_SIO_CYCLE	1
35 #define DEV_SIO_WRITE	2
36 	int cstate;
37 	struct timo watchdog;
38 };
39 
40 int dev_sio_open(struct dev *);
41 int dev_sio_reopen(struct dev *);
42 void dev_sio_close(struct dev *);
43 void dev_sio_log(struct dev *);
44 void dev_sio_start(struct dev *);
45 void dev_sio_stop(struct dev *);
46 
47 #endif /* !defined(SIOFILE_H) */
48