diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-09-17 22:20:28 -0700 |
---|---|---|
committer | Yinghai Lu <yinghai@kernel.org> | 2012-09-17 22:20:28 -0700 |
commit | dc66c2a2efd97f94203c55ab2110b4d96cfb4772 (patch) | |
tree | c1ab803080b7eaa12321df87c42ddb6fbdd45e72 | |
parent | 1ccdaf884736ea976fce580b786c9e7e95d45176 (diff) | |
download | linux-yinghai-dc66c2a2efd97f94203c55ab2110b4d96cfb4772.tar.gz |
PCI: Add is_pci_*_resource_idx()
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
-rw-r--r-- | include/linux/pci.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index ef142f4f524701..7ffd867ec53ee5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -114,6 +114,29 @@ enum { DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES, }; +static inline bool is_pci_std_resource_idx(int i) +{ + return i >= PCI_STD_RESOURCES && i <= PCI_STD_RESOURCE_END; +} + +static inline bool is_pci_rom_resource_idx(int i) +{ + return i == PCI_ROM_RESOURCE; +} + +static inline bool is_pci_iov_resource_idx(int i) +{ +#ifdef CONFIG_PCI_IOV + return i >= PCI_IOV_RESOURCES && i <= PCI_IOV_RESOURCE_END; +#endif + return false; +} + +static inline bool is_pci_bridge_resource_idx(int i) +{ + return i >= PCI_BRIDGE_RESOURCES && i <= PCI_BRIDGE_RESOURCE_END; +} + typedef int __bitwise pci_power_t; #define PCI_D0 ((pci_power_t __force) 0) |