summaryrefslogtreecommitdiff
path: root/sys/dev
AgeCommit message (Collapse)Author
26 hoursdpaa2: Extract checksum statuses on ingressDmitry Salychev
In order to enable RX checksum offloading we need to check the meta-information for the (good) frames to see if the L3/4 checksums were calculated and if there was an error. The way the buffere are setup, the needed frame meta-information is already requested. All we have to do is make sure it is really part of the RX frame, that it is valid, and if the respective bits are set. Also do not forget to set the (dummy) csum_data as otherwise upper layers will just be cranky. An artefact of the past which likely should disappear. PR: 292006 Reviewed by: bz, tuexen Tested by: bz, tuexen Approved by: tuexen Obtained from: bz (initial version, D55320) MFC after: 3 days Sponsored by: Traverse Technologies (providing Ten64 HW for testing) Differential Revision: https://reviews.freebsd.org/D56383
36 hoursthunderbolt: Fix a typo in a source code commentGordon Bergling
- s/Inititalize/Initialize/ MFC after: 3 days
2 daysRevert "sound: Remove some forward declarations from sound.h and uaudio.h"Christos Margiolis
This reverts commit 602249f033d146d9c731d8b1cb4b2e0899c61ad9.
2 dayssound: Remove some forward declarations from sound.h and uaudio.hChristos Margiolis
Sponsored by: The FreeBSD Foundation MFC after: 1 week
3 daysacpi_spmc(4): Remove redundant setting of 'sc->dev' on attachOlivier Certner
Should have been part of the previous commit (but PEBCAK). Reviewed by: obiwac Fixes: bd05b47fbd8b ("acpi_spmc(4): Small probe improvements/fixes") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56483
3 daysacpi_spmc(4): Small probe improvements/fixesOlivier Certner
Remove the test on presence of an ACPI handle, this is implied by ACPI_ID_PROBE() succeeding. Set 'sc->dev' early, so that acpi_spmc_check_dsm_set() using device_printf() will print the driver name. Add a missing newline after printing that more DSM functions are implemented then expected. Reviewed by: obiwac Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56483
3 daysuart/pci: use different probe return valuesRoger Pau Monné
For PCI devices listed in pci_ns8250_ids return BUS_PROBE_SPECIFIC, while for generic UART devices not explicitly listed in pci_ns8250_ids return BUS_PROBE_GENERIC. This allows more specific drivers to take over those devices, and the generic UART PCI driver will only be used as a fallback. This fixes an issue where the UART PCI driver would attach to multiport PCI UART devices, that instead need to use the puc(4) driver to multiplex the device. Reported by: markj Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D56467 Reviewed by: markj imp
3 daysuart/pci: recover ADL AMT device after FIFO size probingRoger Pau Monné
When the Alder Lake Serial-over-LAN device is put into loopback mode and repeated writes are performed to the data register it results in the device ending up in a non-functional state afterwards. Recovering the device to a working state requires re-writing the LCR register with it's current value (no effective change). This should be harmless on all other devices. Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D56107 Reviewed by: imp
3 daysixgbe: improve MDIO performance by reducing semaphore/IPC delaysAdrian Chadd
Each MDIO transfer takes 8ms, and all of that is spent in a set of DELAY() calls, which is consuming a LOT of CPU. * Change the timeout in ixgbe_hic_unlocked() - doing IPC to the on-chip firmware - to a 1uS delay and bump timeout appropriately. This seems to finish in a couple of microseconds on my local test devices. * Change the 2ms sleep in ixgbe_release_swfw_sync_X540() to 2ms for EEPROM/flash, and 10uS otherwise. 10uS seems to work fine on my local testing, but the config EEPROM doesn't read right without this extra delay. The first change shouldn't change the driver behaviour, but the latter change is more intrusive and needs some wider testing. (My guess here is that there SHOULD have been some completion check somewhere in the EEPROM/flash IO path, and these sleeps are masking them.) Locally tested: * C3558 (Denverton) w/ X553 backplane Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D50295
3 daysixgbe: add MDIO bus supportAdrian Chadd
This works enough to let me see the marvell switch on the MDIO bus. It uses clause 22, which ixgbe's existing MDIO code doesn't currently support, so it's implemented in a new source file. Since mdio(4) is now required, add it where appropriate to GENERIC kernels. Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D50128
4 daysrge: add disable_aspm tunable for PCIe power managementChristos Longros
Add a per-interface loader tunable dev.rge.%d.disable_aspm to disable PCIe ASPM (L0s/L1) and ECPM on the RTL8125/8126/8127. Disabling ASPM reduces latency at the cost of higher power consumption. Default is off (ASPM left as configured by BIOS). Signed-off-by: Christos Longros <chris.longros@gmail.com> Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D56103
4 daysasmc: add automatic voltage/current/power/ambient sensor detectionAbdelkader Boudih
Apple SMCs contain numerous undocumented voltage, current, power, and ambient light sensors. This change adds automatic detection and registration of these sensors as sysctls. New sysctl trees: dev.asmc.0.voltage.* - Voltage sensors (millivolts) dev.asmc.0.current.* - Current sensors (milliamps) dev.asmc.0.power.* - Power sensors (milliwatts) dev.asmc.0.ambient.* - Ambient light sensors Implementation: - Scans all SMC keys at attach time via asmc_key_dump_by_index() - Identifies sensors by key prefix patterns: - Voltage: VC*, VD*, VG*, VP*, VI* - Current: I{C,D,G,M,N,O,H,P,B,A,L}* - Power: P{C,D,N,S,T,H,F,Z,z}* - Light: ALV*, ALS* - Dynamically creates sysctls for detected sensors - Supports 8 fixed-point SMC data types: - sp78, sp87, sp4b, sp5a, sp69, sp96, sp2d, ui16 - Auto-converts all values to milli-units (mV, mA, mW) On Mac Mini 5,1, detects: - 7 voltage sensors - 18 current sensors - 27 power sensors - 2 ambient light sensors Enables power consumption monitoring, voltage rail debugging, and ambient light detection without hardcoding model-specific sensor lists. Tested on: - Mac Mini 5,1 (2011) running FreeBSD 15.0-RELEASE - 54 sensors auto-detected and exposed via sysctl - All sensor types verified with multimeter readings - Fixed-point conversions validated against known values - Memory management tested (malloc/free on detach) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D55807
4 dayse6000/fdt: Ignore disabled switch portsJustin Hibbits
Instead of trying to parse a bogus node, just skip it if marked disabled.
4 daysetherswitch: Add minimal support for mv88e6170 switchJustin Hibbits
4 daysmlx5e: Ensure rx timestamps are monotonically increasingAndrew Gallatin
The clock calibration routine currently can result in rx timestamps jumping backwards, which can confuse the TCP stack. Ensure they are monotonically increasing by estimating what we'd calculate as the next timestamp and clamp the calibration so new timestamps are no earlier in time. Reviewed by: kib, nickbanks_netflix.com Tested by: nickbanks_netflix.com Differential Revision: https://reviews.freebsd.org/D56427 Sponsored by: Netflix
4 daysclk_fixed: quiet a warning messageMitchell Horne
Frequently there are some unused/unspecified fixed clocks present in a device tree. Each one emits a warning before it fails to attach, which results in (sometimes many) repeated messages which are not user-actionable. Put this warning behind the bootverbose flag. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56204
4 daysofw: bool-ify OF_hasprop()Mitchell Horne
Adjust the function signature and the few callers that don't treat it this way already. This is style only; no functional change intended. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56203
5 daysacpi: Return "unknown D-state" in acpi_d_state_to_str() if unknownAymeric Wibo
Some ACPI debugging prints call acpi_d_state_to_str() on unset D-states (i.e. ACPI_STATE_UNKNOWN), so return a string explicitly saying "unknown D-state" instead of just panicking. Fixes: 84bbfc32a3f4 ("acpi_powerres: D3cold support") Sponsored by: The FreeBSD Foundation MFC after: 3 days
5 daysuvscom: Fix baud rate validation in uvscom_pre_param()Weixie Cui
The switch fell through from the supported B150–B115200 cases into default and returned EINVAL for every speed. Break out before default so valid rates return success, matching uvscom_cfg_param(). Signed-off-by: Weixie Cui <cuiweixie@gmail.com> Reviewed by: imp,aokblast Pull Request: https://github.com/freebsd/freebsd-src/pull/2110
5 daysasmc: correctly label ASMC_KEY_FANMINSPEED as read-writeMarcus Gartner
Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
5 daysasmc: add support for MacBookPro13,1Marcus Gartner
This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two temperature keys are omitted because they fail to be read: TI0P (IO Proximity) and Ta0P (Ambient Air). Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only applies when the fans have been activated by the system. In my testing, the fans did not spin up until CPU temperatures hit about 80C. At lower temperatures, the fans will happily ignore the minimum speed and remain at 0 rpm. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
5 daysappleir: Add Apple IR receiver driverAbdelkader Boudih
HID driver for Apple IR receivers (USB HID, vendor 0x05ac). Supports Apple Remote and generic IR remotes using NEC protocol. Supported hardware: - Apple IR Receiver (0x8240, 0x8241, 0x8242, 0x8243, 0x1440) Apple Remote protocol (proprietary 5-byte HID reports): - Key down/repeat/battery-low detection - 17-key mapping with two-packet command support - Synthesized key-up via 125ms callout timer Generic IR remotes (NEC protocol): - Format: [0x26][0x7f][0x80][code][~code] - Checksum: code + ~code = 0xFF - Default keymap with 8 common codes - See: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol Output via evdev with standard KEY_* codes. Raw HID access available at /dev/hidraw0 for custom remapping. Based on protocol reverse-engineering by James McKenzie et al. Reference: drivers/hid/hid-appleir.c (Linux) Tested on Mac Mini 2011 (0x05ac:0x8242). Differential Revision: https://reviews.freebsd.org/D55472
5 daysthunderbolt: Support generic USB4 NHIsAymeric Wibo
Check a PCI device's class, subclass, and progif to figure out if it is a USB4 NHI. nhi_identifiers is completely removed as only these generic USB4 NHIs are supported anyway, and all remnants of ICM-supporting code are removed too. All devices now use the HCM. PR: 290827 Reviewed by: jhb, ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52861
6 daysasmc: add raw SMC key read/write interfaceAbdelkader Boudih
This patch adds a debugging interface to read and write arbitrary Apple SMC keys by name through sysctl, enabling hardware exploration and control of undocumented features. The interface provides four sysctls under dev.asmc.0.raw.*: - key - Set the 4-character SMC key name (e.g., "AUPO") - value - Read/write key value as a hex string - len - Auto-detected key value length (can be overridden) - type - Read-only 4-character type string (e.g., "ui8", "flt") Implementation includes a new asmc_key_getinfo() function using SMC command 0x13 to query key metadata. The interface automatically detects key lengths and types, uses hex string encoding for arbitrary binary values, and is safe for concurrent access via CTLFLAG_NEEDGIANT. This interface was essential for discovering that the AUPO key enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys on Mac Mini 5,1. Reviewed by: ngie, adrian, markj Differential Revision: https://reviews.freebsd.org/D54441
7 daysnvme: Use passed in max_pages.Warner Losh
Noticed by: jhb Sponsored by: Netflix
7 dayscompat/linux: Add Linux i2c-dev ioctl compatibility supportYAO, Xin
Implement Linux I2C ioctl translation in the Linux compatibility layer and wire iicbus cdevs up for in-kernel rdwr handling. Support common i2c-dev requests including SLAVE, FUNCS, and RDWR, while rejecting unsupported 10-bit and SMBus operations. Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com> Reviewed by: imp, adrian, pouria Differential Revision: https://reviews.freebsd.org/D56251
8 daysnvme_ctrlr_linux_passthru_cmd: correct size of upages_small arrayRyan Libby
The size broke when upages was converted from array to double pointer. Reported by: gcc -Wsizeof-pointer-div Reviewed by: imp Fixes: 82ff1c334b97 ("nvme: Allow larger user request sizes") Differential Revision: https://reviews.freebsd.org/D56368
8 daysinpcb: retire INP_DROPPED and in_pcbdrop()Gleb Smirnoff
The inpcb flag INP_DROPPED served two purposes. It was used by TCP and subsystems running on top of TCP as a flag that marks a connection that is now in TCPS_CLOSED, but was in some other state before (not a new-born connection). Create a new TCP flag TF_DISCONNECTED for this purpose. The in_pcbdrop() was a TCP's version of in_pcbdisconnect() that also sets INP_DROPPED. Use in_pcbdisconnect() instead. Second purpose of INP_DROPPED was a negative lookup mask in inp_smr_lock(), as SMR-protected lookup may see inpcbs that had been removed from the hash. We already have had INP_INHASHLIST that marks inpcb that is in hash. Convert it into INP_UNCONNECTED with the opposite meaning. This allows to combine it with INP_FREED for the negative lookup mask. The Chelsio/ToE and kTLS changes are done with some style refactoring, like moving inp/tp assignments up and using macros for that. However, no deep thinking was taken to check if those checks are really needed, it could be that some are not. Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D56186
8 dayswsp(4): Make evdev interface operational if sysmouse one is not openedVladimir Kondratyev
Before this change evdev interface sent only copy of data sent through the sysmouse interface. It worked as /dev/wsp0 device node was automatcaly opened by devd(8) with starting of moused(8). Starting with 15.0 moused(8) does not open sysmouse interface by default thus making wsp(4) device dysfunctional. Fix it with adding extra checks of interfaces state. MFC after: 1 week
8 dayswsp(4): Do not handle pressure on non-ForceTouch devicesVladimir Kondratyev
They always report it value as zero breaking pressure-driven drivers like moused(8) and xf86-input-synaptics. MFC after: 1 week
8 daysbcm5974(4): Do not handle pressure on non-ForceTouch devicesVladimir Kondratyev
They always report it value as zero breaking pressure-driven drivers like moused(8) and xf86-input-synaptics. MFC after: 1 week
8 daysbcm5974(4): Fix pre-2015 Apple touchpad supportVladimir Kondratyev
These devices appeared to stop sending reports via mouse USB interface after switching to RAW mode. Fix it with changing Usage of Top Level Collection to one found in HID report descriptor of proper interface. MFC after: 1 week
8 dayshid: Change Usage Page names to match documentationVladimir Kondratyev
According to "HID Usage Tables FOR Universal Serial Bus (USB)" Usage Page ID range 0x93-0xF1CF is "Reserved" and Usage Page ID range 0xFF00-0xFFFF is "Vendor-defined". MFC after: 1 week
9 daysixgbe: Fix MRQC register value.Yuichiro NAITO
Focus on the MRQE field of the MRQC register, which is 4 bits wide, and we use these 3 types of values. - IXGBE_MRQC_RSSEN 0x1 (non VF mode) - IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs) - IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs) If we always take a bitwise OR with IXGBE_MRQC_RSSEN, IXGBE_MRQC_VMDQRSS32EN will never be chosen. Select these 3 types of values for the proper case. Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com> MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/2132
10 daysqcom_gcc: migrate the MSM8916 support to qcom_gccAdrian Chadd
* migrate the MSM8916 (snapdragon 410) support to qcom_gcc * add the full qcom_gcc / qcom_clk list to files.arm64, replacing the MSM8916 stub in sys/arm64/qualcomm . Differential Revision: https://reviews.freebsd.org/D49706
10 daysrge: add Wake-on-LAN support for magic packetChristos Longros
Advertise IFCAP_WOL_MAGIC when PCI power management is available and enable it by default. On suspend or shutdown, rge_setwol() enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables the RXDV gate, and enables PM so the NIC stays powered to watch for magic packets. Move hardware-specific WOL register configuration into rge_wol_config() in if_rge_hw.c to keep hardware-specific functions in sync with OpenBSD. Update rge.4 to document WoL support. Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125 on a Gigabyte B650 Gaming X AX motherboard. Signed-off-by: Christos Longros <chris.longros@gmail.com> Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D56259
11 daysnvme: Allow larger user request sizesWarner Losh
We have a small buffer for pages on the stack, but if the user wants to do an I/O larger than this we currently fail w/o a way for the user to know the max size. It's not hard to allocate an array for the uncommon case of very large I/Os, and the performance advantage of the array is small in that case anyway. In addition, this allows firmware upgrades using the full transfer size of the device as a happy accident too. Sponsored by: Netflix Reviewed by: chs, chuck Differential Revision: https://reviews.freebsd.org/D55638
11 daysix(4): Add support for firmware logging for E610 adaptersBhosale, Yogesh
This is part 3 of the support for the new Intel Ethernet E610 family of devices The ix driver now enables firmware logging on Intel E610 devices for debugging with Customer Support. Logs are enabled by default and generated in binary format that requires decoding by support teams. The collected data is firmware and hardware related for debugging purposes only. When the driver loads, it creates a fw_log sysctl node under the debug section. Events are organized into categories (modules) for targeted logging, and users can adjust verbosity levels as needed. This adds sysctl support for the firmware logging feature and updates the ix(4) manual page with documentation. Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com> Co-developed-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Reviewed by: ziaee, kbowling Tested by: Mateusz Moga <mateusz.moga@intel.com> MFC after: 1 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D53973
11 dayshwpmc: prevent IBS fetch from getting stuckAli Mashtizadeh
Both fetch and op IBS sampling have the same problem where we need to rewrite the control MSR to ensure sampling continues at the correct rate. I also like this because it resets the counter reducing the chances that we collect a sample inside the NMI handler. Reported by: Aalok Agarwal Reviewed by: mhorne Sponsored by: Netflix Fixes: e51ef8ae490f ("hwpmc: Initial support for AMD IBS") Pull Request: https://github.com/freebsd/freebsd-src/pull/2130
11 dayshwpmc: Fix bug when stopping ibs-opAli Mashtizadeh
In ibs_stop_pmc I accidently cleared the fetch max count value rather than the op max count value, when stopping the op counter. This mitigates a bug in early pre-zen processors, but breaks using both counters simultaneously. I also found that the max op count mask needs to be extended for recent zen processors. Reported by: Andre Fernando da Silva Reviewed by: mhorne Sponsored by: Netflix Fixes: e51ef8ae490f ("hwpmc: Initial support for AMD IBS") Pull Request: https://github.com/freebsd/freebsd-src/pull/2120
11 dayshwpmc: Fix compile warningNavdeep Parhar
.../sys/dev/hwpmc/hwpmc_mod.c:4640:1: warning: unused function 'pmc_is_multipart' [-Wunused-function] 4640 | pmc_is_multipart(struct pmc_sample *ps) | ^~~~~~~~~~~~~~~~ 1 warning generated. Reviewed by: mhorne Fixes: e51ef8ae490f - main - hwpmc: Initial support for AMD IBS Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56296
11 daysvirtio_blk: Fix initialisation of dump request structureSarah Walker
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer allocations") failed to update initialisation of the dedicated dump request structure. This caused a panic on attempting to dump core to a virtio_blk device. Reviewed by: asomers Sponsored by: Arm Ltd Pull Request: https://reviews.freebsd.org/D56156
12 daysdpaa2: Extract frame-specific routines to dpaa2_frame.[h,c]Dmitry Salychev
As soon as we need information from the hardware frame annotation to make sure that checksums of the ingress frames were verified by the DPAA2 HW, I've decided to make a preparation and extracted all of the frame related routines into the separate dpaa2_frame.[h,c] along with some clean up and improvements, e.g. no more dpaa2_fa, but dpaa2_swa and dpaa2_hwa structures to describe software and hardware frame annotations respectively, dpaa2_fa_get_swa/dpaa2_fa_get_hwa to obtain those annotations from the frame descriptor. The next step is to implement dpaa2_fa_get_hwa. PR: 292006 Approved by: tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56315
12 daysacpi: Parse _S3D in s2idle instead of _S255DAymeric Wibo
Previously, when entering s2idle, we were parsing the _S255D object to get the shallowest D-state supported by device, as acpi_stype_to_sstate() returns -1 for s2idle. Instead, we should read _S3D. Relevant document: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/07_Power_and_Performance_Mgmt/device-power-management-objects.html#s3d-s3-device-state Reviewed by: olce Tested by: emaste, olce Approved by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55118
13 dayssound: Make chn_reset() control flow clearerChristos Margiolis
I think this is cleaner than playing around with return values. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56264
13 dayssound: De-macro array definitions in chn_calclatency()Christos Margiolis
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56263
13 dayssound: Simplify parts of chn_notify()Christos Margiolis
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56240
13 dayssound: Retire unused CHN_N_* definesChristos Margiolis
These still haven't been implemented by the original author, and there doesn't seem to be much use for them anyway. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56239
13 dayssound: Mark some snd_fmt* functions as staticChristos Margiolis
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56238
2026-04-05net: Add SIOCGI2CPB ioctl & add page/bank fields to ifi2creqAndrew Gallatin
This commit adds page & bank fields to ifi2creq in preparation for adding CMIS support for 400g optics to ifconfig. The new ioctl SIOCGI2CPB is added, so that drivers can distinguish between callers asking for page/bank selection and legacy callers that simply failed to zero out all ifi2creq fields. The mlx5en(4) driver and iflib(4) driver frameork have been updated to use this new SIOCGI2CPB ioctl and support page/bank operations. A follow-on patchset will add support to ifconfig for reporting data from CMIS optics. This has been tested on Nvidia ConnectX-7 and Broadcom Thor2 (using out of tree driver) based NICs. Differential Revision: https://reviews.freebsd.org/D55912 Sponsored by: Netflix Inc. Reviewed by: kib