STREAMS Modules usbms(7M)
NAME
usbms - USB mouse STREAMS module
SYNOPSIS
#include
#include
#include
#include
DESCRIPTION
The usbms STREAMS module processes byte streams generated
by a USB mouse. A USB mouse is a member of the Human
Interface Device (HID) class and the usbms module supports
only the mouse boot protocol defined in the HID specifica-
tion.
The usbms module must be pushed on top of the HID class
driver (see hid(7D)). In the VUIDFIRMEVENT mode, the
usbms module translates packets from the USB mouse into Firm
events. The Firm event structure is defined in
. The STREAMS module state is initially
set to raw or VUIDNATIVE mode which performs no message
processing. See the HID 1.0 specification for the raw for-
mat of the mouse packets. To initiate mouse protocol conver-
sion to Firm events, change the state to VUIDFIRMEVENT.
When the usb mouse is opened or hot plugged in, the
MOUSETYPEABSOLUTE event (Firm event) is sent to the upper
level to notify the VUID application that it is the absolute
mouse.
IOCTLS
VUIDGFORMAT This option returns the current state of the
STREAMS module. The state of the usbms
STREAMS module may be either VUIDNATIVE (no
message processing) or VUIDFIRMEVENT (con-
vert to Firm events).
VUIDSFORMAT The argument is a pointer to an int. Set the
state of the STREAMS module to the int
pointed to by the argument.
SunOS 5.11 Last change: 1 Dec 2005 1
STREAMS Modules usbms(7M)
typedef struct vuidaddrprobe {
short base; /* default vuid device addr directed too */
union {
short next; /* next addr for default when VUIDSADR */
short current; /* current addr of default when VUIDGADR */
} data;
} Vuidaddrprobe;
VUIDSADR The argument is a pointer to a Vuidaddrprobe
structure. VUIDSADR sets the virtual input
device segment address indicated by base to
next.
If base does not equal VKEYFIRST, ENODEV is returned.
VUIDGADR The argument is a pointer to a Vuidaddrprobe
structure. Return the address of the virtual
input device segment indicated by base to
current.
If base does not equal VKEYFIRST, ENODEV is returned.
VUIDGWHELCOUNT
This ioctl takes a pointer to an integer as argument and
sets the value of the integer to the number of wheels
available on this device. This ioctl returns 1 if
wheel(s) are present and zero if no wheels are present.
VUIDGWHELINFO
This command returns static information about the wheel
that does not change while a device is in use.
Currently the only information defined is the wheel
orientation which is either VUIDWHELFORMATVERTICAL
or VUIDWHELFORMATHORIZONTAL. If the module cannot
distinguish the orientation of the wheel or the wheel is
of some other format, the format is set to
VUIDWHELFORMATUNKNOWN.
typedef struct {
int vers;
int id;
int format;
} wheelinfo;
SunOS 5.11 Last change: 1 Dec 2005 2
STREAMS Modules usbms(7M)
The ioctl takes a pointer to "wheelinfo" structure
with the "vers" set to the current version of the
"wheelinfo" structure and "id" set to the id of the
wheel for which the information is desired.
VUIDSWHELSTATE/VUIDGWHELSTATE
VUIDSWHELSTATE sets the state of the wheel to that
specified in the stateflags. VUIDGWHELSTATE returns the
current state settings in the stateflags field.
stateflags is an OR'ed set of flag bits. The only
flag currently defined is VUIDWHELSTATENABLED.
When stateflags is set to VUIDWHELSTATENABLED the
module converts motion of the specified wheel into VUID
events and sends those up stream.
Wheel events are enabled by default.
Applications that want to change the stateflags should
first get the current stateflags and then change only
the bit they want.
typedef struct {
int vers;
int id;
uint32t stateflags;
} wheelstate;
These ioctls take a pointer to "wheelstate" as an argu-
ment with the "vers" and "id" members filled in. These
members have the same meaning as that for 'VUIDGWHEL
INFO' ioctl.
ioctl() requests for changing and retrieving mouse parame-
ters use the Msparms structure:
typedef struct {
int jitterthresh;
int speedlaw;
int speedlimit;
} Msparms;
jitterthresh is the "jitter threshold" of the mouse.
Motions fewer than jitterthresh units along both axes are
accumulated and then sent up the stream after 1/12 second.
SunOS 5.11 Last change: 1 Dec 2005 3
STREAMS Modules usbms(7M)
speedlaw indicates whether extremely large motions are to
be ignored. If it is 1, a "speed limit" is applied to mouse
motions. Motions along either axis of more than speedlimit
units are discarded.
MSIOGETPARMS The argument is a pointer to a Msparams
structure. The usbms module parameters
are returned in the structure.
MSIOSETPARMS The argument is a pointer to a Msparams
structure. The usbms module parameters
are set according to the values in the
structure.
MSIOSRESOLUTION Used by the absolute mouse to get the
current screen resolution. The parameter
is a pointer to the Msscreenresolution
structure:
int height; /* height of the screen */
int width; /* width of the screen */
}Msscreenresolution;
The usbms module parameters are set
according to the values in the structure
and used to calculate the correct coordi-
nates.
FILES
/kernel/strmod/usbms
32-bit ELF kernel STREAMS module (x86 platform only.)
/kernel/strmod/sparcv9/usbms
SPARC 64-bit ELF kernel STREAMS module
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
SunOS 5.11 Last change: 1 Dec 2005 4
STREAMS Modules usbms(7M)
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture PCI-based systems
Availability SUNWusb
SEE ALSO
ioctl(2), attributes(5), hid(7D), virtualkm(7D), usba(7D)
System Administration Guide: Basic Administration
http:/www/sun.com/io
DIAGNOSTICS
The following messages may be logged into the system log.
They are formatted in the following manner:
): message...
Invalid Hid descriptor tree. Set to default value (3 but-
tons).
The mouse supplied incorrect information in its HID
report.
Mouse buffer flushed when overrun.
Mouse data was lost.
SunOS 5.11 Last change: 1 Dec 2005 5
|