summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Simplify/refactor the way vendor/product/serial informations arelandry2018-05-011-2/+2
| | | | | | | | | | | | | | | | | | 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@
* Delete unnecessary <sys/file.h> includesguenther2017-12-301-2/+1
| | | | ok millert@ krw@
* Add dummy FIOASYNC handler.mpi2017-09-231-1/+2
| | | | | | | | | 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.
* Remove SIGIO support. Base tools do not implement it and ports relyingmpi2017-07-201-26/+1
| | | | | | | | | | 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@
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-2/+2
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* Kill unused ioctl(2)s.mpi2016-05-241-14/+2
| | | | ok deraadt@
* Convert uiomovei to uiomove. Fixes a few integer truncations along thestefan2016-03-031-5/+5
| | | | | | way. ok natano@
* Remove USB_SET_IMMED ioctl and corresponding code and manpage bits.stefan2016-02-281-24/+1
| | | | | | Nothing uses it. suggested by and ok mpi@
* revert manual additions of hid.h now that usbhid.h brings it injcs2016-01-091-3/+1
|
* Move HID support files out of dev/usb into new dev/hid directoryjcs2016-01-081-2/+3
| | | | | | | | | 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
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* First step towards making uiomove() take a size_t size argument:miod2015-02-101-4/+4
| | | | | | | - 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@
* Change uhidev(4) set/get report functions in various way.mpi2014-12-111-20/+12
| | | | | | | | | | | | | | 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.
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* Modify the uhidev_*_report() methods to always take a report ID argumentmpi2014-04-151-4/+6
| | | | | | | | 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@
* Add a temporary hack to let a subdriver claim all the reportIDs ofmpi2014-03-191-5/+4
| | | | | | | a device. This should be removed once all the drivers attaching to uhidev(4) are converted. ok andre@, sthen@
* Kill matchlvl usage throughout the usb stack.pirofti2013-11-191-3/+3
| | | | | | Allows us to move forward on cleaning. Okay mpi@
* Clean-up the HID environment.pirofti2013-11-151-29/+12
| | | | | | | | | | | | | | | | | | | | | 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@
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-4/+1
| | | | | | | | 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
* kqueue attach functions should return an errno or 0, not a plain 1. Fixnicm2011-07-021-2/+2
| | | | | | the obvious cases to return EINVAL and ENXIO. ok tedu deraadt
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-7/+1
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* remove dying flag in detach() function.yuo2010-09-241-3/+1
| | | | | | The dying flag will be set in activate()/DEACTIVATE. ok deraadt@
* Handle USB_GET_REPORT, USB_GET_REPORT_DESC, USB_GET_REPORT_ID andmiod2010-08-021-75/+19
| | | | | | | 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@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-8/+8
| | | | | | | | | 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
* add USB_GET_DEVICEINFO and USB_GET_STRING_DESC ioctl to the uhid(4).yuo2009-11-231-1/+17
| | | | ok jsg@ deraadt@
* Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tnicm2009-11-091-2/+1
| | | | | | | | | | 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
* Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()deraadt2009-10-311-1/+2
| | | | | | | 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.
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-3/+3
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* clalloc() can't fail, so there's no need to handle failure cases.blambert2009-07-191-5/+3
| | | | | | | | 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@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | 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@
* Remove the definition and usage of the USB_DECLARE_DRIVER_CLASS andmbalmer2007-06-141-2/+17
| | | | | | | | USB_DECLARE_DRIVER macros. No binary change. ok dlg.
* Remove the definition and use of the device_ptr_t which was a struct device *.mbalmer2007-06-121-2/+2
| | | | | | No binary change. ok mk.
* Remove the usb_proc_ptr type definition, which was really a 'struct proc *'mbalmer2007-06-111-8/+8
| | | | | | | | only. No binary change. ok mk.
* Remove the USB_GET_SC_OPEN macro. There is a double check for sc == NULL inmbalmer2007-06-111-2/+6
| | | | | | | | ulpt.c, I am aware of that and it will be changed later. No binary change. ok mk.
* Remove the definition and use of the USB_GET_SC macro, no binary change.mbalmer2007-06-111-7/+7
| | | | ok mk.
* More USB cleanup: In usb_port.h, get rid of the sel_klist #definemk2007-06-111-4/+4
| | | | | | | (which was there twice without gcc complaining) and update all uses of it. ok jsg mbalmer
* Remove the definition and use of the USBDEV macro. It only created confusionmbalmer2007-06-101-6/+6
| | | | | | | | and the address of it's argument: USBDEV(sc->sc_dev) yields &sc->sc_dev. No binary changes. ok jsg.
* Remove the "Static" declaration of many functions. It was defined to be emptymbalmer2007-06-051-11/+11
| | | | | | | 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.
* Last part of FreeBSD/NetBSD sepcific code removal.mbalmer2007-06-041-20/+1
| | | | ok jsg@
* Farewell USB_{ATTACH,MATCH,DETACH}* you will not be missed.jsg2007-05-271-9/+11
| | | | ok deraadt@ krw@ mbalmer@
* Remove logprintf macrojsg2007-05-211-3/+3
|
* poll errors should be POLLERR, not some random E valuetedu2006-11-011-2/+2
| | | | from alexandre ratchov. ok claudio
* In a drivers activate() entry point, if on DVACT_DEACTIVATE it doesmiod2006-06-231-2/+2
| | | | | | something, then it MUST return zero on DVACT_ACTIVATE, not EOPNOTSUPP; this very popular bug has been cut and pasted a lot of times... ok deraadt@ mickey@
* Move contents of sys/select.h to sys/selinfo.h in preparation for amillert2005-11-211-2/+2
| | | | | userland-visible sys/select.h. Consistent with what Net and Free do. OK deraadt@, tested with full ports build by naddy@.
* put "do { } while (0)" wrappers on all the debug maroc functionsderaadt2004-07-081-3/+3
|
* kqueue support for various usb devices including: usb, uhid, ugen,nate2003-06-271-2/+68
| | | | | and uscanner From NetBSD
* fix documentation links from netbsdnate2003-05-191-2/+2
|
* sync with NetBSDnate2002-11-111-4/+18
|
* update $NetBSD$ tagsnate2002-07-251-2/+2
|
* get rid of trailing whitespacenate2002-07-251-6/+6
|