diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 7349058ed778..de690ca73d58 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -132,6 +132,7 @@ struct pci_dev { | |||
132 | unsigned int is_enabled:1; /* pci_enable_device has been called */ | 132 | unsigned int is_enabled:1; /* pci_enable_device has been called */ |
133 | unsigned int is_busmaster:1; /* device is busmaster */ | 133 | unsigned int is_busmaster:1; /* device is busmaster */ |
134 | unsigned int no_msi:1; /* device may not use msi */ | 134 | unsigned int no_msi:1; /* device may not use msi */ |
135 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | ||
135 | 136 | ||
136 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 137 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
137 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ | 138 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ |
@@ -235,7 +236,6 @@ struct module; | |||
235 | struct pci_driver { | 236 | struct pci_driver { |
236 | struct list_head node; | 237 | struct list_head node; |
237 | char *name; | 238 | char *name; |
238 | struct module *owner; | ||
239 | const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ | 239 | const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ |
240 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ | 240 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ |
241 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ | 241 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ |
@@ -337,6 +337,7 @@ struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, const | |||
337 | struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from); | 337 | struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from); |
338 | struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); | 338 | struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); |
339 | int pci_find_capability (struct pci_dev *dev, int cap); | 339 | int pci_find_capability (struct pci_dev *dev, int cap); |
340 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); | ||
340 | int pci_find_ext_capability (struct pci_dev *dev, int cap); | 341 | int pci_find_ext_capability (struct pci_dev *dev, int cap); |
341 | struct pci_bus * pci_find_next_bus(const struct pci_bus *from); | 342 | struct pci_bus * pci_find_next_bus(const struct pci_bus *from); |
342 | 343 | ||
@@ -431,8 +432,13 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
431 | void *alignf_data); | 432 | void *alignf_data); |
432 | void pci_enable_bridges(struct pci_bus *bus); | 433 | void pci_enable_bridges(struct pci_bus *bus); |
433 | 434 | ||
434 | /* New-style probing supporting hot-pluggable devices */ | 435 | /* Proper probing supporting hot-pluggable devices */ |
435 | int pci_register_driver(struct pci_driver *); | 436 | int __pci_register_driver(struct pci_driver *, struct module *); |
437 | static inline int pci_register_driver(struct pci_driver *driver) | ||
438 | { | ||
439 | return __pci_register_driver(driver, THIS_MODULE); | ||
440 | } | ||
441 | |||
436 | void pci_unregister_driver(struct pci_driver *); | 442 | void pci_unregister_driver(struct pci_driver *); |
437 | void pci_remove_behind_bridge(struct pci_dev *); | 443 | void pci_remove_behind_bridge(struct pci_dev *); |
438 | struct pci_driver *pci_dev_driver(const struct pci_dev *); | 444 | struct pci_driver *pci_dev_driver(const struct pci_dev *); |
@@ -490,6 +496,9 @@ extern void pci_disable_msix(struct pci_dev *dev); | |||
490 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 496 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
491 | #endif | 497 | #endif |
492 | 498 | ||
499 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | ||
500 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | ||
501 | |||
493 | /* | 502 | /* |
494 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 503 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
495 | * a PCI domain is defined to be a set of PCI busses which share | 504 | * a PCI domain is defined to be a set of PCI busses which share |
@@ -543,9 +552,11 @@ static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } | |||
543 | static inline void pci_disable_device(struct pci_dev *dev) { } | 552 | static inline void pci_disable_device(struct pci_dev *dev) { } |
544 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } | 553 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } |
545 | static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} | 554 | static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} |
555 | static inline int __pci_register_driver(struct pci_driver *drv, struct module *owner) { return 0;} | ||
546 | static inline int pci_register_driver(struct pci_driver *drv) { return 0;} | 556 | static inline int pci_register_driver(struct pci_driver *drv) { return 0;} |
547 | static inline void pci_unregister_driver(struct pci_driver *drv) { } | 557 | static inline void pci_unregister_driver(struct pci_driver *drv) { } |
548 | static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } | 558 | static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } |
559 | static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } | ||
549 | static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; } | 560 | static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; } |
550 | static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } | 561 | static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } |
551 | 562 | ||
@@ -560,6 +571,9 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en | |||
560 | 571 | ||
561 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 572 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
562 | 573 | ||
574 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } | ||
575 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } | ||
576 | |||
563 | #endif /* CONFIG_PCI */ | 577 | #endif /* CONFIG_PCI */ |
564 | 578 | ||
565 | /* Include architecture-dependent settings and functions */ | 579 | /* Include architecture-dependent settings and functions */ |