aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 09be0f81b27b..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
@@ -51,8 +48,12 @@
51#include <linux/list.h> 48#include <linux/list.h>
52#include <linux/compiler.h> 49#include <linux/compiler.h>
53#include <linux/errno.h> 50#include <linux/errno.h>
51#include <asm/atomic.h>
54#include <linux/device.h> 52#include <linux/device.h>
55 53
54/* Include the ID list */
55#include <linux/pci_ids.h>
56
56/* File state for mmap()s on /proc/bus/pci/X/Y */ 57/* File state for mmap()s on /proc/bus/pci/X/Y */
57enum pci_mmap_state { 58enum pci_mmap_state {
58 pci_mmap_io, 59 pci_mmap_io,
@@ -159,7 +160,6 @@ struct pci_dev {
159 unsigned int transparent:1; /* Transparent PCI bridge */ 160 unsigned int transparent:1; /* Transparent PCI bridge */
160 unsigned int multifunction:1;/* Part of multi-function device */ 161 unsigned int multifunction:1;/* Part of multi-function device */
161 /* keep track of device state */ 162 /* keep track of device state */
162 unsigned int is_enabled:1; /* pci_enable_device has been called */
163 unsigned int is_busmaster:1; /* device is busmaster */ 163 unsigned int is_busmaster:1; /* device is busmaster */
164 unsigned int no_msi:1; /* device may not use msi */ 164 unsigned int no_msi:1; /* device may not use msi */
165 unsigned int no_d1d2:1; /* only allow d0 or d3 */ 165 unsigned int no_d1d2:1; /* only allow d0 or d3 */
@@ -167,6 +167,7 @@ struct pci_dev {
167 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 167 unsigned int broken_parity_status:1; /* Device generates false positive parity */
168 unsigned int msi_enabled:1; 168 unsigned int msi_enabled:1;
169 unsigned int msix_enabled:1; 169 unsigned int msix_enabled:1;
170 atomic_t enable_cnt; /* pci_enable_device has been called */
170 171
171 u32 saved_config_space[16]; /* config space saved at suspend time */ 172 u32 saved_config_space[16]; /* config space saved at suspend time */
172 struct hlist_head saved_cap_space; 173 struct hlist_head saved_cap_space;
@@ -395,6 +396,21 @@ struct pci_driver {
395 */ 396 */
396#define pci_module_init pci_register_driver 397#define pci_module_init pci_register_driver
397 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
398/* these external functions are only available when PCI support is enabled */ 414/* these external functions are only available when PCI support is enabled */
399#ifdef CONFIG_PCI 415#ifdef CONFIG_PCI
400 416
@@ -453,6 +469,8 @@ struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
453int pci_find_capability (struct pci_dev *dev, int cap); 469int pci_find_capability (struct pci_dev *dev, int cap);
454int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 470int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
455int pci_find_ext_capability (struct pci_dev *dev, int cap); 471int pci_find_ext_capability (struct pci_dev *dev, int cap);
472int pci_find_ht_capability (struct pci_dev *dev, int ht_cap);
473int pci_find_next_ht_capability (struct pci_dev *dev, int pos, int ht_cap);
456struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 474struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
457 475
458struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 476struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
@@ -467,6 +485,7 @@ struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn);
467struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn); 485struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn);
468struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); 486struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from);
469int pci_dev_present(const struct pci_device_id *ids); 487int pci_dev_present(const struct pci_device_id *ids);
488const struct pci_device_id *pci_find_present(const struct pci_device_id *ids);
470 489
471int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val); 490int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
472int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val); 491int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val);
@@ -680,6 +699,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *
680{ return NULL; } 699{ return NULL; }
681 700
682#define pci_dev_present(ids) (0) 701#define pci_dev_present(ids) (0)
702#define pci_find_present(ids) (NULL)
683#define pci_dev_put(dev) do { } while (0) 703#define pci_dev_put(dev) do { } while (0)
684 704
685static inline void pci_set_master(struct pci_dev *dev) { } 705static inline void pci_set_master(struct pci_dev *dev) { }
@@ -782,6 +802,7 @@ enum pci_fixup_pass {
782 pci_fixup_header, /* After reading configuration header */ 802 pci_fixup_header, /* After reading configuration header */
783 pci_fixup_final, /* Final phase of device fixups */ 803 pci_fixup_final, /* Final phase of device fixups */
784 pci_fixup_enable, /* pci_enable_device() time */ 804 pci_fixup_enable, /* pci_enable_device() time */
805 pci_fixup_resume, /* pci_enable_device() time */
785}; 806};
786 807
787/* Anonymous variables would be nice... */ 808/* Anonymous variables would be nice... */
@@ -800,6 +821,9 @@ enum pci_fixup_pass {
800#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ 821#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \
801 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ 822 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \
802 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)
803 827
804 828
805void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 829void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);