diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 8565b81d7fbc..5c604f5fad67 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
50 | #include <linux/ioport.h> | 50 | #include <linux/ioport.h> |
51 | #include <linux/list.h> | 51 | #include <linux/list.h> |
52 | #include <linux/compiler.h> | ||
52 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
53 | #include <linux/device.h> | 54 | #include <linux/device.h> |
54 | 55 | ||
@@ -346,6 +347,8 @@ struct pci_driver { | |||
346 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ | 347 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ |
347 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ | 348 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ |
348 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ | 349 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ |
350 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); | ||
351 | int (*resume_early) (struct pci_dev *dev); | ||
349 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 352 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
350 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ | 353 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ |
351 | void (*shutdown) (struct pci_dev *dev); | 354 | void (*shutdown) (struct pci_dev *dev); |
@@ -353,6 +356,8 @@ struct pci_driver { | |||
353 | struct pci_error_handlers *err_handler; | 356 | struct pci_error_handlers *err_handler; |
354 | struct device_driver driver; | 357 | struct device_driver driver; |
355 | struct pci_dynids dynids; | 358 | struct pci_dynids dynids; |
359 | |||
360 | int multithread_probe; | ||
356 | }; | 361 | }; |
357 | 362 | ||
358 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) | 363 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) |
@@ -401,7 +406,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */ | |||
401 | extern struct list_head pci_devices; /* list of all devices */ | 406 | extern struct list_head pci_devices; /* list of all devices */ |
402 | 407 | ||
403 | void pcibios_fixup_bus(struct pci_bus *); | 408 | void pcibios_fixup_bus(struct pci_bus *); |
404 | int pcibios_enable_device(struct pci_dev *, int mask); | 409 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
405 | char *pcibios_setup (char *str); | 410 | char *pcibios_setup (char *str); |
406 | 411 | ||
407 | /* Used only when drivers/pci/setup.c is used */ | 412 | /* Used only when drivers/pci/setup.c is used */ |
@@ -428,7 +433,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn); | |||
428 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); | 433 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); |
429 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 434 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
430 | unsigned int pci_scan_child_bus(struct pci_bus *bus); | 435 | unsigned int pci_scan_child_bus(struct pci_bus *bus); |
431 | void pci_bus_add_device(struct pci_dev *dev); | 436 | int __must_check pci_bus_add_device(struct pci_dev *dev); |
432 | void pci_read_bridge_bases(struct pci_bus *child); | 437 | void pci_read_bridge_bases(struct pci_bus *child); |
433 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); | 438 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); |
434 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); | 439 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); |
@@ -436,6 +441,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | |||
436 | extern void pci_dev_put(struct pci_dev *dev); | 441 | extern void pci_dev_put(struct pci_dev *dev); |
437 | extern void pci_remove_bus(struct pci_bus *b); | 442 | extern void pci_remove_bus(struct pci_bus *b); |
438 | extern void pci_remove_bus_device(struct pci_dev *dev); | 443 | extern void pci_remove_bus_device(struct pci_dev *dev); |
444 | extern void pci_stop_bus_device(struct pci_dev *dev); | ||
439 | void pci_setup_cardbus(struct pci_bus *bus); | 445 | void pci_setup_cardbus(struct pci_bus *bus); |
440 | 446 | ||
441 | /* Generic PCI functions exported to card drivers */ | 447 | /* Generic PCI functions exported to card drivers */ |
@@ -488,19 +494,19 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val | |||
488 | return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); | 494 | return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); |
489 | } | 495 | } |
490 | 496 | ||
491 | int pci_enable_device(struct pci_dev *dev); | 497 | int __must_check pci_enable_device(struct pci_dev *dev); |
492 | int pci_enable_device_bars(struct pci_dev *dev, int mask); | 498 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); |
493 | void pci_disable_device(struct pci_dev *dev); | 499 | void pci_disable_device(struct pci_dev *dev); |
494 | void pci_set_master(struct pci_dev *dev); | 500 | void pci_set_master(struct pci_dev *dev); |
495 | #define HAVE_PCI_SET_MWI | 501 | #define HAVE_PCI_SET_MWI |
496 | int pci_set_mwi(struct pci_dev *dev); | 502 | int __must_check pci_set_mwi(struct pci_dev *dev); |
497 | void pci_clear_mwi(struct pci_dev *dev); | 503 | void pci_clear_mwi(struct pci_dev *dev); |
498 | void pci_intx(struct pci_dev *dev, int enable); | 504 | void pci_intx(struct pci_dev *dev, int enable); |
499 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 505 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
500 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 506 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
501 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 507 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
502 | int pci_assign_resource(struct pci_dev *dev, int i); | 508 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
503 | int pci_assign_resource_fixed(struct pci_dev *dev, int i); | 509 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); |
504 | void pci_restore_bars(struct pci_dev *dev); | 510 | void pci_restore_bars(struct pci_dev *dev); |
505 | 511 | ||
506 | /* ROM control related routines */ | 512 | /* ROM control related routines */ |
@@ -526,23 +532,24 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *); | |||
526 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 532 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
527 | int (*)(struct pci_dev *, u8, u8)); | 533 | int (*)(struct pci_dev *, u8, u8)); |
528 | #define HAVE_PCI_REQ_REGIONS 2 | 534 | #define HAVE_PCI_REQ_REGIONS 2 |
529 | int pci_request_regions(struct pci_dev *, const char *); | 535 | int __must_check pci_request_regions(struct pci_dev *, const char *); |
530 | void pci_release_regions(struct pci_dev *); | 536 | void pci_release_regions(struct pci_dev *); |
531 | int pci_request_region(struct pci_dev *, int, const char *); | 537 | int __must_check pci_request_region(struct pci_dev *, int, const char *); |
532 | void pci_release_region(struct pci_dev *, int); | 538 | void pci_release_region(struct pci_dev *, int); |
533 | 539 | ||
534 | /* drivers/pci/bus.c */ | 540 | /* drivers/pci/bus.c */ |
535 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | 541 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
536 | resource_size_t size, resource_size_t align, | 542 | struct resource *res, resource_size_t size, |
537 | resource_size_t min, unsigned int type_mask, | 543 | resource_size_t align, resource_size_t min, |
538 | void (*alignf)(void *, struct resource *, | 544 | unsigned int type_mask, |
539 | resource_size_t, resource_size_t), | 545 | void (*alignf)(void *, struct resource *, |
540 | void *alignf_data); | 546 | resource_size_t, resource_size_t), |
547 | void *alignf_data); | ||
541 | void pci_enable_bridges(struct pci_bus *bus); | 548 | void pci_enable_bridges(struct pci_bus *bus); |
542 | 549 | ||
543 | /* Proper probing supporting hot-pluggable devices */ | 550 | /* Proper probing supporting hot-pluggable devices */ |
544 | int __pci_register_driver(struct pci_driver *, struct module *); | 551 | int __must_check __pci_register_driver(struct pci_driver *, struct module *); |
545 | static inline int pci_register_driver(struct pci_driver *driver) | 552 | static inline int __must_check pci_register_driver(struct pci_driver *driver) |
546 | { | 553 | { |
547 | return __pci_register_driver(driver, THIS_MODULE); | 554 | return __pci_register_driver(driver, THIS_MODULE); |
548 | } | 555 | } |
@@ -588,6 +595,7 @@ struct msix_entry { | |||
588 | u16 entry; /* driver uses to specify entry, OS writes */ | 595 | u16 entry; /* driver uses to specify entry, OS writes */ |
589 | }; | 596 | }; |
590 | 597 | ||
598 | |||
591 | #ifndef CONFIG_PCI_MSI | 599 | #ifndef CONFIG_PCI_MSI |
592 | static inline void pci_scan_msi_device(struct pci_dev *dev) {} | 600 | static inline void pci_scan_msi_device(struct pci_dev *dev) {} |
593 | static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} | 601 | static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} |
@@ -606,6 +614,12 @@ extern void pci_disable_msix(struct pci_dev *dev); | |||
606 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 614 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
607 | #endif | 615 | #endif |
608 | 616 | ||
617 | #ifdef CONFIG_HT_IRQ | ||
618 | /* The functions a driver should call */ | ||
619 | int ht_create_irq(struct pci_dev *dev, int idx); | ||
620 | void ht_destroy_irq(unsigned int irq); | ||
621 | #endif /* CONFIG_HT_IRQ */ | ||
622 | |||
609 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | 623 | extern void pci_block_user_cfg_access(struct pci_dev *dev); |
610 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | 624 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); |
611 | 625 | ||
@@ -780,12 +794,13 @@ enum pci_fixup_pass { | |||
780 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 794 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
781 | 795 | ||
782 | extern int pci_pci_problems; | 796 | extern int pci_pci_problems; |
783 | #define PCIPCI_FAIL 1 | 797 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
784 | #define PCIPCI_TRITON 2 | 798 | #define PCIPCI_TRITON 2 |
785 | #define PCIPCI_NATOMA 4 | 799 | #define PCIPCI_NATOMA 4 |
786 | #define PCIPCI_VIAETBF 8 | 800 | #define PCIPCI_VIAETBF 8 |
787 | #define PCIPCI_VSFX 16 | 801 | #define PCIPCI_VSFX 16 |
788 | #define PCIPCI_ALIMAGIK 32 | 802 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ |
803 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ | ||
789 | 804 | ||
790 | #endif /* __KERNEL__ */ | 805 | #endif /* __KERNEL__ */ |
791 | #endif /* LINUX_PCI_H */ | 806 | #endif /* LINUX_PCI_H */ |