.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" This code is derived from software contributed to Berkeley by
.\" the Systems Programming Group of the University of Utah Computer
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" @(#)hil.4 5.2 (Berkeley) 3/27/91
.Nd Human Interface Link device driver
is the interface used by the Series
300 computers to connect devices such as keyboards, mice, control knobs,
refers to the ``loop'' pseudo-device and is used for the queue
allocation commands described below.
In the current implementation,
there can only be one keyboard and it must be the first device
The device file that corresponds to a particular
by the order of the devices on the loop. For instance, if the
is the second physical device on the loop, then
file that should be used for communication with the module.
A process may open a device already opened by another process unless
the process is operating in
in which case it requires exclusive use of the device, or
another process has the device open and is using
Input data from a device are obtained in one of two ways.
style interface in which the
system call is used to get fixed-size input packets,
The shared-queue interface avoids the system call overhead associated with
read interface by sharing a region of memory between the system
This region consists of a circular list of 255 event packets,
and a header containing the size of the queue, and its head and tail indices.
The system deposits event data at the tail of the queue,
a process extracts it from the head.
Extracting an event is done by copying it from the queue and then updating
the head appropriately (i.e. head = (head + 1) % qsize).
It is up to the process to ensure that packets are removed from the
queue quickly enough to prevent the queue from filling.
The system, when it determines that the queue is full,
will ignore future packets from the device.
More than one device can be mapped to a single queue and one device can
be mapped to several queues.
Queues are implicitly unmapped by a
cannot be shared between processes.
Choosing the type of interface is done on a per device basis using
but each device can only have one interface at any given time.
may be used with either interface to detect when input data are present.
With the read interface, selecting indicates when there is input for a
With the shared-queue interface, selecting on the loop pseudo-device
indicates when data are present from any device on any queue
while selecting on an individual device indicates when data are present
for that device on any queue.
shuts down the file descriptor associated with the
The last close (system-wide) of any device removes that device
from all queues it was mapped to while the last close of the loop
pseudo-device unmaps all devices and deallocates all queues.
.Aq Pa hpdev/hilioctl.h )
listed below are separated into two groups.
The first are those which provide functions identical to
complete descriptions of these ioctls.
The second set of ioctls are specific to this implementation and are
primarily related to the shared-queue interface.
.Bl -tag -width HILIOCARO
The device will return up to 11 bytes of information describing the
type and characteristics of the device.
At the very least, 2 bytes of information,
and the Describe Record Header will be returned.
Request the security code record from a device. The security code can
vary from 1 byte to 15, and is only supported by some
An ascii string of up to 15 bytes in length that describes the device
An ascii string of up to 15 bytes in length that describes the current
status of the device is returned.
Additional information of up to 15 bytes is returned describing the device.
to determine if the device supports extended describe.
Turn off auto repeat on the keyboard while it is cooked mode.
Turn on auto repeat on the keyboard while it is in raw mode.
The repeat rate is set to 1/30th of a second.
Turn on auto repeat on the keyboard while it is in raw mode.
The repeat rate is set to 1/60th of a second.
The following ioctls are specific to this implementation:
Generate a keyboard beep as defined by
is a pointer to two bytes of information,
the first is the duration of the beep (microseconds),
the second is the frequency of the beep.
Allocate and map into user space,
.Aq Pa hpdev/hilioctl.h .
structure (also described in
.Aq Pa hpdev/hilioctl.h )
is non-zero it specifies where in the address space to map the queue.
If zero, the system will select a convenient location and fill in
is filled in by the system and
is a small integer used to uniquely identify this queue.
This ioctl can only be issued to the loop pseudo-device.
Release a previously allocated
unmapping it from the user's address space.
structure which contains the
of the queue to be released.
All devices that are currently mapped to the queue are unmapped.
This ioctl can only be issued to the loop pseudo-device.
Maps this device to a previously allocated
is a pointer to an integer containing the
Once a device is mapped to a queue,
all event information generated by the device will be placed
into the event queue at the tail.
Unmap this device from a previously allocated
is a pointer to an integer containing the
Future events from the device are no longer placed on the event queue.
semantics for gathering data from this device.
Instead of placing input events for the device on a queue,
format, into a buffer from which they
This interface is provided for backwards compatibility.
documentation for a description of the event packet.
.Bl -tag -width /dev/hil[2-7] -compact
Another HP-UX process has the device open, or another
device open, and is using it in
No more shared queues available.