This is used in VirtIO v1 to iterate over all the VENDOR capabilities.
Details
Details
- Reviewers
jhb - Group Reviewers
manpages - Commits
- rS331111: MFC r329598:
rS329598: Add PCI methods to iterate over the PCI capabilities
VirtIO PCI v1 is working with pci_find_next_cap. I don't have a way to test the others.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 14965
Event Timeline
Comment Actions
Looks fine overall, just some suggestions / nits.
share/man/man9/pci.9 | ||
---|---|---|
355 | Nit, drop 'the' here and in the other two places. | |
sys/dev/pci/pci.c | ||
1420 | Perhaps add a KASSERT() that that 'pci_read_config(child, start + PCICAP_ID, 1) == PCIY_HT'? More paranoid would be to add a further assertion that the nested capbility in PCIR_HT_COMMAND from 'start' matches 'capability'. | |
1427 | Do you think this should use 'pci_find_next_cap(PCIY_HT)'? | |
1517 | I would add 'KASSERT(pci_read_config(child, start + PCICAP_ID, 1) == capability)' at the start. | |
1585 | I would change this to: ecap = pci_read_config(child, start, 4); KASSERT(PCI_EXTCAP_ID(ecap) == capability, ...); ptr = PCI_EXTCAP_NEXTPTR(ecap); |
sys/dev/pci/pci.c | ||
---|---|---|
1427 | Yes. I'll change pci_find_htcap_method too. |