summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/upd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-5/+3
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* 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
* No need to wakeup(9) the sensor thread because upd_refresh() does notmpi2015-10-011-4/+2
| | | | | | sleep. Discussed with deraadt@
* Four new sensors, from David Higgs.mpi2015-06-171-3/+17
|
* Make the "Battery Present" sensor a depency of all the battery-relatedmpi2015-05-141-2/+6
| | | | | | sensors only if it is present, From David Higgs. Fix a regression reported by and ok halex@
* Refresh sensor values asynchronously.mpi2015-05-111-64/+86
| | | | From David Higgs.
* Link report descriptors to known sensors.mpi2015-04-301-9/+13
| | | | | | | | | | Since HID buffers always start by a reportID we can access the corresponding report descriptor in O(1). Having a list of sensors attached to each report descriptor makes it easier to update all of them with only on I/O request. Note that sensors are attached in depency order on every report list. From David Higgs.
* Instead of using a single flat array for all sensors, put all thempi2015-04-301-34/+62
| | | | | | | | | | children of a sensor in a separate structure. Children sensors should only be probbed if their parent is active. This make the dependency tree explicit and will reduce the number of I/O. From David Higgs.
* Since upd(4) currently supports a known but limited number of sensors,mpi2015-04-271-38/+33
| | | | | | | | | | parse the HID descriptor multiple times to find them. This logic is necessary to later create a tree of sensors in order to avoid lookups in the hot path for sensors that depend on the value of others. From David Higgs.
* with more unit convertion when new sensors will appear.mpi2015-04-271-21/+30
| | | | From David Higgs.
* Make use of DEVNAME(), from David Higgs.mpi2015-04-271-5/+6
|
* Small cleanups when attaching sensors, from David Higgs.mpi2015-04-011-6/+5
|
* use mallocarray(), then set the size afterwards. Prefer if people learnderaadt2015-01-111-4/+5
| | | | and use this idiom everywhere, it is always safest.
* Handle UPSes with broken report descriptors.mpi2014-12-111-2/+6
| | | | | | | | As reported by David Higgs some UPSes might send fewer bytes than requested. When such thing happens, do like apcupsd and adjust the size of the given descriptor. Based on a diff provided by David Higgs, thanks!
* Change uhidev(4) set/get report functions in various way.mpi2014-12-111-14/+9
| | | | | | | | | | | | | | 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-3/+3
| | | | after discussions with beck deraadt kettenis.
* Backport FreeBSD's HID parser in order to properly parse `moderm'mpi2014-05-121-8/+7
| | | | | | | input device descriptors, notably if they include an Item with an Usage array (Min-Max range) and others single Usage elements. Tested by many, thanks! ok andre@
* Remove device white-listing as matching method, relies on on usage idandre2014-04-291-38/+2
| | | | | | versus supported sensors table filtering. discussed with and ok mpi@
* Modify the uhidev_*_report() methods to always take a report ID argumentmpi2014-04-151-9/+7
| | | | | | | | 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@
* - Remove a enumerator for supported sensors, makes better usage of our usb api;andre2014-04-071-136/+197
| | | | | | | | | | | - Allocate/enable sensors wich match both: the static usage table of supported usage IDs and the usages supported by the device; - Do not attach when no sensors can be allocated; - Makes device querying smarter: query the device just once for values stored in the same reportid reply payload. - Use sensor_status. ok mpi@
* Add several devices we already have defined in usbdevs and are also known to beandre2014-03-201-1/+1
| | | | | | | | UPSes. (forced commit due to previous empty commit message) ok mpi@ sthen@
* *** empty log message ***andre2014-03-201-2/+28
|
* When BatteryPresent flag is not set, invalidate battery-dependent sensors.andre2014-03-191-20/+32
| | | | | suggested by deraadt@ ok mpi@
* spacingderaadt2014-03-191-2/+2
|
* Add upd(4) to the tree, disabled. Please do not enable it yet.andre2014-03-171-0/+317
At this moment upd(4) exposes data from usb-based uninterruptable power systems (or just USB Power Devices), sysctl(8) sensors (read snmpd(8) friendly), it is also an "in-base" alternative to other 3rdparty UPS-monitoring software, we have plans to bring more features. This is my first "something" into the tree. Lots of thanks: sthen@ and blambert@ are the ones to blame for the idea/challenge. mpi@ is the one whom pushed me to get it correct (from uhub -> uhidev). reyk@ mentored me on OpenBSD-way with previous iked/relayd experiences. ok mpi@, deraadt@ "get it in".