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.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index cb899eb95d31..805412cc6875 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -174,6 +174,9 @@ struct pci_dev {
174 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 174 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
175 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 175 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 */ 176 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
177#ifdef CONFIG_PCI_MSI
178 unsigned int first_msi_irq;
179#endif
177}; 180};
178 181
179#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) 182#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
@@ -181,6 +184,11 @@ struct pci_dev {
181#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 184#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) 185#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
183 186
187static inline int pci_channel_offline(struct pci_dev *pdev)
188{
189 return (pdev->error_state != pci_channel_io_normal);
190}
191
184static inline struct pci_cap_saved_state *pci_find_saved_cap( 192static inline struct pci_cap_saved_state *pci_find_saved_cap(
185 struct pci_dev *pci_dev,char cap) 193 struct pci_dev *pci_dev,char cap)
186{ 194{
@@ -463,8 +471,7 @@ extern void pci_sort_breadthfirst(void);
463 471
464/* Generic PCI functions exported to card drivers */ 472/* Generic PCI functions exported to card drivers */
465 473
466struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); 474struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
467struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from);
468struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 475struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
469int pci_find_capability (struct pci_dev *dev, int cap); 476int pci_find_capability (struct pci_dev *dev, int cap);
470int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 477int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
@@ -533,6 +540,7 @@ void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
533int __must_check pci_assign_resource(struct pci_dev *dev, int i); 540int __must_check pci_assign_resource(struct pci_dev *dev, int i);
534int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); 541int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i);
535void pci_restore_bars(struct pci_dev *dev); 542void pci_restore_bars(struct pci_dev *dev);
543int pci_select_bars(struct pci_dev *dev, unsigned long flags);
536 544
537/* ROM control related routines */ 545/* ROM control related routines */
538void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); 546void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
@@ -561,6 +569,8 @@ int __must_check pci_request_regions(struct pci_dev *, const char *);
561void pci_release_regions(struct pci_dev *); 569void pci_release_regions(struct pci_dev *);
562int __must_check pci_request_region(struct pci_dev *, int, const char *); 570int __must_check pci_request_region(struct pci_dev *, int, const char *);
563void pci_release_region(struct pci_dev *, int); 571void pci_release_region(struct pci_dev *, int);
572int pci_request_selected_regions(struct pci_dev *, int, const char *);
573void pci_release_selected_regions(struct pci_dev *, int);
564 574
565/* drivers/pci/bus.c */ 575/* drivers/pci/bus.c */
566int __must_check pci_bus_alloc_resource(struct pci_bus *bus, 576int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
@@ -612,10 +622,6 @@ enum pci_dma_burst_strategy {
612 strategy_parameter byte boundaries */ 622 strategy_parameter byte boundaries */
613}; 623};
614 624
615#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
616extern struct pci_dev *isa_bridge;
617#endif
618
619struct msix_entry { 625struct msix_entry {
620 u16 vector; /* kernel uses to write allocated vector */ 626 u16 vector; /* kernel uses to write allocated vector */
621 u16 entry; /* driver uses to specify entry, OS writes */ 627 u16 entry; /* driver uses to specify entry, OS writes */
@@ -623,7 +629,6 @@ struct msix_entry {
623 629
624 630
625#ifndef CONFIG_PCI_MSI 631#ifndef CONFIG_PCI_MSI
626static inline void pci_scan_msi_device(struct pci_dev *dev) {}
627static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} 632static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
628static inline void pci_disable_msi(struct pci_dev *dev) {} 633static inline void pci_disable_msi(struct pci_dev *dev) {}
629static inline int pci_enable_msix(struct pci_dev* dev, 634static inline int pci_enable_msix(struct pci_dev* dev,
@@ -631,7 +636,6 @@ static inline int pci_enable_msix(struct pci_dev* dev,
631static inline void pci_disable_msix(struct pci_dev *dev) {} 636static inline void pci_disable_msix(struct pci_dev *dev) {}
632static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} 637static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
633#else 638#else
634extern void pci_scan_msi_device(struct pci_dev *dev);
635extern int pci_enable_msi(struct pci_dev *dev); 639extern int pci_enable_msi(struct pci_dev *dev);
636extern void pci_disable_msi(struct pci_dev *dev); 640extern void pci_disable_msi(struct pci_dev *dev);
637extern int pci_enable_msix(struct pci_dev* dev, 641extern int pci_enable_msix(struct pci_dev* dev,
@@ -723,8 +727,6 @@ static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) {
723static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } 727static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; }
724static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } 728static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; }
725 729
726#define isa_bridge ((struct pci_dev *)NULL)
727
728#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 730#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
729 731
730static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } 732static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }