HP OpenVMS Systems Documentation

Content starts here

VMS DECwindows Device Driver Manual


Previous Contents Index

A.2 Input Buffer Control Block (INB)

The input buffer control block (INB) in the I/O database defines the control block for the input queue buffer. INB provides control of the server/driver interface and pointers to the input queue and free packets (see Figure A-2). Table A-2 lists and defines the fields of the INB.

One ACB (AST control block) is required for each input queue. An ACB is allocated at offset INB$B_ACB within the INB structure. It is defined by $ACBDEF and the 28-byte length is specified by ACB$K_LENGTH. The INB is defined in module $DECWCOMMON and the length is specified by constant INB$K_LENGTH.

Figure A-2 Input Buffer Control Block (INB)


4735INBSTRUCT.TEX

Table A-2 Input Buffer Control Block Fields
Field Name Contents
INB$L_INPUT_QUEUE_FLINK The forward link to the first or next input packet structure (INP) in the input queue.
INB$L_INPUT_QUEUE_BLINK The backward link to the last or previous input packet structure (INP) in the input queue.
INB$W_SIZE Total size in bytes of the input buffer.
INB$B_TYPE Defines the system or major type of data structure (DECwindows) that is read by the System Dump Analyzer (SDA). The common driver writes the symbolic constant DYN$C_DECW in this field when the common driver creates the INB.
INB$B_SUB_TYPE Defines the specific (subtype) data structure (INB) within the major type that is read by the SDA. When the common driver creates the INB, the common driver writes the symbolic constant DYN$C_DECW_INB in this field.
INB$L_VSYNC_UCB The pointer to the output UCB whose driver first reported a vertical synchronization (VSYNC) interval.
INB$L_FREE_QUEUE_FLINK The forward link to the next packet in the free queue.
INB$L_FREE_QUEUE_BLINK The backward link to the previous packet in the free queue.
INB$L_NOHISTORY_FLINK Reserved.
INB$L_NOHISTORY_BLINK Reserved.
INB$L_HISTORY_BUFFER A pointer to the motion history buffer (MHB).
INB$L_HISTORY_SIZE The current size in pages of the motion history buffer.
INB$L_FLAGS A 32-bit field containing interface status bits. Mask bits in this field correspond to five possible states:
INB$V_ACB_BUSY Bit 0, AST control block already queued.
INB$V_AWAKE Bit 1, AST not required for server.
INB$V_SERVER_TIMED Bit 2, if set, check server (AST-inhibit) timer for zero before sending AST.
INB$V_NON_INT_BOX Bit 3, if set, motion event data is inhibited when pointer is in the noninterest box.
INB$V_MHB_BUSY Bit 4, if set, the motion history buffer is busy with the server or is disabled by the server. A value of 0 enables the buffer.
INB$B_ACB A pointer to the AST control block 28-byte array.
INB$L_SAVED_PID The process ID of the device that sent the AST. EXE$QIO obtains the process identification from the PCB and writes the value into this field.
INB$W_NON_INT_BOX_X1 Address of the first x-axis pointer events noninterest box.
INB$W_NON_INT_BOX_Y1 Address of the first y-axis pointer events noninterest box.
INB$W_NON_INT_BOX_X2 Address of the second x-axis pointer events noninterest box.
INB$W_NON_INT_BOX_Y2 Address of the second y-axis pointer events noninterest box.
INB$B_SAVED_RMOD The access mode value of the process at the time of the I/O request. EXE$QIO obtains the process access mode from the PSL and writes the value into this field.
INB$W_VERSION The INB version number.
INB$L_TIMESTAMP_MONTH The timestamp with month.
INB$L_TIMESTAMP_MS Timestamp to the nearest millisecond.
INB$L_SCHED_QUANTUM Event time slice in server schedule.
INB$W_SCHED_FLAGS A 16-bit field containing interface status bits concerning event scheduling in the server. Mask bits in this field correspond to three possible states:
INB$V_INPUT_PENDING Bit 0, packet in queue if set.
INB$V_QUANTUM_EXPIRED Bit 1, time slot expired if set.
INB$V_SCHED_YIELD Bit 2, yield to a higher priority event if set.
INB$L_COUNTER1 Reserved.
INB$L_COUNTER2 Reserved.
INB$L_COUNTER3 Reserved.
INB$L_COUNTER4 Reserved.
INB$L_PFN_COUNT A pointer to the page frame counter indicating the page frame numbers (PFNs) for the shared buffer.
INB$L_PFN_LIST A pointer to the page frame number list.

1read only fields

A.3 Input Packet (INP)

The input packet (INP) data structure defines the packet format used in the interface between the common device driver and the DECwindows server. The basic DECwindows format of the input packet conforms with the X event format in the X Window System protocol.

Some fields in the packets of certain events may vary. The packet illustrated in Figure A-3 is a typical input event generated by a pointing device or keyboard. Input events include key, button, and pointer motion events. The first 12 bytes (3 longwords) are common to all events. The event information is always 32 bytes, excluding the prefixed forward/ backward pointers (FLINK/BLINK) for VMS. Table A-3 defines the fields of the packet.

Figure A-3 Input Packet Data Structure (INP)


4735INPSTRUCT.TEX

Table A-3 Input Packet Fields
Field Name Contents
INP$L_FLINK The forward link to the next INP structure. This field is filled in by the class driver queue routines.
INP$L_BLINK The backward link to the previous INP structure. This field is filled in by the class driver queue routines.
INP$B_TYPE Specifies the X11 event type. The class driver writes the packet type in this field when it creates the INP. Possible key definition states: KEYPRESS, KEYRELEASE. Possible mouse definition states: BUTTONPRESS, BUTTONRELEASE, and MOTIONNOTIFY.
INP$B_DETAIL A keyboard or mouse code specifying the key or button activity.
INP$W_SEQUENCE The packet sequence number in the transmission session.
INP$L_TIMESTAMP The date/time of packet creation.
INP$L_ROOT_WIN The pointer to a root window data structure in the display application.
INP$L_EVENT_WIN The pointer to the event window data structure in the application where the current activity is referenced.
INP$L_CHILD_WIN The pointer to a child display window in the application associated with the current activity. (The parent is the event window data structure.)
INP$W_ROOT_X A value in pixels specifying the horizontal placement of the upper left corner of the root window on the screen.
INP$W_ROOT_Y A value in pixels specifying the vertical placement of the upper left corner of the root window on the screen.
INP$W_EVENT_X A value in pixels specifying the pointer movement (left, right, distance) along the x-axis.
INP$W_EVENT_Y A value in pixels specifying the pointer movement (up, down, distance) along the y-axis.
INP$W_KEY_BUTTON_MASK A 16-bit mask marking the bit position that defines a specific function for a key or button. The following bits in this field identify specific functions of the input event:
INP$V_SHIFTMASK Bit 0, shift key pressed.
INP$V_CAPSLOCKMASK Bit 1, caps lock key pressed.
INP$V_CONTROLMASK Bit 2, control key pressed.
INP$V_MOD1MASK Bit 3, the key pressed is modifying MB1.
INP$V_MOD2MASK Bit 4, the key pressed is modifying MB2.
INP$V_MOD3MASK Bit 5, the key pressed is modifying MB3.
INP$V_MOD4MASK Bit 6, the key pressed is modifying MB4.
INP$V_MOD5MASK Bit 7, the key pressed is modifying MB5.
INP$V_BUTTON1MASK Bit 8, MB1 is pressed.
INP$V_BUTTON2MASK Bit 9, MB2 is pressed.
INP$V_BUTTON3MASK Bit 10, MB3 is pressed.
INP$V_BUTTON4MASK Bit 11, MB4 is pressed.
INP$V_BUTTON5MASK Bit 12, MB5 is pressed.
INP$V_UNUSED1MASK Bit 13, reserved.
INP$V_UNUSED2MASK Bit 14, reserved.
INP$V_ANYMODIFIER Bit 15, set when any grab button or grab key modifier is pressed.

1read only fields

A.4 Keyboard Information Block (KIB)

The keyboard information block (KIB) in the I/O database contains keyboard characteristics that are used in the execution of the keyboard information $QIO system service. During the keyboard information sense or set mode $QIO call, data is passed between server and driver by the system service reading or writing the KIB. The p2 $QIO parameter points to the starting address of the block. The fields define bell and keyclick volume and autorepeat information (see Figure A-4). Table A-4 lists and defines the fields of the KIB. The length of the data structure is defined by the constant KIB$S_KBD_INFO.

Figure A-4 Keyboard Information Block


4735KIBSTRUCT.TEX

Table A-4 Keyboard Information Block Fields
Field Name Contents
KIB$L_ENABLE_MASK Entry to the 256-bit autorepeat enable mask for the LK201 keys. The mask defines which keys are in autorepeat mode. The bits are numbered 0 to 255 and each bit position corresponds to a specific key position on an LK201 keyboard. For example, using decimal keycode numbering, mask-bit 90 corresponds to the 90 key position (F5) on the LK201 keyboard.
KIB$L_KEYCLICK_VOL A longword specifying the keyclick volume in percent. A value of 100 specifies the loudest click while a value 0 turns the keyclick off. A value of --1 provides a default volume of 70 percent.
KIB$L_BELL_VOL A longword specifying the bell volume in percent. A value of 100 specifies the loudest ring while a value 0 turns the bell off. A value of --1 provides a default volume of 70 percent.
KIB$L_AUTO_ON_OFF Defines the state of the autorepeat feature. A value of 0 turns autorepeat on and a value of 1 turns it off.

1read only fields

A.5 Motion History Buffer (MHB)

The motion history buffer (MHB) data structure in the I/O database provides a storage area for pointing device movements as history events. The buffer structure contains a 16-byte control block or header at the top followed by (starting at address 1610) 8-byte motion history packets (MHPs) that make up a ring buffer. Each history packet contains x-axis and y-axis movement with an event timestamp (see Figure A-5). Table A-5 lists and defines the fields of the motion history buffer.

The MHB header and MHP packets are defined by the $DECWCOMMON macro. The MHB header length is defined by constant MHB$S_MHB_STRUCT and the MHP packet length (8 bytes) is defined by MHP$K_LENGTH. Field MHB$L_PUT_PTR points to the next free packet and field MHB$L_GET_PTR points to the oldest pointer motion event. Field MHB$L_END_PTR points to the last byte in the buffer. MHB$T_RING points to the starting address of the ring buffer packet area or the first packet in the ring.

Figure A-5 Motion History Buffer Data Structure


4735MHBSTRUCT.TEX

Table A-5 Motion History Buffer Fields
Field Name Contents
MHB$L_PUT_PTR Points to the next or oldest free packet in the ring.
MHB$L_GET_PTR Points to the oldest motion event packet in the ring.
MHB$W_SIZE Size in bytes of the history buffer.
MHB$B_TYPE Defines the system or major type of data structure (DECwindows) that is read by the System Dump Analyzer (SDA). The common driver writes the symbolic constant DYN$C_DECW in this field when the common driver creates the MHB.
MHB$B_SUBTYPE Defines the specific (subtype) data structure (MHB) within the major type that is read by the SDA. When the common driver creates the MHB, the common driver writes the symbolic constant DYN$C_DECW_MHB in this field.
MHB$L_END_PTR Points to the last free packet in the ring.
MHP$W_EVENT_X A packet event value in pixels specifying the pointer movement (left, right, distance) along the x-axis.
MHP$W_EVENT_Y A packet event value in pixels specifying the pointer movement (up, down, distance) along the y-axis.
MHP$L_TIMESTAMP A packet event value specifying the date/time of the pointer movement.

1read only fields

A.6 Unit Control Block for Input Device

A unit control block (UCB) data structure is a variable-length block in the I/O database that describes the characteristics of a single device unit. The driver-loading procedure creates some static fields. The operating system and device drivers can read and modify all nonstatic fields of the UCB.

The general UCB structure for an input device with a port/class interface is shown in Figure A-6. It contains five sections: the system section (base UCB), the class driver terminal section, the DECwindows input device extension, the port driver terminal section, and the port extension region.

The system section of the terminal driver UCB contains the fields of the UCB that are present in all of the UCBs on the system. The length of the system UCB is defined by UCB$K_LENGTH.

The class driver terminal section of the UCB contains fields that are needed by the class driver. These fields have names of the form UCB$x_TT_fieldname, where x denotes the field size and fieldname is the name of the field. The UCB$K_TT_LENGTH constant defines the length of the class driver section of the UCB.

The DECwindows input extension section contains fields that are needed by all DECwindows device drivers for communication and processing. These fields have names of the form DWI$x_fieldname, where x denotes the field size and fieldname is the name of the field. Symbol UCB$L_DECW_I_DWI is always the address of the input extension starting address.

The port driver terminal section of the UCB contains fields that both the class and port driver must access. These fields have names of the form UCB$x_TP_fieldname, where x denotes the field size and fieldname is the name of the field. Although a port driver may not actually use all these fields, they are needed by other software.

The terminal port extension region is defined by the terminal port driver. It can be any length and contain any context that the port driver needs in order to execute the port functions.

Figure A-6 Unit Control Block General Structure


A.6.1 UCB/DECwindows Common Input Extension (DWI)

Each terminal device on the system has its own UCB, including VMS terminal extensions for port and class drivers (described in the OpenVMS VAX Device Support Reference Manual). A DECwindows UCB includes a common input extension (DWI/DECW) and a device-specific extension (see Figure A-6). UCB class driver section field UCB$L_DECW_I_DWI points to the DWI extension starting address. Note that field UCB$L_TT_WFLINK is overwritten and redefined as UCB$L_DECW_I_DWI when the DECwindows extension is created by macro $DECWINPUTUCB (invoked by $DECWGBL). The common DWI extension length is specified at B816 (18410) by DWI$K_DECW_COMMON_LENGTH.

This section describes the DWI common input extension structure (see Figure A-7). Table A-6 lists and defines the fields of the DECwindows UCB common input extension.

Figure A-7 UCB/DECwindows Common Input Extension


4735DWISTRUCT.TEX

Table A-6 UCB/DECwindows Common Input Extension Fields
Field Name Contents
DWI$L_DECW_INB Pointer to the INB header.
DWI$L_DECW_OUTPUT_UCB Pointer to the start of the output UCB.
DWI$L_DECW_DEV_CHARS Pointer to the DVI.
DWI$L_DECW_PRIVATE Defines the escape point for extensions (reserved for Digital).
DWI$L_DECW_SILO Pointer to the start of the SILO 1 block.
DWI$T_DECW_SILO The SILO buffer area (block) defined by the $SILODEF macro.
DWI$B_DECW_DEV_TYPE A byte that defines the input device type (mouse/keyboard).
DWI$L_DECW_INIT_VECTOR Offset to the initialization routine that starts the device self-test.
DWI$L_DECW_FUNC_VECTOR Offset to the powerfail function routine.
DWI$L_DECW_UART Address of the UART/CSR 2 for the serial input device.

1SILO is a software version of a Service In Logical Order buffer for serial input and output data in the channel associated with the UCB.
2UART is a universal asynchronous receiver/transmitter chip for serial interfaces and CSR is the Control/Status Register.


Previous Next Contents Index