summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* deprecate interface input handler lists, just use one input function.dlg2020-07-221-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the interface input handler lists were originally set up to help us during the intial mpsafe network stack work. at the time not all the virtual ethernet interfaces (vlan, svlan, bridge, trunk, etc) were mpsafe, so we wanted a way to avoid them by default, and only take the kernel lock hit when they were specifically enabled on the interface. since then, they have been fixed up to be mpsafe. i could leave the list in place, but it has some semantic problems. because virtual interfaces filter packets based on the order they were attached to the parent interface, you can get packets taken away in surprising ways, especially when you reboot and netstart does something different to what you did by hand. by hardcoding the order that things like vlan and bridge get to look at packets, we can document the behaviour and get consistency. it also means we can get rid of a use of SRPs which were difficult to replace with SMRs. the interface input handler list is an SRPL, which we would like to deprecate. it turns out that you can sleep during stack processing, which you're not supposed to do with SRPs or SMRs, but SRPs are a lot more forgiving and it worked. lastly, it turns out that this code is faster than the input list handling, so lots of winning all around. special thanks to hrvoje popovski and aaron bieber for testing. this has been in snaps as part of a larger diff for over a week.
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-7/+6
| | | | | | | fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
* Move the adapter related items (luns, adapter, adapter_target,krw2020-07-191-6/+6
| | | | | | | adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-161-3/+3
| | | | | | | | In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
* When athn(4) is deciding how to decrypt an incoming frame, look into thestsp2020-07-131-2/+2
| | | | | | | | | ieee80211_node data structure to find the WPA group cipher which was negotiated with the peer, rather than checking the wireless interface's configuration data. Found while investigating a problem where WPA2+TKIP wasn't working with athn. Problem reported by Tim Chase.
* Build 'flags' in intermediate variable and shuffle sc_linkkrw2020-07-111-16/+17
| | | | initialization closer to config_found() invocation.
* Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw2020-07-111-2/+1
| | | | statement. All to make upcoming diff(s) smaller and easier to read.
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-1018-50/+50
| | | | ok dlg@ tobhe@
* Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2020-07-1011-22/+22
| | | | | | "new" API. ok dlg@ tobhe@
* match on D-Link DWA-121 rev B1jsg2020-07-061-1/+2
| | | | from Miguel Landaeta
* regenjsg2020-07-062-4/+9
|
* add D-Link DWA-121 rev B1jsg2020-07-061-1/+2
| | | | from Miguel Landaeta
* uvideo_querycap(): Set the 'device_caps' field of struct v4l2_capability like done in utvfu(4)landry2020-07-051-2/+3
| | | | | | | | | | | | | | | | | | Fixes webcam detection in firefox 78, where code was added to check for V4L2_CAP_VIDEO_CAPTURE capability on 'device_caps', whereas we only set it in the 'capabilities' field. According to https://www.kernel.org/doc/html/v4.14/media/uapi/v4l/vidioc-querycap.html#description those distinct fields are here for drivers that provide several devices, but firefox decided to check for 'device_caps' field instead of 'capability' (cf https://hg.mozilla.org/integration/autoland/rev/33facf191f23) - so fill the field for compatibility reasons, while https://bugzilla.mozilla.org/show_bug.cgi?id=1650572 discusses with upstream what's the right way. ok mglocker@
* Fix mbuf leak in urtwn(4) with frames that are CCMP-crypted in hardware.stsp2020-07-051-1/+2
| | | | | Problem reported and fix tested by Bastian Wessling on bugs@ ok jmatthew@
* When a transfer times out, the TRB should be aborted, too. But stillgerhard2020-06-301-8/+21
| | | | | | | | the completion interrupt may already be pending while aborting. Hence, in xhci_event_command() ignore events from a TRB that is not the expected one. And don't let xhci_abort_command() yield the CPU. ok mpi@
* Nuke trailing whitespace.krw2020-06-271-2/+2
|
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha2020-06-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
* Acknowledge xhci(4) interrupts before calling usb_schedsoftintr().patrick2020-06-241-5/+5
| | | | | | | | | | | | | | | | | On powerdown (halt -p), sd(4)'s suspend function tries to powerdown a USB mass storage using a STOP command. In that case we are already cold and splhigh(), so that the xhci is supposed to run in polling- mode. usb_schedsoftintr() behaves differently when running in polling-mode. Instead of scheduling a soft interrupt, it immediately dequeues from the event queue. But dequeueing means touching the xhci registers. Apparently we need to acknowledge the interrupts before touching those registers, the hardware doesn't like it otherwise and we will never get an interrupt status for the second transfer. ok gerhard@
* Apply sc->sc_xfer_flags to control transfers as well. These are usedpatrick2020-06-241-5/+5
| | | | | | | | | | so that in polled-mode the USB transfers are marked synchronous. In case that sending commands to the USB mass storage fails, the control transfers are used to reset the device. Without the synchronous flag, the STOP command sent by sd(4) on powerdown would wait for completion indefinitely, possibly hanging the machine. ok gerhard@
* Blacklist Ericsson F5521gw broadband modem.tobhe2020-06-221-1/+9
| | | | ok sthen@
* regentobhe2020-06-222-4/+16
|
* Add Ericsson F5521gw Mobile Broadband Modem.tobhe2020-06-221-1/+5
| | | | ok sthen@
* Fix broken HID descriptors of Elecom trackballs.bru2020-06-174-4/+99
| | | | | | | | | The report descriptors specify an invalid button count for models with 6 or 8 buttons. Thanks to Sivaram Gowkanapal, who provided the core of this patch. ok mpi@
* Release the rx node if we were unable to allocate a new rx buffer.jmatthew2020-06-161-2/+2
| | | | | | | | The node here is always ic_bss, for which the reference count isn't actually used (it's always freed when the interface detaches), so not releasing it in this case wasn't really a problem. ok stsp@
* When detaching uaudio, wait for device ref counter to drop to 0ratchov2020-06-111-7/+46
| | | | | | | To maintain the correct refs count, blocking calls to uaudio are wrapped in usbd_ref_incr() and usbd_ref_decr() calls. suggested by mpi@ and ok visa@
* Make use of hardware crypto for CCMP. The tricky bits had been lyingjmatthew2020-06-111-35/+123
| | | | | | | | dormant in the driver for years, we just needed to insert the IV before transmission and do packet number checks on received frames. tested by kevlo@ solene@ benno@ and me on a variety of hardware ok kevlo@ stsp@
* Do not call encap routines with the IFQ mutex held, as they mightgerhard2020-06-0911-49/+45
| | | | | | sleep in the stop routine in case of errors. Fix proposed by mpi@, ok patrick@
* add umstc(4) for Microsoft Surface Type Cover keyboardsjcs2020-05-312-1/+178
|
* regenjcs2020-05-312-4/+14
|
* add two Surface Go Type Cover modelsjcs2020-05-311-1/+3
|
* Fix UVIDEO_DEBUG buildfeinerer2020-05-301-1/+2
| | | | | | | | | | | | | | | | | | | | Include sys/proc.h to address following errors: /usr/src/sys/dev/usb/uvideo.c:2901:31: error: incomplete definition of type 'struct proc' vn_close(nd.ni_vp, FWRITE, p->p_ucred, p); ~^ /usr/src/sys/sys/types.h:223:8: note: forward declaration of 'struct proc' struct proc; ^ /usr/src/sys/dev/usb/uvideo.c:2925:40: error: incomplete definition of type 'struct proc' UIO_SYSSPACE, IO_APPEND|IO_UNIT, p->p_ucred, NULL, p); ~^ /usr/src/sys/sys/types.h:223:8: note: forward declaration of 'struct proc' struct proc; ^ 2 errors generated. ok mpi@
* dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt2020-05-292-6/+2
| | | | | | conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
* match on TP-Link TL-WN822N-EU v5jsg2020-05-261-2/+3
| | | | from Tero Koskinen
* regenjsg2020-05-262-5/+10
|
* add TP-Link TL-WN822N-EU v5jsg2020-05-261-2/+3
| | | | from Tero Koskinen
* regenpatrick2020-05-252-4/+16
|
* ThingM blink(1)patrick2020-05-251-1/+5
|
* change wsdisplay attribute type from long to uint32_tjsg2020-05-251-9/+9
| | | | | | | | miod explained it was initially a long as it was thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. suggested and reviewed by miod@
* rename wsdisplay alloc_attr() to pack_attr()jsg2020-05-251-2/+2
| | | | | | | | Suggested by John Carmack. miod agrees a rename would make sense and explained it was initially thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. ok mpi@
* Use seltrue_kqfilter() instead of hand-rolling it in multiple drivers.mpi2020-05-132-26/+6
| | | | ok visa@
* Remove redundant code testing if a terminal is a usb stream.ratchov2020-05-041-5/+1
| | | | | | Fixes coverity CID 1492830. ok sthen, deraadt
* Check v6 availablilty mask instead of v4.gerhard2020-05-041-2/+2
| | | | go for it deraadt@
* If there's only one input (output) name it simply "input" ("output")ratchov2020-04-301-4/+27
| | | | | | Besides making things simpler, this allows libsndio to figure out that this is a control affecting all inputs (outputs) that needs to be exposed.
* Use "inputs" class instead of "record"ratchov2020-04-301-11/+5
| | | | | | | There's no reliable way to decide whether a control must belong to "inputs" or to "record". In other words both classes were used for the same thing. Furthermore we've no "play" class which tends to make things more confusing.
* Use "dac" instead of "play" in mixer control namesratchov2020-04-301-2/+2
| | | | | All other drivers use "dac" and libsndio needs the control name to be "dac" for the control to be exposed.
* Set terminal and clock names after all units are parsedratchov2020-04-301-13/+25
| | | | | Makes the code simpler and more flexible as the naming is done in a single place where the full units list is available.
* Use macros instead of hardcoded "play" and "record" string constantsratchov2020-04-301-4/+10
| | | | No object change.
* IPv6 is no longer on by default. It must be enabled with "inet6 eui64".gerhard2020-04-271-2/+3
| | | | Input from sthen@, ok claudio@
* Offload CCMP (WPA2) encryption and decryption to athn(4) hardware.stsp2020-04-272-6/+59
| | | | | | | | | | | | | | | | This reduces CPU load during traffic bursts, which is especially noticeable on boards with relatively slow CPUs such as Alix and APU. For reference, my rcc-ve boards (Intel Atom C2558) now forward ~2000pps between Ethernet and wifi with <= 1% CPU interrupt time according to systat. Beforehand, these boards became noticeably less responsive with fairly high interrupt and spin %. CCMP offload is used on both PCI and USB devices (thanks kevlo@ for catching my omission of USB devices in the first iteration of this change!) Tested by (at least) Kevin Chadwick, tracey@, kevlo@, kili@, Ted Patterson, David Dahlberg, and Scott Bennett. ok tracey@ kevlo@