Commit graph

4538 commits

Author SHA1 Message Date
Dmitry Luhtionov 4cc4b5e2b5 Add some AMD device IDs. 2024-06-07 13:02:03 -04:00
Maxime Thiebaut b5b90ff984 u3g: Add support for SIM7600G
Signed-off-by:	Maxime Thiebaut <maxime+freebsd@thiebaut.dev>
Reviewed by:	kp
2024-06-06 17:02:15 +02:00
Joshua Kinard 80828c6fab 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")
2024-06-03 12:52:58 -03:00
Kevin Lo 345fd21a6a Add a new USB ID for Xiaomi mini USB WiFi 2024-05-31 09:40:03 +08:00
Ahmad Khalifa 881ae768f2 usb: Remove uneeded revision verbosity from quirks list
Seperate usb quirks that target specific revisions from those that
dont. Alot of the quirks dont use lo_rev and hi_rev, so we can abstract
the 0x0000, 0xffff into a macro.

[[ This commit is a bit more churn than we like. I carefully reviewed
   each one and they are all good. The end product is better -- imp ]]

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1153
2024-05-11 13:32:57 -06:00
Ahmad Khalifa 64e05e9065 usb: Fix quirks list
In some cases, the USB_QUIRK_VP macro was being misused. Instead of
setting quirks to the intended value, the first two supplied quirks
would go into lo_rev and hi_rev. Replace it with USB_QUIRK_VO which only
takes the needed args. This also makes the Dummy products, which where
being used to correctly set vendor only quirks, not necessary.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1153
2024-05-11 13:32:37 -06:00
Ed Maste 7ef6ce5174 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
2024-05-08 14:18:46 -04:00
Gordon Bergling 604511f84a usb(4): Remove a double word in a source code comment
- s/of of/of/

MFC after:	3 days
2024-04-20 14:10:59 +02:00
Denis Bodor 54e231b373 Add support for i2c-tiny-usb: usb to iic bridge
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1123
2024-04-19 16:40:23 -06:00
Gordon Bergling 046fe202e7 muge(4): Fix a typo in a source code comment
- s/addres/address/

MFC after:	3 days
2024-04-18 16:18:26 +02:00
Lexi Winter ac83063d37 bcm2838_xhci: add module
bcm2838_xhci(4) is a shim for the XHCI controller on the Raspberry Pi 4B
SoC.  It loads the controller's firmware before passing control to the
normal xhci(4) driver.

When xhci(4) is built as a module (and not in the kernel), bcm2838_xhci
is not built at all and the RPi4's XHCI controller won't attach due to
missing firmware.

To fix this, build a new module, bcm2838_xhci.ko, which depends on
xhci.ko.  For the dependency to work correctly, also modify xhci to
provide the 'xhci' module in addition to the 'xhci_pci' module it
already provided.

Since bcm2838_xhci is specific to a quirk of the RPi4 SoC, only build
the module for AArch64.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1142
2024-04-09 21:11:39 -06:00
Gordon Bergling 5a476e64b5 uath(4): Fix a typo in a source code comment
- s/parmeter/parameter/

MFC after:	3 days
2024-02-22 16:55:51 +01:00
Gordon Bergling 059fd69e74 umcs(4): Fix two typos in source code comments
- s/frequences/frequencies/

MFC after:	3 days
2024-02-22 14:14:08 +01:00
Andriy Gapon 8f374fa528 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
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43960
2024-02-19 12:44:00 +02:00
Bjoern A. Zeeb 713db49d06 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 643d6dce6c 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).

PR:		271979, 271988, 275255, 263613, 274003
Sponsored by:	The FreeBSD Foundation (in 2023)
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43389
2024-02-14 19:47:21 +00:00
Andriy Gapon 5b54b6ac8c usbdevs: add Ralink RT7601 aka MT7601
This is a popular USB WiFi chip.
Unfortunately, it's not supported by FreeBSD yet.
2024-01-28 13:10:51 +02:00
Gordon Bergling d743711016 usb: Fix a typo in a source code comment
- s/recevied/received/

MFC after:	3 days
2024-01-22 21:57:06 +01:00
Gordon Bergling f5e3329a5a usb: Fix two typos in source code comments
- s/bascially/basically/
- s/assistence/assistance/

MFC after:	3 days
2024-01-20 17:32:20 +01:00
Christos Margiolis 45cd29412e 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
2024-01-16 18:49:08 +02:00
Emmanuel Vadot 62e8ccc3a4 syscon: Move syscon code in dev/syscon
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by:	mhorne
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D43196
2024-01-10 19:20:37 +01:00
Emmanuel Vadot 950a6087ec phy: Move phy code in dev/phy
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by:	emaste, imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D43195
2024-01-10 19:20:34 +01:00
Emmanuel Vadot b2f0caf160 regulator: Move regulator code in dev/regulator
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by:	emaste, imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D43194
2024-01-10 19:20:32 +01:00
Emmanuel Vadot 1f469a9fc4 hwreset: Move reset code in dev/hwreset
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by:	imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D43192
2024-01-10 19:20:28 +01:00
Emmanuel Vadot be82b3a0bf clk: Move clock code in dev/clk
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by:	mhorne
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D43191
2024-01-10 19:20:26 +01:00
Emmanuel Vadot fe75646a02 usb: dwc3: Move driver under a subdirectory
dwc3 is big enough to have its own subdirectory.
While here only make it depend on kernel option dwc3 and rk_dwc3
without any SOC options.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D43190
2024-01-10 19:20:24 +01:00
Mark Johnston b2caed2f8d 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
2023-12-25 21:04:00 -05:00
Ronald Klop 8a0ee30622 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

PR:	274092
Approved by:	karels
MFC after:	1 month
2023-12-07 17:50:28 +01:00
Ronald Klop 3878bbf1bb 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.

PR:	274092
Reported by:	Patrick M. Hausen (via ML)
Reviewed by:	imp, karels, zlei
Tested by:	Patrick M. Hausen
Approved by:	karels
MFC after:	1 month
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D42463
2023-12-07 12:32:01 +01:00
Eugene Grosbein 970d73856b usbdevs: add quirk for WD MyPassport Ultra External HDD
WD MyPassport Ultra External HDD needs quirk
UQ_MSC_NO_TEST_UNIT_READY to attach.

MFC after:	3 days
2023-12-03 23:50:40 +07:00
Bjoern A. Zeeb 75f298492a Revert "Enter the network epoch in USB WiFi drivers when processing input"
This reverts commit 17c328b6ae.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-12-01 00:48:54 +00:00
Bjoern A. Zeeb 39b7027979 Revert "Widen EPOCH(9) usage in USB WLAN drivers."
This reverts commit 21c4082de9.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-12-01 00:48:54 +00:00
Warner Losh fdafd315ad sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:00 -07:00
Dmitry Luhtionov f969fb53d8 Add some Intel ICH10 PCI IDs. 2023-10-30 10:37:36 -04:00
Warner Losh f42bb99ad5 udbp: Remove stale splnet comment
netgraph no longer needs splnet. Document that we're forcing queueing.

Sponsored by:		Netflix
2023-10-27 14:12:04 -06:00
Justin Hibbits 8f31b879ec 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
2023-10-13 14:33:31 -04:00
Justin Hibbits 5e444deec0 Revert "bpf: Add IfAPI analogue for bpf_peers_present()"
This reverts commit c81dd8e5fe.

Commit message needs revised.
2023-10-13 14:33:31 -04:00
Justin Hibbits c81dd8e5fe 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 includes a NULL check.  Since this API
is used in only a handful of locations, it reduces the the NULL check
scope over inserting the check into bpf_peers_present().

Sponsored by:	Juniper Networks, Inc.
MFC after:	1 week
2023-10-13 13:12:44 -04:00
Mazin Fadl 94efe9f91b usb: add quirks for the Genesys GL3220 card reader
Without these, card hotplugging does not work on the GL3220.

PR:	263868
Fixes:	520b88860d7a79 ("usb(4): Automagically apply all quirks [...]")
2023-10-11 16:08:53 -05:00
Mazin Fadl b332adfa96 usb: add necessary quirks for the NOREL Systems NS1081 SD reader
Without these, the Norelsys NS1081 is completely defunct.

PR:	263868
Fixes:	520b88860d7a79 ("usb(4): Automagically apply all quirks [...]")
2023-10-11 16:08:53 -05:00
Poul-Henning Kamp f17b69fd0f Move (LENOVO, TBT3LAN) from if_ure til if_cdce where it works much better 2023-10-11 15:54:55 +00:00
Damien Broka 6962da914d 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
2023-10-04 11:08:06 -04:00
Bjoern A. Zeeb f156cd892b 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
MFC after:	4 weeks
2023-10-02 14:52:57 +00:00
Damien Broka 70fbcd451b 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
2023-09-13 10:08:11 -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