summaryrefslogtreecommitdiffstats
path: root/sys/dev
AgeCommit message (Collapse)AuthorFilesLines
2021-02-09Add a barrier between reading the cqe flags and the command ID, whichjmatthew1-1/+3
should ensure that we don't read a stale command ID and complete the wrong scsi io. powerpc64 base builds were crashing like this fairly regularly. ok deraadt@ dlg@
2021-02-08change discipline name from "RAID1C" to "RAID 1C" to match the man pagesstsp1-2/+2
2021-02-08Add a RAID1C (raid1 + crypto) softraid(8) discipline.stsp1-0/+325
The RAID1C discipline encrypts data like the CRYPTO discipline, and accepts multiple chunks during creation and assembly like the RAID1 discipline. To deal with failing disks a RAID1C volume may be assembled with a smaller number of chunks than the volume was created with. The volume will then come up in degraded state. If the volume is now detached and assembled again with the correct number of chunks, any re-added chunks will require a rebuild. Consequently, assembling RAID1C volumes requires careful attention to the chunks passed via 'bioctl -l'. If a chunk is accidentally omitted from the command line during volume assembly, then this chunk will need to be rebuilt. At least one known-good chunk is required in order to assemble the volume. Like CRYPTO, RAID1C supports passphrase and key-disk authentication. Key-disk based volumes are assembled automatically if the key disk is present while the system is booting up. Unlike CRYPTO and RAID1, there is no boot support for RAID1C yet. RAID1C largely reuses existing code of RAID1 and CRYPTO disciplines. At present RAID1C's discipline-specific data structure is shared with that of the CRYPTO discipline to allow re-use of existing CRYPTO code. A custom RAID1C data structure would require CRYPTO code to access struct sr_crypto via a pointer instead of via a member field of struct sr_discipline. ok jsing@
2021-02-08Add a RAID1C (raid1 + crypto) softraid(8) discipline.stsp3-31/+64
The RAID1C discipline encrypts data like the CRYPTO discipline, and accepts multiple chunks during creation and assembly like the RAID1 discipline. To deal with failing disks a RAID1C volume may be assembled with a smaller number of chunks than the volume was created with. The volume will then come up in degraded state. If the volume is now detached and assembled again with the correct number of chunks, any re-added chunks will require a rebuild. Consequently, assembling RAID1C volumes requires careful attention to the chunks passed via 'bioctl -l'. If a chunk is accidentally omitted from the command line during volume assembly, then this chunk will need to be rebuilt. At least one known-good chunk is required in order to assemble the volume. Like CRYPTO, RAID1C supports passphrase and key-disk authentication. Key-disk based volumes are assembled automatically if the key disk is present while the system is booting up. Unlike CRYPTO and RAID1, there is no boot support for RAID1C yet. RAID1C largely reuses existing code of RAID1 and CRYPTO disciplines. At present RAID1C's discipline-specific data structure is shared with that of the CRYPTO discipline to allow re-use of existing CRYPTO code. A custom RAID1C data structure would require CRYPTO code to access struct sr_crypto via a pointer instead of via a member field of struct sr_discipline. ok jsing@
2021-02-08Simplify sleep_setup API to two operations in preparation for splittingmpi3-14/+10
the SCHED_LOCK(). Putting a thread on a sleep queue is reduce to the following: sleep_setup(); /* check condition or release lock */ sleep_finish(); Previous version ok cheloha@, jmatthew@, ok claudio@
2021-02-05Prevent that when ugen(4) tries to set an alternative configurationmglocker1-1/+5
descriptor (usually doesn't happen), that we continue to use an outdated cdesc pointer which still refers to the previous cdesc. Instead update the cdesc pointer to the new configuration descriptor. Reported by Thomas Jeunet <cleptho AT gmail DOT com> ok phessler@
2021-02-05arm_intr_establish_fdt() has long been renamed to fdt_intr_establish().patrick3-8/+7
2021-02-05Fix CVS tag.patrick1-1/+1
2021-02-05Fix whitespace.patrick1-2/+2
2021-02-05Rename probe/attach functions to fit our regular naming scheme. Replacepatrick1-13/+13
&armv7_bs_tag with fdt_cons_bs_tag, which is our early console bus tag for both arm64 and armv7. On armv7, it points to &armv7_bs_tag. With this we can get rid of the armv7var.h include. Reduce a bit of diff to imxuart(4). ok kettenis@
2021-02-05Move exuart(4) to sys/dev/fdt so it can be shared between arm64 and armv7.patrick3-1/+1057
ok kettenis@
2021-02-04Tedu unnecessary imxuartvar.h.patrick2-21/+1
ok kettenis@
2021-02-04Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton2-1/+1060
exposing battery sensors for HID++ 2.0 devices. Most of the code is derived from the hid-logitech-hidpp Linux driver. Thanks to Ville Valkonen <weezeldinga at gmail dot com> for testing. ok mglocker@
2021-02-04Add uhidev_set_report_dev() allowing usb drivers to early on install aanton2-5/+25
handler for a specific report id. Needed by an upcoming driver in order to communicate with the device already in the attach routine. ok mglocker@ as part of a larger diff
2021-02-03After the rev. 1.108 commit we see some issues with ugen(4) behaviour,mglocker1-1/+5
which finally makes umb(4) fail, since ugen(4) attaches to one of the umb(4) interfaces, fails, and marks the whole device dying. Therefore make usbd_device2interface_handle() backwards compatible again. Problem reported by Mikolaj Kucharski. ok edd@
2021-02-01handle #pinctrl-cells 2jsg1-2/+7
needed for >= linux 5.9 dtbs on bbb ok kettenis@
2021-02-01Align the mixed naming for the variables used to reference tomglocker4-31/+31
bInterfaceNumber and bAlternateSetting as following: ifaceidx -> ifaceno altidx -> altno Suggested and ok mpi@
2021-01-31Spacing.mglocker1-2/+2
2021-01-31Add basic support for BCM4378 as found on the Apple M1 SoCs. There's apatrick3-3/+12
little bit more to do though before it can be enabled.
2021-01-31regenpatrick2-2/+7
2021-01-31Add Broadcom BCM4378.patrick1-1/+2
2021-01-29update remaining usb.org URLssthen4-12/+12
2021-01-29update usb.org URLssthen3-7/+7
2021-01-29update some usb.org URLs following reorganisation, add a new one for updsthen6-13/+15
partly from Alessandro Ricci
2021-01-29Don't rely on USB interfaces being at compliant indices.edd1-5/+16
When obtaining an interface handle, we currently rely on the device being properly USB compliant, and thus the interface being at the correct index in the interfaces array. However, some devices present their indices incorrectly. For example, the following audio device exposes interfaces 0, 1 and 3, in that order (skipping interface 2 entirely): uaudio2 at uhub4 port 4 configuration 1 interface 3 "E+ Corp. DAC Audio" rev 1.10/0.01 addr 2 uaudio2: class v1, full-speed, async, channels: 2 play, 0 rec, 3 ctls This means that that the audio stream interface (number 3) is not found at the expected index of 2, and this causes looking up the handle to fail. This change makes usbd_device2interface_handle() search for the right interface, instead of assuming it will be at the right index. Although this is a little slower, note that this routine not very frequently called and there are typically not hundreds of interfaces on a typical USB device. This fixes the above E+ Corp device, and one other uaudio device reported broken by a user. With input from, tested by, and OK ratchov@, mglocker@ and kettenis@. Many thanks!
2021-01-28tpm(4): fix delay unitscheloha1-18/+9
tpm(4) has timeout constants in milliseconds, e.g. #define TPM_ACCESS_TMO 2000 /* 2sec */ This is fine. The odd thing is that tpm(4) first converts these timeouts to counts of ticks via tpm_tmotohz() before using DELAY() to busy-wait. DELAY() takes a count of microseconds, which are not equivalent to ticks, so the units are all screwed up. Let's correct this: - Remove tpm_tmotohz(). We're not working with ticks so we don't it. - Multiply the timeouts to match the delay interval. tpm_request_locality() and tpm_getburst() use intervals of 10 microseconds, so multiply the millisecond timeouts by 100. In tpm_waitfor() the delay interval is 1 microsecond, so multiply the millisecond timeout by 1000. - Update the parameter name in tpm_waitfor() to note that we expect a count of milliseconds, not "tries". Discussion: https://marc.info/?l=openbsd-tech&m=160995671326406&w=2 Prompted by kettenis@. Suspend/resume tested by florian@ on an X1 Gen 2. For the record, it looks like this: tpm0 at acpi0 TPM_ addr 0xfed40000/0x5000, device 0x0000104a rev 0x4e Earlier versions of this patch were reviewed by kn@, but the patch became more ambitious when kettenis@ got involved so those reviews are no longer applicable. jcs@ notes (https://marc.info/?l=openbsd-tech&m=160834427630142&w=2) in a related discussion that this driver "sucks" and should be replaced with NetBSD's rewrite. This would get us a cleaner driver with TPM 2.0 support. So there is future work to do here. ok kettenis@
2021-01-28Be consistent in not using parameter names for function prototypes;mglocker1-3/+3
I've missed two more cases in the previous commit.
2021-01-28Rename bNumInterface to bNumInterfaces to fix build on arm64.kurt1-2/+2
2021-01-27The usb configuration descriptor parameter providing the number ofmglocker6-16/+16
available device interfaces is called 'bNumInterfaces'. ok phessler@, thfr@ (who provided the man page diff)
2021-01-27regenjsg2-2/+177
2021-01-27add some more amdgpu devicesjsg1-1/+36
2021-01-27Be consistent in not using parameter names for function prototypes.mglocker1-5/+5
2021-01-27do better accounting of how many msix interrupts we want to use.dlg1-2/+8
ok jmatthew@
2021-01-26intrmap attribute missing from mcx; ok dlgderaadt1-3/+3
2021-01-25Resolve data toggle out of sync problem for ugen(4) and uhidev(4) devicesmglocker2-2/+92
on xhci(4) controllers by clearing the interface endpoints before opening the pipes. Tested by Mikolaj Kucharski for ugen(4) and gnezdo@ for uhidev(4), plus myself for both. ok mpi@
2021-01-25Add the new function usbd_clear_endpoint_feature() which allows to issuemglocker2-2/+16
an UR_CLEAR_FEATURE request on a specific endpoint address without the need to have a pipe open to that endpoint. From NetBSD, ok mpi@
2021-01-25raise the max number of queues/interrupts to 16, up from 1.dlg1-3/+12
jmatthew@ has tried this before, but hrvoje popovski experienced breakage so it wasn't enabled. we've tightened the code up since then so it's time to try again. this diff has been tested by hrvoje popovski and myself ok jmatthew@
2021-01-25if the rx descriptor reports the rss hash, use it for the mbuf flowid.dlg1-2/+10
ok jmatthew@
2021-01-25don't lose the M_FLOWID flag if the ipv4 cksum is ok.dlg1-2/+2
found while poking around with hrvoje popovski yes jmatthew@
2021-01-25use an intrmap when establishing interrupts for queues.dlg1-21/+44
mcx is still hardcoded/limited to 1 queue for now, but this lets different mcx devices use different cpus for handling packets. looks good jmatthew@
2021-01-24match on Intel Alder Lake and Meteor Lake I219 Ethernet idsjsg3-3/+30
2021-01-24regenjsg2-2/+47
2021-01-24add Intel Alder Lake and Meteor Lake I219 Ethernet idsjsg1-1/+10
2021-01-24match on Realtek RTL8168H ids for Killer E2500V2 and E2600jsg1-1/+3
checked against linux and windows drivers
2021-01-24regenjsg2-2/+12
2021-01-24add Realtek RTL8168H ids for Killer E2500V2 and E2600jsg1-1/+3
checked against linux and windows drivers
2021-01-23match on another Realtek RTL8168 idjsg1-1/+2
reported and tested by John Batteen on a TP-Link TG-3468
2021-01-23regenjsg2-2/+7
2021-01-23add another Realtek RTL8168 idjsg1-1/+2
shows up on a TP-Link TG-3468 John Batteen has
2021-01-23Fix IORT struct for Context and PMU interrupts. I misread bytes with bits.patrick1-7/+5
ok kettenis@