aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 13:31:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 13:31:12 -0400
commit3e370b29d35fb01bfb92c2814d6f79bf6a2cb970 (patch)
tree3b8fb467d60bfe6a34686f4abdc3a60050ba40a4 /include/linux/pci.h
parent88d1dce3a74367291f65a757fbdcaf17f042f30c (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into x86/pci-ioapic-boot-irq-quirks
Conflicts: drivers/pci/quirks.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h57
1 files changed, 48 insertions, 9 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6755cf5ac109..cfc2297c3e28 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -17,8 +17,7 @@
17#ifndef LINUX_PCI_H 17#ifndef LINUX_PCI_H
18#define LINUX_PCI_H 18#define LINUX_PCI_H
19 19
20/* Include the pci register defines */ 20#include <linux/pci_regs.h> /* The pci register defines */
21#include <linux/pci_regs.h>
22 21
23/* 22/*
24 * The PCI interface treats multi-function devices as independent 23 * The PCI interface treats multi-function devices as independent
@@ -49,12 +48,22 @@
49#include <linux/list.h> 48#include <linux/list.h>
50#include <linux/compiler.h> 49#include <linux/compiler.h>
51#include <linux/errno.h> 50#include <linux/errno.h>
51#include <linux/kobject.h>
52#include <asm/atomic.h> 52#include <asm/atomic.h>
53#include <linux/device.h> 53#include <linux/device.h>
54 54
55/* Include the ID list */ 55/* Include the ID list */
56#include <linux/pci_ids.h> 56#include <linux/pci_ids.h>
57 57
58/* pci_slot represents a physical slot */
59struct pci_slot {
60 struct pci_bus *bus; /* The bus this slot is on */
61 struct list_head list; /* node in list of slots on this bus */
62 struct hotplug_slot *hotplug; /* Hotplug info (migrate over time) */
63 unsigned char number; /* PCI_SLOT(pci_dev->devfn) */
64 struct kobject kobj;
65};
66
58/* File state for mmap()s on /proc/bus/pci/X/Y */ 67/* File state for mmap()s on /proc/bus/pci/X/Y */
59enum pci_mmap_state { 68enum pci_mmap_state {
60 pci_mmap_io, 69 pci_mmap_io,
@@ -147,6 +156,7 @@ struct pci_dev {
147 156
148 void *sysdata; /* hook for sys-specific extension */ 157 void *sysdata; /* hook for sys-specific extension */
149 struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */ 158 struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */
159 struct pci_slot *slot; /* Physical slot this device is in */
150 160
151 unsigned int devfn; /* encoded device & function index */ 161 unsigned int devfn; /* encoded device & function index */
152 unsigned short vendor; 162 unsigned short vendor;
@@ -172,6 +182,13 @@ struct pci_dev {
172 pci_power_t current_state; /* Current operating state. In ACPI-speak, 182 pci_power_t current_state; /* Current operating state. In ACPI-speak,
173 this is D0-D3, D0 being fully functional, 183 this is D0-D3, D0 being fully functional,
174 and D3 being off. */ 184 and D3 being off. */
185 int pm_cap; /* PM capability offset in the
186 configuration space */
187 unsigned int pme_support:5; /* Bitmask of states from which PME#
188 can be generated */
189 unsigned int d1_support:1; /* Low power state D1 is supported */
190 unsigned int d2_support:1; /* Low power state D2 is supported */
191 unsigned int no_d1d2:1; /* Only allow D0 and D3 */
175 192
176#ifdef CONFIG_PCIEASPM 193#ifdef CONFIG_PCIEASPM
177 struct pcie_link_state *link_state; /* ASPM link state. */ 194 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -196,7 +213,6 @@ struct pci_dev {
196 unsigned int is_added:1; 213 unsigned int is_added:1;
197 unsigned int is_busmaster:1; /* device is busmaster */ 214 unsigned int is_busmaster:1; /* device is busmaster */
198 unsigned int no_msi:1; /* device may not use msi */ 215 unsigned int no_msi:1; /* device may not use msi */
199 unsigned int no_d1d2:1; /* only allow d0 or d3 */
200 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 216 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
201 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 217 unsigned int broken_parity_status:1; /* Device generates false positive parity */
202 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ 218 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */
@@ -273,6 +289,7 @@ struct pci_bus {
273 struct list_head children; /* list of child buses */ 289 struct list_head children; /* list of child buses */
274 struct list_head devices; /* list of devices on this bus */ 290 struct list_head devices; /* list of devices on this bus */
275 struct pci_dev *self; /* bridge device as seen by parent */ 291 struct pci_dev *self; /* bridge device as seen by parent */
292 struct list_head slots; /* list of slots on this bus */
276 struct resource *resource[PCI_BUS_NUM_RESOURCES]; 293 struct resource *resource[PCI_BUS_NUM_RESOURCES];
277 /* address space routed to this bus */ 294 /* address space routed to this bus */
278 295
@@ -334,7 +351,7 @@ struct pci_bus_region {
334struct pci_dynids { 351struct pci_dynids {
335 spinlock_t lock; /* protects list, index */ 352 spinlock_t lock; /* protects list, index */
336 struct list_head list; /* for IDs added at runtime */ 353 struct list_head list; /* for IDs added at runtime */
337 unsigned int use_driver_data:1; /* pci_driver->driver_data is used */ 354 unsigned int use_driver_data:1; /* pci_device_id->driver_data is used */
338}; 355};
339 356
340/* ---------------------------------------------------------------- */ 357/* ---------------------------------------------------------------- */
@@ -396,7 +413,7 @@ struct pci_driver {
396 int (*resume_early) (struct pci_dev *dev); 413 int (*resume_early) (struct pci_dev *dev);
397 int (*resume) (struct pci_dev *dev); /* Device woken up */ 414 int (*resume) (struct pci_dev *dev); /* Device woken up */
398 void (*shutdown) (struct pci_dev *dev); 415 void (*shutdown) (struct pci_dev *dev);
399 416 struct pm_ext_ops *pm;
400 struct pci_error_handlers *err_handler; 417 struct pci_error_handlers *err_handler;
401 struct device_driver driver; 418 struct device_driver driver;
402 struct pci_dynids dynids; 419 struct pci_dynids dynids;
@@ -495,6 +512,10 @@ struct pci_bus *pci_create_bus(struct device *parent, int bus,
495 struct pci_ops *ops, void *sysdata); 512 struct pci_ops *ops, void *sysdata);
496struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 513struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
497 int busnr); 514 int busnr);
515struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
516 const char *name);
517void pci_destroy_slot(struct pci_slot *slot);
518void pci_update_slot_number(struct pci_slot *slot, int slot_nr);
498int pci_scan_slot(struct pci_bus *bus, int devfn); 519int pci_scan_slot(struct pci_bus *bus, int devfn);
499struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 520struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
500void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 521void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
@@ -624,6 +645,8 @@ int pci_restore_state(struct pci_dev *dev);
624int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 645int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
625pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 646pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
626int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 647int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
648int pci_prepare_to_sleep(struct pci_dev *dev);
649int pci_back_from_sleep(struct pci_dev *dev);
627 650
628/* Functions for PCI Hotplug drivers to use */ 651/* Functions for PCI Hotplug drivers to use */
629int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 652int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
@@ -845,6 +868,11 @@ static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
845 return -EIO; 868 return -EIO;
846} 869}
847 870
871static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
872{
873 return -EIO;
874}
875
848static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, 876static inline int pci_set_dma_max_seg_size(struct pci_dev *dev,
849 unsigned int size) 877 unsigned int size)
850{ 878{
@@ -983,9 +1011,9 @@ static inline void pci_set_drvdata(struct pci_dev *pdev, void *data)
983/* If you want to know what to call your pci_dev, ask this function. 1011/* If you want to know what to call your pci_dev, ask this function.
984 * Again, it's a wrapper around the generic device. 1012 * Again, it's a wrapper around the generic device.
985 */ 1013 */
986static inline char *pci_name(struct pci_dev *pdev) 1014static inline const char *pci_name(struct pci_dev *pdev)
987{ 1015{
988 return pdev->dev.bus_id; 1016 return dev_name(&pdev->dev);
989} 1017}
990 1018
991 1019
@@ -1020,7 +1048,9 @@ enum pci_fixup_pass {
1020 pci_fixup_header, /* After reading configuration header */ 1048 pci_fixup_header, /* After reading configuration header */
1021 pci_fixup_final, /* Final phase of device fixups */ 1049 pci_fixup_final, /* Final phase of device fixups */
1022 pci_fixup_enable, /* pci_enable_device() time */ 1050 pci_fixup_enable, /* pci_enable_device() time */
1023 pci_fixup_resume, /* pci_enable_device() time */ 1051 pci_fixup_resume, /* pci_device_resume() */
1052 pci_fixup_suspend, /* pci_device_suspend */
1053 pci_fixup_resume_early, /* pci_device_resume_early() */
1024}; 1054};
1025 1055
1026/* Anonymous variables would be nice... */ 1056/* Anonymous variables would be nice... */
@@ -1042,6 +1072,12 @@ enum pci_fixup_pass {
1042#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ 1072#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \
1043 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ 1073 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \
1044 resume##vendor##device##hook, vendor, device, hook) 1074 resume##vendor##device##hook, vendor, device, hook)
1075#define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \
1076 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \
1077 resume_early##vendor##device##hook, vendor, device, hook)
1078#define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \
1079 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \
1080 suspend##vendor##device##hook, vendor, device, hook)
1045 1081
1046 1082
1047void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1083void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
@@ -1066,7 +1102,10 @@ extern int pci_pci_problems;
1066extern unsigned long pci_cardbus_io_size; 1102extern unsigned long pci_cardbus_io_size;
1067extern unsigned long pci_cardbus_mem_size; 1103extern unsigned long pci_cardbus_mem_size;
1068 1104
1069extern int pcibios_add_platform_entries(struct pci_dev *dev); 1105int pcibios_add_platform_entries(struct pci_dev *dev);
1106void pcibios_disable_device(struct pci_dev *dev);
1107int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1108 enum pcie_reset_state state);
1070 1109
1071#ifdef CONFIG_PCI_MMCONFIG 1110#ifdef CONFIG_PCI_MMCONFIG
1072extern void __init pci_mmcfg_early_init(void); 1111extern void __init pci_mmcfg_early_init(void);