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.h352
1 files changed, 107 insertions, 245 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a13d6825e586..fb57c892b214 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -224,7 +224,8 @@ enum pci_bus_speed {
224}; 224};
225 225
226struct pci_cap_saved_data { 226struct pci_cap_saved_data {
227 char cap_nr; 227 u16 cap_nr;
228 bool cap_extended;
228 unsigned int size; 229 unsigned int size;
229 u32 data[0]; 230 u32 data[0];
230}; 231};
@@ -351,7 +352,7 @@ struct pci_dev {
351 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ 352 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */
352#ifdef CONFIG_PCI_MSI 353#ifdef CONFIG_PCI_MSI
353 struct list_head msi_list; 354 struct list_head msi_list;
354 struct kset *msi_kset; 355 const struct attribute_group **msi_irq_groups;
355#endif 356#endif
356 struct pci_vpd *vpd; 357 struct pci_vpd *vpd;
357#ifdef CONFIG_PCI_ATS 358#ifdef CONFIG_PCI_ATS
@@ -375,7 +376,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
375} 376}
376 377
377struct pci_dev *pci_alloc_dev(struct pci_bus *bus); 378struct pci_dev *pci_alloc_dev(struct pci_bus *bus);
378struct pci_dev * __deprecated alloc_pci_dev(void);
379 379
380#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 380#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
381#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 381#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -385,8 +385,6 @@ static inline int pci_channel_offline(struct pci_dev *pdev)
385 return (pdev->error_state != pci_channel_io_normal); 385 return (pdev->error_state != pci_channel_io_normal);
386} 386}
387 387
388extern struct resource busn_resource;
389
390struct pci_host_bridge_window { 388struct pci_host_bridge_window {
391 struct list_head list; 389 struct list_head list;
392 struct resource *res; /* host bridge aperture (CPU address) */ 390 struct resource *res; /* host bridge aperture (CPU address) */
@@ -551,8 +549,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
551 int reg, int len, u32 val); 549 int reg, int len, u32 val);
552 550
553struct pci_bus_region { 551struct pci_bus_region {
554 resource_size_t start; 552 dma_addr_t start;
555 resource_size_t end; 553 dma_addr_t end;
556}; 554};
557 555
558struct pci_dynids { 556struct pci_dynids {
@@ -634,8 +632,7 @@ struct pci_driver {
634 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table 632 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
635 * @_table: device table name 633 * @_table: device table name
636 * 634 *
637 * This macro is used to create a struct pci_device_id array (a device table) 635 * This macro is deprecated and should not be used in new code.
638 * in a generic manner.
639 */ 636 */
640#define DEFINE_PCI_DEVICE_TABLE(_table) \ 637#define DEFINE_PCI_DEVICE_TABLE(_table) \
641 const struct pci_device_id _table[] 638 const struct pci_device_id _table[]
@@ -737,9 +734,9 @@ void pci_fixup_cardbus(struct pci_bus *);
737 734
738/* Generic PCI functions used internally */ 735/* Generic PCI functions used internally */
739 736
740void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 737void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
741 struct resource *res); 738 struct resource *res);
742void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 739void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
743 struct pci_bus_region *region); 740 struct pci_bus_region *region);
744void pcibios_scan_specific_bus(int busn); 741void pcibios_scan_specific_bus(int busn);
745struct pci_bus *pci_find_bus(int domain, int busnr); 742struct pci_bus *pci_find_bus(int domain, int busnr);
@@ -763,7 +760,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
763 const char *name, 760 const char *name,
764 struct hotplug_slot *hotplug); 761 struct hotplug_slot *hotplug);
765void pci_destroy_slot(struct pci_slot *slot); 762void pci_destroy_slot(struct pci_slot *slot);
766void pci_renumber_slot(struct pci_slot *slot, int slot_nr);
767int pci_scan_slot(struct pci_bus *bus, int devfn); 763int pci_scan_slot(struct pci_bus *bus, int devfn);
768struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 764struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
769void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 765void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
@@ -779,6 +775,7 @@ struct pci_dev *pci_dev_get(struct pci_dev *dev);
779void pci_dev_put(struct pci_dev *dev); 775void pci_dev_put(struct pci_dev *dev);
780void pci_remove_bus(struct pci_bus *b); 776void pci_remove_bus(struct pci_bus *b);
781void pci_stop_and_remove_bus_device(struct pci_dev *dev); 777void pci_stop_and_remove_bus_device(struct pci_dev *dev);
778void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev);
782void pci_stop_root_bus(struct pci_bus *bus); 779void pci_stop_root_bus(struct pci_bus *bus);
783void pci_remove_root_bus(struct pci_bus *bus); 780void pci_remove_root_bus(struct pci_bus *bus);
784void pci_setup_cardbus(struct pci_bus *bus); 781void pci_setup_cardbus(struct pci_bus *bus);
@@ -938,6 +935,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev);
938void pci_msi_off(struct pci_dev *dev); 935void pci_msi_off(struct pci_dev *dev);
939int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 936int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
940int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 937int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
938int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask);
941int pci_wait_for_pending_transaction(struct pci_dev *dev); 939int pci_wait_for_pending_transaction(struct pci_dev *dev);
942int pcix_get_max_mmrbc(struct pci_dev *dev); 940int pcix_get_max_mmrbc(struct pci_dev *dev);
943int pcix_get_mmrbc(struct pci_dev *dev); 941int pcix_get_mmrbc(struct pci_dev *dev);
@@ -951,10 +949,13 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
951int __pci_reset_function(struct pci_dev *dev); 949int __pci_reset_function(struct pci_dev *dev);
952int __pci_reset_function_locked(struct pci_dev *dev); 950int __pci_reset_function_locked(struct pci_dev *dev);
953int pci_reset_function(struct pci_dev *dev); 951int pci_reset_function(struct pci_dev *dev);
952int pci_try_reset_function(struct pci_dev *dev);
954int pci_probe_reset_slot(struct pci_slot *slot); 953int pci_probe_reset_slot(struct pci_slot *slot);
955int pci_reset_slot(struct pci_slot *slot); 954int pci_reset_slot(struct pci_slot *slot);
955int pci_try_reset_slot(struct pci_slot *slot);
956int pci_probe_reset_bus(struct pci_bus *bus); 956int pci_probe_reset_bus(struct pci_bus *bus);
957int pci_reset_bus(struct pci_bus *bus); 957int pci_reset_bus(struct pci_bus *bus);
958int pci_try_reset_bus(struct pci_bus *bus);
958void pci_reset_bridge_secondary_bus(struct pci_dev *dev); 959void pci_reset_bridge_secondary_bus(struct pci_dev *dev);
959void pci_update_resource(struct pci_dev *dev, int resno); 960void pci_update_resource(struct pci_dev *dev, int resno);
960int __must_check pci_assign_resource(struct pci_dev *dev, int i); 961int __must_check pci_assign_resource(struct pci_dev *dev, int i);
@@ -974,9 +975,14 @@ void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size);
974int pci_save_state(struct pci_dev *dev); 975int pci_save_state(struct pci_dev *dev);
975void pci_restore_state(struct pci_dev *dev); 976void pci_restore_state(struct pci_dev *dev);
976struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); 977struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev);
977int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state);
978int pci_load_and_free_saved_state(struct pci_dev *dev, 978int pci_load_and_free_saved_state(struct pci_dev *dev,
979 struct pci_saved_state **state); 979 struct pci_saved_state **state);
980struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap);
981struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev,
982 u16 cap);
983int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
984int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
985 u16 cap, unsigned int size);
980int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); 986int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state);
981int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 987int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
982pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 988pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
@@ -985,7 +991,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable);
985int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, 991int __pci_enable_wake(struct pci_dev *dev, pci_power_t state,
986 bool runtime, bool enable); 992 bool runtime, bool enable);
987int pci_wake_from_d3(struct pci_dev *dev, bool enable); 993int pci_wake_from_d3(struct pci_dev *dev, bool enable);
988pci_power_t pci_target_state(struct pci_dev *dev);
989int pci_prepare_to_sleep(struct pci_dev *dev); 994int pci_prepare_to_sleep(struct pci_dev *dev);
990int pci_back_from_sleep(struct pci_dev *dev); 995int pci_back_from_sleep(struct pci_dev *dev);
991bool pci_dev_run_wake(struct pci_dev *dev); 996bool pci_dev_run_wake(struct pci_dev *dev);
@@ -998,21 +1003,10 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
998 return __pci_enable_wake(dev, state, false, enable); 1003 return __pci_enable_wake(dev, state, false, enable);
999} 1004}
1000 1005
1001#define PCI_EXP_IDO_REQUEST (1<<0) 1006/* PCI Virtual Channel */
1002#define PCI_EXP_IDO_COMPLETION (1<<1) 1007int pci_save_vc_state(struct pci_dev *dev);
1003void pci_enable_ido(struct pci_dev *dev, unsigned long type); 1008void pci_restore_vc_state(struct pci_dev *dev);
1004void pci_disable_ido(struct pci_dev *dev, unsigned long type); 1009void pci_allocate_vc_save_buffers(struct pci_dev *dev);
1005
1006enum pci_obff_signal_type {
1007 PCI_EXP_OBFF_SIGNAL_L0 = 0,
1008 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
1009};
1010int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
1011void pci_disable_obff(struct pci_dev *dev);
1012
1013int pci_enable_ltr(struct pci_dev *dev);
1014void pci_disable_ltr(struct pci_dev *dev);
1015int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns);
1016 1010
1017/* For use by arch with custom probe code */ 1011/* For use by arch with custom probe code */
1018void set_pcie_port_type(struct pci_dev *pdev); 1012void set_pcie_port_type(struct pci_dev *pdev);
@@ -1022,11 +1016,12 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);
1022int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 1016int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
1023unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); 1017unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge);
1024unsigned int pci_rescan_bus(struct pci_bus *bus); 1018unsigned int pci_rescan_bus(struct pci_bus *bus);
1019void pci_lock_rescan_remove(void);
1020void pci_unlock_rescan_remove(void);
1025 1021
1026/* Vital product data routines */ 1022/* Vital product data routines */
1027ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 1023ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
1028ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); 1024ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf);
1029int pci_vpd_truncate(struct pci_dev *dev, size_t size);
1030 1025
1031/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 1026/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
1032resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); 1027resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx);
@@ -1078,6 +1073,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1078 resource_size_t), 1073 resource_size_t),
1079 void *alignf_data); 1074 void *alignf_data);
1080 1075
1076static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar)
1077{
1078 struct pci_bus_region region;
1079
1080 pcibios_resource_to_bus(pdev->bus, &region, &pdev->resource[bar]);
1081 return region.start;
1082}
1083
1081/* Proper probing supporting hot-pluggable devices */ 1084/* Proper probing supporting hot-pluggable devices */
1082int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1085int __must_check __pci_register_driver(struct pci_driver *, struct module *,
1083 const char *mod_name); 1086 const char *mod_name);
@@ -1115,7 +1118,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
1115 1118
1116void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), 1119void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
1117 void *userdata); 1120 void *userdata);
1118int pci_cfg_space_size_ext(struct pci_dev *dev);
1119int pci_cfg_space_size(struct pci_dev *dev); 1121int pci_cfg_space_size(struct pci_dev *dev);
1120unsigned char pci_bus_max_busnr(struct pci_bus *bus); 1122unsigned char pci_bus_max_busnr(struct pci_bus *bus);
1121void pci_setup_bridge(struct pci_bus *bus); 1123void pci_setup_bridge(struct pci_bus *bus);
@@ -1154,59 +1156,42 @@ struct msix_entry {
1154}; 1156};
1155 1157
1156 1158
1157#ifndef CONFIG_PCI_MSI 1159#ifdef CONFIG_PCI_MSI
1158static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) 1160int pci_msi_vec_count(struct pci_dev *dev);
1159{ 1161int pci_enable_msi_block(struct pci_dev *dev, int nvec);
1160 return -1;
1161}
1162
1163static inline int
1164pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec)
1165{
1166 return -1;
1167}
1168
1169static inline void pci_msi_shutdown(struct pci_dev *dev)
1170{ }
1171static inline void pci_disable_msi(struct pci_dev *dev)
1172{ }
1173
1174static inline int pci_msix_table_size(struct pci_dev *dev)
1175{
1176 return 0;
1177}
1178static inline int pci_enable_msix(struct pci_dev *dev,
1179 struct msix_entry *entries, int nvec)
1180{
1181 return -1;
1182}
1183
1184static inline void pci_msix_shutdown(struct pci_dev *dev)
1185{ }
1186static inline void pci_disable_msix(struct pci_dev *dev)
1187{ }
1188
1189static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev)
1190{ }
1191
1192static inline void pci_restore_msi_state(struct pci_dev *dev)
1193{ }
1194static inline int pci_msi_enabled(void)
1195{
1196 return 0;
1197}
1198#else
1199int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1200int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1201void pci_msi_shutdown(struct pci_dev *dev); 1162void pci_msi_shutdown(struct pci_dev *dev);
1202void pci_disable_msi(struct pci_dev *dev); 1163void pci_disable_msi(struct pci_dev *dev);
1203int pci_msix_table_size(struct pci_dev *dev); 1164int pci_msix_vec_count(struct pci_dev *dev);
1204int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); 1165int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1205void pci_msix_shutdown(struct pci_dev *dev); 1166void pci_msix_shutdown(struct pci_dev *dev);
1206void pci_disable_msix(struct pci_dev *dev); 1167void pci_disable_msix(struct pci_dev *dev);
1207void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1168void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1208void pci_restore_msi_state(struct pci_dev *dev); 1169void pci_restore_msi_state(struct pci_dev *dev);
1209int pci_msi_enabled(void); 1170int pci_msi_enabled(void);
1171int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec);
1172int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
1173 int minvec, int maxvec);
1174#else
1175static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
1176static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec)
1177{ return -ENOSYS; }
1178static inline void pci_msi_shutdown(struct pci_dev *dev) { }
1179static inline void pci_disable_msi(struct pci_dev *dev) { }
1180static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; }
1181static inline int pci_enable_msix(struct pci_dev *dev,
1182 struct msix_entry *entries, int nvec)
1183{ return -ENOSYS; }
1184static inline void pci_msix_shutdown(struct pci_dev *dev) { }
1185static inline void pci_disable_msix(struct pci_dev *dev) { }
1186static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { }
1187static inline void pci_restore_msi_state(struct pci_dev *dev) { }
1188static inline int pci_msi_enabled(void) { return 0; }
1189static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec,
1190 int maxvec)
1191{ return -ENOSYS; }
1192static inline int pci_enable_msix_range(struct pci_dev *dev,
1193 struct msix_entry *entries, int minvec, int maxvec)
1194{ return -ENOSYS; }
1210#endif 1195#endif
1211 1196
1212#ifdef CONFIG_PCIEPORTBUS 1197#ifdef CONFIG_PCIEPORTBUS
@@ -1217,12 +1202,10 @@ extern bool pcie_ports_auto;
1217#define pcie_ports_auto false 1202#define pcie_ports_auto false
1218#endif 1203#endif
1219 1204
1220#ifndef CONFIG_PCIEASPM 1205#ifdef CONFIG_PCIEASPM
1221static inline int pcie_aspm_enabled(void) { return 0; }
1222static inline bool pcie_aspm_support_enabled(void) { return false; }
1223#else
1224int pcie_aspm_enabled(void);
1225bool pcie_aspm_support_enabled(void); 1206bool pcie_aspm_support_enabled(void);
1207#else
1208static inline bool pcie_aspm_support_enabled(void) { return false; }
1226#endif 1209#endif
1227 1210
1228#ifdef CONFIG_PCIEAER 1211#ifdef CONFIG_PCIEAER
@@ -1233,15 +1216,12 @@ static inline void pci_no_aer(void) { }
1233static inline bool pci_aer_available(void) { return false; } 1216static inline bool pci_aer_available(void) { return false; }
1234#endif 1217#endif
1235 1218
1236#ifndef CONFIG_PCIE_ECRC 1219#ifdef CONFIG_PCIE_ECRC
1237static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1238{
1239 return;
1240}
1241static inline void pcie_ecrc_get_policy(char *str) {};
1242#else
1243void pcie_set_ecrc_checking(struct pci_dev *dev); 1220void pcie_set_ecrc_checking(struct pci_dev *dev);
1244void pcie_ecrc_get_policy(char *str); 1221void pcie_ecrc_get_policy(char *str);
1222#else
1223static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
1224static inline void pcie_ecrc_get_policy(char *str) { }
1245#endif 1225#endif
1246 1226
1247#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1227#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1265,15 +1245,8 @@ void pci_cfg_access_unlock(struct pci_dev *dev);
1265extern int pci_domains_supported; 1245extern int pci_domains_supported;
1266#else 1246#else
1267enum { pci_domains_supported = 0 }; 1247enum { pci_domains_supported = 0 };
1268static inline int pci_domain_nr(struct pci_bus *bus) 1248static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1269{ 1249static inline int pci_proc_domain(struct pci_bus *bus) { return 0; }
1270 return 0;
1271}
1272
1273static inline int pci_proc_domain(struct pci_bus *bus)
1274{
1275 return 0;
1276}
1277#endif /* CONFIG_PCI_DOMAINS */ 1250#endif /* CONFIG_PCI_DOMAINS */
1278 1251
1279/* some architectures require additional setup to direct VGA traffic */ 1252/* some architectures require additional setup to direct VGA traffic */
@@ -1302,180 +1275,88 @@ _PCI_NOP_ALL(write,)
1302static inline struct pci_dev *pci_get_device(unsigned int vendor, 1275static inline struct pci_dev *pci_get_device(unsigned int vendor,
1303 unsigned int device, 1276 unsigned int device,
1304 struct pci_dev *from) 1277 struct pci_dev *from)
1305{ 1278{ return NULL; }
1306 return NULL;
1307}
1308 1279
1309static inline struct pci_dev *pci_get_subsys(unsigned int vendor, 1280static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
1310 unsigned int device, 1281 unsigned int device,
1311 unsigned int ss_vendor, 1282 unsigned int ss_vendor,
1312 unsigned int ss_device, 1283 unsigned int ss_device,
1313 struct pci_dev *from) 1284 struct pci_dev *from)
1314{ 1285{ return NULL; }
1315 return NULL;
1316}
1317 1286
1318static inline struct pci_dev *pci_get_class(unsigned int class, 1287static inline struct pci_dev *pci_get_class(unsigned int class,
1319 struct pci_dev *from) 1288 struct pci_dev *from)
1320{ 1289{ return NULL; }
1321 return NULL;
1322}
1323 1290
1324#define pci_dev_present(ids) (0) 1291#define pci_dev_present(ids) (0)
1325#define no_pci_devices() (1) 1292#define no_pci_devices() (1)
1326#define pci_dev_put(dev) do { } while (0) 1293#define pci_dev_put(dev) do { } while (0)
1327 1294
1328static inline void pci_set_master(struct pci_dev *dev) 1295static inline void pci_set_master(struct pci_dev *dev) { }
1329{ } 1296static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
1330 1297static inline void pci_disable_device(struct pci_dev *dev) { }
1331static inline int pci_enable_device(struct pci_dev *dev)
1332{
1333 return -EIO;
1334}
1335
1336static inline void pci_disable_device(struct pci_dev *dev)
1337{ }
1338
1339static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) 1298static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
1340{ 1299{ return -EIO; }
1341 return -EIO;
1342}
1343
1344static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) 1300static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
1345{ 1301{ return -EIO; }
1346 return -EIO;
1347}
1348
1349static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, 1302static inline int pci_set_dma_max_seg_size(struct pci_dev *dev,
1350 unsigned int size) 1303 unsigned int size)
1351{ 1304{ return -EIO; }
1352 return -EIO;
1353}
1354
1355static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, 1305static inline int pci_set_dma_seg_boundary(struct pci_dev *dev,
1356 unsigned long mask) 1306 unsigned long mask)
1357{ 1307{ return -EIO; }
1358 return -EIO;
1359}
1360
1361static inline int pci_assign_resource(struct pci_dev *dev, int i) 1308static inline int pci_assign_resource(struct pci_dev *dev, int i)
1362{ 1309{ return -EBUSY; }
1363 return -EBUSY;
1364}
1365
1366static inline int __pci_register_driver(struct pci_driver *drv, 1310static inline int __pci_register_driver(struct pci_driver *drv,
1367 struct module *owner) 1311 struct module *owner)
1368{ 1312{ return 0; }
1369 return 0;
1370}
1371
1372static inline int pci_register_driver(struct pci_driver *drv) 1313static inline int pci_register_driver(struct pci_driver *drv)
1373{ 1314{ return 0; }
1374 return 0; 1315static inline void pci_unregister_driver(struct pci_driver *drv) { }
1375}
1376
1377static inline void pci_unregister_driver(struct pci_driver *drv)
1378{ }
1379
1380static inline int pci_find_capability(struct pci_dev *dev, int cap) 1316static inline int pci_find_capability(struct pci_dev *dev, int cap)
1381{ 1317{ return 0; }
1382 return 0;
1383}
1384
1385static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, 1318static inline int pci_find_next_capability(struct pci_dev *dev, u8 post,
1386 int cap) 1319 int cap)
1387{ 1320{ return 0; }
1388 return 0;
1389}
1390
1391static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) 1321static inline int pci_find_ext_capability(struct pci_dev *dev, int cap)
1392{ 1322{ return 0; }
1393 return 0;
1394}
1395 1323
1396/* Power management related routines */ 1324/* Power management related routines */
1397static inline int pci_save_state(struct pci_dev *dev) 1325static inline int pci_save_state(struct pci_dev *dev) { return 0; }
1398{ 1326static inline void pci_restore_state(struct pci_dev *dev) { }
1399 return 0;
1400}
1401
1402static inline void pci_restore_state(struct pci_dev *dev)
1403{ }
1404
1405static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) 1327static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
1406{ 1328{ return 0; }
1407 return 0;
1408}
1409
1410static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) 1329static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable)
1411{ 1330{ return 0; }
1412 return 0;
1413}
1414
1415static inline pci_power_t pci_choose_state(struct pci_dev *dev, 1331static inline pci_power_t pci_choose_state(struct pci_dev *dev,
1416 pm_message_t state) 1332 pm_message_t state)
1417{ 1333{ return PCI_D0; }
1418 return PCI_D0;
1419}
1420
1421static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1334static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
1422 int enable) 1335 int enable)
1423{ 1336{ return 0; }
1424 return 0;
1425}
1426
1427static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type)
1428{
1429}
1430
1431static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type)
1432{
1433}
1434
1435static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type)
1436{
1437 return 0;
1438}
1439
1440static inline void pci_disable_obff(struct pci_dev *dev)
1441{
1442}
1443 1337
1444static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) 1338static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
1445{ 1339{ return -EIO; }
1446 return -EIO; 1340static inline void pci_release_regions(struct pci_dev *dev) { }
1447}
1448
1449static inline void pci_release_regions(struct pci_dev *dev)
1450{ }
1451 1341
1452#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 1342#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
1453 1343
1454static inline void pci_block_cfg_access(struct pci_dev *dev) 1344static inline void pci_block_cfg_access(struct pci_dev *dev) { }
1455{ }
1456
1457static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) 1345static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
1458{ return 0; } 1346{ return 0; }
1459 1347static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
1460static inline void pci_unblock_cfg_access(struct pci_dev *dev)
1461{ }
1462 1348
1463static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) 1349static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
1464{ return NULL; } 1350{ return NULL; }
1465
1466static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, 1351static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
1467 unsigned int devfn) 1352 unsigned int devfn)
1468{ return NULL; } 1353{ return NULL; }
1469
1470static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 1354static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1471 unsigned int devfn) 1355 unsigned int devfn)
1472{ return NULL; } 1356{ return NULL; }
1473 1357
1474static inline int pci_domain_nr(struct pci_bus *bus) 1358static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1475{ return 0; } 1359static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
1476
1477static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1478{ return NULL; }
1479 1360
1480#define dev_is_pci(d) (false) 1361#define dev_is_pci(d) (false)
1481#define dev_is_pf(d) (false) 1362#define dev_is_pf(d) (false)
@@ -1486,10 +1367,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1486 1367
1487#include <asm/pci.h> 1368#include <asm/pci.h>
1488 1369
1489#ifndef PCIBIOS_MAX_MEM_32
1490#define PCIBIOS_MAX_MEM_32 (-1)
1491#endif
1492
1493/* these helpers provide future and backwards compatibility 1370/* these helpers provide future and backwards compatibility
1494 * for accessing popular PCI BAR info */ 1371 * for accessing popular PCI BAR info */
1495#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1372#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
@@ -1635,7 +1512,7 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev);
1635int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); 1512int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
1636#else 1513#else
1637static inline void pci_fixup_device(enum pci_fixup_pass pass, 1514static inline void pci_fixup_device(enum pci_fixup_pass pass,
1638 struct pci_dev *dev) {} 1515 struct pci_dev *dev) { }
1639static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) 1516static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
1640{ 1517{
1641 return pci_dev_get(dev); 1518 return pci_dev_get(dev);
@@ -1707,32 +1584,17 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1707int pci_sriov_get_totalvfs(struct pci_dev *dev); 1584int pci_sriov_get_totalvfs(struct pci_dev *dev);
1708#else 1585#else
1709static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1586static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1710{ 1587{ return -ENODEV; }
1711 return -ENODEV; 1588static inline void pci_disable_sriov(struct pci_dev *dev) { }
1712}
1713static inline void pci_disable_sriov(struct pci_dev *dev)
1714{
1715}
1716static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) 1589static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1717{ 1590{ return IRQ_NONE; }
1718 return IRQ_NONE; 1591static inline int pci_num_vf(struct pci_dev *dev) { return 0; }
1719}
1720static inline int pci_num_vf(struct pci_dev *dev)
1721{
1722 return 0;
1723}
1724static inline int pci_vfs_assigned(struct pci_dev *dev) 1592static inline int pci_vfs_assigned(struct pci_dev *dev)
1725{ 1593{ return 0; }
1726 return 0;
1727}
1728static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 1594static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
1729{ 1595{ return 0; }
1730 return 0;
1731}
1732static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) 1596static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1733{ 1597{ return 0; }
1734 return 0;
1735}
1736#endif 1598#endif
1737 1599
1738#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1600#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)