1usbms(7M)                       STREAMS Modules                      usbms(7M)
2
3
4

NAME

6       usbms - USB mouse STREAMS module
7

SYNOPSIS

9       #include <sys/vuid_event.h>
10
11
12       #include <sys/vuid_wheel.h>
13
14
15       #include <sys/msio.h>
16
17
18       #include <sys/msreg.h>
19
20

DESCRIPTION

22       The   usbms  STREAMS  module  processes byte streams generated by a USB
23       mouse.  A  USB mouse is a member of the Human  Interface  Device  (HID)
24       class  and  the   usbms  module  supports  only the mouse boot protocol
25       defined in the HID specification.
26
27
28       The usbms module must be pushed on top of the  HID  class  driver  (see
29       hid(7D)).  In  the   VUID_FIRM_EVENT  mode, the usbms module translates
30       packets from the USB mouse into Firm events. The Firm  event  structure
31       is  defined  in  <sys/vuid_event.h>.  The  STREAMS module state is ini‐
32       tially set to raw or VUID_NATIVE mode which performs  no  message  pro‐
33       cessing. See the  HID 1.0 specification for the raw format of the mouse
34       packets. To initiate mouse protocol conversion to Firm  events,  change
35       the state to VUID_FIRM_EVENT.
36
37
38       When the usb mouse is opened or hot plugged in, the MOUSE_TYPE_ABSOLUTE
39       event (Firm event) is sent to the upper level to notify the VUID appli‐
40       cation that it is the absolute mouse.
41

IOCTLS

43       VUIDGFORMAT     This  option  returns the current state of the  STREAMS
44                       module. The state of the usbms STREAMS  module  may  be
45                       either   VUID_NATIVE   (no   message   processing)   or
46                       VUID_FIRM_EVENT (convert to Firm events).
47
48
49       VUIDSFORMAT     The argument is a pointer to an int. Set the  state  of
50                       the   STREAMS module to the int pointed to by the argu‐
51                       ment.
52
53
54         typedef struct  vuid_addr_probe {
55              short base; /* default vuid device addr directed too */
56              union {
57                     short next;   /* next addr for default when VUIDSADDR */
58                     short current; /* current addr of default when VUIDGADDR */
59              } data;
60         } Vuid_addr_probe;
61
62
63       VUIDSADDR     The argument is a pointer to a Vuid_addr_probe structure.
64                     VUIDSADDR  sets  the virtual input device segment address
65                     indicated by base to next.
66
67
68
69       If base does not equal VKEY_FIRST,  ENODEV is returned.
70
71       VUIDGADDR     The argument is a pointer to a Vuid_addr_probe structure.
72                     Return  the  address  of the virtual input device segment
73                     indicated by base to current.
74
75
76
77       If base does not equal VKEY_FIRST, ENODEV is returned.
78
79       VUIDGWHEELCOUNT
80
81           This ioctl takes a pointer to an integer as argument and  sets  the
82           value  of  the  integer  to  the number of wheels available on this
83           device. This ioctl returns 1 if wheel(s) are present and zero if no
84           wheels are present.
85
86
87       VUIDGWHEELINFO
88
89           This  command  returns static information about the wheel that does
90           not  change while a device is in use. Currently the  only  informa‐
91           tion    defined    is   the   wheel  orientation  which  is  either
92           VUID_WHEEL_FORMAT_VERTICAL or VUID_WHEEL_FORMAT_HORIZONTAL. If  the
93           module cannot distinguish the orientation of the wheel or the wheel
94           is of some other format,  the  format  is  set  to  VUID_WHEEL_FOR‐
95           MAT_UNKNOWN.
96
97                typedef struct {
98                        int     vers;
99                        int     id;
100                        int     format;
101                } wheel_info;
102
103           The   ioctl   takes  a  pointer  to "wheel_info" structure with the
104           "vers" set to the current version of the "wheel_info" structure and
105           "id"  set  to  the  id  of  the  wheel for which the information is
106           desired.
107
108
109       VUIDSWHEELSTATE/VUIDGWHEELSTATE
110
111           VUIDSWHEELSTATE sets the state of the wheel to  that  specified  in
112           the  stateflags. VUIDGWHEELSTATE returns the current state settings
113           in the stateflags field.
114
115           stateflags is an  OR'ed  set of  flag  bits.  The  only  flag  cur‐
116           rently defined is VUID_WHEEL_STATE_ENABLED.
117
118           When  stateflags is set to VUID_WHEEL_STATE_ENABLED the module con‐
119           verts motion of the specified wheel  into  VUID  events  and  sends
120           those up stream.
121
122           Wheel events are enabled by default.
123
124           Applications  that  want  to change the stateflags should first get
125           the current stateflags and then change only the bit they want.
126
127                typedef struct {
128                        int            vers;
129                        int            id;
130                        uint32_t       stateflags;
131                } wheel_state;
132
133           These ioctls take a pointer to "wheel_state" as  an  argument  with
134           the  "vers" and "id" members filled in. These members have the same
135           meaning as that for 'VUIDGWHEEL INFO' ioctl.
136
137
138
139       ioctl() requests for changing and retrieving mouse parameters  use  the
140       Ms_parms structure:
141
142            typedef struct {
143                 int     jitter_thresh;
144                 int     speed_law;
145                 int     speed_limit;
146            } Ms_parms;
147
148
149
150       jitter_thresh  is  the  "jitter threshold" of the mouse.  Motions fewer
151       than jitter_thresh units along both axes are accumulated and then  sent
152       up the stream after 1/12 second.
153
154
155       speed_law  indicates whether extremely large motions are to be ignored.
156       If it is 1, a "speed limit" is applied to mouse motions.  Motions along
157       either axis of more than speed_limit units are discarded.
158
159       MSIOGETPARMS       The  argument is a pointer to a Ms_params structure.
160                          The usbms module  parameters  are  returned  in  the
161                          structure.
162
163
164       MSIOSETPARMS       The  argument is a pointer to a Ms_params structure.
165                          The usbms module parameters are set according to the
166                          values in the structure.
167
168
169       MSIOSRESOLUTION    Used  by  the  absolute  mouse  to  get the  current
170                          screen resolution. The parameter is a pointer to the
171                          Ms_screen_resolution structure:
172
173                            int    height;         /* height of the screen */
174                            int    width;         /* width of the screen */
175                            }Ms_screen_resolution;
176
177                          The usbms module parameters are set according to the
178                          values in the structure and used  to  calculate  the
179                          correct coordinates.
180
181

FILES

183       /kernel/strmod/usbms
184
185           32-bit ELF kernel STREAMS module (x86 platform only.)
186
187
188       /kernel/strmod/sparcv9/usbms
189
190           SPARC 64-bit ELF kernel STREAMS module
191
192

ATTRIBUTES

194       See attributes(5) for a description of the following attributes:
195
196
197
198
199       ┌─────────────────────────────┬─────────────────────────────┐
200       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
201       ├─────────────────────────────┼─────────────────────────────┤
202       │Architecture                 │PCI-based  systems           │
203       ├─────────────────────────────┼─────────────────────────────┤
204       │Availability                 │SUNWusb                      │
205       └─────────────────────────────┴─────────────────────────────┘
206

SEE ALSO

208       ioctl(2), attributes(5), hid(7D), virtualkm(7D), usba(7D)
209
210
211       System Administration Guide: Basic Administration
212
213
214       http://www/sun.com/io
215

DIAGNOSTICS

217       The following messages may be logged into the system log. They are for‐
218       matted in the following manner:
219
220         <device path><usbms<instance number>): message...
221
222
223
224       Invalid Hid descriptor tree. Set to default value (3 buttons).
225
226           The mouse supplied incorrect information in its HID report.
227
228
229       Mouse buffer flushed when overrun.
230
231           Mouse data was lost.
232
233
234
235
236SunOS 5.11                        1 Dec 2005                         usbms(7M)
Impressum