diff options
| author | Yu Zhao <yu.zhao@intel.com> | 2008-11-21 13:39:32 -0500 |
|---|---|---|
| committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-01-07 14:13:01 -0500 |
| commit | fde09c6d8f92de0c9f75698a75f0989f2234c517 (patch) | |
| tree | 7d01ac3c194e87897185a2bf015f6d3b472e7601 /include/linux | |
| parent | 14add80b5120966fe0659d61815b9e9b4b68fdc5 (diff) | |
PCI: define PCI resource names in an 'enum'
This patch moves all definitions of the PCI resource names to an 'enum',
and also replaces some hard-coded resource variables with symbol
names. This change eases introduction of device specific resources.
Reviewed-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pci.h | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index c5e02f324e13..da1c22bab40e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -82,7 +82,30 @@ enum pci_mmap_state { | |||
| 82 | #define PCI_DMA_FROMDEVICE 2 | 82 | #define PCI_DMA_FROMDEVICE 2 |
| 83 | #define PCI_DMA_NONE 3 | 83 | #define PCI_DMA_NONE 3 |
| 84 | 84 | ||
| 85 | #define DEVICE_COUNT_RESOURCE 12 | 85 | /* |
| 86 | * For PCI devices, the region numbers are assigned this way: | ||
| 87 | */ | ||
| 88 | enum { | ||
| 89 | /* #0-5: standard PCI resources */ | ||
| 90 | PCI_STD_RESOURCES, | ||
| 91 | PCI_STD_RESOURCE_END = 5, | ||
| 92 | |||
| 93 | /* #6: expansion ROM resource */ | ||
| 94 | PCI_ROM_RESOURCE, | ||
| 95 | |||
| 96 | /* resources assigned to buses behind the bridge */ | ||
| 97 | #define PCI_BRIDGE_RESOURCE_NUM 4 | ||
| 98 | |||
| 99 | PCI_BRIDGE_RESOURCES, | ||
| 100 | PCI_BRIDGE_RESOURCE_END = PCI_BRIDGE_RESOURCES + | ||
| 101 | PCI_BRIDGE_RESOURCE_NUM - 1, | ||
| 102 | |||
| 103 | /* total resources associated with a PCI device */ | ||
| 104 | PCI_NUM_RESOURCES, | ||
| 105 | |||
| 106 | /* preserve this for compatibility */ | ||
| 107 | DEVICE_COUNT_RESOURCE | ||
| 108 | }; | ||
| 86 | 109 | ||
| 87 | typedef int __bitwise pci_power_t; | 110 | typedef int __bitwise pci_power_t; |
| 88 | 111 | ||
| @@ -274,18 +297,6 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | |||
| 274 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | 297 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); |
| 275 | } | 298 | } |
| 276 | 299 | ||
| 277 | /* | ||
| 278 | * For PCI devices, the region numbers are assigned this way: | ||
| 279 | * | ||
| 280 | * 0-5 standard PCI regions | ||
| 281 | * 6 expansion ROM | ||
| 282 | * 7-10 bridges: address space assigned to buses behind the bridge | ||
| 283 | */ | ||
| 284 | |||
| 285 | #define PCI_ROM_RESOURCE 6 | ||
| 286 | #define PCI_BRIDGE_RESOURCES 7 | ||
| 287 | #define PCI_NUM_RESOURCES 11 | ||
| 288 | |||
| 289 | #ifndef PCI_BUS_NUM_RESOURCES | 300 | #ifndef PCI_BUS_NUM_RESOURCES |
| 290 | #define PCI_BUS_NUM_RESOURCES 16 | 301 | #define PCI_BUS_NUM_RESOURCES 16 |
| 291 | #endif | 302 | #endif |
