USB Mouse Client Device Driver
Purpose
Supports the Universal Serial Bus (USB) mouse device.
Syntax
#include <sys/usbdi.h>
Description
The USB mouse client device driver consists of a back end that interfaces with the USB system driver (USBD) and a front end that interfaces with an AIX® application such as the X server application. The client driver has no knowledge of the underlying USB adapter hardware. Instead, the client driver sends control requests to the USB mouse through the USBD and receives input events through the USBD. The USB mouse client driver supports the attachment of multiple USB mouse devices. Each device is enumerated in the Object Data Manager (ODM) and marked available. The client driver treats all the mouse devices as a single logical device. Input events from all the devices are sent to a single input ring.
A device special file is created for each USB mouse device. Until there is at least one USB mouse device that is marked available, an application (typically the X server application) can open any one of the USB mouse special files because the client driver ignores the minor number specification. A USB mouse device that is added and configured after the open operation is automatically added to the open set. The device special files (for example, /dev/mouse0, /dev/mouse1, and so on) are created for each USB mouse device.
Special
treatment for the mouse is provided by the USBD configuration method
because of the strict configuration and ordering rules of the graphics
subsystem. When a USB host controller and a graphics adapter are marked
available, and no existing mouse is present, the USBD ensures that
at least one USB mouse instance is defined. The USB mouse client driver
uses the USBD_OPEN_DEVICE_EXT
ioctl
operation
to open the device that generates a valid handle even when there is
no USB mouse that is attached to the system. The EAGAIN
error
code is returned by the USBD_OPEN_DEVICE_EXT
operation
if there is no mouse device and the client driver treats the device
as disconnected. When you plug in a USB mouse, a reconnect call back
operation is made to the mouse client by the USBD and the device is
initialized for the input events to flow to the X server application.
The
following input device driver ioctl
operations are
used for the USB mouse operations:
Operation | Description |
---|---|
IOCINFO | Returns a devinfo structure,
which is defined in the sys/devinfo.h header
file, that describes the device. The first field of the structure
(devtype ) is set to DD_INPUT ; the
rest of the structure is set to zero. |
MQUERYID | Queries mouse device identifier. |
MREGRING | Registers input ring. |
MREGRINGEXT | Registers extended input ring. |
MRFLUSH | Flushes input ring. |
MTHRESHOLD | Sets mouse reporting threshold. |
MRESOLUTION | Sets mouse resolution. |
MSCALE | Sets mouse scale factor. |
MSAMPLERATE | Sets mouse sample rate. |