Date: Sat, 30 May 2026 23:51:43 +0000 From: Bjoern A. Zeeb <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: d07460f19483 - main - LinuxKPI: 802.11 suspend/resume: fix the is_pci_dev check Message-ID: <6a1b780f.18192.b58df6a@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d07460f194835410b6a0e99af6b9721b872fb009 commit d07460f194835410b6a0e99af6b9721b872fb009 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2026-05-30 21:33:51 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2026-05-30 21:33:51 +0000 LinuxKPI: 802.11 suspend/resume: fix the is_pci_dev check Shortly before I committed the works from a year ago, jhb added a function ("is_pci_device") so that the check against the devclass does not have to be coded in every driver. Use this instead in main (and stable/15 in case the works get MFCed). At the same time this fixes the check (the old one was wrong) as we attach to the LinuxKPI 802.11 driver, e.g., iwlwifi and thus we need to check the parent of the parent and not just the parent to be of the devclass "pci" in the identify bus function. The was the first error. The second was (and this is why it worked) that we checked for == instead of != and so the wrong check became true again. Discussed with: jhb Fixes: 11d69a4558de ("LinuxKPI: 802.11: add support for s/r") MFC after: 3 days X-MFC after: ffcf5e356644 ("pci: Add is_pci_device helper function") Sponsored by: The FreeBSD Foundation --- sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c b/sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c index c69288bd5886..cf9384bf53f2 100644 --- a/sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c +++ b/sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c @@ -13,6 +13,7 @@ #include <sys/module.h> #include <linux/pci.h> +#include <dev/pci/pcivar.h> #include "linux_80211.h" #include <net80211/ieee80211_var.h> @@ -139,7 +140,7 @@ lkpi_80211_pm_identify(driver_t *driver, device_t parent) return; /* Make sure this is PCI for now. */ - if (device_get_devclass(parent) == devclass_find("pci")) + if (!is_pci_device(parent)) return; if (BUS_ADD_CHILD(parent, 0, driver->name, DEVICE_UNIT_ANY) == NULL)home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a1b780f.18192.b58df6a>
