History log of /freebsd/sys/compat/linuxkpi/common/include/linux/pci.h (Results 1 – 25 of 131)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# e29d72ac 24-Apr-2025 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: pci: add pci_info()

Add pci_info() needed for a driver update. While here prefix
__VA_ARGS__ with ## for pci_err and pci_info in case we are only
passed a string without format arguments.

LinuxKPI: pci: add pci_info()

Add pci_info() needed for a driver update. While here prefix
__VA_ARGS__ with ## for pci_err and pci_info in case we are only
passed a string without format arguments.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50009

show more ...


Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0
# 21b55655 04-Mar-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Fix `pci_upstream_bridge()` with DRM devices

In the case of DRM drivers, the passed device is a child of `vgapci`. We
want to start the lookup from `vgapci`, so the parent of the passed
`d

linuxkpi: Fix `pci_upstream_bridge()` with DRM devices

In the case of DRM drivers, the passed device is a child of `vgapci`. We
want to start the lookup from `vgapci`, so the parent of the passed
`drmn`. We use the `isdrm` flag to determine if we are in this
situation.

This fixes an infinite loop with the amdgpu DRM driver that started to
use this function in Linux 6.8: `pci_upstream_bridge()` was returning
itself and the code in amdgpu was calling it again, hoping to get a
device with a vendor that is not "ATI".

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49388

show more ...


# 3f847ccf 26-Feb-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Define a few more `PCI_*` constants

They are synonymous to existing FreeBSD constants.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.fr

linuxkpi: Define a few more `PCI_*` constants

They are synonymous to existing FreeBSD constants.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49379

show more ...


Revision tags: release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4
# 1396a731 05-Feb-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Print "TODO" if a driver call `pci_wake_from_d3()`

This helps developers working with linuxkpi find out a function is
already defined but is just a stub.

Reported by: bz
Reviewed by: bz,

linuxkpi: Print "TODO" if a driver call `pci_wake_from_d3()`

This helps developers working with linuxkpi find out a function is
already defined but is just a stub.

Reported by: bz
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48862

show more ...


# dec2806f 05-Feb-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Define `PCI_IRQ_LEGACY` for Linux < 6.10

Commit 03e39d3d42e70482cd6f65ecaa5cf8ff9674d27c decreased the Linux
version that exposes this constant to be Linux 6.7. It happens that the
constan

linuxkpi: Define `PCI_IRQ_LEGACY` for Linux < 6.10

Commit 03e39d3d42e70482cd6f65ecaa5cf8ff9674d27c decreased the Linux
version that exposes this constant to be Linux 6.7. It happens that the
constant is older.

However, it is removed in Linux 6.10. Let's change the version condition
to say that it is defined for any version before 6.10.

Reported by: bz
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48861

show more ...


Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3
# 73281513 01-Jan-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `pci_wake_from_d3()`

[Why]
This is used by the amdgpu DRM driver starting with Linux 6.7.

[How]
The function just returns 0 for now.

Reviewed by: manu
Sponsored by: The FreeBSD Found

linuxkpi: Add `pci_wake_from_d3()`

[Why]
This is used by the amdgpu DRM driver starting with Linux 6.7.

[How]
The function just returns 0 for now.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48759

show more ...


# 479c61bd 22-Dec-2024 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `pci_get_base_class()`

[Why]
This new API is used by the amdgpu DRM driver is Linux 6.7.

[How]
This is the same as `pci_get_class()` except that it searches a PCI
device matching the

linuxkpi: Add `pci_get_base_class()`

[Why]
This new API is used by the amdgpu DRM driver is Linux 6.7.

[How]
This is the same as `pci_get_class()` except that it searches a PCI
device matching the base class only; the subclass is ignored.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48746

show more ...


# 03e39d3d 21-Dec-2024 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Declare `PCI_IRQ_LEGACY` even for linuxkpi 6.7

[Why]
DRM drivers in Linux 6.7 already use this constant.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: http

linuxkpi: Declare `PCI_IRQ_LEGACY` even for linuxkpi 6.7

[Why]
DRM drivers in Linux 6.7 already use this constant.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48742

show more ...


Revision tags: release/14.2.0
# 157e93e0 26-Sep-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX

PCI_IRQ_LEGACY was added in 366d68f28379 (likely) for rtw88 only.
The define now got renamed and I cannot find any other use but
rtw88 and rtw89.

LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX

PCI_IRQ_LEGACY was added in 366d68f28379 (likely) for rtw88 only.
The define now got renamed and I cannot find any other use but
rtw88 and rtw89.
We keep the old name as comapt while driver updates are in
progress enabling it defining LINUXKPI_VERSION for the two drivers.

Sponsored by; The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D46822

show more ...


Revision tags: release/13.4.0
# 01e1131e 12-Sep-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: add pci_err()

Add pci_err() as a wrapper to dev_err() as needed by an updated driver.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: htt

LinuxKPI: add pci_err()

Add pci_err() as a wrapper to dev_err() as needed by an updated driver.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46660

show more ...


# f5c7feee 28-Aug-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: add general module_driver(), use it for module_pci_driver()

Factor out module_pci_driver() from 366d68f283793 into a general
module_driver() so other bus attachments can also use the same

LinuxKPI: add general module_driver(), use it for module_pci_driver()

Factor out module_pci_driver() from 366d68f283793 into a general
module_driver() so other bus attachments can also use the same kind
of macro without duplicating all the lines.

Redefine module_pci_driver() using the new general macro.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D46467

show more ...


# fcc350c3 21-Jul-2024 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Add pci_iomap_range function

pci_iomap_range creates a virtual mapping cookie for a PCI BAR.
As compared with pci_iomap it got extra offset parameter.

Sponsored by: Serenity CyberSecurity

LinuxKPI: Add pci_iomap_range function

pci_iomap_range creates a virtual mapping cookie for a PCI BAR.
As compared with pci_iomap it got extra offset parameter.

Sponsored by: Serenity CyberSecurity, LLC
MFC after: 1 week
Reviewed by: manu, bz
Differential Revision: https://reviews.freebsd.org/D45904

show more ...


# 5b1171a0 21-Jul-2024 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Add pci_match_id to linux/pci.h

It finds out if a given PCI device matches a given pci_id table.

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu
Differentia

LinuxKPI: Add pci_match_id to linux/pci.h

It finds out if a given PCI device matches a given pci_id table.

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D45846

show more ...


Revision tags: release/14.1.0
# a1cdddcf 31-Mar-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: add further constants to pci.h

Updated wireless drivers require more knowledge about PCI (BAR) bits.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: jhb
Differential R

LinuxKPI: add further constants to pci.h

Updated wireless drivers require more knowledge about PCI (BAR) bits.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D44573

show more ...


# f1206503 08-Apr-2024 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Add pci_dev_id to linux/pci.h

It returns bus/device/function number for given PCI device.
Also add intermediate PCI_DEVID macro used in some drivers.

Sponsored by: Serenity Cyber Security

LinuxKPI: Add pci_dev_id to linux/pci.h

It returns bus/device/function number for given PCI device.
Also add intermediate PCI_DEVID macro used in some drivers.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: emaste
MFC after: 1 week

show more ...


Revision tags: release/13.3.0
# 808ae4e2 24-Dec-2023 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Add pcie_capability_clear_and_set_word() function

It does a Read-Modify-Write operation using clear and set bitmasks on
PCI Express Capability Register at pos. As certain PCI Express
Capab

LinuxKPI: Add pcie_capability_clear_and_set_word() function

It does a Read-Modify-Write operation using clear and set bitmasks on
PCI Express Capability Register at pos. As certain PCI Express
Capability Registers are accessed concurrently in RMW fashion, hence
require locking which is handled transparently to the caller.

Sponsored by: Serenity CyberSecurity, LLC
Reviewed by: manu, bz
MFC after: 1 week
MFC TODO: Move pcie_cap_lock to bottom to preserve KBI compatibility
Differential Revision: https://reviews.freebsd.org/D42821

show more ...


# 96ab16eb 24-Dec-2023 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Remove sys/rman.h include from LKPI headers.

sys/rman.h defines `resource` structure which conflicts with the Linux
structure of the same name. To fix that remove reference to sys/rman.h
f

LinuxKPI: Remove sys/rman.h include from LKPI headers.

sys/rman.h defines `resource` structure which conflicts with the Linux
structure of the same name. To fix that remove reference to sys/rman.h
from linux/pci.h and move resource management code to linux_pci.c.
Update consumers which were depending on linux/pci.h pollution.

No functional changes intended.

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42792

show more ...


Revision tags: release/14.0.0
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# f74c09f3 26-Jul-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: pci.h add more constants

Add two more PCI_EXP_LNKSTA_CLS constants to the compat defines
needed by wireless drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: m

LinuxKPI: pci.h add more constants

Add two more PCI_EXP_LNKSTA_CLS constants to the compat defines
needed by wireless drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: manu, emaste
Differential Revision: https://reviews.freebsd.org/D41258

show more ...


# 17bde9cb 20-May-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: pci: update struct msi_desc

It seems struct msi_desc is setup differently (or was changed) compared
to how we added it a while ago. Catch up in order to keep drivers
directly accessing fi

LinuxKPI: pci: update struct msi_desc

It seems struct msi_desc is setup differently (or was changed) compared
to how we added it a while ago. Catch up in order to keep drivers
directly accessing fields compiling.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40175

show more ...


# 7d7d12ba 24-May-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: pci: add PCI_COMMAND_MEMORY

Add another PCI alias to our native defines for a wireless driver.

MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D4

LinuxKPI: pci: add PCI_COMMAND_MEMORY

Add another PCI alias to our native defines for a wireless driver.

MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40247

show more ...


# 525dd4ac 16-May-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: implement pci_rescan_bus()

Try to implement pci_rescan_bus(). pci_rescan_method() is already
doing most of the job. We only have to do the count for the return
value again ourselves.

Sp

LinuxKPI: implement pci_rescan_bus()

Try to implement pci_rescan_bus(). pci_rescan_method() is already
doing most of the job. We only have to do the count for the return
value again ourselves.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D40122

show more ...


# 0e8953b9 20-Apr-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: pci.h: always initialize return value

In pcie_capability_read_*() always initialize the return value to
avoid warnings of uninitialized values in callers.

Sponsored by: The FreeBSD Founda

LinuxKPI: pci.h: always initialize return value

In pcie_capability_read_*() always initialize the return value to
avoid warnings of uninitialized values in callers.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39721

show more ...


Revision tags: release/13.2.0
# 83df72e5 20-Feb-2023 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Define `pat_enabled()`

This new <asm/memtype.h> header is included from <linux/pci.h> because
that's how it is included in Linux too. DRM drivers depend on this.

Reviewed by: manu
Approve

linuxkpi: Define `pat_enabled()`

This new <asm/memtype.h> header is included from <linux/pci.h> because
that's how it is included in Linux too. DRM drivers depend on this.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D39052

show more ...


# af19988f 20-Feb-2023 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Define `pcie_aspm_enabled()`

This is not the same as querying the PCIE ASPM capability. The function
should return if the feature is actually enabled or not. It always
return false on Free

linuxkpi: Define `pcie_aspm_enabled()`

This is not the same as querying the PCIE ASPM capability. The function
should return if the feature is actually enabled or not. It always
return false on FreeBSD.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D39053

show more ...


123456