Commit Graph

6150 Commits

Author SHA1 Message Date
jakllsch 151a4210f9 include opt_ntp.h for PPS_SYNC 2024-04-12 16:54:37 +00:00
riastradh 2722c57029 usb *hci: Always set ux_status before usbd_xfer_schedule_timeout.
Add an assert to usbd_xfer_schedule_timeout to enforce this.

Since access to ux_status is serialized by the bus lock, and nothing
releases the bus lock in the interim, this doesn't make a functional
change.  But it does reduce confusion by readers, who no longer have
to worry if some callers got the order wrong.  It could also now
potentially be factored out in a subsequent commit.
2024-04-05 18:57:10 +00:00
thorpej 9d92f090f4 ugen and ugenif share the same /dev/ugenN.xx namespace in such a way
that the device unit number does not necessarily match the /dev/ugenN.xx
unit number (N).  If you ONLY have ugen devices, it happens to work out
and devpubd scripts can be extremely naive.  If you ONLY have ugenif
devices, it also happens to work out, but your devpubd scripts have to
slightly more informed.  If you have a mix of ugen AND ugenif devices,
though, you're pretty much out of luck.

So, this change adds a "ugen-unit" device property which devpubd scripts
can query to determine which /dev/ugenN.xx nodes a given ugen or ugenif
device is using.
2024-03-29 19:30:09 +00:00
thorpej cedac9206f Add a "match quirk" mechanism to the uftdi driver that allows it to
selectively reject individual interfaces based on the combination of
- Vendor ID
- Product ID
- Interface number
- Vendor string
- Product string

This is necessary[*] to allow some devices that would otherwise match
uftdi (and thus instantiate a ucom) to be matched by ugenif instead,
which is required to make the device available to libusb1.

[*] ...due to a deficiency in the USB stack that does not provide a
mechanism for a user-space driver to claim a device from a kernel driver
and then return it back at a later time.

Use this new match quirk mechanism to reject "interface 1" of the
FTDI 2232C-based Tigard debug board; On this board, "interface 0"
is brought out to regular TTL-level UART pins, but "interface 1" is
brought out to SWD and JTAG headers, and is really only useful when
used with something like openocd.  Because the FTDI 2232C on this board
just uses the standard FTDI vendor and product IDs, it can only be
distinguished by the strings, which cannot be specified usbdevices.config,
thus necessitating the match quirk entry (that works in combination
with the ugenif entry added in usbdevices.config).
2024-03-26 03:38:02 +00:00
thorpej 64830a10b2 Define a "flags 1" config directive for ugenif, which is similar to ugen's,
but rather forces the ugenif to match at the *lowest* match priority rather
than the highest.  This allows ugenif to claim only otherwise unclaimed
interfaces.
2024-03-26 03:24:14 +00:00
jakllsch 010a79541e Use HUD_PEN instead of 0x0002 as appropriate 2024-03-18 15:15:27 +00:00
jakllsch 0cb28d4d87 Prevent errant ucycom-presenting device from causing up to 225
bytes of kernel memory following input buffer to leak to tty
application.

Probably not practically expolitable, but you never know.
2024-03-17 20:10:52 +00:00
mrg 1498001423 give some anonymous structures names 2024-03-08 07:05:02 +00:00
dholland e91196a244 usbdevs: regen; usb_quirks.c: update to match
Regen for additional Logitech B100, and update the UQ_ALWAYS_ON entry
to refer to both device ids.
2024-02-28 21:52:40 +00:00
dholland f904ab5978 usbdevs: add another device id for LOGITECH B100.
The mouse I'm looking at says "Logitech B100" on the back but has a
different device id from the one already here.
2024-02-28 21:50:51 +00:00
riastradh 048ca36a11 urtwn(4): Ditch old queued commands on overflow.
Don't increment ring->queued past what the task will decrement.

This is a stop-gap measure; really, we should just have one task for
each operation that is deferred to the task thread.

PR kern/57965
2024-02-28 20:18:13 +00:00
andvar a10c2cec39 fix various typos in comments and log messages. 2024-02-10 09:21:51 +00:00
andvar 100a3398b8 fix spelling mistakes, mainly in comments and log messages. 2024-02-09 22:08:30 +00:00
mrg 541af60bf9 avoid different struct type problem. 2024-02-06 23:57:41 +00:00
jmcneill d736a27c95 Ensure proper alignment/padding of EHCI hardware descriptors.
These descriptor structs are embedded in structs that contain additional
context for software. With a non cache coherent device and non-padded
descriptors, the device may issue a read/modify/write past the end of
the descriptor, clobbering software state in the process. This was the
root cause of multiple crashes on evbppc with a non cache coherent EHCI.
2024-02-05 23:07:42 +00:00
jmcneill 1e70fa6df2 Fix DMA sync flags in ehci_append_sqtd 2024-02-05 23:04:18 +00:00
mrg 2026b7285b update my email address. 2024-02-04 05:43:05 +00:00
andvar f22ed7e5e6 fix various typos in comments. 2024-02-02 22:00:32 +00:00
jmcneill e988d63375 usb: increase USB_PORT_RESET_RECOVERY from 10ms to 20ms
I changed this from 250ms to 10ms back in 2021 based on a similar FreeBSD
change, but it seems to be a bit too aggressive for some platforms.
2024-01-20 21:09:28 +00:00
jmcneill 86bb242cc1 ehci: add EHCIF_32BIT_ACCESS flag to force 32-bit MMIO 2024-01-20 00:51:29 +00:00
andvar a89f0eb820 s/asynchrounous/asynchronous/, s/assistence/assistance/ in comments. 2024-01-14 12:53:41 +00:00
riastradh c67daeba76 usbdi(9): Assert not polling in abort path.
XXX Not sure if this is safe.
2024-01-13 18:22:13 +00:00
hgutch b8a5009895 Add workaround for Microsoft Sculpt Wireless keyboard/mouse.
From M. Boerschig in PR 57845.
2024-01-13 15:26:36 +00:00
hgutch cd33e585cb Regen 2024-01-13 15:22:40 +00:00
hgutch 7a6ca76c84 Add Microsoft Sculpt Wireless keyboard/mouse.
From M. Boerschig in PR 57845.
2024-01-13 14:42:14 +00:00
riastradh ea9e2c5540 usbdi(9): Avoid taking locks in usbd_transfer while polling.
PR kern/57783

XXX pullup-10
XXX pullup-9
XXX pullup-8
2024-01-13 12:42:10 +00:00
riastradh dd95526d08 usbdi(9): Avoid calling ubm_softint with lock held and polling on.
PR kern/57783

XXX pullup-10
XXX pullup-9
XXX pullup-8
2024-01-13 12:27:54 +00:00
gutteridge e70022630e if_athn_usb.c: provide the usual device information 2024-01-11 00:31:02 +00:00
maya 9b0ba0f262 Add Mercusys NW150US V2 USB support
No changes needed, other than recognizing it as working.

From Daeil Lee in PR/57819
2024-01-06 00:26:26 +00:00
maya 921cefa17f Regen usbdevs 2024-01-06 00:24:36 +00:00
maya cb5d4f66ff Add Mercusys and Mercusys MW150USV2
From Daeil Lee in PR/57819
2024-01-06 00:24:07 +00:00
gutteridge 6ecdff9e54 usbdevs.h & usbdevs_data.h: regen 2023-12-24 02:47:47 +00:00
gutteridge c76a535096 usbdevs: add RTL8188FU 2023-12-24 02:42:51 +00:00
skrll b1a004dd35 Use un_flags as pointed out by mrg@ thanks. 2023-12-19 08:19:42 +00:00
skrll e97ed54620 Add support for AX88179A. From sc.dying on current-users. 2023-12-19 07:05:36 +00:00
mlelstv 70c2a8fcd3 Regen 2023-12-11 13:35:40 +00:00
mlelstv 446c7b4da5 Add RTL8156 2023-12-11 13:33:35 +00:00
hannken dbee9926f7 Undo the DPRINTFN part of the last commit. It breaks i386 at least
when KERNHIST_LOG casts the pointer to uintmax_t.

Kernel ALL/i386 compiles again.
2023-11-06 12:16:52 +00:00
riastradh 95b733af94 ehci(4): Fix bug causing missed wakeups since ehci.c 1.308.
For reasons beyond me now, I used cv_signal on the same cv that is
used to wait for the doorbell to be available _and_ to wait for the
host controller to acknowledge the doorbell.  Which means when the
host controller acknowledges the doorbell, we might wake some thread
waiting for the doorbell to be available -- and leave the thread
waiting for the doorbell acknowledgment hanging indefinitely.

PR port-i386/57662

XXX pullup-10
2023-10-28 21:18:31 +00:00
riastradh b436790693 ehci(4): Fix cv_timedwait loop in ehci_sync_hc.
Stop when

	now - starttime >= delta,

i.e., when at least delta ticks have elapsed since the start, not
when

	endtime - now > delta,

i.e., more than delta ticks _remain_ to sleep, which is never going
to happen (except on arithmetic overflow).

As is, what will happen in the case that should time out is that we
wake up after delta ticks, and find now = getticks() is exactly
endtime, so we retry cv_timedwait with timo=(endtime - now)=0 which
means sleep indefinitely with no timeout as if with cv_wait.

PR port-i386/57662

XXX pullup-10
2023-10-28 21:18:15 +00:00
simonb 1fdac6ddeb Debug printf tidy up, KNF comma,space nits. 2023-10-10 10:58:03 +00:00
riastradh 4a682b0fd5 usbnet(9): Fix typo in comment.
No functional change intended.

PR kern/57645

XXX pullup-10
2023-10-09 17:44:33 +00:00
riastradh c1b31cab70 usbnet(9): On if_init, stop/init if IFF_RUNNING -- not noop.
ether_ioctl(9) relies on this to reinitialize an interface when a
flags change returns ENETRESET.  We can't just reprogram the hardware
multicast filter because some drivers have logic in if_init that's
conditional on IFF_PROMISC; perhaps we can reduce the cost of this if
we can change those drivers to do it in uno_mcast but that requires
some analysis to determine.

PR kern/57645

XXX pullup-10
2023-10-09 17:43:01 +00:00
riastradh 4d2a5263b8 usbnet(9): Fix sense of conditional in usbnet_ifflags_cb.
This appears to have been mistranscribed in revision 1.1 of usbnet.c.

PR kern/57645

XXX pullup-10
2023-10-09 17:42:09 +00:00
riastradh 6586a9d44c usbnet(9): Make sure unp->unp_if_flags is initialized on init.
usbnet_ifflags_cb is only called if the flags change while up and
running.  (XXX Maybe it should be called in other circumstances too
so there's only one path here?)

Out of paranoia, clear the cache on stop.

PR kern/57645

XXX pullup-10
2023-10-09 17:42:00 +00:00
riastradh 8228640c71 ure(4): Set all bits, not no bits, in multicast filter for promisc.
This was lost in revision 1.40.

PR kern/57648

XXX pullup-10
2023-10-09 11:28:05 +00:00
skrll 59b88703c4 Apply the new diff from
kern/55273 urndis(4) error "could not find data bulk in/out" without CDC union descriptor

Fallback to the interface association descriptor if  no CDC Union Descriptor is
found.
2023-10-01 06:55:27 +00:00
msaitoh 821e159c0a s/ for for / for / in comment. 2023-09-21 09:31:49 +00:00
ad 875881b5f1 Add USB device TOPPING DX3 Pro. 2023-09-07 20:04:18 +00:00
riastradh 658c9f7b8c ukbd(4): Sort includes.
No functional change intended.
2023-09-02 17:43:16 +00:00