OpenCBM
cbm_module.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 1999 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
8  * Copyright 2009 Arnd Menge <arnd(at)jonnz(dot)de>
9 */
10 
11 #ifndef CBM_MODULE_H
12 #define CBM_MODULE_H
13 
14 #if defined(__linux__)
15 #include <linux/ioctl.h>
16 #include <linux/types.h>
17 #else
18 #if defined(__FreeBSD__)
19 #include <sys/ioctl.h>
20 #endif
21 #endif
22 
23 #define CBMCTRL_BASE 0xcb
24 
25 #define CBMCTRL_TALK _IO(CBMCTRL_BASE, 0)
26 #define CBMCTRL_LISTEN _IO(CBMCTRL_BASE, 1)
27 #define CBMCTRL_UNTALK _IO(CBMCTRL_BASE, 2)
28 #define CBMCTRL_UNLISTEN _IO(CBMCTRL_BASE, 3)
29 #define CBMCTRL_OPEN _IO(CBMCTRL_BASE, 4)
30 #define CBMCTRL_CLOSE _IO(CBMCTRL_BASE, 5)
31 #define CBMCTRL_RESET _IO(CBMCTRL_BASE, 6)
32 #define CBMCTRL_GET_EOI _IO(CBMCTRL_BASE, 7)
33 #define CBMCTRL_CLEAR_EOI _IO(CBMCTRL_BASE, 8)
34 
35 #define CBMCTRL_PP_READ _IO(CBMCTRL_BASE, 10)
36 #define CBMCTRL_PP_WRITE _IO(CBMCTRL_BASE, 11)
37 #define CBMCTRL_IEC_POLL _IO(CBMCTRL_BASE, 12)
38 #define CBMCTRL_IEC_SET _IO(CBMCTRL_BASE, 13)
39 #define CBMCTRL_IEC_RELEASE _IO(CBMCTRL_BASE, 14)
40 #define CBMCTRL_IEC_WAIT _IO(CBMCTRL_BASE, 15)
41 #define CBMCTRL_IEC_SETRELEASE _IO(CBMCTRL_BASE, 16)
42 
43 /* linux constants needed by parallel burst */
44 #define CBMCTRL_PARBURST_READ _IO(CBMCTRL_BASE, 17)
45 #define CBMCTRL_PARBURST_WRITE _IO(CBMCTRL_BASE, 18)
46 #define CBMCTRL_PARBURST_READ_TRACK _IO(CBMCTRL_BASE, 19)
47 #define CBMCTRL_PARBURST_WRITE_TRACK _IO(CBMCTRL_BASE, 20)
48 #define CBMCTRL_PARBURST_READ_TRACK_VAR _IO(CBMCTRL_BASE, 21)
49 
50 /* all values needed by PARBURST_READ_TRACK and PARBURST_WRITE_TRACK */
51 typedef struct PARBURST_RW_VALUE {
52  unsigned char *buffer;
53  int length;
55 
56 #endif