aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2026-04-12 18:09:23 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2026-04-12 18:09:23 +0000
commit817e6995a19cb6f35851d0191bb1099a73d98bb9 (patch)
treedbceb5dfb0aecc0d5073a57d8bc4adf2098a41c3
parentdc5a94962e21a267550a2c20a0c4707d06843942 (diff)
wsp(4): Make evdev interface operational if sysmouse one is not opened
Before this change evdev interface sent only copy of data sent through the sysmouse interface. It worked as /dev/wsp0 device node was automatcaly opened by devd(8) with starting of moused(8). Starting with 15.0 moused(8) does not open sysmouse interface by default thus making wsp(4) device dysfunctional. Fix it with adding extra checks of interfaces state. MFC after: 1 week
-rw-r--r--sys/dev/usb/input/wsp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c
index a78fac49491a..2d7e3b796b17 100644
--- a/sys/dev/usb/input/wsp.c
+++ b/sys/dev/usb/input/wsp.c
@@ -1068,6 +1068,10 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error)
if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) {
evdev_push_key(sc->sc_evdev, BTN_LEFT, ibt);
evdev_sync(sc->sc_evdev);
+ if ((sc->sc_fflags & FREAD) == 0 ||
+ usb_fifo_put_bytes_max(
+ sc->sc_fifo.fp[USB_FIFO_RX]) == 0)
+ goto tr_setup;
}
#endif
sc->sc_status.flags &= ~MOUSE_POSCHANGED;
@@ -1357,7 +1361,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error)
case USB_ST_SETUP:
tr_setup:
/* check if we can put more data into the FIFO */
- if (usb_fifo_put_bytes_max(
+ if (
+#ifdef EVDEV_SUPPORT
+ ((evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) != 0 &&
+ (sc->sc_state & WSP_EVDEV_OPENED) != 0) ||
+#endif
+ usb_fifo_put_bytes_max(
sc->sc_fifo.fp[USB_FIFO_RX]) != 0) {
usbd_xfer_set_frame_len(xfer, 0,
sc->tp_datalen);