p The .Fa enable member defines the function to be called to enable monitoring pointer movements and passing these events to wscons. The .Fa disable member defines the function to disable movement events. The .Fa ioctl member defines the function to be called to perform mouse-specific ioctl calls.
p There is a .Fa void * cookie provided by the mouse driver associated with these functions, which is passed to them when they are invoked. t Fa struct wsmouse_attach_args A structure used to attach the .Xr wsmouse 4 child device. It has the following members: d -literal const struct wsmouse_accessops *accessops; void *accesscookie; .Ed .El .Sh FUNCTIONS l -tag -width compact t Fn wsmouse_input "msdev" "btns" "x" "y" "z" "flags" Callback from the mouse driver to the wsmouse interface driver. The argument .Fa btns specifies the current button configuration. The pointer coordinate is specified by the .Fa x , .Fa y , .Fa z tuple. The .Fa flags argument specify whether the pointer device and the measurement is in relative or absolute mode. Valid values for .Fa flags are: l -tag -width compact t WSMOUSE_INPUT_DELTA Relative mode. t WSMOUSE_INPUT_ABSOLUTE_X Obsolute mode in x-direction. t WSMOUSE_INPUT_ABSOLUTE_Y Obsolute mode in y-direction. t WSMOUSE_INPUT_ABSOLUTE_Z Obsolute mode in z-direction. .El t Fn wsmousedevprint "aux" "pnp" The default wsmouse printing routine used by .Fn config_found . (see .Xr autoconf 9 ) . .El .Sh AUTOCONFIGURATION Mouse drivers which want to utilise the wsmouse module must be a parent to the .Xr wsmouse 4 device and provide an attachment interface. To attach the .Xr wsmouse 4 device, the mouse driver must allocate and populate a .Fa wsmouse_attach_args structure with the supported operations and callbacks and call .Fn config_found to perform the attach (see .Xr autoconf 9 ) . .Sh OPERATION When a mouse-movement event is received, the device driver must perform any necessary movement decoding to wscons events and pass the events to wscons via .Fn wsmouse_input .
p The wscons framework calls back into the hardware driver by invoking the functions that are specified in the .Em accessops structure. The .Fn enable and .Fn disable functions are relatively simple and self-explanatory. The .Fn ioctl function is called by the wscons interface to perform mouse-specific ioctl operations (see .Xr ioctl 2 ) . The argument .Fa cmd to the .Fn ioctl function specifies the specific command to perform using the data .Fa data . Valid commands are listed in
a sys/dev/wscons/wsconsio.h . .Sh CODE REFERENCES This section describes places within the .Nx source tree where actual code implementing or utilising the machine-independent wscons subsystem can be found. All pathnames are relative to
p The wscons subsystem is implemented within the directory
a sys/dev/wscons . The .Nm module itself is implement within the file
a sys/dev/wscons/wsmouse.c . .Xr ioctl 2 operations are listed in
a sys/dev/wscons/wsconsio.h . .Sh SEE ALSO .Xr ioctl 2 , .Xr autoconf 9 , .Xr driver 9 , .Xr intro 9 , .Xr wsdisplay 9 , .Xr wskbd 9