OpenCBM
Macros | Functions | Variables
libiec/init.c File Reference

Initialize the IEC bus. More...

#include <wdm.h>
#include "cbm_driver.h"
#include "i_iec.h"

Go to the source code of this file.

Macros

#define READ_TIMEOUT_VALUE(_what_, _default_)
 

Functions

NTSTATUS cbmiec_cleanup (IN PDEVICE_EXTENSION Pdx)
 Cleanup the IEC bus. More...
 
VOID cbmiec_set_cabletype (IN PDEVICE_EXTENSION Pdx, IN IEC_CABLETYPE CableType)
 Set the type of the IEC cable. More...
 
NTSTATUS cbmiec_init (IN PDEVICE_EXTENSION Pdx)
 Initialize the IEC bus. More...
 
NTSTATUS cbmiec_global_init (IN PHANDLE HKey)
 Initialization for libiec which are global in nature. More...
 

Variables

IEC_TIMEOUTS libiec_global_timeouts
 

Detailed Description

Initialize the IEC bus.



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

Definition in file libiec/init.c.

Macro Definition Documentation

#define READ_TIMEOUT_VALUE (   _what_,
  _default_ 
)
Value:
do { \
libiec_global_timeouts._what_ = _default_; \
if (HKey) cbm_registry_read_ulong(*HKey, L#_what_, &libiec_global_timeouts._what_); \
} while (0)
IEC_TIMEOUTS libiec_global_timeouts
Definition: libiec/init.c:28
NTSTATUS cbm_registry_read_ulong(IN HANDLE HandleKey, IN PCWSTR KeyName, OUT PULONG Value)
Read a ULONG value out of a registry key.
Definition: util-reg.c:299

Read timeout values from the registry

Definition at line 31 of file libiec/init.c.

Function Documentation

NTSTATUS cbmiec_cleanup ( IN PDEVICE_EXTENSION  Pdx)

Cleanup the IEC bus.

This function cleans the IEC bus immediately before it is released.

Parameters
PdxPointer to the device extension.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

Definition at line 116 of file libiec/init.c.

References cbmiec_release_bus(), and FUNC_ENTER.

NTSTATUS cbmiec_global_init ( IN PHANDLE  HKey)

Initialization for libiec which are global in nature.

This function initializes libiec.

Parameters
HKeyPointer to a handle with holds a registry key. If this is NULL, no access to the registry is performed.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

Definition at line 251 of file libiec/init.c.

References FUNC_ENTER.

Referenced by cbm_init_registry().

NTSTATUS cbmiec_init ( IN PDEVICE_EXTENSION  Pdx)

Initialize the IEC bus.

This function initializes the IEC bus itself, and sets some variables in the device extension. It has to be called before any other IEC function is called.

Parameters
PdxPointer to the device extension.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

Definition at line 199 of file libiec/init.c.

References cbmiec_checkcable(), CBMIEC_RELEASE, FUNC_ENTER, PP_ATN_OUT, PP_CLK_OUT, PP_DATA_OUT, PP_LP_BIDIR, PP_LP_IRQ, and PP_RESET_OUT.

Referenced by cbm_lock_parport().

VOID cbmiec_set_cabletype ( IN PDEVICE_EXTENSION  Pdx,
IN IEC_CABLETYPE  CableType 
)

Set the type of the IEC cable.

This function sets the type of the IEC cable.

Parameters
PdxPointer to the device extension.
CableTypeThe type of the cable.

Definition at line 139 of file libiec/init.c.

References CABLESTATE_UNKNOWN, cbmiec_setcablestate(), FUNC_ENTER, and FUNC_LEAVE.

Referenced by cbm_init_registry().

Variable Documentation

IEC_TIMEOUTS libiec_global_timeouts