diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 5c1c0ae38dd3..bd68ed11b394 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -183,6 +183,11 @@ enum pci_dev_flags { | |||
183 | PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT = (__force pci_dev_flags_t) (1 << 9), | 183 | PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT = (__force pci_dev_flags_t) (1 << 9), |
184 | /* Do not use FLR even if device advertises PCI_AF_CAP */ | 184 | /* Do not use FLR even if device advertises PCI_AF_CAP */ |
185 | PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), | 185 | PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), |
186 | /* | ||
187 | * Resume before calling the driver's system suspend hooks, disabling | ||
188 | * the direct_complete optimization. | ||
189 | */ | ||
190 | PCI_DEV_FLAGS_NEEDS_RESUME = (__force pci_dev_flags_t) (1 << 11), | ||
186 | }; | 191 | }; |
187 | 192 | ||
188 | enum pci_irq_reroute_variant { | 193 | enum pci_irq_reroute_variant { |
@@ -356,6 +361,8 @@ struct pci_dev { | |||
356 | unsigned int msix_enabled:1; | 361 | unsigned int msix_enabled:1; |
357 | unsigned int ari_enabled:1; /* ARI forwarding */ | 362 | unsigned int ari_enabled:1; /* ARI forwarding */ |
358 | unsigned int ats_enabled:1; /* Address Translation Service */ | 363 | unsigned int ats_enabled:1; /* Address Translation Service */ |
364 | unsigned int pasid_enabled:1; /* Process Address Space ID */ | ||
365 | unsigned int pri_enabled:1; /* Page Request Interface */ | ||
359 | unsigned int is_managed:1; | 366 | unsigned int is_managed:1; |
360 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ | 367 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ |
361 | unsigned int state_saved:1; | 368 | unsigned int state_saved:1; |
@@ -366,7 +373,7 @@ struct pci_dev { | |||
366 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ | 373 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ |
367 | unsigned int __aer_firmware_first_valid:1; | 374 | unsigned int __aer_firmware_first_valid:1; |
368 | unsigned int __aer_firmware_first:1; | 375 | unsigned int __aer_firmware_first:1; |
369 | unsigned int broken_intx_masking:1; | 376 | unsigned int broken_intx_masking:1; /* INTx masking can't be used */ |
370 | unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ | 377 | unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ |
371 | unsigned int irq_managed:1; | 378 | unsigned int irq_managed:1; |
372 | unsigned int has_secondary_link:1; | 379 | unsigned int has_secondary_link:1; |
@@ -399,6 +406,12 @@ struct pci_dev { | |||
399 | u8 ats_stu; /* ATS Smallest Translation Unit */ | 406 | u8 ats_stu; /* ATS Smallest Translation Unit */ |
400 | atomic_t ats_ref_cnt; /* number of VFs with ATS enabled */ | 407 | atomic_t ats_ref_cnt; /* number of VFs with ATS enabled */ |
401 | #endif | 408 | #endif |
409 | #ifdef CONFIG_PCI_PRI | ||
410 | u32 pri_reqs_alloc; /* Number of PRI requests allocated */ | ||
411 | #endif | ||
412 | #ifdef CONFIG_PCI_PASID | ||
413 | u16 pasid_features; | ||
414 | #endif | ||
402 | phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ | 415 | phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ |
403 | size_t romlen; /* Length of ROM if it's not from the BAR */ | 416 | size_t romlen; /* Length of ROM if it's not from the BAR */ |
404 | char *driver_override; /* Driver name to force a match */ | 417 | char *driver_override; /* Driver name to force a match */ |
@@ -694,7 +707,8 @@ struct pci_error_handlers { | |||
694 | pci_ers_result_t (*slot_reset)(struct pci_dev *dev); | 707 | pci_ers_result_t (*slot_reset)(struct pci_dev *dev); |
695 | 708 | ||
696 | /* PCI function reset prepare or completed */ | 709 | /* PCI function reset prepare or completed */ |
697 | void (*reset_notify)(struct pci_dev *dev, bool prepare); | 710 | void (*reset_prepare)(struct pci_dev *dev); |
711 | void (*reset_done)(struct pci_dev *dev); | ||
698 | 712 | ||
699 | /* Device driver may resume normal operations */ | 713 | /* Device driver may resume normal operations */ |
700 | void (*resume)(struct pci_dev *dev); | 714 | void (*resume)(struct pci_dev *dev); |
@@ -1004,6 +1018,15 @@ int __must_check pci_reenable_device(struct pci_dev *); | |||
1004 | int __must_check pcim_enable_device(struct pci_dev *pdev); | 1018 | int __must_check pcim_enable_device(struct pci_dev *pdev); |
1005 | void pcim_pin_device(struct pci_dev *pdev); | 1019 | void pcim_pin_device(struct pci_dev *pdev); |
1006 | 1020 | ||
1021 | static inline bool pci_intx_mask_supported(struct pci_dev *pdev) | ||
1022 | { | ||
1023 | /* | ||
1024 | * INTx masking is supported if PCI_COMMAND_INTX_DISABLE is | ||
1025 | * writable and no quirk has marked the feature broken. | ||
1026 | */ | ||
1027 | return !pdev->broken_intx_masking; | ||
1028 | } | ||
1029 | |||
1007 | static inline int pci_is_enabled(struct pci_dev *pdev) | 1030 | static inline int pci_is_enabled(struct pci_dev *pdev) |
1008 | { | 1031 | { |
1009 | return (atomic_read(&pdev->enable_cnt) > 0); | 1032 | return (atomic_read(&pdev->enable_cnt) > 0); |
@@ -1027,7 +1050,6 @@ int __must_check pci_set_mwi(struct pci_dev *dev); | |||
1027 | int pci_try_set_mwi(struct pci_dev *dev); | 1050 | int pci_try_set_mwi(struct pci_dev *dev); |
1028 | void pci_clear_mwi(struct pci_dev *dev); | 1051 | void pci_clear_mwi(struct pci_dev *dev); |
1029 | void pci_intx(struct pci_dev *dev, int enable); | 1052 | void pci_intx(struct pci_dev *dev, int enable); |
1030 | bool pci_intx_mask_supported(struct pci_dev *dev); | ||
1031 | bool pci_check_and_mask_intx(struct pci_dev *dev); | 1053 | bool pci_check_and_mask_intx(struct pci_dev *dev); |
1032 | bool pci_check_and_unmask_intx(struct pci_dev *dev); | 1054 | bool pci_check_and_unmask_intx(struct pci_dev *dev); |
1033 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); | 1055 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); |