#
b9ae17a0 |
| 30-Dec-2024 |
guenther <guenther@openbsd.org> |
All the device and file type ioctl routines just ignore FIONBIO, so stop calling down into those layer from fcntl(F_SETFL) or ioctl(FIONBIO) and delete the "do nothing for this" stubs in all the *ioc
All the device and file type ioctl routines just ignore FIONBIO, so stop calling down into those layer from fcntl(F_SETFL) or ioctl(FIONBIO) and delete the "do nothing for this" stubs in all the *ioctl routines.
ok dlg@
show more ...
|
#
81508fe3 |
| 23-May-2024 |
jsg <jsg@openbsd.org> |
remove unneeded includes; ok mpi@
|
#
e165ecb1 |
| 20-Apr-2023 |
brynet <brynet@openbsd.org> |
Move ring buffer allocation to before calling uhidev_open(), otherwise it might be NULL in uhid_intr.
fixes "b_to_q: tty has no clist" panic hit by namn@
tested by thfr@ and namn@
ok anton@
|
#
1525749f |
| 02-Jul-2022 |
visa <visa@openbsd.org> |
Remove unused device poll functions.
Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.
Some addenda from jsg@.
OK miod@ mpi@
|
#
faac88c0 |
| 15-Nov-2021 |
anton <anton@openbsd.org> |
In preparation for once again trying the resolve the claim multiple report ids conflict, extract the claim multiple report ids conditional in order to minimize the required upcoming changes to resolv
In preparation for once again trying the resolve the claim multiple report ids conflict, extract the claim multiple report ids conditional in order to minimize the required upcoming changes to resolve the conflict.
Tested by gnezdo@
show more ...
|
#
09ed7d4e |
| 15-Sep-2021 |
anton <anton@openbsd.org> |
Change the errno to ENOTTY when encountering an unknown ioctl command as opposed of using EINVAL which is ambiguous in this context.
ok deraadt@
|
#
6cdbbe9b |
| 12-Sep-2021 |
anton <anton@openbsd.org> |
Revert recent uhidev report size changes. It's reported to break fido devices for as of now unknown reasons.
|
#
adb06565 |
| 10-Sep-2021 |
anton <anton@openbsd.org> |
Instead of letting uhidev drivers get the report sizes, do it once in uhidev and pass the same sizes as part of the attach arguments. Makes the uhidev drivers a bit less repetitive.
It might look te
Instead of letting uhidev drivers get the report sizes, do it once in uhidev and pass the same sizes as part of the attach arguments. Makes the uhidev drivers a bit less repetitive.
It might look tempting to let uhidev assign the sizes after a driver has attached, removing the need to repeat this logic in each driver. This does however not work since the input size must be known while calling uhidev_open() in order to open the interrupt pipe; and uhidev_open() is called from several attach routines.
Note that this change only works and applies to when attaching to a single report ID.
ok jcs@
show more ...
|
#
f31b43ce |
| 08-Mar-2021 |
jcs <jcs@openbsd.org> |
Allow uhidev child devices to claim selective report ids
There may be multiple matching devices on a single uhidev device but the first device that responds to UHIDEV_CLAIM_ALLREPORTID will block th
Allow uhidev child devices to claim selective report ids
There may be multiple matching devices on a single uhidev device but the first device that responds to UHIDEV_CLAIM_ALLREPORTID will block the others from attaching.
Change this to UHIDEV_CLAIM_MULTIPLE_REPORTID and require any devices wanting some/all report ids to fill in the claimed array in uhidev_attach_arg with just the reports it needs. uhidev can then run match routines for other drivers with the available report ids.
ok anton
show more ...
|
#
a007768d |
| 29-Jan-2021 |
sthen <sthen@openbsd.org> |
update some usb.org URLs following reorganisation, add a new one for upd partly from Alessandro Ricci
|
#
1d44892e |
| 23-Jan-2021 |
thfr <thfr@openbsd.org> |
introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers. This includes ujoy_hid_is_collection() to work around limitations of hid_is_collection() until this can be combined without fall
introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers. This includes ujoy_hid_is_collection() to work around limitations of hid_is_collection() until this can be combined without fallout.
input, testing with 8bitdo controller, and ok brynet@ PS4 controller testing, fix for hid_is_collection, and ok mglocker@
show more ...
|
#
9b0cf67b |
| 25-Dec-2020 |
visa <visa@openbsd.org> |
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remai
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification.
OK mpi@
show more ...
|
#
a9ad0377 |
| 13-May-2020 |
mpi <mpi@openbsd.org> |
Use seltrue_kqfilter() instead of hand-rolling it in multiple drivers.
ok visa@
|
#
9c969c9a |
| 07-Apr-2020 |
visa <visa@openbsd.org> |
Abstract the head of knote lists. This allows extending the lists, for example, with locking assertions.
OK mpi@, anton@
|
#
494e3bdd |
| 03-Apr-2020 |
mpi <mpi@openbsd.org> |
Fix incoherencies of errors returned by various *kqfilter routines.
EOPNOTSUPP is returned when there's no "filterops" for a given fd. EINVAL when the requested filter isn't supported by the "filte
Fix incoherencies of errors returned by various *kqfilter routines.
EOPNOTSUPP is returned when there's no "filterops" for a given fd. EINVAL when the requested filter isn't supported by the "filterops". ENXIO means the underlying device is no longer valid/present.
ok visa@
show more ...
|
#
b8213689 |
| 20-Feb-2020 |
visa <visa@openbsd.org> |
Replace field f_isfd with field f_flags in struct filterops to allow adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
#
8afab49b |
| 18-Jan-2020 |
visa <visa@openbsd.org> |
Invalidate knote list of uhid(4) after device detach. This prevents a crash that can happen if a uhid(4) device is detached while kqueue still holds references to knotes that point to the device.
Th
Invalidate knote list of uhid(4) after device detach. This prevents a crash that can happen if a uhid(4) device is detached while kqueue still holds references to knotes that point to the device.
The invalidation has to be done after vdevgone(). This order ensures that the file descriptors return an error or EOF when kevent(2) returns the EOF events.
Crash reported and fix tested by Greg Steuck OK mpi@
show more ...
|
#
94321eb4 |
| 31-Dec-2019 |
visa <visa@openbsd.org> |
Use C99 designated initializers with struct filterops. In addition, make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
|
#
96f776b3 |
| 19-Dec-2019 |
reyk <reyk@openbsd.org> |
poll handlers must return a poll(2) revents value, not errno(2) values.
Some drivers have returned ENXIO (6) if the device is not available which incorrectly translates into POLLPRI|POLLOUT (2|4) in
poll handlers must return a poll(2) revents value, not errno(2) values.
Some drivers have returned ENXIO (6) if the device is not available which incorrectly translates into POLLPRI|POLLOUT (2|4) in userland.
Change it to POLLERR for now, but it might as well be POLLHUP.
OK mpi@
show more ...
|
#
1ba9f8e2 |
| 17-Dec-2019 |
reyk <reyk@openbsd.org> |
Add fido(4), a HID driver for FIDO/U2F security keys
While FIDO/U2F keys were already supported by the generic uhid(4) driver, this driver adds the first step to tighten the security of FIDO/U2F acc
Add fido(4), a HID driver for FIDO/U2F security keys
While FIDO/U2F keys were already supported by the generic uhid(4) driver, this driver adds the first step to tighten the security of FIDO/U2F access. Specifically, users don't need read/write access to all USB/HID devices anymore and the driver also improves integration with pledge(2) and unveil(2): It is pledge-friendly because it doesn't require any ioctls to discover the device and unveil-friendly because it uses a single /dev/fido/* directory for its device nodes.
It also allows to support FIDO/U2F in firefox without further weakening the "sandbox" of the browser. Firefox does not have a proper privsep design and many operations, such as U2F access, are handled directly by the main process. This means that the browser's "fat" main process needs direct read/write access to all USB HID devices, at least on other operating systems. With fido(4) we can support security keys in Firefox under OpenBSD without such a compromise.
With this change, libfido2 stops using the ioctl to query the device vendor/product and just assumes "OpenBSD" "fido(4)" instead. The ioctl is still supported but there was no benefit in obtaining the vendor product or name; it also allows to use libfido2 under pledge.
With feedback from deraadt@ and many others OK kettenis@ djm@ and jmc@ for the manpage bits
show more ...
|
#
a2ef69b7 |
| 27-Nov-2019 |
mpi <mpi@openbsd.org> |
Convert infinite sleeps to tsleep_nsec(9).
ok bluhm@
|
#
39369402 |
| 01-May-2018 |
landry <landry@openbsd.org> |
Simplify/refactor the way vendor/product/serial informations are gathered from usb devices.
Cache them early in usbd_new_device() instead of querying the device several times (the content wont chang
Simplify/refactor the way vendor/product/serial informations are gathered from usb devices.
Cache them early in usbd_new_device() instead of querying the device several times (the content wont change anyway) and uselessly generating usb traffic (which could conflict with other access..)
The heuristic stays the same, first look in the device descriptor, then try to match against usb_known_vendors/usb_known_products, then fallback to use the idVendor/idProduct codes.
Remove the now useless 'usedev' parameter from usbd_fill_deviceinfo().
Tested from bsd & bsd.rd.
suggested by and ok mpi@
show more ...
|
#
98edb555 |
| 30-Dec-2017 |
guenther <guenther@openbsd.org> |
Delete unnecessary <sys/file.h> includes
ok millert@ krw@
|
#
bbdb0ce0 |
| 23-Sep-2017 |
mpi <mpi@openbsd.org> |
Add dummy FIOASYNC handler.
Without it uhid_do_ioctl() will return EINVAL which will make the upper layer assume that uhid node do not support non-blocking reads.
Fix a regression introduced by the
Add dummy FIOASYNC handler.
Without it uhid_do_ioctl() will return EINVAL which will make the upper layer assume that uhid node do not support non-blocking reads.
Fix a regression introduced by the removal of SIGIO support.
Reported by many, fix tested by Bryan Linton, Micah Muer and Nam Nguyen.
show more ...
|
#
5dab5ed0 |
| 20-Jul-2017 |
mpi <mpi@openbsd.org> |
Remove SIGIO support. Base tools do not implement it and ports relying on libusbhid, generally via SDL, shouldn't do it either since it's not portable.
Suggested by deraadt@ after Ilja van Sprundel
Remove SIGIO support. Base tools do not implement it and ports relying on libusbhid, generally via SDL, shouldn't do it either since it's not portable.
Suggested by deraadt@ after Ilja van Sprundel reported an issue with a stale struct proc pointer in similar code.
ok kettenis@, deraadt@
show more ...
|