void
wsmouse_input(
struct device *msdev
, u_int btns
, int x
, int y
, int z
, int w
, u_int flags
)
int
wsmousedevprint(
void *aux
, const char *pnp
)
struct
wsmouse_accessops
int (*enable)(void *);
int (*ioctl)(void *v, u_long cmd, void *data,
int flag, struct lwp *l);
void (*disable)(void *);
The
enable
member defines the function to be called to enable monitoring pointer
movements and passing these events to
wscons.
The
disable
member defines the function to disable movement events.
The
ioctl
member defines the function to be called to perform mouse-specific
ioctl calls.
There is a
void
*
cookie provided by the mouse driver associated with these functions,
which is passed to them when they are invoked.
struct
wsmousedev_attach_args
const struct wsmouse_accessops *accessops;
void *accesscookie;
msdev
, btns
, x
, y
, z
, w
, flags
)
msdev
struct
device
pointer passed from
config_found(
)
on attaching the child
wsmouse(4)
to specify the mouse device.
btns
WSCONS_EVENT_MOUSE_DOWN
event on
wsmouse(4)
device) should be set, and bits for released buttons (which will cause the
WSCONS_EVENT_MOUSE_UP
event) should be zero.
The left most button state should be in LSB,
i.e. for typical three button mouse,
the left button is 0x01,
the middle button is 0x02,
and the right button is 0x04.
x
y
z
w
flags
x
,
y
,
z
,
and
w
axes is in relative or absolute mode.
Valid values for
flags
are:
x
axis.
y
axis.
z
axis.
w
axis.
aux
, pnp
)
).
(see
autoconf(9)).
wsmousedev_attach_args
structure with the supported operations and callbacks and call
config_found(
)
to perform the attach (see
autoconf(9)).
).
The wscons framework calls back into the hardware driver by invoking
the functions that are specified in the
accessops
structure.
The
enable()
and
disable(
)
functions are relatively simple and self-explanatory.
The
ioctl(
)
function is called by the wscons interface to perform
mouse-specific ioctl operations (see
ioctl(2)).
The argument
cmd
to the
ioctl()
function specifies the specific command to perform using the data
data
.
Valid commands are listed in
sys/dev/wscons/wsconsio.h
.
/usr/src
.
The wscons subsystem is implemented within the directory
sys/dev/wscons
.
The
wsmouse
module itself is implement within the file
sys/dev/wscons/wsmouse.c
.
ioctl(2)
operations are listed in
sys/dev/wscons/wsconsio.h
.