Commit graph

4529 commits

Author SHA1 Message Date
Frank Hilgendorf
3126ebadf9 ukbd: Enable ukbd_apple_swap for all Apple ISO keyboards
Key code swapping between [<>] and [^°] key is enabled for all Apple ISO
type keyboards.  Before, swapping was enabled when the Eject key was
detected in HID usage.  This did not correlate well with the swapped
keys presence.

usbdevs file is extended by several Apple keyboard models to support ISO
model identification.

Reviewed by:	markj
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1506

(cherry picked from commit 541e7a98b762916cd951a64dd7e77efd51dfa8dc)
2024-11-22 21:23:47 +00:00
Hajimu UMEMOTO
47db906375 usb: Add support for Brainboxes USB-to-Serial adapters
PR:		277482
Reported by:	Cameron Williams

(cherry picked from commit 8eaeaf5c467866cf72701cdc34f7ab2ee3c2f123)
2024-11-17 14:17:55 +09:00
Ed Maste
ddc9bb7068 usb: fix loop in usb_config_parse
By inspection, index increment was missing.

PR:		281843
Reported by:	Matt Jacobson
Reviewed by:	bz, markj
Fixes: e4611d2626 ("usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting.")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 114080d19973331426cd826f3a961c6ea9216a53)
2024-11-13 09:26:44 -05:00
Li-Wen Hsu
630077a841
Move support of Realtek 8156/8156B from cdce(4) to ure(4)
Reviewed by:	kevlo, imp, hrs
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45088

(cherry picked from commit 6ea4d95f6c76aa64d2db5c04c87e68dc299544df)
2024-10-21 10:58:35 +08:00
Alexander Motin
8748daf670 ure(4): Add ID for LAN port in Thinkpad OneLink+ dock
That's a pretty old dock for Thinkpad X1 Carbon Gen4 and few others.

MFC after:	1 week

(cherry picked from commit a1bb5bdb0ab69bc3ce1f6051b6abc0cbaab83faa)
2024-09-25 20:49:31 -04:00
Dmitry Luhtionov
d01a9cceef Add some AMD device IDs.
(cherry picked from commit 4cc4b5e2b5f85f136169069559108ed7fff351f9)
2024-09-25 09:17:26 -04:00
Justin Hibbits
6c2430c72b bpf: Add IfAPI analogue for bpf_peers_present()
An interface's bpf could feasibly not exist, in which case
bpf_peers_present() would panic from a NULL pointer dereference.  Solve
this by adding a new IfAPI that could deal with a NULL bpf, if such
could occur in the network stack.

Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42082

(cherry picked from commit 8f31b879ecaf9e738dba631df4606742ee404e8e)

bpf: Prefer the boolean form when calling bpf_peers_present()

Reviewed by:	markj, kp, #network
MFC with:	8f31b879ecaf
Differential Revision:	https://reviews.freebsd.org/D45509

(cherry picked from commit 89204d9dcbe28558fae65936a0e93f44d926b88f)
2024-09-24 12:30:48 +08:00
Niko Sonack
b21881d8c4 ums(4): fix incorrect mouse button reporting via evdev
when ums driver receives non-mouse HID report. This results in
unexpected button release event. Reuse existing sysmouse logic to
keep button pressed.

Reviewed by:	imp, wulf
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45838

(cherry picked from commit d6888e211b07be79dd8de3145ac41b365f482ae8)
2024-09-20 00:41:43 +03:00
Franco Fichtner
3e6d533dd1 u3g: add SIERRA AC340U
Pull request:	https://github.com/freebsd/freebsd-src/pull/1397
MFC after:	3 days

(cherry picked from commit 4b6e76eff8b63d691c05772520849b6c94d535e8)
2024-09-01 21:46:02 -07:00
Mark Johnston
030cbcc4c2 if_urndis: Organize buffer layouts more naturally
- Group the request header and I/O buffer in one structure, rather than
  assuming that both request structures have the same size.
- Pass a pointer to the whole structure to urndis_ctrl_query() and
  urndis_ctrl_set() rather than just the header.  Otherwise, on CHERI
  platforms, these functions violate subobject bounds since they modify
  the buffer following the header.

While here, there is no apparent reason for the request structure used
in urndis_attach() to be allocated statically.  Change it so that it's
allocated on the stack.

No functional change intended.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D45866

(cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e)
2024-07-23 09:01:37 -04:00
Zhenlei Huang
6b1f530935 net: Remove unneeded NULL check for the allocated ifnet
Change 4787572d05 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().

No functional change intended.

Reviewed by:	kp, imp, glebius, stevek
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45740

(cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
2024-07-12 20:03:37 +08:00
Maxime Thiebaut
1296443295 u3g: Add support for SIM7600G
Signed-off-by:	Maxime Thiebaut <maxime+freebsd@thiebaut.dev>
Reviewed by:	kp

(cherry picked from commit b5b90ff9844d1cb780ff777fc42ad393e4683563)
2024-06-12 21:34:25 +02:00
Joshua Kinard
030596bfe4 kern: Remove leftover saf1761otg bits
Almost all code related to the saf1761 driver was removed in commit
44796b7e82, except for two small bits related to saf1761otg support.
This patch completes the removal.

PR:		279302
Signed-off-by:	Joshua Kinard <freebsd@kumba.dev>
Reviewed by:	mhorne
MFC after:	3 days
Fixes:		44796b7e82 ("mips: remove saf1761")

(cherry picked from commit 80828c6fab0292b5c5a34a63558d837cb9308fbd)
2024-06-06 11:23:01 -03:00
Ed Maste
5e7de5daa9 smsc(4): update to mention Microchip
Microchip Technology acquired SMSC in 2012, and all current products
and datasheets refer to the devices supported by this driver as
Microchip parts.  Mention SMSC in a parenthetical comment to explain
the driver's name.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45115

(cherry picked from commit 7ef6ce51742d44a7375ccbaeda4cc64e034c4816)
2024-05-10 09:01:52 -04:00
Gordon Bergling
4a393999f3 usb(4): Remove a double word in a source code comment
- s/of of/of/

(cherry picked from commit 604511f84ae6378db25ae3080e9db2e3bc9e0811)
2024-04-23 07:21:45 +02:00
Gordon Bergling
04ab41437a muge(4): Fix a typo in a source code comment
- s/addres/address/

(cherry picked from commit 046fe202e76623988ac612b20047940b86dd373f)
2024-04-21 09:33:29 +02:00
Andriy Gapon
98ee1305b6 ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver
Previosuly, USB_IFACE_DRIVER_ACTIVE would report that the driver is
active even after it detached.  That's because a device(9) still
remains.

So, add device_is_alive(9) check for more accurate reporting.

Reviewed by:	markj

(cherry picked from commit 8f374fa528d7643919bca1b4153dde03996305fe)
2024-03-16 17:11:37 +02:00
Gordon Bergling
ff9794844f umcs(4): Fix two typos in source code comments
- s/frequences/frequencies/

(cherry picked from commit 059fd69e749953c12b2cf099b34d3323d9c67d11)
2024-02-25 08:43:54 +01:00
Gordon Bergling
a3c51cfd5d uath(4): Fix a typo in a source code comment
- s/parmeter/parameter/

(cherry picked from commit 5a476e64b543dc63fae7fcd243dc066dced31c3b)
2024-02-25 08:42:24 +01:00
Bjoern A. Zeeb
b392b36d37 net80211: deal with lost state transitions
Since 5efea30f03 we can possibly lose a state transition which can
cause trouble further down the road.
The reproducer from 643d6dce6c1e can trigger these for example.
Drivers for firmware based wireless cards have worked around some of
this (and other) problems in the past.

Add an array of tasks rather than a single one as we would simply
get npending > 1 and lose order with other tasks.  Try to keep state
changes updated as queued in case we end up with more than one at a
time.  While this is not ideal either (call it a hack) it will sort
the problem for now.
We will queue in ieee80211_new_state_locked() and do checks there
and dequeue in ieee80211_newstate_cb().
If we still overrun the (currently) 8 slots we will drop the state
change rather than overwrite the last one.
When dequeing we will update iv_nstate and keep it around for historic
reasons for the moment.

The longer term we should make the callers of
ieee80211_new_state[_locked]() actually use the returned errors
and act appropriately but that will touch a lot more places and
drivers (possibly incl. changed behaviour for ioctls).

rtwn(4) and rum(4) should probably be revisted and net80211 internals
removed (for rum(4) at least the current logic still seems prone to
races).

Given this changes the internal structure of 'struct ieee80211vap',
which gets allocated by the drivers, and we do not have enough
spares, all wireless drivers need to be recompiled.
Given we are forced to do the update, we leave fields in the middle
of the struct and add more spares at the same time.
__FreeBSD_version gets updated to 1400509 to be able to detect
this change.

PR:		271979, 271988, 275255, 263613, 274003
Sponsored by:	The FreeBSD Foundation (in 2023)
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43389

(cherry picked from commit 713db49d06deee90dd358b2e4b9ca05368a5eaf6)
(cherry picked from commit a890a3a5ddf33acb0a4000885945b89156799b07)
2024-02-18 18:31:17 +00:00
Bjoern A. Zeeb
dd2988b0bc Revert "Enter the network epoch in USB WiFi drivers when processing input"
This reverts commit 17c328b6ae.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 75f298492a12d53df97c26963ec9f2dc0b052878)
2024-02-18 16:42:38 +00:00
Bjoern A. Zeeb
b4038a0b67 Revert "Widen EPOCH(9) usage in USB WLAN drivers."
This reverts commit 21c4082de9.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 39b702797994fbd62a21dd3af6d4cd7045fded23)
2024-02-18 16:42:32 +00:00
Andriy Gapon
2036512135 usbdevs: add Ralink RT7601 aka MT7601
This is a popular USB WiFi chip.
Unfortunately, it's not supported by FreeBSD yet.

(cherry picked from commit 5b54b6ac8ca1bc0653a3b31e79c1bffd9b227c6e)
2024-02-17 16:15:10 +02:00
Christos Margiolis
e95213b35b usb: use only usb_devinfo() in device_set_usb_desc()
device_set_usb_desc() first tries to fetch device information through
the iInterface descriptor, otherwise it falls back to usb_devinfo().
Since usb_devinfo() is both guaranteed to work, and is more verbose, get
rid of the initial iInterface attempt.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D43383

(cherry picked from commit 45cd29412eadbb0e8c40590a94b10663addac17a)
2024-01-30 13:07:29 +02:00
Gordon Bergling
7924b5f36b usb: Fix a typo in a source code comment
- s/recevied/received/

(cherry picked from commit d743711016298046ca77c5661bab41739396a180)
2024-01-25 07:45:09 +01:00
Gordon Bergling
4aed20f637 usb: Fix two typos in source code comments
- s/bascially/basically/
- s/assistence/assistance/

(cherry picked from commit f5e3329a5a480aa1b2904106b2fdfd999439455b)
2024-01-23 07:42:03 +01:00
Mark Johnston
f9946e9ae7 uhid: Check for errors from copyin() in ioctl handlers
This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by:	wulf
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43103

(cherry picked from commit b2caed2f8d699d6dc59ecf8810d945cdea148c44)
2024-01-01 19:29:44 -05:00
Ronald Klop
028e4c6548 Teach if_smsc to get MAC from bootargs.
Some Raspberry Pi pass smsc95xx.macaddr=XX:XX:XX:XX:XX:XX as bootargs.
Use this if no ethernet address is found in an EEPROM.
As last resort fall back to ether_gen_addr() instead of random MAC.

(cherry picked from commit 3878bbf1bb9e68f8579b57cde7d4e5c77de93320)

if_smsc: fix build on armv6 & armv7

compile error was:
/usr/src/sys/dev/usb/net/if_smsc.c:1597:40: error: format specifies type 'unsigned long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]
                                "failed alloc for bootargs (%lu)", len);
                                                            ~~~    ^~~
                                                            %zd

(cherry picked from commit 8a0ee306227a17a998bdc7af2275fd94b9164342)

PR:	274092
Reported by:	Patrick M. Hausen (via ML)
Reviewed by:	imp, karels, zlei
Tested by:	Patrick M. Hausen
Approved by:	karels
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D42463
2023-12-28 15:40:31 +01:00
Eugene Grosbein
8c165cbaf0 usbdevs: add quirk for WD MyPassport Ultra External HDD
WD MyPassport Ultra External HDD needs quirk
UQ_MSC_NO_TEST_UNIT_READY to attach.

(cherry picked from commit 970d73856b626a68597de19d37b68c376e2c0491)
2023-12-06 11:21:42 +07:00
Mazin Fadl
6c22e9fa0c usb: add necessary quirks for the NOREL Systems NS1081 SD reader
Without these, the Norelsys NS1081 is completely defunct.

PR:	263868
Fixes:	7520b88860 ("usb(4): Automagically apply all quirks [...]")
(cherry picked from commit b332adfa96218148dfbb936a9c09d00484c868e3)
2023-11-25 22:07:11 -06:00
Mazin Fadl
93f1302dc6 usb: add quirks for the Genesys GL3220 card reader
Without these, card hotplugging does not work on the GL3220.

PR:	263868
Fixes:	7520b88860 ("usb(4): Automagically apply all quirks [...]")
(cherry picked from commit 94efe9f91be7f3aa501983716db5a4378282a734)
2023-11-25 22:07:11 -06:00
Damien Broka
b973cdbb20 axge: Add support for AX88179A
The AX88179A has two firmware modes, one of which is backward
compatible with existing AX88178A/179 driver. The active firmware mode
can be controlled through a register.

Update axge(4) man page to mention 179A support and ensure that, when
bound to a AX88179A, the driver activates the compatible firmware mode.

Reviewed by:	markj
Pull Request:	https://github.com/freebsd/freebsd-src/pull/854
MFC after:	1 week

(cherry picked from commit 6962da914dd511349b219241e92b32329be76fc6)
2023-10-11 09:16:14 -04:00
Bjoern A. Zeeb
493d625543 net80211 / drivers: remove public use of ieee80211_node_incref()
ieee80211_node_incref() is the FreeBSD implementation of
ieee80211_ref_node().  Not being interested in the node returned
it was used as a shortcut in 3 drivers (ath, uath, wpi).
Replace the call with the public KPI of ieee80211_ref_node() and
ignore the result.
This leaves us with the single internal call going
ieee80211_ref_node() -> ieee80211_node_incref() and that should
help increasing portability but also limiting the places to trace
for node reference operations.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f156cd892b55c04a39fa06d1899e6e316de77f03)
2023-10-04 15:19:18 +00:00
Damien Broka
9b12f3763f axge: Skip dummy packet headers
Newer versions of the AX88179 interweave dummies alongside valid
packet headers in bulk IN transfer data. This was probably done for
backward compatibility with existing drivers.

However current driver records these dummy headers as dropped frames,
leading to stats misreporting one Ierr per Ipkt.

This skips those dummy headers silently, thereby not generating Ierrs
for them.

Reviewed by:	emaste
Pull Request:	https://github.com/freebsd/freebsd-src/pull/842

(cherry picked from commit 70fbcd451b68b7f6038d8a602cd8d5e1bb890f1d)
2023-09-24 09:18:06 -04:00
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