diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index f3c617eabd8d..98c8765a488e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -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 | unsigned int is_managed:1; | ||
170 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 171 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
171 | 172 | ||
172 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 173 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
@@ -174,6 +175,9 @@ struct pci_dev { | |||
174 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ | 175 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ |
175 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ | 176 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ |
176 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ | 177 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ |
178 | #ifdef CONFIG_PCI_MSI | ||
179 | unsigned int first_msi_irq; | ||
180 | #endif | ||
177 | }; | 181 | }; |
178 | 182 | ||
179 | #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) | 183 | #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) |
@@ -181,6 +185,11 @@ struct pci_dev { | |||
181 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 185 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
182 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 186 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
183 | 187 | ||
188 | static inline int pci_channel_offline(struct pci_dev *pdev) | ||
189 | { | ||
190 | return (pdev->error_state != pci_channel_io_normal); | ||
191 | } | ||
192 | |||
184 | static inline struct pci_cap_saved_state *pci_find_saved_cap( | 193 | static inline struct pci_cap_saved_state *pci_find_saved_cap( |
185 | struct pci_dev *pci_dev,char cap) | 194 | struct pci_dev *pci_dev,char cap) |
186 | { | 195 | { |
@@ -463,8 +472,7 @@ extern void pci_sort_breadthfirst(void); | |||
463 | 472 | ||
464 | /* Generic PCI functions exported to card drivers */ | 473 | /* Generic PCI functions exported to card drivers */ |
465 | 474 | ||
466 | struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); | 475 | struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); |
467 | struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from); | ||
468 | struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); | 476 | struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); |
469 | int pci_find_capability (struct pci_dev *dev, int cap); | 477 | int pci_find_capability (struct pci_dev *dev, int cap); |
470 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); | 478 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); |
@@ -521,6 +529,14 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val | |||
521 | 529 | ||
522 | int __must_check pci_enable_device(struct pci_dev *dev); | 530 | int __must_check pci_enable_device(struct pci_dev *dev); |
523 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); | 531 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); |
532 | int __must_check pcim_enable_device(struct pci_dev *pdev); | ||
533 | void pcim_pin_device(struct pci_dev *pdev); | ||
534 | |||
535 | static inline int pci_is_managed(struct pci_dev *pdev) | ||
536 | { | ||
537 | return pdev->is_managed; | ||
538 | } | ||
539 | |||
524 | void pci_disable_device(struct pci_dev *dev); | 540 | void pci_disable_device(struct pci_dev *dev); |
525 | void pci_set_master(struct pci_dev *dev); | 541 | void pci_set_master(struct pci_dev *dev); |
526 | #define HAVE_PCI_SET_MWI | 542 | #define HAVE_PCI_SET_MWI |
@@ -533,6 +549,7 @@ void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | |||
533 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 549 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
534 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); | 550 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); |
535 | void pci_restore_bars(struct pci_dev *dev); | 551 | void pci_restore_bars(struct pci_dev *dev); |
552 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | ||
536 | 553 | ||
537 | /* ROM control related routines */ | 554 | /* ROM control related routines */ |
538 | void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); | 555 | void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); |
@@ -561,6 +578,8 @@ int __must_check pci_request_regions(struct pci_dev *, const char *); | |||
561 | void pci_release_regions(struct pci_dev *); | 578 | void pci_release_regions(struct pci_dev *); |
562 | int __must_check pci_request_region(struct pci_dev *, int, const char *); | 579 | int __must_check pci_request_region(struct pci_dev *, int, const char *); |
563 | void pci_release_region(struct pci_dev *, int); | 580 | void pci_release_region(struct pci_dev *, int); |
581 | int pci_request_selected_regions(struct pci_dev *, int, const char *); | ||
582 | void pci_release_selected_regions(struct pci_dev *, int); | ||
564 | 583 | ||
565 | /* drivers/pci/bus.c */ | 584 | /* drivers/pci/bus.c */ |
566 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | 585 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
@@ -573,10 +592,11 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | |||
573 | void pci_enable_bridges(struct pci_bus *bus); | 592 | void pci_enable_bridges(struct pci_bus *bus); |
574 | 593 | ||
575 | /* Proper probing supporting hot-pluggable devices */ | 594 | /* Proper probing supporting hot-pluggable devices */ |
576 | int __must_check __pci_register_driver(struct pci_driver *, struct module *); | 595 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, |
596 | const char *mod_name); | ||
577 | static inline int __must_check pci_register_driver(struct pci_driver *driver) | 597 | static inline int __must_check pci_register_driver(struct pci_driver *driver) |
578 | { | 598 | { |
579 | return __pci_register_driver(driver, THIS_MODULE); | 599 | return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); |
580 | } | 600 | } |
581 | 601 | ||
582 | void pci_unregister_driver(struct pci_driver *); | 602 | void pci_unregister_driver(struct pci_driver *); |
@@ -611,10 +631,6 @@ enum pci_dma_burst_strategy { | |||
611 | strategy_parameter byte boundaries */ | 631 | strategy_parameter byte boundaries */ |
612 | }; | 632 | }; |
613 | 633 | ||
614 | #if defined(CONFIG_ISA) || defined(CONFIG_EISA) | ||
615 | extern struct pci_dev *isa_bridge; | ||
616 | #endif | ||
617 | |||
618 | struct msix_entry { | 634 | struct msix_entry { |
619 | u16 vector; /* kernel uses to write allocated vector */ | 635 | u16 vector; /* kernel uses to write allocated vector */ |
620 | u16 entry; /* driver uses to specify entry, OS writes */ | 636 | u16 entry; /* driver uses to specify entry, OS writes */ |
@@ -622,7 +638,6 @@ struct msix_entry { | |||
622 | 638 | ||
623 | 639 | ||
624 | #ifndef CONFIG_PCI_MSI | 640 | #ifndef CONFIG_PCI_MSI |
625 | static inline void pci_scan_msi_device(struct pci_dev *dev) {} | ||
626 | static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} | 641 | static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} |
627 | static inline void pci_disable_msi(struct pci_dev *dev) {} | 642 | static inline void pci_disable_msi(struct pci_dev *dev) {} |
628 | static inline int pci_enable_msix(struct pci_dev* dev, | 643 | static inline int pci_enable_msix(struct pci_dev* dev, |
@@ -630,7 +645,6 @@ static inline int pci_enable_msix(struct pci_dev* dev, | |||
630 | static inline void pci_disable_msix(struct pci_dev *dev) {} | 645 | static inline void pci_disable_msix(struct pci_dev *dev) {} |
631 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} | 646 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} |
632 | #else | 647 | #else |
633 | extern void pci_scan_msi_device(struct pci_dev *dev); | ||
634 | extern int pci_enable_msi(struct pci_dev *dev); | 648 | extern int pci_enable_msi(struct pci_dev *dev); |
635 | extern void pci_disable_msi(struct pci_dev *dev); | 649 | extern void pci_disable_msi(struct pci_dev *dev); |
636 | extern int pci_enable_msix(struct pci_dev* dev, | 650 | extern int pci_enable_msix(struct pci_dev* dev, |
@@ -722,8 +736,6 @@ static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) { | |||
722 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } | 736 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } |
723 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } | 737 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } |
724 | 738 | ||
725 | #define isa_bridge ((struct pci_dev *)NULL) | ||
726 | |||
727 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 739 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
728 | 740 | ||
729 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } | 741 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } |
@@ -828,6 +840,11 @@ enum pci_fixup_pass { | |||
828 | 840 | ||
829 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 841 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
830 | 842 | ||
843 | void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | ||
844 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | ||
845 | void __iomem * const * pcim_iomap_table(struct pci_dev *pdev); | ||
846 | int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); | ||
847 | |||
831 | extern int pci_pci_problems; | 848 | extern int pci_pci_problems; |
832 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ | 849 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
833 | #define PCIPCI_TRITON 2 | 850 | #define PCIPCI_TRITON 2 |