diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 01c707261f9c..f3c617eabd8d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -20,9 +20,6 @@ | |||
20 | /* Include the pci register defines */ | 20 | /* Include the pci register defines */ |
21 | #include <linux/pci_regs.h> | 21 | #include <linux/pci_regs.h> |
22 | 22 | ||
23 | /* Include the ID list */ | ||
24 | #include <linux/pci_ids.h> | ||
25 | |||
26 | /* | 23 | /* |
27 | * The PCI interface treats multi-function devices as independent | 24 | * The PCI interface treats multi-function devices as independent |
28 | * devices. The slot/function address of each device is encoded | 25 | * devices. The slot/function address of each device is encoded |
@@ -54,6 +51,9 @@ | |||
54 | #include <asm/atomic.h> | 51 | #include <asm/atomic.h> |
55 | #include <linux/device.h> | 52 | #include <linux/device.h> |
56 | 53 | ||
54 | /* Include the ID list */ | ||
55 | #include <linux/pci_ids.h> | ||
56 | |||
57 | /* File state for mmap()s on /proc/bus/pci/X/Y */ | 57 | /* File state for mmap()s on /proc/bus/pci/X/Y */ |
58 | enum pci_mmap_state { | 58 | enum pci_mmap_state { |
59 | pci_mmap_io, | 59 | pci_mmap_io, |
@@ -396,6 +396,21 @@ struct pci_driver { | |||
396 | */ | 396 | */ |
397 | #define pci_module_init pci_register_driver | 397 | #define pci_module_init pci_register_driver |
398 | 398 | ||
399 | /** | ||
400 | * PCI_VDEVICE - macro used to describe a specific pci device in short form | ||
401 | * @vend: the vendor name | ||
402 | * @dev: the 16 bit PCI Device ID | ||
403 | * | ||
404 | * This macro is used to create a struct pci_device_id that matches a | ||
405 | * specific PCI device. The subvendor, and subdevice fields will be set | ||
406 | * to PCI_ANY_ID. The macro allows the next field to follow as the device | ||
407 | * private data. | ||
408 | */ | ||
409 | |||
410 | #define PCI_VDEVICE(vendor, device) \ | ||
411 | PCI_VENDOR_ID_##vendor, (device), \ | ||
412 | PCI_ANY_ID, PCI_ANY_ID, 0, 0 | ||
413 | |||
399 | /* these external functions are only available when PCI support is enabled */ | 414 | /* these external functions are only available when PCI support is enabled */ |
400 | #ifdef CONFIG_PCI | 415 | #ifdef CONFIG_PCI |
401 | 416 | ||
@@ -454,6 +469,8 @@ struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); | |||
454 | int pci_find_capability (struct pci_dev *dev, int cap); | 469 | int pci_find_capability (struct pci_dev *dev, int cap); |
455 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); | 470 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); |
456 | int pci_find_ext_capability (struct pci_dev *dev, int cap); | 471 | int pci_find_ext_capability (struct pci_dev *dev, int cap); |
472 | int pci_find_ht_capability (struct pci_dev *dev, int ht_cap); | ||
473 | int pci_find_next_ht_capability (struct pci_dev *dev, int pos, int ht_cap); | ||
457 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); | 474 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); |
458 | 475 | ||
459 | struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, | 476 | struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, |
@@ -468,6 +485,7 @@ struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn); | |||
468 | struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn); | 485 | struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn); |
469 | struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); | 486 | struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); |
470 | int pci_dev_present(const struct pci_device_id *ids); | 487 | int pci_dev_present(const struct pci_device_id *ids); |
488 | const struct pci_device_id *pci_find_present(const struct pci_device_id *ids); | ||
471 | 489 | ||
472 | int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val); | 490 | int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val); |
473 | int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val); | 491 | int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val); |
@@ -681,6 +699,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev * | |||
681 | { return NULL; } | 699 | { return NULL; } |
682 | 700 | ||
683 | #define pci_dev_present(ids) (0) | 701 | #define pci_dev_present(ids) (0) |
702 | #define pci_find_present(ids) (NULL) | ||
684 | #define pci_dev_put(dev) do { } while (0) | 703 | #define pci_dev_put(dev) do { } while (0) |
685 | 704 | ||
686 | static inline void pci_set_master(struct pci_dev *dev) { } | 705 | static inline void pci_set_master(struct pci_dev *dev) { } |
@@ -783,6 +802,7 @@ enum pci_fixup_pass { | |||
783 | pci_fixup_header, /* After reading configuration header */ | 802 | pci_fixup_header, /* After reading configuration header */ |
784 | pci_fixup_final, /* Final phase of device fixups */ | 803 | pci_fixup_final, /* Final phase of device fixups */ |
785 | pci_fixup_enable, /* pci_enable_device() time */ | 804 | pci_fixup_enable, /* pci_enable_device() time */ |
805 | pci_fixup_resume, /* pci_enable_device() time */ | ||
786 | }; | 806 | }; |
787 | 807 | ||
788 | /* Anonymous variables would be nice... */ | 808 | /* Anonymous variables would be nice... */ |
@@ -801,6 +821,9 @@ enum pci_fixup_pass { | |||
801 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 821 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
802 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 822 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
803 | vendor##device##hook, vendor, device, hook) | 823 | vendor##device##hook, vendor, device, hook) |
824 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | ||
825 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | ||
826 | resume##vendor##device##hook, vendor, device, hook) | ||
804 | 827 | ||
805 | 828 | ||
806 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 829 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |