Commit Graph

5554 Commits

Author SHA1 Message Date
macallan
de38ddbcdc send PMF events for keyboard brightness hotkeys on apple laptops 2020-09-12 18:10:37 +00:00
ryoon
702e22bbae Regenerate 2020-09-07 06:33:05 +00:00
ryoon
ce81c731e8 Add Buffalo BWC-35H01 or BWC-30L01 2020-09-07 06:32:13 +00:00
riastradh
9fc453562f Round of uvm.h cleanup.
The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
  to query whether curlwp is the pagedaemon, which should maybe be
  exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
  by it.  We should split up uvm_extern.h but this will serve for now
  to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
  UVMHIST(ubchist), since ubchist is declared in uvm.h but the
  reference evaporates if UVMHIST is not defined, so we reduce header
  file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
  here.

ok chs@
2020-09-05 16:30:10 +00:00
riastradh
d306d8a27b atu(4): Reject packets larger than MCLBYTES. 2020-08-28 19:02:19 +00:00
riastradh
d1cd546d76 usbnet: Reject buflen>MCLBYTES in usbnet_newbuf. 2020-08-28 17:05:32 +00:00
jakllsch
f27e554c2a xhci(4): initial support for Isochronous pipes
Needs more cleanup, and more work, particularly transaction scheduling
may need to be examined with bus analyzer (to check if too frequent/
infrequent) or various isoc pipe consumers (to check if too infrequent)
and fixed if incorrect.

Begins to address PR kern/55574.
2020-08-21 20:46:03 +00:00
jakllsch
471a35f04a xhci(4): copy HCCPARAMS regs to softc, use when needed
We'll need more than just the AC64 bit for the Isoc support coming up;
and we don't need to keep all the bits as bools in the softc.
2020-08-21 20:16:39 +00:00
msaitoh
cc67c5474a s/ be be / be / 2020-08-19 02:19:06 +00:00
riastradh
257aaf9afb Fix ugen detach after partial attach.
While here, register null pmf handler even for partially attached
devices so they don't needlessly interfere with suspend.

Reported-by: syzbot+5a091d2e62da20b77259@syzkaller.appspotmail.com
2020-08-18 14:32:34 +00:00
simonb
2b428978f3 Regen. 2020-08-18 02:53:25 +00:00
simonb
6be04df69b Add Moonbase Otago OneRNG Random Number Generator. 2020-08-18 02:53:01 +00:00
riastradh
ae3eedf331 Fix sloppy mistakes in previous.
1. Give the offset of the rbnode, not some other random members to
   overwrite with garbage.

2. Don't try to unlock a mutex at NULL.

3. Make sure all paths out after ugenif_acquire go via
   ugenif_release.
2020-08-16 06:17:31 +00:00
riastradh
d21e522e87 Expose Yubikey CCID interface to userland via ugenif. 2020-08-16 02:38:06 +00:00
riastradh
ee406c527b Share unit numbering for ugen and ugenif.
This way putting ugenif in kernel config actually works to wire it to
the /dev/ugenN.MM device nodes in userland.

Not a fully fleshed out solution to the ugen problem -- there's no
way for a userland driver to kick out a kernel driver and take over,
but this will let us, e.g., use uhidev(4) for Yubikey OTP/U2F/FIDO2
but ugen(4), with pcscd(8), for Yubikey CCID.

Fix various MP-safety issues while here (still not MPSAFE, but more
progress).
2020-08-16 02:37:19 +00:00
riastradh
6269170c9d Convert DIAGNOSTIC prints to KASSERTs. 2020-08-16 02:34:54 +00:00
riastradh
b663bb53fc Hold the lock over access to the data structures it covers.
Still not MPSAFE, but progress.
2020-08-16 02:34:20 +00:00
riastradh
a2da0435ef Remove UGEN_ASLP microoptimization.
cv_signal already has this microoptimization.

While here, make the lock cover the relevant things we're issuing
cv_signal about -- progress toward real MP-safety.
2020-08-16 02:33:17 +00:00
rjs
5d3121f64a Add some extra V4L ioctl() requests to latest V4L userland to work.
Import sys/videoio.h from OpenBSD, this is just the Linux headers
concatenated together.
2020-08-10 19:27:27 +00:00
riastradh
bdc07cff2c Sort #includes. Nix trailing whitespace.
No functional change intended.
2020-07-22 17:18:10 +00:00
riastradh
487ce959a3 Omit needless <sys/pcq.h>. 2020-07-22 17:17:36 +00:00
simonb
95c71ed76b Set up the USB xfer for every transfer, not just once in the attach
function.  Caught by DIAGNOSTIC on a similar driver.  Thanks to phone@
for USB xfer clue and martin@ for testing.
2020-07-13 13:53:04 +00:00
mrg
64401a8f3a for both usbd_transfer() and usbd_ar_pipe() be sure to reset the
xfer ux_state to XFER_BUSY when removing from the queue.

seems to fix an occasional panic i was seeing on pinebook and
pinebookpro lately with axen(4).

from riastradh@.

XXX: pullup-9.
2020-07-13 05:43:38 +00:00
mrg
65e387b6dc mark USBNET_DEBUG as a defflag that depends on USB_DEBUG. 2020-07-13 04:44:03 +00:00
simonb
74c0b378b1 Clean up some useless ugliness. NFC. 2020-07-09 13:43:04 +00:00
skrll
d8434ea326 KASSERT polling or holding sc_lock in a few more places.
kern/52569: Entering ddb using USB keyboard panics with "locking against myself"
2020-07-07 10:02:17 +00:00
ryoon
ac76789489 usb/ugensa: Support Linux USB 3.0 debugging port serial communication 2020-07-04 08:07:02 +00:00
ryoon
d8bdfea95f usbdevs: Regenerate 2020-07-04 08:06:12 +00:00
ryoon
11e94a8068 usbdevs: Add Linux USB 3.0 debugging port serial device 2020-07-04 08:05:26 +00:00
jdolecek
0b2511aeb5 mark several init-only functions as noinline to avoid bumping into the
stack limit
2020-06-27 14:34:45 +00:00
jmcneill
423f1f504e prop_data_data_nocopy -> prop_data_value 2020-06-27 13:32:00 +00:00
maxv
6cac1dde29 Fix NULL deref on attach failure. Found via vHCI fuzzing.
Reported-by: syzbot+9fdcdc21799e5d6d75ee@syzkaller.appspotmail.com
2020-06-27 07:29:11 +00:00
jdolecek
232edc8c48 disable inlining for couple functions which allocate usb_device_request_t
on stack to reduce total run_init() stack usage from 7KB to 2KB
2020-06-24 21:06:39 +00:00
flxd
b4c7a18260 regen 2020-06-19 11:54:01 +00:00
flxd
32868a2248 Add umass quirk for Alcor AU6366 multi-card reader. 2020-06-19 11:52:42 +00:00
maxv
5cbb56529f remove unused 2020-06-16 17:25:56 +00:00
martin
89e3596f3d Better bounds checking for oversized packets, to avoid kernel memory
corruption. Pointed out by Ilja Van Sprundel.
2020-06-11 09:56:57 +00:00
martin
8a2c263d7e Stricter bounds check for some packet length we get from the usb chip,
to make sure we do not corrupt kernel memory.
Pointed out by Ilja Van Sprundel.
2020-06-11 09:51:37 +00:00
thorpej
814a779807 Update for proplib(3) API changes. 2020-06-11 02:32:06 +00:00
gson
c2d905cb60 Conditionally enable the formerly #if'ed-out code to use the
WRITE_REGION_1 command for writing blocks of data to the device.
This is to address a performance issue where "ifconfig run0 up" would
take as long as 20-30 seconds when using a UHCI or OHCI host
controller due to the large number of control transfers performed by
the driver in combination with the inability of those host controllers
to perform multiple control transfers per USB frame.  Limit the
transfers to 64 bytes as in the corresponding #if'ed-out code in
FreeBSD.  Currently only enabled for mac_ver 0x5390 as it is the only
version tested so far.
2020-06-06 13:53:43 +00:00
skrll
648bd77418 More __BITS. NFCI. 2020-06-06 08:56:30 +00:00
maxv
9259199775 Register eight vHCI buses, and use separate KCOV mailboxes for them. 2020-06-05 17:20:56 +00:00
skrll
d78befcef4 Replace calls to usbd_device2interface_handle in u3g_match() and
u3g_attach() with the interface already passed in uiaa->uiaa_iface and
store the interface in sc->sc_iface for later use by u3g_open()/

Also skip Direct IP interfaces in u3g_match() to avoid potential side effects.

PR kern/55330
2020-06-05 08:02:32 +00:00
skrll
6c5683e6b5 Remove duplicated USB_VENDOR_SIERRA USB_PRODUCT_SIERRA_USB305 entry
PR kern/55329
2020-06-05 08:01:49 +00:00
skrll
4d4b2f24d4 Near complete conversion to __BITS 2020-06-04 20:54:37 +00:00
skrll
74934b7c45 Consistent whitespace. Register defines are <tab> indented. Bits defines
for registers are <tab><space> indented.
2020-06-04 19:50:21 +00:00
skrll
4a9c8cafe4 Convert ohcireg.h to __BITS. NFCI. 2020-06-03 15:38:02 +00:00
skrll
3d720802db Remove some unnecessary bit shifts by using appropriate read size 2020-06-01 10:25:00 +00:00
maxv
869e8f7b28 Reset ud_ifaces and ud_cdesc to NULL, to prevent use-after-free in
usb_free_device().

Reported-by: syzbot+c7e74d0ae89e9f08f863@syzkaller.appspotmail.com
2020-05-31 18:33:08 +00:00
jdolecek
39045d90bd also set ifc->ui_endpoints to NULL in usbd_free_iface_data() when the value
is freed, to make it impossible to re-enter this by mistake

very likely has no effect for the syzbot problem, but good to do nevetheless

Reported-by: syzbot+c555801d6bc0d768f402@syzkaller.appspotmail.com
2020-05-31 18:20:23 +00:00