summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert sleep to tsleep_nsec(9).mpi2020-01-041-3/+3
| | | | ok bluhm@
* UPGT_USB_TIMEOUT is specified in msec not in ticks, correct the timeoutmpi2020-01-041-2/+3
| | | | | | value of the sleep by using tsleep_nsec(9). ok mglocker@
* Use C99 designated initializers with struct filterops. In addition,visa2019-12-312-12/+32
| | | | | | make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
* poll handlers must return a poll(2) revents value, not errno(2) values.reyk2019-12-191-3/+3
| | | | | | | | | 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@
* undo assumptions about MI .h inclusionsderaadt2019-12-181-2/+15
|
* Add fido(4), a HID driver for FIDO/U2F security keysreyk2019-12-174-43/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reduce the max. number of frame buffers so that we can run highermglocker2019-12-081-2/+7
| | | | | | | | resolutions without running out of kernel memory. Tested with 1920x1080 uncompressed and mjpeg without performance degradation. ok mpi@
* regenkevlo2019-12-072-4/+9
|
* - Add support for RTL8156kevlo2019-12-073-164/+481
| | | | | | - Add RX/TX checksum offload support Tested by Shawn Chiou and myself.
* utwitch(4): tsleep(9) -> tsleep_nsec(9); ok jca@cheloha2019-11-301-4/+4
|
* On short transfers with multiple TRBs in a TD we get two events.patrick2019-11-281-3/+4
| | | | | | | | | | One on the TRB that went short, and one for the last TRB in a TD. We already set actlen only once so that the last TRB in a TD does not override it, but some controllers throw another short event instead of a success event, so we have to add the same check there as well. ok gerhard@ mglocker@
* Convert infinite sleeps to tsleep_nsec(9).mpi2019-11-275-12/+12
| | | | ok bluhm@
* When there is no network around the state timeout fires over and over again.claudio2019-11-261-2/+5
| | | | | Change the printf into a log and only under IFF_DEBUG to reduce dmesg spam. Loudly requested by beck@ OK deraadt@
* Convert to tsleep_nsec(9) and use the correct timeout period in msec.mpi2019-11-251-4/+6
| | | | Tested by kevlo@, ok stsp@
* Add umb_rtrequest() to handle RTM_PROPOSAL events and send back theclaudio2019-11-241-7/+24
| | | | | | DNS proposals in that case. Also clear the DNS proposals when the interface is deconfigured (e.g. when going down). OK florian@
* Use rtm_proposal() to send out DNS updates. Both when DNS are added andclaudio2019-11-221-1/+28
| | | | when the interface is deconfigured (when going down).
* Fix off-by-one TRB issue in bulk transfers larger than 64k.mglocker2019-11-181-2/+2
| | | | | | This makes udl(4) on xhci(4) work fine. Help and ok patrick@
* Fix actual length calculation of short transfers in xhci(4). So farpatrick2019-11-181-8/+37
| | | | | | | | | | | | | | | we have subtracted the remaining length from the total transfer length, which essentially means that we assume that all TRBs have successfully been transferred apart from the remainder. Actually we might get a short completion in the middle of a chain of TRBs, which means that all TRBs until this TRB have completed successfully apart from a remainder. Thus we have to count the length of all TRBs until and including the one that we went short on, and remove the remainder. All following TRBs in the same transfer must be ignored. Found by and fixed with gerhard@ ok mglocker@
* - Don't enable/disable efuse access protection for rtl8188c/rtl8192c;kevlo2019-11-161-16/+1
| | | | | | | it may prevent incorrect mac address read from efuse - Disable BB/RF is not needed in urtwn_r92c_power_on() ok stsp@
* Remove hardcoding of NetChip vendor/product id so that urndis(4) can attachabieber2019-11-141-2/+1
| | | | | | when Linux has g_ether configured as RNDIS. OK patrick@, sthen@
* Send uhid(4) reports via the optional interrupt out pipe. Somepatrick2019-11-131-16/+45
| | | | | | | | tiny devices don't accept reports using control transfers since they think that offering the interrupt pipe is enough. Discussed with djm@ ok mpi@
* Convert tsleep(9) that wait for a multiple of `hz' to tsleep_nsec(9).mpi2019-11-127-17/+21
| | | | ok cheloha@
* Make udl(4) and uts(4) compile again in debug mode by fixing IOCGROUPmglocker2019-11-062-7/+7
| | | | and IOCPARM_LEN macros types.
* Mark recycled USB `xfer' as NOT_STARTED to not confuse HCD abort methods.mpi2019-10-211-1/+2
| | | | | | Prevent an infinite loop when aborting ulpt(4)'s pipe after an I/O error. Found by and ok stsp@
* Fix compiler's view of the alignment of xhci structs. Because the structvisa2019-10-151-6/+6
| | | | | | | | | | | | | fields are naturally aligned, it is enough to remove __packed. This lets the compiler generate saner machine code. In particular, now the compiler does not use lwl/lwr and swl/swr instructions on mips64 for changing xhci descriptors. The descriptors are properly aligned in memory, so lwl/lwr and swl/swr end up doing a redundant load or store. Feedback from guenther@ deraadt@ Tested on amd64 by krw@ OK mpi@ krw@ kettenis@
* Convert tsleep(9) to tsleep_nsec(9).mpi2019-10-142-4/+4
| | | | ok visa@, kn@
* Only set the IPv4 address in umb(4) if both MBIM_IPCONF_HAS_ADDRINFO andclaudio2019-10-101-6/+5
| | | | | | | MBIM_IPCONF_HAS_GWINFO are available. Configuring umb(4) without gateway wont work the system needs a destination address for the interface. Problem found by jsg@. OK jsg@ deraadt@
* Convert tsleep(9) to tsleep_nsec(9).mpi2019-10-081-5/+6
| | | | ok visa@, kn@, cheloha@
* Use MSEC_TO_NSEC() to define XHCI_CMD_TIMEOUT & use it w/ tsleep_nsec(9).mpi2019-10-062-6/+5
| | | | ok visa@, kn@
* tsleep(9) to tsleep_nsec(9) conversions.mpi2019-10-064-13/+13
| | | | ok visa@, kn@, cheloha@
* Fix vn_open to require an op of 0, and 0 or KERNELPATH only as flags.beck2019-10-061-2/+2
| | | | | | | | sweep tree to correct NDIINT op and flags ahead of time. document the requirement. This allows KERNELPATH to be used to bypass unveil for crash dumps with nosuidcoredump=2 or 3 ok visa@ deraadt@ florian@
* Switch the bpf of umb(4) from DTL_RAW to DTL_LOOP. DTL_RAW is limited toclaudio2019-10-031-13/+31
| | | | | | | | | | ip only whereas DTL_LOOP passes the address family of the packet and so supports more address families. To make this work umb_decap() prepends the AF to the packet and which is consumed then by umb_input(). Similar umb_output() sets ph_family in the mbuf header which is used by umb_start(). OK deraadt@ dlg@
* turn the success paths of FCC registration into debug prints. Thederaadt2019-09-291-3/+3
| | | | | (unlikely) failure path remains noisy. discussed with claudio
* Make umb(4) add a default route when configuring the interface. This routeclaudio2019-09-271-52/+97
| | | | | | | | has a lower priority than wifi or wired LAN and so should only be used when no other interface is available. With this using umb(4) becomes less painful Now ifconfig umb0 up will be enough especially if unwind(8) is used to handle DNS requests. OK deraadt@ job@ benno@
* Make wireless drivers call if_input() only once per interrupt.stsp2019-09-126-32/+57
| | | | | | | | | | | | | | This reduces drops caused by the ifq pressure drop mechanism and hence increases throughput. Such drops are visible with e.g. 'netstat -dnI iwm0'. Not all affected drivers have been tested yet but these changes are largely mechanical and should be safe. As usual, please report any regressions. With help from dlg@ and mpi@ Problem found by robert@ Tested by robert, jmc, Tracey Emer, Matthias Schmidt, florian, Björn Ketelaars ok mpi@
* Use the new set_blksz() interface to set the block size.ratchov2019-09-051-46/+34
| | | | | | | This simplifies the code and allows any block size multiple of 1ms to be used when play and recording number of channels are not the same. ok mpi@
* ure: attach to RTL8153B device on Lenovo USB-C Dockjcs2019-08-291-1/+2
|
* Add support for RTL8153B after study of Linux r8152 driver.kevlo2019-08-292-355/+596
| | | | Tested by myself, jcs@
* syncjcs2019-08-272-4/+9
|
* add ethernet found on Lenovo USB-C Dockjcs2019-08-271-1/+2
|
* Keep ieee80211_node structures cached across scans, rather thanstsp2019-08-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | wiping the entire cache every time a scan is triggered. This has benefits for userland programs trying to look at scan results, and for drivers which don't get a full view from hardware on every scan. Nodes will still be evicted from the cache in one of several ways: Add a new way of timing out inactive nodes which don't send a beacon within 10 scan iterations, for client mode only. This should get rid of stale APs if we're scanning for some time in a changing environment. If we fail to associate a few times, the corresponding node is removed. If net80211 transitions back to INIT state (e.g. because of a user-initiated configuration change) all nodes are removed. When a background scan starts all nodes will be removed. This could be revisited later but has been intentionally left as-is for now. Tested by myself, jmc@, benno@, procter@ on iwm(4), athn(4) and ral(4).
* Replace umb_ntop() with sockaddr_ntop() which does almost the same thing.claudio2019-08-262-38/+26
| | | | | | Also change the storage type for the DNS addresses to struct in_addr since that is more convinient for userland. This includes some minor other cleanup. OK gerhard@
* avoid checking s->spf twice if it is above maximum in uaudio_adjspf(); ok ratchov@miko2019-08-251-2/+2
|
* udcf(4): tvtohz(9)+timeout_add(9) -> timeout_add_msec(9); ok kettenis@cheloha2019-08-101-56/+21
|
* Add support for integrated USB cameras with two functions, aspatrick2019-08-071-9/+126
| | | | | | | | | seen on a Lenovo X395 which combines normal webcam functionality with another IR camera, by parsing the USB interface association descriptors. This fixes the symptom of uvideo(4) complaining about too many headers and not providing any functionality at all. ok jan@
* Add support for the KSMedia 8-bit IR format, a greyscale format,patrick2019-08-072-2/+10
| | | | | | as seen on the IR camera of my Lenovo X395. ok jan@
* ttysleep(): drop unused timeout parametercheloha2019-07-191-2/+2
| | | | | | | | All callers sleep indefinitely. With help from visa@. ok visa@, ratchov@, kn@
* The USB video class specification has increased its probe bufferpatrick2019-07-101-5/+12
| | | | | | | sizes with each specification. Use the correct size for the given version, since some newer devices cannot handle small buffers. ok jan@
* Also dump interface association descriptor when debugging ispatrick2019-07-101-1/+26
| | | | | | compiled in. ok jan@
* Fix whitespace issue.patrick2019-07-091-3/+3
| | | | ok jan@