Commit Graph

4495 Commits

Author SHA1 Message Date
Emmanuel Vadot
5fb94d0e16 arm64: xilinx: dwc3: Fix reset names
Use the correct resets and not the same one three times in a row.

Reported by:	rpokala
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-23 09:42:40 +02:00
Emmanuel Vadot
29bfcb3a28 arm64: xilinx: Add glue driver for usb3 controller
Like other dwc3 controller, on Xilinx ZynqMP the base node is just here
to provide resets, the main dwc3 controller node is a child node.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-23 09:00:05 +02:00
Stephen J. Kiernan
332af8c25d xhci: Add support for 64-bit DMA in generic XHCI controller driver
The XHCI controller on 64-bit SoCs need to use 64-bit DMA.
Add a quirk to tell the generic XHCI driver that 32-bit DMA needs
to be used, if there are any that may need to use 32-bit DMA only.

Reviewed by:	andrew
Obtained from:	Juniper Networks, Inc.
2023-08-19 20:05:45 -04:00
Ed Maste
4722ceb7d5 Use 115200 bps by default for serial communication
9600 was a standard baud rate decades ago, but 115200 is now more common
so choose defaults that are useful to the largest number of users.

Note that boot0sio does not support rates above 9600 so it remains
unchanged.

Reviewed by:	bz, imp, manu
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36295
2023-08-17 13:31:38 -04:00
Dag-Erling Smørgrav
e738085b94 Remove my middle name. 2023-08-17 15:08:30 +02:00
Warner Losh
78d146160d sys: Remove $FreeBSD$: one-line bare tag
Remove /^\s*\$FreeBSD\$$\n/
2023-08-16 11:55:17 -06:00
Warner Losh
031beb4e23 sys: Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:58 -06:00
Warner Losh
685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh
71625ec9ad sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:24 -06:00
Warner Losh
2ff63af9b8 sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:18 -06:00
Warner Losh
95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Vladimir Kondratyev
f1d955be2a hidraw(4): Implement HIDRAW_GET_DEVICEINFO ioctl
In commit c77bfaa750 uhid(4) gained support for ioctl from
USB_GET_DEVICEINFO. This is used in libraries like libfido2 to
retrieve information about a device.

This commit adds binary compatible version to hidraw(4).

PR:		264843
MFC after:	1 month
Requested by:	grembo
2023-08-06 14:51:08 +03:00
Vladimir Kondratyev
4b1712817e hid: Add child device parameter to HID methods
Some devices like Apple HID-over-SPI may contain more than one report
descriptors necessitating creation of multiple hidbus children.
Add indentificator of child devices to distinct them.
No functional changes intended.

Differential Revision:	https://reviews.freebsd.org/D41246
2023-08-03 19:10:50 +03:00
Gordon Bergling
a924b48579 usb(4): Fix a typo in a source code comment
- s/determin/determine/

MFC after:	3 days
2023-08-02 11:04:24 +02:00
Marius Strobl
83e67a9d14 xhci(4): Describe AMD 400 Series USB 3.1 controllers
While at it, correct the string for 300 series ones, these also are
already xHCI 3.1.

Fixes:	d171d2f2 Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system
2023-07-23 09:21:46 +02:00
Michael
971bac5ace kbd: consolidate kb interfaces (phase one)
Refactor to eliminate duplicated rate and delay tables, with minor style
tweaks for changed lines.  Remove an obsolete comment about needing to
convert from microseconds to ticks (that's done elsewhere). Remove
traiing whitespace in kbdcontrol.c.

Except for the new warning, no change in behavior

Sponsored by: 		DSS GmbH
Reviewed by:		imp [minor style tweaks as well]
Pull Request:		https://github.com/freebsd/pull/683
Differential Revision: 	https://reviews.freebsd.org/D38818
2023-07-06 23:10:18 -06:00
Joerg Pulz
53a03e312c ure(4): add support for Thinkpad Hybrid USB-C with USB-A dock
Add support for LAN port found on Thinkpad Hybrid USB-C with USB-A dock.
While here fix a small typo
  - s/UBS/USB/

Sponsored by:	Technical University of Munich
Reviewed by:	markj
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/791
2023-07-04 15:42:55 -04:00
Jessica Clarke
9b3bce2074 usb: Fixed botched spacing
Fixes:	d3a83456e1 ("Add vendor id for Quectel USB modem and align with quectel marketing names.")
2023-06-28 00:07:54 +01:00
Gabriele Laganà
d3a83456e1 Add vendor id for Quectel USB modem and align with quectel marketing names.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/750
2023-06-27 16:35:20 -06:00
Warner Losh
eebd9d5366 spdx: Simplify BSD-2-Clause AND BSD-2-Clause
After removing the -FreeBSD and -NetBSD, we're left with a nuber of
BSD-2-Clause AND BSD-2-Clause, so tidy that up.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:04 -06:00
Warner Losh
b61a573019 spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD
The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:04 -06:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Val Packett
ef8397c28e bcm5974(4): add Magic Trackpad 2 (USB only) support
The MT2 uses a compact report format, but otherwise is similar in many
ways to the internal trackpads, it even uses the same mode switching
commands.

Reviewed by:	wulf
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D34437
2023-04-25 12:20:53 +03:00
John Baldwin
5328efb3d0 if_mos: Remove set but unused variable.
Reviewed by:	hselasky
Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D39356
2023-04-10 10:35:48 -07:00
Hans Petter Selasky
9b077d72bc usb(4): Separate the fast path and the slow path to avoid races and use-after-free for the USB FS interface.
Bad behaving user-space USB applicatoins may crash the kernel by issuing
USB FS related ioctl(2)'s out of their expected order. By default
the USB FS ioctl(2) interface is only available to the
administrator, root, and driver applications like webcamd(8) needs
to be hijacked in order for this to happen.

The issue is the fast-path code does not always see updates made
by the slow-path code, and may then work on freed memory.

This is easily fixed by using an EPOCH(9) type of synchronization
mechanism. A SX(9) lock will be used as a substitute for EPOCH(9),
due to the need for sleepability. In addition most calls going into
the fast-path originate from a single user-space process and the
need for multi-thread performance is not present.

Differential Revision:	https://reviews.freebsd.org/D39373
Reviewed by:	markj@
Reported by:	C Turt <ecturt@gmail.com>
admbugs:	994
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-04-08 17:11:31 +02:00
Hans Petter Selasky
03a2e432d5 usb(4): Code refactoring as a pre-step for adding missing synchronization mechanism.
Move code in switch cases into own functions to make later changes easier to track.

No functional change, except for removing a superfluous break statement when
range checking USB_FS_MAX_FRAMES, in the USB_FS_OPEN case.
It should not have been there at all.

Suggested by:	emaste@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-04-08 16:52:20 +02:00
Zhenlei Huang
082895ebec xhci(4): Describe Fresco Logic FL1009 USB 3.0 controller
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38922
2023-03-20 12:04:14 +08:00
Zhenlei Huang
b754d7faaf uhci(4): Correct PCI device ID for Zhaoxin USB controller
And minor style fixes.

Tested by:	Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes:		986c7be472 uhci(4): Add new USB IDs
Differential Revision:	https://reviews.freebsd.org/D38924
2023-03-18 01:30:19 +08:00
Zhenlei Huang
95b2d16b38 ehci(4): Correct PCI device ID for Zhaoxin USB 2.0 controller
And minor style fixes.

Tested by:	Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes:		f9237e1937 ehci(4): Add new USB IDs
Differential Revision:	https://reviews.freebsd.org/D38923
2023-03-18 01:30:18 +08:00
Zhenlei Huang
f50f53931e xhci(4): Correct PCI device IDs for Zhaoxin USB 3.0 controllers
And minor style fixes.

Reviewed by:	hselasky
Tested by:	Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes:		0d7064d58f xhci(4): Add new USB IDs
Differential Revision:	https://reviews.freebsd.org/D38921
2023-03-18 01:30:18 +08:00
Joerg Wunsch
175a584e50
usb: dwc3: add <sys/mutex.h>
Commit 5e54bb1ea9 added USB_BUS_LOCK/USB_BUS_UNLOCK. They, in
consequence, require mutexes so <sys/mutex.h> is needed.
2023-03-08 20:59:29 +01:00
Justin Hibbits
935b194ded Mechanically convert usb ethernet drivers to DrvAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37812
2023-03-06 11:04:15 -05:00
John Baldwin
89cd5d084e usb: Trim another MIPS reference.
Fix a nearby whitespace nit while here.
2023-03-01 10:51:27 -08:00
Allan Jude
71af885af9 u3g(4): Add device ID for the Quectel EM160R
Also add the EM160R to the man page, noting the work-around
required to make it function properly in PPP mode.

MFC-After:	1 week
Sponsored by:	Metify Inc.
Sponsored by:	Klara Inc.
2023-03-01 14:05:24 +00:00
Mateusz Guzik
15c0b8c998 mips: whack __mips__ leftover
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-03-01 11:09:48 +00:00
Kyle Evans
5e54bb1ea9 usb: dwc3: implement hw.usb.xhci.use_polling
Polling is currently only implemented in the xhci pci attachment.
Adding it to dwc3 doesn't make it much uglier, and supporting it can be
useful for confirming that hardware's otherwise functional when
interrupts are apparently not firing.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D38816
2023-02-28 16:16:14 -06:00
Cy Schubert
8866ea619a usb: Add HID_IGNORE quirk for APC Smart-UPS1000
Without the HID_IGNORE quirk enabled it will appear to be a uhid device.

PR:		269729
MFC after:	1 week
2023-02-28 05:46:00 -08:00
Cy Schubert
6f295aab80 usbdevs: Add APC Smart-UPS1000
MFC after:	1 week
2023-02-28 05:46:00 -08:00
Cy Schubert
b1723f48d8 usbdevs: Remove duplicate APC entries
MFC after:	1 week
2023-02-28 05:46:00 -08:00
Zhenlei Huang
3bafe73aff usb: Remove unused member in struct mos_softc
Spotted by jhibbits in D37812.

Reviewed by:	#network, glebius
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38581
2023-02-15 13:07:19 +08:00
Stefan Eßer
f20058955c sys/kbio.h: make pre-unicode keymap support optional
FreeBSD-9 had introduced support for the full set of Unicode
characters to the parsing and processing of keymap character tables.

This support has been extended to cover the table for accented
characters that are reached via dead key combinations in FreeBSD-13.2.

New ioctls have been introduced to support both the pre-Unicode and
the Unicode formats and keyboard drivers have been extended to support
those ioctls.

This commit makes the ABI compatibility functions in the kernel
optional and dependent on COMPAT_FREEBSD13 in -CURRENT.

The kbdcontrol command in -CURRENT and 13-STABLE (before 13.2) has
been made ABI compatible with old kernels to allow a new world to be
run on an old kernel (that does not have full Unicode support for
keymaps).

This commit is not to merged back to 12-STABLE or 13-STABLE. It is
part of review D38465, which has been split into 3 separate commits
due to different MFC and life-time requirements of either commit.

Approved by:	imp
Differential Revision:	https://reviews.freebsd.org/D38465
2023-02-14 14:03:28 +01:00
Michael Paepcke
08ecb40e88 u3g: add huawei device id
Add missing entry for E3372h Model already in NCM mode

Noticed by: David BOYER
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/645
2023-02-10 16:29:54 -07:00
Justin Hibbits
2fda7967b6 Mechanically convert usb_ethernet(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37802
2023-02-07 14:15:45 -05:00
Stefan Eßer
4972fb9276 Support Unicode characters in keymap dead key tables
Support for Unicode characters had been added to the keyboard code,
but there are keymaps that have accented characters accessed via dead
key combinations, and those were still restricted to 8 bit codes.

This update to kbd.c adds support for Unicode characters and
compatibility code that allows a kbdcontrol command built from kbio.h
without these patches to work on a new kernel.

Compatibility code that allows a new kbdcontrol binary running on an
old kernel to load and display the dead key map will be committed in a
separate commit.

Reviewed by:	imp, brooks
Approved by:	brooks
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38381
2023-02-06 23:48:47 +01:00
ev
0cec5b99b3 usb/u3g: Add support for QUECTEL EP06-E 4G modem
Add QUECTEL EP06-E modem support via USB for FreeBSD.
Tested and works like a ppp on FreeBSD-13.

Reviewed by: imp
PR: 269326
2023-02-04 20:48:41 -07:00
Michael Paepcke
848ac8451b usb: Remove obsolete Huawei 3G from usbdevs
- remove Huawei 3G E3131 (E3131_INIT):
	- frees up 0x1505/0x14fe shared IDs => product is EOL (since...)
	- 3G networks are shutdown/scheduled
	- E3131 devices will still work the same via scsi_huawei_eject2
	- new 4G devices will switch & report correctly now

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
2023-02-04 14:27:09 -07:00
Michael Paepcke
e66352013a usb: add support for Huawei E5573Cs322
Switch the now added E5573Cs322_ECM (0x14db) as well per default to NCM.
With this patch we default all devices to simple NCM mode to avoid the
problem and get a consistent reliable behavior. No matter what firmware
version and provider mix are involved.

Rationale:
Even the bigger SOC shows under complex load in ECM (double-nat) mode
the same performance drop from 25Mbit to 2Mbit Line Speed, similar to E3372h.
Reason: Thermal problems (reported via serial debug interface in ACM Mode)
after 2-3 minutes load.

Fix the root cause and bundle a working firmware is out of reach because
Huawei sells the same hardware, different (crippled) firmware versions
at different price points in different markets as strategy.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
2023-02-04 14:27:09 -07:00
Michael Paepcke
1997d3a4a9 usb: add new scsi_huawei eject3 & eject4 driver support
Add initialization for new Huawei 4G E3372_NCM, E3372v153_NCM,
E5573Cs322_NCM, E5573Cs322_ECM, and E5573Cs322_ACM.

Remove now-obsolete Huawei 3G E3131 init sequence. These devices are
obsolete, share IDs with new devices and the 3G networks are shutdown.
These old devices work correctly via the 4G code while still allowing
the shared IDs to work differently for the new devices.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
2023-02-04 14:27:08 -07:00
Michael Paepcke
7d4b2b5834 usb: add new scsi_huawei eject3 & eject4 sequences
Add new Huawei eject3 and eject4 command sequences.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
2023-02-04 14:27:08 -07:00
Michael Paepcke
64fd867f8c usb: add new scsi_huawei eject3 & eject4 quirks
Add new scsi_huawei eject3 & eject4 mode driver to usb quirks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
2023-02-04 14:27:08 -07:00