Page MenuHomeFreeBSD

LinuxKPI: MODULE_DEVICE_TABLE() factor out the bus specific MODULE_PNP_INFO()
ClosedPublic

Authored by bz on Jun 25 2025, 8:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 10, 6:21 AM
Unknown Object (File)
Wed, Sep 10, 1:36 AM
Unknown Object (File)
Fri, Aug 29, 11:06 PM
Unknown Object (File)
Fri, Aug 29, 9:43 AM
Unknown Object (File)
Fri, Aug 29, 8:51 AM
Unknown Object (File)
Fri, Aug 29, 2:19 AM
Unknown Object (File)
Sun, Aug 24, 6:16 PM
Unknown Object (File)
Thu, Aug 14, 5:42 PM
Subscribers

Details

Summary

In order to be able to use MODULE_DEVICE_TABLE() with multiple bus
attachments, factor out the bus-specfic MODULE_PNP_INFO() and place
it next to the structure defining the table.

As it turns out bnxt(4) has been using the MODULE_DEVICE_TABLE() with
PCI attachments for the "auxillary" bus so far. That makes little sense.
Define the MODULE_PNP_INFO() to nothing for that. We may consider
pulling these LinucKPI bits in semi-native drivers into LinuxKPI
one day as that route is not really sustainabke.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Jun 25 2025, 8:24 PM

As is, this change is good. Some notes for the future..

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

This macro is now out of place in pci.h. It's likely fine for now, but we'll need to move it so usb drivers, say, don't need to include pci.h to get the definition for MODULE_DEVICE_TABLE.... Assuming Linux has a generic interface for that.

This revision is now accepted and ready to land.Jun 25 2025, 8:42 PM
bz marked an inline comment as done.Jun 25 2025, 8:46 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/pci.h
80

It'll migrate to include/linux/mod_devicetable.h once these bits have moved in. I have more changes to that file so it'll be in a next batch.