Skip to content

Commit

Permalink
Add PNP info to the PCI attachment of the aacraid driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhanshiva committed May 11, 2018
1 parent 18a47bd commit 71384ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sys/dev/aacraid/aacraid_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ static driver_t aacraid_pci_driver = {
static devclass_t aacraid_devclass;

DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#", pci, aacraid,
aacraid_family_identifiers, sizeof(aacraid_family_identifiers[0]),
nitems(aacraid_family_identifiers) - 1);
MODULE_DEPEND(aacraid, pci, 1, 1, 1);

struct aac_ident
Expand Down

3 comments on commit 71384ca

@ctuffli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lakhanshiva , maybe my understanding of how all this works is wrong, but can you comment on why the .num_entry field is set to nitems() - 1 and not just nitems()? My guess is this was copied from the dev/ed/if_ed_*.c drivers. Other drivers effectively use nitems(), although they literally use something of the form sizeof(table) / sizeof(table[0]).

kldxref does things like this:

for (i = 0; i < pnp.num_entry; i++) {

which suggests using the value nitems() - 1 will prevent kldxref from ever matching the last entry.

@bsdimp , what would you think of normalizing the MODULE_PNP_INFO() usage in the driver as a part of this GSoC effort (i.e. using nitems() everywhere)?

@lakhanshiva
Copy link
Collaborator Author

@lakhanshiva lakhanshiva commented on 71384ca May 11, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctuffli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lakhanshiva , ahh, OK, thanks.

Please sign in to comment.