OpenCBM
Data Structures | Macros | Typedefs | Enumerations | Functions
cbmioctl.h File Reference

Define the IOCTL codes for the opencbm driver. More...

Go to the source code of this file.

Data Structures

struct  CBMT_IECADDRESS
 
struct  CBMT_SINGLEBYTE
 
struct  CBMT_LINE
 
struct  CBMT_LINESTATE
 
struct  CBMT_BOOLEAN
 
struct  CBMT_I_INSTALL_OUT
 
struct  CBMT_I_TESTIRQ
 
struct  CBMT_IEC_DBG_VALUE
 

Macros

#define CBM_REGKEY_SERVICE   "System\\CurrentControlSet\\Services\\opencbm"
 
#define CBM_REGKEY_SERVICE_DEFAULTLPT   "DefaultLpt"
 
#define CBM_REGKEY_SERVICE_IECCABLE   "CableType"
 
#define CBM_REGKEY_SERVICE_PERMLOCK   "PermanentlyLock"
 
#define CBM_REGKEY_SERVICE_DEBUGFLAGS   "DebugFlags"
 
#define CBM_REGKEY_SERVICE_DLL_DEBUGFLAGS   "DllDebugFlags"
 
#define OPENCBM_DRIVERNAME   "opencbm"
 
#define CBMDEVICENAME_MAINPART   "\\\\.\\" OPENCBM_DRIVERNAME
 
#define IEC_LINE_DATA   0x01
 
#define IEC_LINE_CLOCK   0x02
 
#define IEC_LINE_ATN   0x04
 
#define IEC_LINE_RESET   0x08
 
#define CBMT_I_INSTALL_OUT_GET_VERSION_MAJOR(_x)   (((_x) >> 24) & 0xFF)
 
#define CBMT_I_INSTALL_OUT_GET_VERSION_MINOR(_x)   (((_x) >> 16) & 0xFF)
 
#define CBMT_I_INSTALL_OUT_GET_VERSION_SUBMINOR(_x)   (((_x) >> 8) & 0xFF)
 
#define CBMT_I_INSTALL_OUT_GET_VERSION_DEVEL(_x)   (((_x) >> 0) & 0xFF)
 
#define CBMT_I_INSTALL_OUT_MAKE_VERSION(_x, _y, _z, _w)   (((((_x) << 8 | (_y)) << 8 | (_z)) << 8 | (_w)))
 
#define CBMT_I_INSTALL_OUT_GET_VERSION_EX_BUGFIX(_x)   (((_x) >> 0) & 0xFF)
 
#define CBMT_I_INSTALL_OUT_MAKE_VERSION_EX(_w)   (_w)
 
#define CBMCTRL_BASE   0x0000A424
 
#define OPENCBM_IOCTL_INDEX   0x823
 
#define _CBMIO(_a, _b)
 
#define CBMCTRL_TALK   _CBMIO(CBMCTRL_BASE, 0)
 IOCTL for sending a TALK command.
 
#define CBMCTRL_LISTEN   _CBMIO(CBMCTRL_BASE, 1)
 IOCTL for sending a LISTEN command.
 
#define CBMCTRL_UNTALK   _CBMIO(CBMCTRL_BASE, 2)
 IOCTL for sending an UNTALK command.
 
#define CBMCTRL_UNLISTEN   _CBMIO(CBMCTRL_BASE, 3)
 IOCTL for sending an UNLISTEN command.
 
#define CBMCTRL_OPEN   _CBMIO(CBMCTRL_BASE, 4)
 IOCTL for sending an OPEN command.
 
#define CBMCTRL_CLOSE   _CBMIO(CBMCTRL_BASE, 5)
 IOCTL for sending a CLOSE command.
 
#define CBMCTRL_RESET   _CBMIO(CBMCTRL_BASE, 6)
 IOCTL for sending a RESET.
 
#define CBMCTRL_GET_EOI   _CBMIO(CBMCTRL_BASE, 7)
 IOCTL for getting the EOI state.
 
#define CBMCTRL_CLEAR_EOI   _CBMIO(CBMCTRL_BASE, 8)
 IOCTL for resetting the EOI state.
 
#define CBMCTRL_PP_READ   _CBMIO(CBMCTRL_BASE, 10)
 IOCTL for reading the PP values.
 
#define CBMCTRL_PP_WRITE   _CBMIO(CBMCTRL_BASE, 11)
 IOCTL for setting the PP values.
 
#define CBMCTRL_IEC_POLL   _CBMIO(CBMCTRL_BASE, 12)
 IOCTL for polling an IEC line.
 
#define CBMCTRL_IEC_SET   _CBMIO(CBMCTRL_BASE, 13)
 IOCTL for setting an IEC line.
 
#define CBMCTRL_IEC_RELEASE   _CBMIO(CBMCTRL_BASE, 14)
 IOCTL for releasing an IEC line.
 
#define CBMCTRL_IEC_WAIT   _CBMIO(CBMCTRL_BASE, 15)
 IOCTL for waiting for an IEC line.
 
#define CBMCTRL_I_INSTALL   _CBMIO(CBMCTRL_BASE, 16)
 IOCTL for performing und checking the installation; ONLY FOR USE OF INSTCBM!
 
#define CBMCTRL_I_READDBG   _CBMIO(CBMCTRL_BASE, 17)
 IOCTL reading the debug buffer of the driver; ONLY FOR USE OF INSTCBM!
 
#define CBMCTRL_IEC_SETRELEASE   _CBMIO(CBMCTRL_BASE, 18)
 IOCTL for setting and releasing IEC lines at once.
 
#define CBMCTRL_PARBURST_READ   _CBMIO(CBMCTRL_BASE, 19)
 IOCTL for reading from the parallel port (for controlling parallel burst)
 
#define CBMCTRL_PARBURST_WRITE   _CBMIO(CBMCTRL_BASE, 20)
 IOCTL for writing to the parallel port (for controlling parallel burst)
 
#define CBMCTRL_PARBURST_READ_TRACK   _CBMIO(CBMCTRL_BASE, 21)
 IOCTL for reading a complete track (for parallel burst)
 
#define CBMCTRL_PARBURST_WRITE_TRACK   _CBMIO(CBMCTRL_BASE, 22)
 IOCTL for writing a complete track (for parallel burst)
 
#define CBMCTRL_PARPORT_LOCK   _CBMIO(CBMCTRL_BASE, 23)
 IOCTL for locking the driver onto the parallel port.
 
#define CBMCTRL_PARPORT_UNLOCK   _CBMIO(CBMCTRL_BASE, 24)
 IOCTL for locking the driver onto the parallel port.
 
#define CBMCTRL_UPDATE   _CBMIO(CBMCTRL_BASE, 25)
 IOCTL for updating settings of the driver.
 
#define CBMCTRL_TEST_IRQ   _CBMIO(CBMCTRL_BASE, 26)
 IOCTL for testing the interrupt facilities of the hardware.
 
#define CBMCTRL_IEC_DBG_READ   _CBMIO(CBMCTRL_BASE, 27)
 IOCTL for debugging a cable: Read all the input lines in a hardware-specific way.
 
#define CBMCTRL_IEC_DBG_WRITE   _CBMIO(CBMCTRL_BASE, 28)
 IOCTL for debugging a cable: Write all the output lines in a hardware-specific way.
 
#define CBMCTRL_PARBURST_READ_TRACK_VAR   _CBMIO(CBMCTRL_BASE, 29)
 IOCTL for reading a variable length track (for parallel burst)
 
#define CBM_I_DRIVER_INSTALL_0_FAILED   0xFFFFFFFF
 CBMCTRL_I_INSTALL: The driver could not be opened.
 
#define CBM_I_DRIVER_INSTALL_0_IOCTL_FAILED   0xFFFFFFFE
 CBMCTRL_I_INSTALL: The IOCTL failed.
 
#define CBM_I_DRIVER_INSTALL_0M_NO_INTERRUPT   0x80000000
 CBMCTRL_I_INSTALL: No interrupt available.
 

Typedefs

typedef enum iec_cabletype IEC_CABLETYPE
 
typedef struct CBMT_IECADDRESS CBMT_IECADDRESS
 
typedef struct CBMT_SINGLEBYTE CBMT_SINGLEBYTE
 
typedef struct CBMT_LINE CBMT_LINE
 
typedef struct CBMT_LINESTATE CBMT_LINE_STATE
 
typedef struct CBMT_BOOLEAN CBMT_BOOLEAN
 
typedef struct CBMT_I_INSTALL_OUT CBMT_I_INSTALL_OUT
 
typedef struct CBMT_I_INSTALL_OUTPCBMT_I_INSTALL_OUT
 
typedef struct CBMT_I_TESTIRQ CBMT_I_TESTIRQ
 
typedef struct CBMT_I_TESTIRQPCBMT_I_TESTIRQ
 
typedef struct CBMT_IEC_DBG_VALUE CBMT_IEC_DBG_VALUE
 
typedef CBMT_IECADDRESS CBMT_TALK_IN
 
typedef CBMT_IECADDRESS CBMT_LISTEN_IN
 
typedef CBMT_IECADDRESS CBMT_OPEN_IN
 
typedef CBMT_IECADDRESS CBMT_CLOSE_IN
 
typedef CBMT_SINGLEBYTE CBMT_PP_WRITE_IN
 
typedef CBMT_SINGLEBYTE CBMT_PP_READ_OUT
 
typedef CBMT_LINE CBMT_IEC_POLL_OUT
 
typedef CBMT_LINE_STATE CBMT_IEC_WAIT_IN
 
typedef CBMT_LINE CBMT_IEC_WAIT_OUT
 
typedef CBMT_LINE CBMT_IEC_SET_IN
 
typedef CBMT_LINE CBMT_IEC_RELEASE_IN
 
typedef CBMT_BOOLEAN CBMT_GET_EOI_OUT
 
typedef CBMT_LINE_STATE CBMT_IEC_SETRELEASE_IN
 
typedef CBMT_SINGLEBYTE CBMT_PARBURST_PREAD_OUT
 
typedef CBMT_SINGLEBYTE CBMT_PARBURST_PWRITE_IN
 
typedef CBMT_IEC_DBG_VALUE CBMT_IEC_DBG_READ
 
typedef CBMT_IEC_DBG_VALUE CBMT_IEC_DBG_WRITE
 

Enumerations

enum  iec_cabletype {
  IEC_CABLETYPE_UNSPEC = -2, IEC_CABLETYPE_AUTO = -1, IEC_CABLETYPE_XM = 0, IEC_CABLETYPE_XA = 1,
  IEC_CABLETYPE_XE
}
 

Functions

 DEFINE_GUID (GUID_OPENCBM, 0x9c3b5b5e, 0x558e, 0x47cc, 0x9c, 0x5, 0xf1, 0xfc, 0xf5, 0x17, 0x54, 0x7)
 

Detailed Description

Define the IOCTL codes for the opencbm driver.



Author
Spiro Trikaliotis
Authors
Based on code from Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>

Definition in file cbmioctl.h.

Macro Definition Documentation

#define _CBMIO (   _a,
  _b 
)
Value:
CTL_CODE(CBMCTRL_BASE, (OPENCBM_IOCTL_INDEX+(_b)), \
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define CBMCTRL_BASE
Definition: cbmioctl.h:254
#define OPENCBM_IOCTL_INDEX
Definition: cbmioctl.h:256

Define a IOCTL

Definition at line 259 of file cbmioctl.h.

#define CBM_REGKEY_SERVICE   "System\\CurrentControlSet\\Services\\opencbm"

Registry key (under HKLM) of the service

Definition at line 38 of file cbmioctl.h.

Referenced by cbm_get_debugging_flags(), and IsDriverStartedAutomatically().

#define CBM_REGKEY_SERVICE_DEBUGFLAGS   "DebugFlags"

Registry entry (under CBM_REGKEY_SERVICE) of the DebugFlags

Definition at line 53 of file cbmioctl.h.

#define CBM_REGKEY_SERVICE_DEFAULTLPT   "DefaultLpt"

Registry entry (under CBM_REGKEY_SERVICE) of the default LPT port

Definition at line 42 of file cbmioctl.h.

#define CBM_REGKEY_SERVICE_DLL_DEBUGFLAGS   "DllDebugFlags"

Registry entry (under CBM_REGKEY_SERVICE) of the DebugFlags for the DLL

Definition at line 56 of file cbmioctl.h.

Referenced by cbm_get_debugging_flags().

#define CBM_REGKEY_SERVICE_IECCABLE   "CableType"

Registry entry (under CBM_REGKEY_SERVICE) for the cable type

Definition at line 46 of file cbmioctl.h.

#define CBM_REGKEY_SERVICE_PERMLOCK   "PermanentlyLock"

Registry entry (under CBM_REGKEY_SERVICE) for determining if the parport is to be permanently locked

Definition at line 50 of file cbmioctl.h.

#define CBMCTRL_BASE   0x0000A424

BASE number of the custom IOCTL

Definition at line 254 of file cbmioctl.h.

#define CBMDEVICENAME_MAINPART   "\\\\.\\" OPENCBM_DRIVERNAME

The device name of the driver This is necessary for DOS drivers and "old-style" DLLs A number is appended to this name, starting with 0.

Definition at line 65 of file cbmioctl.h.

#define CBMT_I_INSTALL_OUT_GET_VERSION_DEVEL (   _x)    (((_x) >> 0) & 0xFF)

the devel number, that is, w

Definition at line 152 of file cbmioctl.h.

#define CBMT_I_INSTALL_OUT_GET_VERSION_EX_BUGFIX (   _x)    (((_x) >> 0) & 0xFF)

the bugfix number in the version extension

Definition at line 160 of file cbmioctl.h.

#define CBMT_I_INSTALL_OUT_GET_VERSION_MAJOR (   _x)    (((_x) >> 24) & 0xFF)

These macros define how to extract version information from CBMT_I_INSTALL_OUT.DriverVersion and/or .DllVersion Assume that a version is x.y.z.w

the major number, that is, x

Definition at line 146 of file cbmioctl.h.

#define CBMT_I_INSTALL_OUT_GET_VERSION_MINOR (   _x)    (((_x) >> 16) & 0xFF)

the minor number, that is, y

Definition at line 148 of file cbmioctl.h.

#define CBMT_I_INSTALL_OUT_GET_VERSION_SUBMINOR (   _x)    (((_x) >> 8) & 0xFF)

the subminor number, that is, z

Definition at line 150 of file cbmioctl.h.

#define CBMT_I_INSTALL_OUT_MAKE_VERSION (   _x,
  _y,
  _z,
  _w 
)    (((((_x) << 8 | (_y)) << 8 | (_z)) << 8 | (_w)))

Build such a version number

Definition at line 155 of file cbmioctl.h.

Referenced by cbm_driver_install(), and cbm_install().

#define CBMT_I_INSTALL_OUT_MAKE_VERSION_EX (   _w)    (_w)

Build such a version extension

Definition at line 163 of file cbmioctl.h.

Referenced by cbm_driver_install(), and cbm_install().

#define IEC_LINE_ATN   0x04

CBMT_LINE: ATN

Definition at line 78 of file cbmioctl.h.

Referenced by cbmiec_iec_poll(), cbmiec_iec_setrelease(), cbmiec_iec_wait(), and DllMain().

#define IEC_LINE_CLOCK   0x02

CBMT_LINE: CLOCK

Definition at line 76 of file cbmioctl.h.

Referenced by cbmiec_iec_poll(), cbmiec_iec_setrelease(), cbmiec_iec_wait(), and DllMain().

#define IEC_LINE_DATA   0x01

CBMT_LINE: DATA

Definition at line 74 of file cbmioctl.h.

Referenced by cbmiec_iec_poll(), cbmiec_iec_setrelease(), cbmiec_iec_wait(), and DllMain().

#define IEC_LINE_RESET   0x08

CBMT_LINE: RESET

Definition at line 80 of file cbmioctl.h.

Referenced by cbmiec_iec_poll(), cbmiec_iec_setrelease(), and DllMain().

#define OPENCBM_DRIVERNAME   "opencbm"

The name of the driver with which to communicate

Definition at line 59 of file cbmioctl.h.

Referenced by cbm_driver_start(), cbm_driver_stop(), opencbm_plugin_install_do_install(), and opencbm_plugin_install_do_uninstall().

#define OPENCBM_IOCTL_INDEX   0x823

INDEX number of the custom IOCTLs

Definition at line 256 of file cbmioctl.h.

Typedef Documentation

typedef struct CBMT_BOOLEAN CBMT_BOOLEAN

This type contains a boolean decision

Input buffer for CLOSE

Definition at line 224 of file cbmioctl.h.

Output buffer for GET_EOI

Definition at line 240 of file cbmioctl.h.

Output buffer for I_INSTALL

Output buffer for CBMCTRL_TEST_IRQ. Values of 1 indicate an error, values of -1 are warnings only.

Output buffer for IEC_DBG_READ

Definition at line 248 of file cbmioctl.h.

A value for both the CBMT_IEC_DBG_READ and CBMT_IEC_DBG_WRITE IOCTLs

Input buffer for IEC_DBG_WRITE

Definition at line 250 of file cbmioctl.h.

Output buffer for IEC_POLL

Definition at line 230 of file cbmioctl.h.

Input buffer for RELEASE

Definition at line 238 of file cbmioctl.h.

Input buffer for IEC_SET

Definition at line 236 of file cbmioctl.h.

Input buffer for IEC_SET

Definition at line 242 of file cbmioctl.h.

Input buffer for IEC_WAIT

Definition at line 232 of file cbmioctl.h.

Output buffer for IEC_WAIT

Definition at line 234 of file cbmioctl.h.

This type provides primary and secondary address on the IEC bus

typedef struct CBMT_LINE CBMT_LINE

This type gives a line (one out of IEC_ATN, IEC_DATA, IEC_CLOCK)

This type gives a line (one out of IEC_ATN, IEC_DATA, IEC_CLOCK) and the corresponding state.

Input buffer for LISTEN

Definition at line 220 of file cbmioctl.h.

Input buffer for OPEN

Definition at line 222 of file cbmioctl.h.

Output buffer for IEC_PARBURST_READ

Definition at line 244 of file cbmioctl.h.

Input buffer for IEC_PARBURST_PAR_WRITE

Definition at line 246 of file cbmioctl.h.

Output buffer for IEC_PP_READ

Definition at line 228 of file cbmioctl.h.

Input buffer for IEC_PP_WRITE

Definition at line 226 of file cbmioctl.h.

This type provides a single (raw) byte

Input buffer for TALK

Definition at line 218 of file cbmioctl.h.

Tell the type of the cable used

Enumeration Type Documentation

Tell the type of the cable used

Definition at line 26 of file cbmioctl.h.

Function Documentation

DEFINE_GUID ( GUID_OPENCBM  ,
0x9c3b5b5e  ,
0x558e  ,
0x47cc  ,
0x9c  ,
0x5  ,
0xf1  ,
0xfc  ,
0xf5  ,
0x17  ,
0x54  ,
0x7   
)

the GUID for communication with the kernel-mode driver

Todo:
Currently, this is unused!