diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_host.h | 1 | ||||
-rw-r--r-- | include/linux/pci-aspm.h | 1 | ||||
-rw-r--r-- | include/linux/pci.h | 49 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 17 |
5 files changed, 67 insertions, 3 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b9c3299c6a55..31ebb59cbd2f 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -517,6 +517,7 @@ struct kvm_assigned_dev_kernel { | |||
517 | struct kvm *kvm; | 517 | struct kvm *kvm; |
518 | spinlock_t intx_lock; | 518 | spinlock_t intx_lock; |
519 | char irq_name[32]; | 519 | char irq_name[32]; |
520 | struct pci_saved_state *pci_saved_state; | ||
520 | }; | 521 | }; |
521 | 522 | ||
522 | struct kvm_irq_mask_notifier { | 523 | struct kvm_irq_mask_notifier { |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index 67cb3ae38016..7cea7b6c1413 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
@@ -28,6 +28,7 @@ extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | |||
28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); | 29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); |
30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
31 | extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); | ||
31 | extern void pcie_clear_aspm(void); | 32 | extern void pcie_clear_aspm(void); |
32 | extern void pcie_no_aspm(void); | 33 | extern void pcie_no_aspm(void); |
33 | #else | 34 | #else |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 96f70d7e058d..4604d1d5514d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -214,12 +214,17 @@ enum pci_bus_speed { | |||
214 | PCI_SPEED_UNKNOWN = 0xff, | 214 | PCI_SPEED_UNKNOWN = 0xff, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | struct pci_cap_saved_state { | 217 | struct pci_cap_saved_data { |
218 | struct hlist_node next; | ||
219 | char cap_nr; | 218 | char cap_nr; |
219 | unsigned int size; | ||
220 | u32 data[0]; | 220 | u32 data[0]; |
221 | }; | 221 | }; |
222 | 222 | ||
223 | struct pci_cap_saved_state { | ||
224 | struct hlist_node next; | ||
225 | struct pci_cap_saved_data cap; | ||
226 | }; | ||
227 | |||
223 | struct pcie_link_state; | 228 | struct pcie_link_state; |
224 | struct pci_vpd; | 229 | struct pci_vpd; |
225 | struct pci_sriov; | 230 | struct pci_sriov; |
@@ -366,7 +371,7 @@ static inline struct pci_cap_saved_state *pci_find_saved_cap( | |||
366 | struct hlist_node *pos; | 371 | struct hlist_node *pos; |
367 | 372 | ||
368 | hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { | 373 | hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { |
369 | if (tmp->cap_nr == cap) | 374 | if (tmp->cap.cap_nr == cap) |
370 | return tmp; | 375 | return tmp; |
371 | } | 376 | } |
372 | return NULL; | 377 | return NULL; |
@@ -807,6 +812,10 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); | |||
807 | /* Power management related routines */ | 812 | /* Power management related routines */ |
808 | int pci_save_state(struct pci_dev *dev); | 813 | int pci_save_state(struct pci_dev *dev); |
809 | void pci_restore_state(struct pci_dev *dev); | 814 | void pci_restore_state(struct pci_dev *dev); |
815 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); | ||
816 | int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state); | ||
817 | int pci_load_and_free_saved_state(struct pci_dev *dev, | ||
818 | struct pci_saved_state **state); | ||
810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 819 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 820 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 821 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
@@ -828,6 +837,23 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
828 | return __pci_enable_wake(dev, state, false, enable); | 837 | return __pci_enable_wake(dev, state, false, enable); |
829 | } | 838 | } |
830 | 839 | ||
840 | #define PCI_EXP_IDO_REQUEST (1<<0) | ||
841 | #define PCI_EXP_IDO_COMPLETION (1<<1) | ||
842 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); | ||
843 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | ||
844 | |||
845 | enum pci_obff_signal_type { | ||
846 | PCI_EXP_OBFF_SIGNAL_L0, | ||
847 | PCI_EXP_OBFF_SIGNAL_ALWAYS, | ||
848 | }; | ||
849 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | ||
850 | void pci_disable_obff(struct pci_dev *dev); | ||
851 | |||
852 | bool pci_ltr_supported(struct pci_dev *dev); | ||
853 | int pci_enable_ltr(struct pci_dev *dev); | ||
854 | void pci_disable_ltr(struct pci_dev *dev); | ||
855 | int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); | ||
856 | |||
831 | /* For use by arch with custom probe code */ | 857 | /* For use by arch with custom probe code */ |
832 | void set_pcie_port_type(struct pci_dev *pdev); | 858 | void set_pcie_port_type(struct pci_dev *pdev); |
833 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | 859 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); |
@@ -1207,6 +1233,23 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
1207 | return 0; | 1233 | return 0; |
1208 | } | 1234 | } |
1209 | 1235 | ||
1236 | static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type) | ||
1237 | { | ||
1238 | } | ||
1239 | |||
1240 | static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) | ||
1241 | { | ||
1242 | } | ||
1243 | |||
1244 | static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) | ||
1245 | { | ||
1246 | return 0; | ||
1247 | } | ||
1248 | |||
1249 | static inline void pci_disable_obff(struct pci_dev *dev) | ||
1250 | { | ||
1251 | } | ||
1252 | |||
1210 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) | 1253 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) |
1211 | { | 1254 | { |
1212 | return -EIO; | 1255 | return -EIO; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 8652a4fa3fe2..24787b751286 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2483,6 +2483,8 @@ | |||
2483 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f | 2483 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
2484 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 | 2484 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 |
2485 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 | 2485 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 |
2486 | #define PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MIN 0x1e40 | ||
2487 | #define PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MAX 0x1e5f | ||
2486 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MIN 0x2310 | 2488 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MIN 0x2310 |
2487 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MAX 0x231f | 2489 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MAX 0x231f |
2488 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2490 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index be01380f798a..e8840964aca1 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -508,8 +508,18 @@ | |||
508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | 508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ |
509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
511 | #define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ | ||
512 | #define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */ | ||
513 | #define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */ | ||
514 | #define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ | ||
511 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 515 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
512 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ | 516 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ |
517 | #define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ | ||
518 | #define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ | ||
519 | #define PCI_EXP_LTR_EN 0x400 /* Latency tolerance reporting */ | ||
520 | #define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ | ||
521 | #define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ | ||
522 | #define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ | ||
513 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 523 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
514 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ | 524 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ |
515 | 525 | ||
@@ -527,6 +537,7 @@ | |||
527 | #define PCI_EXT_CAP_ID_ARI 14 | 537 | #define PCI_EXT_CAP_ID_ARI 14 |
528 | #define PCI_EXT_CAP_ID_ATS 15 | 538 | #define PCI_EXT_CAP_ID_ATS 15 |
529 | #define PCI_EXT_CAP_ID_SRIOV 16 | 539 | #define PCI_EXT_CAP_ID_SRIOV 16 |
540 | #define PCI_EXT_CAP_ID_LTR 24 | ||
530 | 541 | ||
531 | /* Advanced Error Reporting */ | 542 | /* Advanced Error Reporting */ |
532 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ | 543 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ |
@@ -683,6 +694,12 @@ | |||
683 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | 694 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ |
684 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | 695 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ |
685 | 696 | ||
697 | #define PCI_LTR_MAX_SNOOP_LAT 0x4 | ||
698 | #define PCI_LTR_MAX_NOSNOOP_LAT 0x6 | ||
699 | #define PCI_LTR_VALUE_MASK 0x000003ff | ||
700 | #define PCI_LTR_SCALE_MASK 0x00001c00 | ||
701 | #define PCI_LTR_SCALE_SHIFT 10 | ||
702 | |||
686 | /* Access Control Service */ | 703 | /* Access Control Service */ |
687 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ | 704 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ |
688 | #define PCI_ACS_SV 0x01 /* Source Validation */ | 705 | #define PCI_ACS_SV 0x01 /* Source Validation */ |