Page MenuHomeFreeBSD

LinuxKPI: extend pci.h by various functions
ClosedPublic

Authored by bz on May 28 2021, 11:35 AM.

Details

Summary

Add dummy functions for dealing with "HotPlug" events which we currently
do not support. Leave a printf in case someone hits them so we can
implement.
Similar do for pci_disable_link_state() which none of the targeted
iwlwifi devices seems to need to my reading.

Add pci_dev_get(), pci_find_ext_capability() and pci_pme_capable().

The added pcie_find_root_port() is a bit special as we need to create
another linux pci device; for that make lkpinew_pci_dev() public
which is also helpful for other cases when we want to use the Linux
routines to check for device identifiers only and need a container
for the "bsddev" to use natively. This has proven to avoid basic
checking code for the sake of rewriting it to native field names
elsewhere. Given we cache the newly created "root" we also need to
make sure we clean it up.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz requested review of this revision.May 28 2021, 11:35 AM

Anyone interested in this or should I go ahead and commit it?

You should also bump the FreeBSD version when pushing this.

You should also bump the FreeBSD version when pushing this.

does that mean this is ok?

Yes. See one comment.

sys/compat/linuxkpi/common/include/linux/pci.h
551

Maybe just remove this printf. Function returns error in any case.

This revision is now accepted and ready to land.Jun 18 2021, 11:34 AM
bz marked an inline comment as done.Jun 18 2021, 1:20 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/pci.h
551

Done in the local tree for committing.

sys/compat/linuxkpi/common/include/linux/pci.h
1140

I think it is safe to remove this printf() aswell.

This revision was automatically updated to reflect the committed changes.
bz marked an inline comment as done.