| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
partly from Alessandro Ricci
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
ok visa@
|
|
|
|
|
|
| |
for example, with locking assertions.
OK mpi@, anton@
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
ok bluhm@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
ok millert@ krw@
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
| |
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
|
|
|
|
| |
ok deraadt@
|
|
|
|
|
|
| |
way.
ok natano@
|
|
|
|
|
|
| |
Nothing uses it.
suggested by and ok mpi@
|
| |
|
|
|
|
|
|
|
|
|
| |
These files aren't USB-specific and were used by the previous
Bluetooth implementation, and will be used by the upcoming
HID-over-i2C implementation
ok deraadt
previous version ok kettenis and mpi
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
|
| |
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Always pass the parent uhidev(4) descriptor corresponding to the single
USB device with multiple reportIDs instead of a child.
Make uhidev_get_report() aware of non NUL reportID by prepending a byte
to the given buffer, just like uhidev_set_report{,async}() already do.
Return the number of bytes written or read upon success and -1 otherwise.
This allow callers to deal with short reads without having do mess with
xfer error codes madness.
Reviewed and tested by David Higgs.
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
|
| |
instead of using the default, per-driver, one. This is a step to move
away from the 1 report ID <-> 1 driver design which is no longer true
since the addition of upd(4).
ok andre@
|
|
|
|
|
|
|
| |
a device. This should be removed once all the drivers attaching to
uhidev(4) are converted.
ok andre@, sthen@
|
|
|
|
|
|
| |
Allows us to move forward on cleaning.
Okay mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This set of drivers were very very dirty.
i/ Clean-up the match/attach multi-casting hackjob
- stop casting aux to every attach arg in existance
- be consistent about casting it only to uhidev_attach_arg
- fetch the usb_attach_arg from above where needed
ii/ Sort out the activate routines
- leave the deactivation to the parent (uhidev(4))
- ditch the sc_dying flag in favour of usbd_is_dying()
iii/ Get closer to keeping all the usb hid information in the uhidev
structure (one uhidev per reportID)
- store the usbd_device in the uhidev
- use it consistently instead of always peaking at the parent's
soft state
Okay mpi@
|
|
|
|
|
|
|
|
| |
that's ever used it, and it's long since been changed to use
DVACT_{QUIESCE,SUSPEND,RESUME} instead.
ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it
up a few weeks ago
|
|
|
|
|
|
| |
the obvious cases to return EINVAL and ENXIO.
ok tedu deraadt
|
|
|
|
|
|
| |
them from userland, and nothing in the kernel uses them.
ok krw@, miod@
|
|
|
|
|
|
| |
The dying flag will be set in activate()/DEACTIVATE.
ok deraadt@
|
|
|
|
|
|
|
| |
USB_SET_REPORT ioctls in ukbd and ums.
This allows usbhidctl to be used on these devices e.g. to dump the report
descriptor of troublesome models.
ok deraadt@
|
|
|
|
|
|
|
|
|
| |
so that the process-level stuff is to/from struct process and not
struct proc. This fixes a bunch of problem cases in rthreads.
Based on earlier work by blambert and myself, but mostly written
at c2k10.
Tested by many: deraadt, sthen, krw, ray, and in snapshots
|
|
|
|
| |
ok jsg@ deraadt@
|
|
|
|
|
|
|
|
|
|
| |
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).
Based on a diff from tedu.
ok deraadt
|
|
|
|
|
|
|
| |
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.
|
|
|
|
|
|
| |
This is needed for the addition of further suspend/resume actions.
Okay deraadt@, marco@.
|
|
|
|
|
|
|
|
| |
Change to void function.
Also, no need to have global tty stats pointer, so just return it
from clalloc, as the caller frees it immediately anyway.
ok miod@
|
|
|
|
|
|
|
|
|
| |
Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.
OK deraadt@
|
|
|
|
|
|
|
|
| |
USB_DECLARE_DRIVER macros.
No binary change.
ok dlg.
|
|
|
|
|
|
| |
No binary change.
ok mk.
|
|
|
|
|
|
|
|
| |
only.
No binary change.
ok mk.
|
|
|
|
|
|
|
|
| |
ulpt.c, I am aware of that and it will be changed later.
No binary change.
ok mk.
|
|
|
|
| |
ok mk.
|
|
|
|
|
|
|
| |
(which was there twice without gcc complaining) and update all uses of
it.
ok jsg mbalmer
|
|
|
|
|
|
|
|
| |
and the address of it's argument: USBDEV(sc->sc_dev) yields &sc->sc_dev.
No binary changes.
ok jsg.
|
|
|
|
|
|
|
| |
and it was not consistently used. It was confusing as it suggested these
functions were static, which they were not.
discussed with dlg and jsg, ok jsg.
|