Index | Thread | Search

From:
Thomas Frohwein <tfrohwein@fastmail.com>
Subject:
Re: Adding rumble/force feedback control to ujoy(4)
To:
Matthieu Herrb <matthieu@herrb.eu>
Cc:
tech@openbsd.org
Date:
Fri, 22 Nov 2024 19:38:06 -0500

Download raw body.

Thread
On Wed, 20 Nov 2024 21:52:03 +0100
Matthieu Herrb <matthieu@herrb.eu> wrote:

> > +
> > +#define UJOYIO_RUMBLE	_IOW('J', 7, struct ujoy_rumble)
> > +  
> 
> Doesn't the '_IOW()' here mean that you need write access to
> /dev/ujoy/<n> to use that ioctl() ?

While a little out of my depth, I've had some discussions and based on
that and also [1], the choice of _IO{W,R,WR}() depends on if a struct
is sent (written) to the kernel and/or read.

The filesystem permissions for /dev/ujoy//<n> are for open(2) calls,
but ioctl(2) is different. For what it's worth the implementation in my
diff works fine without any write access, which appears to prove this..

> 
> Also, even though I'm partly responsible for the current situation as
> porter of the now defunct ISA joy(4) driver
> (https://man.openbsd.org/OpenBSD-3.0/i386/joy),  I think one should
> think about plugging it into wsmouse(4) (adding a
> WSMOUSE_TYPE_JOYSTICK to let applications make the difference). IT
> will make supporting them in libinput-openbsd easier.

This would seem to me like a large project, and how much need is there
for joystick devices as part of wsmouse? The joystick/gamepad uses that
I'm aware of are 99% via sdl/sdl2 and that doesn't have problems with
using working via /dev/joy or /dev/ujoy...

Also that's not specific to the question of enabling the rumble/force
feedback support for the ujoy(4) device that we already have, right?

[1] https://man.bsd.lv/DragonFly-5.6.1/man9/_IOWR.9