Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cbmioctl.h

Go to the documentation of this file.
00001 
00012 /*
00013  *      This program is free software; you can redistribute it and/or
00014  *      modify it under the terms of the GNU General Public License
00015  *      as published by the Free Software Foundation; either version
00016  *      2 of the License, or (at your option) any later version.
00017  *
00018  *  Copyright 1999 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
00019  *  Copyright 2001-2004 Spiro Trikaliotis
00020 */
00021 
00022 #ifndef CBM_IOCTL_H
00023 #define CBM_IOCTL_H
00024 
00027 #define CBM_REGKEY_SERVICE "System\\CurrentControlSet\\Services\\opencbm"
00028 
00031 #define CBM_REGKEY_SERVICE_DEFAULTLPT "DefaultLpt"
00032 
00035 #define CBM_REGKEY_SERVICE_IECCABLE "IecCable"
00036 
00039 #define CBM_REGKEY_SERVICE_PERMLOCK "PermanentlyLock"
00040 
00042 #define CBM_REGKEY_SERVICE_DEBUGFLAGS "DebugFlags"
00043 
00045 #define CBM_REGKEY_SERVICE_DLL_DEBUGFLAGS "DllDebugFlags"
00046 
00048 #define OPENCBM_DRIVERNAME "opencbm"
00049 
00054 #define CBMDEVICENAME_MAINPART "\\\\.\\" OPENCBM_DRIVERNAME
00055 
00059 // {9C3B5B5E-558E-47cc-9C05-F1FCF5175407}
00060 DEFINE_GUID(GUID_OPENCBM, 0x9c3b5b5e, 0x558e, 0x47cc, 0x9c, 0x5, 0xf1, 0xfc, 0xf5, 0x17, 0x54, 0x7);
00061 
00063 #define IEC_LINE_DATA   0x01
00064 
00065 #define IEC_LINE_CLOCK  0x02
00066 
00067 #define IEC_LINE_ATN    0x04
00068 
00069 #define IEC_LINE_RESET  0x08
00070 
00071 
00072 // Data structures for accessing the kernel mode driver:
00073 
00075 typedef 
00076 struct CBMT_IECADDRESS
00077 {
00079     UCHAR PrimaryAddress;
00080 
00082     UCHAR SecondaryAddress;
00083 
00084 } CBMT_IECADDRESS;
00085 
00087 typedef
00088 struct CBMT_SINGLEBYTE
00089 {
00091     UCHAR Byte;
00092 
00093 } CBMT_SINGLEBYTE;
00094 
00096 typedef 
00097 struct CBMT_LINE
00098 {
00101     UCHAR Line;
00102 
00103 } CBMT_LINE;
00104 
00108 typedef 
00109 struct CBMT_LINESTATE
00110 {
00113     UCHAR Line;
00114 
00116     UCHAR State;
00117 
00118 } CBMT_LINE_STATE;
00119 
00121 typedef
00122 struct CBMT_BOOLEAN
00123 {
00125     BOOLEAN Decision;
00126 
00127 } CBMT_BOOLEAN;
00128 
00135 #define CBMT_I_INSTALL_OUT_GET_VERSION_MAJOR(_x)    (((_x) >> 24) & 0xFF)
00136 
00137 #define CBMT_I_INSTALL_OUT_GET_VERSION_MINOR(_x)    (((_x) >> 16) & 0xFF)
00138 
00139 #define CBMT_I_INSTALL_OUT_GET_VERSION_SUBMINOR(_x) (((_x) >>  8) & 0xFF)
00140 
00141 #define CBMT_I_INSTALL_OUT_GET_VERSION_DEVEL(_x)    (((_x) >>  0) & 0xFF)
00142 
00144 #define CBMT_I_INSTALL_OUT_MAKE_VERSION(_x, _y, _z, _w) \
00145     (((((_x) << 8 | (_y)) << 8 | (_z)) << 8 | (_w)))
00146 
00147 
00149 #define CBMT_I_INSTALL_OUT_GET_VERSION_EX_BUGFIX(_x) (((_x) >>  0) & 0xFF)
00150 
00152 #define CBMT_I_INSTALL_OUT_MAKE_VERSION_EX(_w) \
00153     (_w)
00154 
00156 typedef
00157 struct CBMT_I_INSTALL_OUT
00158 {
00162     ULONG ErrorFlags;
00163 
00165     ULONG DllVersion;
00166 
00168     ULONG DriverVersion;
00169 
00171     ULONG DllVersionEx;
00172 
00174     ULONG DriverVersionEx;
00175 
00176 } CBMT_I_INSTALL_OUT, *PCBMT_I_INSTALL_OUT;
00177 
00179 typedef CBMT_IECADDRESS CBMT_TALK_IN;
00181 typedef CBMT_IECADDRESS CBMT_LISTEN_IN;
00183 typedef CBMT_IECADDRESS CBMT_OPEN_IN;
00185 typedef CBMT_IECADDRESS CBMT_CLOSE_IN;
00187 typedef CBMT_SINGLEBYTE CBMT_PP_WRITE_IN;
00189 typedef CBMT_SINGLEBYTE CBMT_PP_READ_OUT;
00191 typedef CBMT_LINE       CBMT_IEC_POLL_OUT;
00193 typedef CBMT_LINE_STATE CBMT_IEC_WAIT_IN;
00195 typedef CBMT_LINE       CBMT_IEC_WAIT_OUT;
00197 typedef CBMT_LINE       CBMT_IEC_SET_IN;
00199 typedef CBMT_LINE       CBMT_IEC_RELEASE_IN;
00201 typedef CBMT_BOOLEAN    CBMT_GET_EOI_OUT;
00203 typedef CBMT_LINE_STATE CBMT_IEC_SETRELEASE_IN;
00205 typedef CBMT_SINGLEBYTE CBMT_PARBURST_PREAD_OUT;
00207 typedef CBMT_SINGLEBYTE CBMT_PARBURST_PWRITE_IN;
00208 
00209 
00211 #define CBMCTRL_BASE    0x0000A424
00212 
00213 #define CBM4WIN_IOCTL_INDEX  0x823
00214 
00216 #define _CBMIO(_a,_b) CTL_CODE(CBMCTRL_BASE, (CBM4WIN_IOCTL_INDEX+(_b)), \
00217                    METHOD_BUFFERED, FILE_ANY_ACCESS)
00218 
00219                                                   // INPUT:               OUTPUT:
00221 #define CBMCTRL_TALK        _CBMIO(CBMCTRL_BASE, 0)  // CBMT_TALK_IN         -
00222 
00223 #define CBMCTRL_LISTEN      _CBMIO(CBMCTRL_BASE, 1)  // CBMT_LISTEN_IN       -
00224 
00225 #define CBMCTRL_UNTALK      _CBMIO(CBMCTRL_BASE, 2)  // -                    -
00226 
00227 #define CBMCTRL_UNLISTEN    _CBMIO(CBMCTRL_BASE, 3)  // -                    -
00228 
00229 #define CBMCTRL_OPEN        _CBMIO(CBMCTRL_BASE, 4)  // CBMT_OPEN_IN         -
00230 
00231 #define CBMCTRL_CLOSE       _CBMIO(CBMCTRL_BASE, 5)  // CBMT_CLOSE_IN        -
00232 
00233 #define CBMCTRL_RESET       _CBMIO(CBMCTRL_BASE, 6)  // -                    -
00234 
00235 #define CBMCTRL_GET_EOI     _CBMIO(CBMCTRL_BASE, 7)  // -                    CBMT_GET_EOI_OUT
00236 
00237 #define CBMCTRL_CLEAR_EOI   _CBMIO(CBMCTRL_BASE, 8)  // -                    -
00238 
00240 #define CBMCTRL_PP_READ     _CBMIO(CBMCTRL_BASE, 10) // -                    CBMT_PP_READ_OUT
00241 
00242 #define CBMCTRL_PP_WRITE    _CBMIO(CBMCTRL_BASE, 11) // CBMT_PP_WRITE_IN     -
00243 
00244 #define CBMCTRL_IEC_POLL    _CBMIO(CBMCTRL_BASE, 12) // -                    CBMT_IEC_POLL_OUT    
00245 
00246 #define CBMCTRL_IEC_SET     _CBMIO(CBMCTRL_BASE, 13) // CBMT_IEC_SET_IN      -
00247 
00248 #define CBMCTRL_IEC_RELEASE _CBMIO(CBMCTRL_BASE, 14) // CBMT_IEC_RELEASE_IN  -
00249 
00250 #define CBMCTRL_IEC_WAIT    _CBMIO(CBMCTRL_BASE, 15) // CBMT_IEC_WAIT_IN     CBMT_IEC_WAIT_OUT
00251 
00253 #define CBMCTRL_I_INSTALL   _CBMIO(CBMCTRL_BASE, 16) // -                    CBMT_I_INSTALL_OUT (or an array of it)
00254 
00255 #if DBG
00256 
00257 #define CBMCTRL_I_READDBG   _CBMIO(CBMCTRL_BASE, 17) // -                    char array which will be filled
00258 #endif // #if DBG
00259 
00261 #define CBMCTRL_IEC_SETRELEASE _CBMIO(CBMCTRL_BASE, 18) // CBMT_IEC_SETRELEASE_IN -
00262 
00264 #define CBMCTRL_PARBURST_READ \
00265                             _CBMIO(CBMCTRL_BASE, 19) // CBMT_IEC_PARBURST_PREAD_IN -
00266 
00268 #define CBMCTRL_PARBURST_WRITE \
00269                             _CBMIO(CBMCTRL_BASE, 20) // -                    CBMT_IEC_PARBURST_PWRITE_OUT
00270 
00272 #define CBMCTRL_PARBURST_READ_TRACK \
00273                             _CBMIO(CBMCTRL_BASE, 21) // -                    CBMT_PARBURST_READ_TRACK_OUT
00274 
00276 #define CBMCTRL_PARBURST_WRITE_TRACK \
00277                             _CBMIO(CBMCTRL_BASE, 22) // CBMT_PARBURST_WRITE_TRACK_IN -
00278 
00280 #define CBMCTRL_PARPORT_LOCK  \
00281                             _CBMIO(CBMCTRL_BASE, 23) // -                    -
00282 
00284 #define CBMCTRL_PARPORT_UNLOCK  \
00285                             _CBMIO(CBMCTRL_BASE, 24) // -                    -
00286 
00288 #define CBMCTRL_UPDATE \
00289                             _CBMIO(CBMCTRL_BASE, 25) // -                    -
00290 
00291 /* these are the return codes of CBMCTRL_I_INSTALL: */
00292 
00294 #define CBM_I_DRIVER_INSTALL_0_FAILED         0xFFFFFFFF
00295 
00296 #define CBM_I_DRIVER_INSTALL_0_IOCTL_FAILED   0xFFFFFFFE
00297 
00298 #define CBM_I_DRIVER_INSTALL_0M_NO_INTERRUPT  0x80000000
00299 
00300 #endif /* #ifndef CBM_IOCTL_H */
00301 

Generated on Sun Apr 30 18:45:45 2006 for opencbm by  doxygen 1.4.2