PCI: Add pci_find_ht_capability() for finding Hypertransport capabilities
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 22 Nov 2006 07:26:18 +0000 (18:26 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Dec 2006 18:54:42 +0000 (10:54 -0800)
commit687d5fe3dc33794efb500f42164a0588e2647914
tree9d344d790ae2e9d6214c2b2941360e5c0ef97f7b
parentd3bac118fb27a365d5e9f54f4a078eb9b42f968f
PCI: Add pci_find_ht_capability() for finding Hypertransport capabilities

There are already several places in the kernel that want to search a PCI
device for a given Hypertransport capability. Although this is possible
using pci_find_capability() etc., it makes sense to encapsulate that
logic in a helper - pci_find_ht_capability().

To cater for searching exhaustively for a capability, we also provide
pci_find_next_ht_capability().

We also need to cater for the fact that the HT capability fields may be
either 3 or 5 bits wide. pci_find_ht_capability() deals with this for you,
but callers using the #defines directly must handle that themselves.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pci.c
include/linux/pci.h
include/linux/pci_regs.h