aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/hotplug/acpiphp.h26
-rw-r--r--drivers/pci/hotplug/cpci_hotplug.h36
-rw-r--r--drivers/pci/hotplug/cpqphp.h70
-rw-r--r--drivers/pci/hotplug/cpqphp_nvram.h12
-rw-r--r--drivers/pci/hotplug/ibmphp.h66
-rw-r--r--drivers/pci/hotplug/pciehp.h22
-rw-r--r--drivers/pci/hotplug/rpadlpar.h8
-rw-r--r--drivers/pci/hotplug/rpaphp.h16
-rw-r--r--drivers/pci/hotplug/shpchp.h26
-rw-r--r--drivers/pci/pci.h89
-rw-r--r--drivers/pci/pcie/aer/aerdrv.h14
-rw-r--r--drivers/pci/pcie/portdrv.h18
-rw-r--r--include/linux/pci-aspm.h20
-rw-r--r--include/linux/pci-ats.h26
-rw-r--r--include/linux/pci.h95
-rw-r--r--include/linux/pci_hotplug.h12
-rw-r--r--include/linux/pcieport_if.h4
17 files changed, 275 insertions, 285 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index b70ac00a117e..9daddf4b9576 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -174,23 +174,23 @@ struct acpiphp_attention_info
174/* function prototypes */ 174/* function prototypes */
175 175
176/* acpiphp_core.c */ 176/* acpiphp_core.c */
177extern int acpiphp_register_attention(struct acpiphp_attention_info*info); 177int acpiphp_register_attention(struct acpiphp_attention_info*info);
178extern int acpiphp_unregister_attention(struct acpiphp_attention_info *info); 178int acpiphp_unregister_attention(struct acpiphp_attention_info *info);
179extern int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot); 179int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot);
180extern void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot); 180void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
181 181
182/* acpiphp_glue.c */ 182/* acpiphp_glue.c */
183extern int acpiphp_glue_init (void); 183int acpiphp_glue_init(void);
184extern void acpiphp_glue_exit (void); 184void acpiphp_glue_exit(void);
185typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); 185typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
186 186
187extern int acpiphp_enable_slot (struct acpiphp_slot *slot); 187int acpiphp_enable_slot(struct acpiphp_slot *slot);
188extern int acpiphp_disable_slot (struct acpiphp_slot *slot); 188int acpiphp_disable_slot(struct acpiphp_slot *slot);
189extern int acpiphp_eject_slot (struct acpiphp_slot *slot); 189int acpiphp_eject_slot(struct acpiphp_slot *slot);
190extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot); 190u8 acpiphp_get_power_status(struct acpiphp_slot *slot);
191extern u8 acpiphp_get_attention_status (struct acpiphp_slot *slot); 191u8 acpiphp_get_attention_status(struct acpiphp_slot *slot);
192extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot); 192u8 acpiphp_get_latch_status(struct acpiphp_slot *slot);
193extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); 193u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot);
194 194
195/* variables */ 195/* variables */
196extern bool acpiphp_debug; 196extern bool acpiphp_debug;
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
index 3ae19f774cb3..1356211431d0 100644
--- a/drivers/pci/hotplug/cpci_hotplug.h
+++ b/drivers/pci/hotplug/cpci_hotplug.h
@@ -75,29 +75,29 @@ static inline const char *slot_name(struct slot *slot)
75 return hotplug_slot_name(slot->hotplug_slot); 75 return hotplug_slot_name(slot->hotplug_slot);
76} 76}
77 77
78extern int cpci_hp_register_controller(struct cpci_hp_controller *controller); 78int cpci_hp_register_controller(struct cpci_hp_controller *controller);
79extern int cpci_hp_unregister_controller(struct cpci_hp_controller *controller); 79int cpci_hp_unregister_controller(struct cpci_hp_controller *controller);
80extern int cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last); 80int cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last);
81extern int cpci_hp_unregister_bus(struct pci_bus *bus); 81int cpci_hp_unregister_bus(struct pci_bus *bus);
82extern int cpci_hp_start(void); 82int cpci_hp_start(void);
83extern int cpci_hp_stop(void); 83int cpci_hp_stop(void);
84 84
85/* 85/*
86 * Internal function prototypes, these functions should not be used by 86 * Internal function prototypes, these functions should not be used by
87 * board/chassis drivers. 87 * board/chassis drivers.
88 */ 88 */
89extern u8 cpci_get_attention_status(struct slot *slot); 89u8 cpci_get_attention_status(struct slot *slot);
90extern u8 cpci_get_latch_status(struct slot *slot); 90u8 cpci_get_latch_status(struct slot *slot);
91extern u8 cpci_get_adapter_status(struct slot *slot); 91u8 cpci_get_adapter_status(struct slot *slot);
92extern u16 cpci_get_hs_csr(struct slot * slot); 92u16 cpci_get_hs_csr(struct slot * slot);
93extern int cpci_set_attention_status(struct slot *slot, int status); 93int cpci_set_attention_status(struct slot *slot, int status);
94extern int cpci_check_and_clear_ins(struct slot * slot); 94int cpci_check_and_clear_ins(struct slot * slot);
95extern int cpci_check_ext(struct slot * slot); 95int cpci_check_ext(struct slot * slot);
96extern int cpci_clear_ext(struct slot * slot); 96int cpci_clear_ext(struct slot * slot);
97extern int cpci_led_on(struct slot * slot); 97int cpci_led_on(struct slot * slot);
98extern int cpci_led_off(struct slot * slot); 98int cpci_led_off(struct slot * slot);
99extern int cpci_configure_slot(struct slot *slot); 99int cpci_configure_slot(struct slot *slot);
100extern int cpci_unconfigure_slot(struct slot *slot); 100int cpci_unconfigure_slot(struct slot *slot);
101 101
102#ifdef CONFIG_HOTPLUG_PCI_CPCI 102#ifdef CONFIG_HOTPLUG_PCI_CPCI
103int cpci_hotplug_init(int debug); 103int cpci_hotplug_init(int debug);
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h
index d8ffc7366801..516b87738b6e 100644
--- a/drivers/pci/hotplug/cpqphp.h
+++ b/drivers/pci/hotplug/cpqphp.h
@@ -404,50 +404,44 @@ struct resource_lists {
404 404
405 405
406/* debugfs functions for the hotplug controller info */ 406/* debugfs functions for the hotplug controller info */
407extern void cpqhp_initialize_debugfs(void); 407void cpqhp_initialize_debugfs(void);
408extern void cpqhp_shutdown_debugfs(void); 408void cpqhp_shutdown_debugfs(void);
409extern void cpqhp_create_debugfs_files(struct controller *ctrl); 409void cpqhp_create_debugfs_files(struct controller *ctrl);
410extern void cpqhp_remove_debugfs_files(struct controller *ctrl); 410void cpqhp_remove_debugfs_files(struct controller *ctrl);
411 411
412/* controller functions */ 412/* controller functions */
413extern void cpqhp_pushbutton_thread(unsigned long event_pointer); 413void cpqhp_pushbutton_thread(unsigned long event_pointer);
414extern irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data); 414irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data);
415extern int cpqhp_find_available_resources(struct controller *ctrl, 415int cpqhp_find_available_resources(struct controller *ctrl,
416 void __iomem *rom_start); 416 void __iomem *rom_start);
417extern int cpqhp_event_start_thread(void); 417int cpqhp_event_start_thread(void);
418extern void cpqhp_event_stop_thread(void); 418void cpqhp_event_stop_thread(void);
419extern struct pci_func *cpqhp_slot_create(unsigned char busnumber); 419struct pci_func *cpqhp_slot_create(unsigned char busnumber);
420extern struct pci_func *cpqhp_slot_find(unsigned char bus, unsigned char device, 420struct pci_func *cpqhp_slot_find(unsigned char bus, unsigned char device,
421 unsigned char index); 421 unsigned char index);
422extern int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func); 422int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func);
423extern int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func); 423int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func);
424extern int cpqhp_hardware_test(struct controller *ctrl, int test_num); 424int cpqhp_hardware_test(struct controller *ctrl, int test_num);
425 425
426/* resource functions */ 426/* resource functions */
427extern int cpqhp_resource_sort_and_combine (struct pci_resource **head); 427int cpqhp_resource_sort_and_combine (struct pci_resource **head);
428 428
429/* pci functions */ 429/* pci functions */
430extern int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num); 430int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num);
431extern int cpqhp_get_bus_dev(struct controller *ctrl, u8 *bus_num, u8 *dev_num, 431int cpqhp_get_bus_dev(struct controller *ctrl, u8 *bus_num, u8 *dev_num,
432 u8 slot); 432 u8 slot);
433extern int cpqhp_save_config(struct controller *ctrl, int busnumber, 433int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug);
434 int is_hot_plug); 434int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func);
435extern int cpqhp_save_base_addr_length(struct controller *ctrl, 435int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func);
436 struct pci_func *func); 436int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func);
437extern int cpqhp_save_used_resources(struct controller *ctrl, 437int cpqhp_save_slot_config(struct controller *ctrl, struct pci_func *new_slot);
438 struct pci_func *func); 438int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func);
439extern int cpqhp_configure_board(struct controller *ctrl, 439void cpqhp_destroy_board_resources(struct pci_func *func);
440 struct pci_func *func); 440int cpqhp_return_board_resources(struct pci_func *func,
441extern int cpqhp_save_slot_config(struct controller *ctrl, 441 struct resource_lists *resources);
442 struct pci_func *new_slot); 442void cpqhp_destroy_resource_list(struct resource_lists *resources);
443extern int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func); 443int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func);
444extern void cpqhp_destroy_board_resources(struct pci_func *func); 444int cpqhp_unconfigure_device(struct pci_func *func);
445extern int cpqhp_return_board_resources (struct pci_func *func,
446 struct resource_lists *resources);
447extern void cpqhp_destroy_resource_list(struct resource_lists *resources);
448extern int cpqhp_configure_device(struct controller *ctrl,
449 struct pci_func *func);
450extern int cpqhp_unconfigure_device(struct pci_func *func);
451 445
452/* Global variables */ 446/* Global variables */
453extern int cpqhp_debug; 447extern int cpqhp_debug;
diff --git a/drivers/pci/hotplug/cpqphp_nvram.h b/drivers/pci/hotplug/cpqphp_nvram.h
index e89c0702119d..34e4e54fcf15 100644
--- a/drivers/pci/hotplug/cpqphp_nvram.h
+++ b/drivers/pci/hotplug/cpqphp_nvram.h
@@ -30,26 +30,26 @@
30 30
31#ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM 31#ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM
32 32
33static inline void compaq_nvram_init (void __iomem *rom_start) 33static inline void compaq_nvram_init(void __iomem *rom_start)
34{ 34{
35 return; 35 return;
36} 36}
37 37
38static inline int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) 38static inline int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl)
39{ 39{
40 return 0; 40 return 0;
41} 41}
42 42
43static inline int compaq_nvram_store (void __iomem *rom_start) 43static inline int compaq_nvram_store(void __iomem *rom_start)
44{ 44{
45 return 0; 45 return 0;
46} 46}
47 47
48#else 48#else
49 49
50extern void compaq_nvram_init (void __iomem *rom_start); 50void compaq_nvram_init(void __iomem *rom_start);
51extern int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl); 51int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl);
52extern int compaq_nvram_store (void __iomem *rom_start); 52int compaq_nvram_store(void __iomem *rom_start);
53 53
54#endif 54#endif
55 55
diff --git a/drivers/pci/hotplug/ibmphp.h b/drivers/pci/hotplug/ibmphp.h
index a8d391a4957d..8c5b25871d02 100644
--- a/drivers/pci/hotplug/ibmphp.h
+++ b/drivers/pci/hotplug/ibmphp.h
@@ -275,17 +275,17 @@ extern struct list_head ibmphp_slot_head;
275* FUNCTION PROTOTYPES * 275* FUNCTION PROTOTYPES *
276***********************************************************/ 276***********************************************************/
277 277
278extern void ibmphp_free_ebda_hpc_queue (void); 278void ibmphp_free_ebda_hpc_queue(void);
279extern int ibmphp_access_ebda (void); 279int ibmphp_access_ebda(void);
280extern struct slot *ibmphp_get_slot_from_physical_num (u8); 280struct slot *ibmphp_get_slot_from_physical_num(u8);
281extern int ibmphp_get_total_hp_slots (void); 281int ibmphp_get_total_hp_slots(void);
282extern void ibmphp_free_ibm_slot (struct slot *); 282void ibmphp_free_ibm_slot(struct slot *);
283extern void ibmphp_free_bus_info_queue (void); 283void ibmphp_free_bus_info_queue(void);
284extern void ibmphp_free_ebda_pci_rsrc_queue (void); 284void ibmphp_free_ebda_pci_rsrc_queue(void);
285extern struct bus_info *ibmphp_find_same_bus_num (u32); 285struct bus_info *ibmphp_find_same_bus_num(u32);
286extern int ibmphp_get_bus_index (u8); 286int ibmphp_get_bus_index(u8);
287extern u16 ibmphp_get_total_controllers (void); 287u16 ibmphp_get_total_controllers(void);
288extern int ibmphp_register_pci (void); 288int ibmphp_register_pci(void);
289 289
290/* passed parameters */ 290/* passed parameters */
291#define MEM 0 291#define MEM 0
@@ -381,24 +381,24 @@ struct res_needed {
381 381
382/* functions */ 382/* functions */
383 383
384extern int ibmphp_rsrc_init (void); 384int ibmphp_rsrc_init(void);
385extern int ibmphp_add_resource (struct resource_node *); 385int ibmphp_add_resource(struct resource_node *);
386extern int ibmphp_remove_resource (struct resource_node *); 386int ibmphp_remove_resource(struct resource_node *);
387extern int ibmphp_find_resource (struct bus_node *, u32, struct resource_node **, int); 387int ibmphp_find_resource(struct bus_node *, u32, struct resource_node **, int);
388extern int ibmphp_check_resource (struct resource_node *, u8); 388int ibmphp_check_resource(struct resource_node *, u8);
389extern int ibmphp_remove_bus (struct bus_node *, u8); 389int ibmphp_remove_bus(struct bus_node *, u8);
390extern void ibmphp_free_resources (void); 390void ibmphp_free_resources(void);
391extern int ibmphp_add_pfmem_from_mem (struct resource_node *); 391int ibmphp_add_pfmem_from_mem(struct resource_node *);
392extern struct bus_node *ibmphp_find_res_bus (u8); 392struct bus_node *ibmphp_find_res_bus(u8);
393extern void ibmphp_print_test (void); /* for debugging purposes */ 393void ibmphp_print_test(void); /* for debugging purposes */
394 394
395extern void ibmphp_hpc_initvars (void); 395void ibmphp_hpc_initvars(void);
396extern int ibmphp_hpc_readslot (struct slot *, u8, u8 *); 396int ibmphp_hpc_readslot(struct slot *, u8, u8 *);
397extern int ibmphp_hpc_writeslot (struct slot *, u8); 397int ibmphp_hpc_writeslot(struct slot *, u8);
398extern void ibmphp_lock_operations (void); 398void ibmphp_lock_operations(void);
399extern void ibmphp_unlock_operations (void); 399void ibmphp_unlock_operations(void);
400extern int ibmphp_hpc_start_poll_thread (void); 400int ibmphp_hpc_start_poll_thread(void);
401extern void ibmphp_hpc_stop_poll_thread (void); 401void ibmphp_hpc_stop_poll_thread(void);
402 402
403//---------------------------------------------------------------------------- 403//----------------------------------------------------------------------------
404 404
@@ -749,11 +749,11 @@ struct controller {
749 749
750/* Functions */ 750/* Functions */
751 751
752extern int ibmphp_init_devno (struct slot **); /* This function is called from EBDA, so we need it not be static */ 752int ibmphp_init_devno(struct slot **); /* This function is called from EBDA, so we need it not be static */
753extern int ibmphp_do_disable_slot (struct slot *slot_cur); 753int ibmphp_do_disable_slot(struct slot *slot_cur);
754extern int ibmphp_update_slot_info (struct slot *); /* This function is called from HPC, so we need it to not be be static */ 754int ibmphp_update_slot_info(struct slot *); /* This function is called from HPC, so we need it to not be be static */
755extern int ibmphp_configure_card (struct pci_func *, u8); 755int ibmphp_configure_card(struct pci_func *, u8);
756extern int ibmphp_unconfigure_card (struct slot **, int); 756int ibmphp_unconfigure_card(struct slot **, int);
757extern struct hotplug_slot_ops ibmphp_hotplug_slot_ops; 757extern struct hotplug_slot_ops ibmphp_hotplug_slot_ops;
758 758
759#endif //__IBMPHP_H 759#endif //__IBMPHP_H
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index 2c113de94323..7fb326983ed6 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -127,15 +127,15 @@ struct controller {
127#define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS) 127#define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS)
128#define PSN(ctrl) ((ctrl)->slot_cap >> 19) 128#define PSN(ctrl) ((ctrl)->slot_cap >> 19)
129 129
130extern int pciehp_sysfs_enable_slot(struct slot *slot); 130int pciehp_sysfs_enable_slot(struct slot *slot);
131extern int pciehp_sysfs_disable_slot(struct slot *slot); 131int pciehp_sysfs_disable_slot(struct slot *slot);
132extern u8 pciehp_handle_attention_button(struct slot *p_slot); 132u8 pciehp_handle_attention_button(struct slot *p_slot);
133extern u8 pciehp_handle_switch_change(struct slot *p_slot); 133u8 pciehp_handle_switch_change(struct slot *p_slot);
134extern u8 pciehp_handle_presence_change(struct slot *p_slot); 134u8 pciehp_handle_presence_change(struct slot *p_slot);
135extern u8 pciehp_handle_power_fault(struct slot *p_slot); 135u8 pciehp_handle_power_fault(struct slot *p_slot);
136extern int pciehp_configure_device(struct slot *p_slot); 136int pciehp_configure_device(struct slot *p_slot);
137extern int pciehp_unconfigure_device(struct slot *p_slot); 137int pciehp_unconfigure_device(struct slot *p_slot);
138extern void pciehp_queue_pushbutton_work(struct work_struct *work); 138void pciehp_queue_pushbutton_work(struct work_struct *work);
139struct controller *pcie_init(struct pcie_device *dev); 139struct controller *pcie_init(struct pcie_device *dev);
140int pcie_init_notification(struct controller *ctrl); 140int pcie_init_notification(struct controller *ctrl);
141int pciehp_enable_slot(struct slot *p_slot); 141int pciehp_enable_slot(struct slot *p_slot);
@@ -166,8 +166,8 @@ static inline const char *slot_name(struct slot *slot)
166#include <acpi/acpi_bus.h> 166#include <acpi/acpi_bus.h>
167#include <linux/pci-acpi.h> 167#include <linux/pci-acpi.h>
168 168
169extern void __init pciehp_acpi_slot_detection_init(void); 169void __init pciehp_acpi_slot_detection_init(void);
170extern int pciehp_acpi_slot_detection_check(struct pci_dev *dev); 170int pciehp_acpi_slot_detection_check(struct pci_dev *dev);
171 171
172static inline void pciehp_firmware_init(void) 172static inline void pciehp_firmware_init(void)
173{ 173{
diff --git a/drivers/pci/hotplug/rpadlpar.h b/drivers/pci/hotplug/rpadlpar.h
index 4a0a59b82eae..81df93931ad0 100644
--- a/drivers/pci/hotplug/rpadlpar.h
+++ b/drivers/pci/hotplug/rpadlpar.h
@@ -15,10 +15,10 @@
15#ifndef _RPADLPAR_IO_H_ 15#ifndef _RPADLPAR_IO_H_
16#define _RPADLPAR_IO_H_ 16#define _RPADLPAR_IO_H_
17 17
18extern int dlpar_sysfs_init(void); 18int dlpar_sysfs_init(void);
19extern void dlpar_sysfs_exit(void); 19void dlpar_sysfs_exit(void);
20 20
21extern int dlpar_add_slot(char *drc_name); 21int dlpar_add_slot(char *drc_name);
22extern int dlpar_remove_slot(char *drc_name); 22int dlpar_remove_slot(char *drc_name);
23 23
24#endif 24#endif
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index df5677440a08..3135856e5e1c 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -86,18 +86,18 @@ extern struct list_head rpaphp_slot_head;
86/* function prototypes */ 86/* function prototypes */
87 87
88/* rpaphp_pci.c */ 88/* rpaphp_pci.c */
89extern int rpaphp_enable_slot(struct slot *slot); 89int rpaphp_enable_slot(struct slot *slot);
90extern int rpaphp_get_sensor_state(struct slot *slot, int *state); 90int rpaphp_get_sensor_state(struct slot *slot, int *state);
91 91
92/* rpaphp_core.c */ 92/* rpaphp_core.c */
93extern int rpaphp_add_slot(struct device_node *dn); 93int rpaphp_add_slot(struct device_node *dn);
94extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, 94int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
95 char **drc_name, char **drc_type, int *drc_power_domain); 95 char **drc_name, char **drc_type, int *drc_power_domain);
96 96
97/* rpaphp_slot.c */ 97/* rpaphp_slot.c */
98extern void dealloc_slot_struct(struct slot *slot); 98void dealloc_slot_struct(struct slot *slot);
99extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); 99struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
100extern int rpaphp_register_slot(struct slot *slot); 100int rpaphp_register_slot(struct slot *slot);
101extern int rpaphp_deregister_slot(struct slot *slot); 101int rpaphp_deregister_slot(struct slot *slot);
102 102
103#endif /* _PPC64PHP_H */ 103#endif /* _PPC64PHP_H */
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index b849f995075a..e260f207a90e 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -168,19 +168,19 @@ struct controller {
168#define WRONG_BUS_FREQUENCY 0x0000000D 168#define WRONG_BUS_FREQUENCY 0x0000000D
169#define POWER_FAILURE 0x0000000E 169#define POWER_FAILURE 0x0000000E
170 170
171extern int __must_check shpchp_create_ctrl_files(struct controller *ctrl); 171int __must_check shpchp_create_ctrl_files(struct controller *ctrl);
172extern void shpchp_remove_ctrl_files(struct controller *ctrl); 172void shpchp_remove_ctrl_files(struct controller *ctrl);
173extern int shpchp_sysfs_enable_slot(struct slot *slot); 173int shpchp_sysfs_enable_slot(struct slot *slot);
174extern int shpchp_sysfs_disable_slot(struct slot *slot); 174int shpchp_sysfs_disable_slot(struct slot *slot);
175extern u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl); 175u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl);
176extern u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl); 176u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl);
177extern u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl); 177u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl);
178extern u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl); 178u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl);
179extern int shpchp_configure_device(struct slot *p_slot); 179int shpchp_configure_device(struct slot *p_slot);
180extern int shpchp_unconfigure_device(struct slot *p_slot); 180int shpchp_unconfigure_device(struct slot *p_slot);
181extern void cleanup_slots(struct controller *ctrl); 181void cleanup_slots(struct controller *ctrl);
182extern void shpchp_queue_pushbutton_work(struct work_struct *work); 182void shpchp_queue_pushbutton_work(struct work_struct *work);
183extern int shpc_init( struct controller *ctrl, struct pci_dev *pdev); 183int shpc_init( struct controller *ctrl, struct pci_dev *pdev);
184 184
185static inline const char *slot_name(struct slot *slot) 185static inline const char *slot_name(struct slot *slot)
186{ 186{
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 7346ee68f47d..68678ed76b0d 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -8,26 +8,25 @@
8 8
9/* Functions internal to the PCI core code */ 9/* Functions internal to the PCI core code */
10 10
11extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); 11int pci_create_sysfs_dev_files(struct pci_dev *pdev);
12extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); 12void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
13#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI) 13#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI)
14static inline void pci_create_firmware_label_files(struct pci_dev *pdev) 14static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
15{ return; } 15{ return; }
16static inline void pci_remove_firmware_label_files(struct pci_dev *pdev) 16static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
17{ return; } 17{ return; }
18#else 18#else
19extern void pci_create_firmware_label_files(struct pci_dev *pdev); 19void pci_create_firmware_label_files(struct pci_dev *pdev);
20extern void pci_remove_firmware_label_files(struct pci_dev *pdev); 20void pci_remove_firmware_label_files(struct pci_dev *pdev);
21#endif 21#endif
22extern void pci_cleanup_rom(struct pci_dev *dev); 22void pci_cleanup_rom(struct pci_dev *dev);
23#ifdef HAVE_PCI_MMAP 23#ifdef HAVE_PCI_MMAP
24enum pci_mmap_api { 24enum pci_mmap_api {
25 PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */ 25 PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */
26 PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */ 26 PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */
27}; 27};
28extern int pci_mmap_fits(struct pci_dev *pdev, int resno, 28int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vmai,
29 struct vm_area_struct *vmai, 29 enum pci_mmap_api mmap_api);
30 enum pci_mmap_api mmap_api);
31#endif 30#endif
32int pci_probe_reset_function(struct pci_dev *dev); 31int pci_probe_reset_function(struct pci_dev *dev);
33 32
@@ -60,17 +59,17 @@ struct pci_platform_pm_ops {
60 int (*run_wake)(struct pci_dev *dev, bool enable); 59 int (*run_wake)(struct pci_dev *dev, bool enable);
61}; 60};
62 61
63extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); 62int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
64extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state); 63void pci_update_current_state(struct pci_dev *dev, pci_power_t state);
65extern void pci_power_up(struct pci_dev *dev); 64void pci_power_up(struct pci_dev *dev);
66extern void pci_disable_enabled_device(struct pci_dev *dev); 65void pci_disable_enabled_device(struct pci_dev *dev);
67extern int pci_finish_runtime_suspend(struct pci_dev *dev); 66int pci_finish_runtime_suspend(struct pci_dev *dev);
68extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign); 67int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
69extern void pci_wakeup_bus(struct pci_bus *bus); 68void pci_wakeup_bus(struct pci_bus *bus);
70extern void pci_config_pm_runtime_get(struct pci_dev *dev); 69void pci_config_pm_runtime_get(struct pci_dev *dev);
71extern void pci_config_pm_runtime_put(struct pci_dev *dev); 70void pci_config_pm_runtime_put(struct pci_dev *dev);
72extern void pci_pm_init(struct pci_dev *dev); 71void pci_pm_init(struct pci_dev *dev);
73extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); 72void pci_allocate_cap_save_buffers(struct pci_dev *dev);
74void pci_free_cap_save_buffers(struct pci_dev *dev); 73void pci_free_cap_save_buffers(struct pci_dev *dev);
75 74
76static inline void pci_wakeup_event(struct pci_dev *dev) 75static inline void pci_wakeup_event(struct pci_dev *dev)
@@ -96,7 +95,7 @@ struct pci_vpd {
96 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ 95 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */
97}; 96};
98 97
99extern int pci_vpd_pci22_init(struct pci_dev *dev); 98int pci_vpd_pci22_init(struct pci_dev *dev);
100static inline void pci_vpd_release(struct pci_dev *dev) 99static inline void pci_vpd_release(struct pci_dev *dev)
101{ 100{
102 if (dev->vpd) 101 if (dev->vpd)
@@ -105,9 +104,9 @@ static inline void pci_vpd_release(struct pci_dev *dev)
105 104
106/* PCI /proc functions */ 105/* PCI /proc functions */
107#ifdef CONFIG_PROC_FS 106#ifdef CONFIG_PROC_FS
108extern int pci_proc_attach_device(struct pci_dev *dev); 107int pci_proc_attach_device(struct pci_dev *dev);
109extern int pci_proc_detach_device(struct pci_dev *dev); 108int pci_proc_detach_device(struct pci_dev *dev);
110extern int pci_proc_detach_bus(struct pci_bus *bus); 109int pci_proc_detach_bus(struct pci_bus *bus);
111#else 110#else
112static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; } 111static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; }
113static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; } 112static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; }
@@ -118,8 +117,8 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
118int pci_hp_add_bridge(struct pci_dev *dev); 117int pci_hp_add_bridge(struct pci_dev *dev);
119 118
120#ifdef HAVE_PCI_LEGACY 119#ifdef HAVE_PCI_LEGACY
121extern void pci_create_legacy_files(struct pci_bus *bus); 120void pci_create_legacy_files(struct pci_bus *bus);
122extern void pci_remove_legacy_files(struct pci_bus *bus); 121void pci_remove_legacy_files(struct pci_bus *bus);
123#else 122#else
124static inline void pci_create_legacy_files(struct pci_bus *bus) { return; } 123static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }
125static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; } 124static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; }
@@ -134,7 +133,7 @@ extern unsigned int pci_pm_d3_delay;
134 133
135#ifdef CONFIG_PCI_MSI 134#ifdef CONFIG_PCI_MSI
136void pci_no_msi(void); 135void pci_no_msi(void);
137extern void pci_msi_init_pci_dev(struct pci_dev *dev); 136void pci_msi_init_pci_dev(struct pci_dev *dev);
138#else 137#else
139static inline void pci_no_msi(void) { } 138static inline void pci_no_msi(void) { }
140static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } 139static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
@@ -198,12 +197,11 @@ enum pci_bar_type {
198 197
199bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, 198bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl,
200 int crs_timeout); 199 int crs_timeout);
201extern int pci_setup_device(struct pci_dev *dev); 200int pci_setup_device(struct pci_dev *dev);
202extern int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, 201int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
203 struct resource *res, unsigned int reg); 202 struct resource *res, unsigned int reg);
204extern int pci_resource_bar(struct pci_dev *dev, int resno, 203int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type);
205 enum pci_bar_type *type); 204void pci_configure_ari(struct pci_dev *dev);
206extern void pci_configure_ari(struct pci_dev *dev);
207 205
208/** 206/**
209 * pci_ari_enabled - query ARI forwarding status 207 * pci_ari_enabled - query ARI forwarding status
@@ -217,7 +215,7 @@ static inline int pci_ari_enabled(struct pci_bus *bus)
217} 215}
218 216
219void pci_reassigndev_resource_alignment(struct pci_dev *dev); 217void pci_reassigndev_resource_alignment(struct pci_dev *dev);
220extern void pci_disable_bridge_window(struct pci_dev *dev); 218void pci_disable_bridge_window(struct pci_dev *dev);
221 219
222/* Single Root I/O Virtualization */ 220/* Single Root I/O Virtualization */
223struct pci_sriov { 221struct pci_sriov {
@@ -241,7 +239,7 @@ struct pci_sriov {
241}; 239};
242 240
243#ifdef CONFIG_PCI_ATS 241#ifdef CONFIG_PCI_ATS
244extern void pci_restore_ats_state(struct pci_dev *dev); 242void pci_restore_ats_state(struct pci_dev *dev);
245#else 243#else
246static inline void pci_restore_ats_state(struct pci_dev *dev) 244static inline void pci_restore_ats_state(struct pci_dev *dev)
247{ 245{
@@ -249,14 +247,13 @@ static inline void pci_restore_ats_state(struct pci_dev *dev)
249#endif /* CONFIG_PCI_ATS */ 247#endif /* CONFIG_PCI_ATS */
250 248
251#ifdef CONFIG_PCI_IOV 249#ifdef CONFIG_PCI_IOV
252extern int pci_iov_init(struct pci_dev *dev); 250int pci_iov_init(struct pci_dev *dev);
253extern void pci_iov_release(struct pci_dev *dev); 251void pci_iov_release(struct pci_dev *dev);
254extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, 252int pci_iov_resource_bar(struct pci_dev *dev, int resno,
255 enum pci_bar_type *type); 253 enum pci_bar_type *type);
256extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, 254resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
257 int resno); 255void pci_restore_iov_state(struct pci_dev *dev);
258extern void pci_restore_iov_state(struct pci_dev *dev); 256int pci_iov_bus_range(struct pci_bus *bus);
259extern int pci_iov_bus_range(struct pci_bus *bus);
260 257
261#else 258#else
262static inline int pci_iov_init(struct pci_dev *dev) 259static inline int pci_iov_init(struct pci_dev *dev)
@@ -282,10 +279,10 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
282 279
283#endif /* CONFIG_PCI_IOV */ 280#endif /* CONFIG_PCI_IOV */
284 281
285extern unsigned long pci_cardbus_resource_alignment(struct resource *); 282unsigned long pci_cardbus_resource_alignment(struct resource *);
286 283
287static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, 284static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
288 struct resource *res) 285 struct resource *res)
289{ 286{
290#ifdef CONFIG_PCI_IOV 287#ifdef CONFIG_PCI_IOV
291 int resno = res - dev->resource; 288 int resno = res - dev->resource;
@@ -298,7 +295,7 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
298 return resource_alignment(res); 295 return resource_alignment(res);
299} 296}
300 297
301extern void pci_enable_acs(struct pci_dev *dev); 298void pci_enable_acs(struct pci_dev *dev);
302 299
303struct pci_dev_reset_methods { 300struct pci_dev_reset_methods {
304 u16 vendor; 301 u16 vendor;
@@ -307,7 +304,7 @@ struct pci_dev_reset_methods {
307}; 304};
308 305
309#ifdef CONFIG_PCI_QUIRKS 306#ifdef CONFIG_PCI_QUIRKS
310extern int pci_dev_specific_reset(struct pci_dev *dev, int probe); 307int pci_dev_specific_reset(struct pci_dev *dev, int probe);
311#else 308#else
312static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) 309static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe)
313{ 310{
diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h
index 22f840f4dda1..d12c77cd6991 100644
--- a/drivers/pci/pcie/aer/aerdrv.h
+++ b/drivers/pci/pcie/aer/aerdrv.h
@@ -110,15 +110,15 @@ static inline pci_ers_result_t merge_result(enum pci_ers_result orig,
110} 110}
111 111
112extern struct bus_type pcie_port_bus_type; 112extern struct bus_type pcie_port_bus_type;
113extern void aer_do_secondary_bus_reset(struct pci_dev *dev); 113void aer_do_secondary_bus_reset(struct pci_dev *dev);
114extern int aer_init(struct pcie_device *dev); 114int aer_init(struct pcie_device *dev);
115extern void aer_isr(struct work_struct *work); 115void aer_isr(struct work_struct *work);
116extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info); 116void aer_print_error(struct pci_dev *dev, struct aer_err_info *info);
117extern void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info); 117void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info);
118extern irqreturn_t aer_irq(int irq, void *context); 118irqreturn_t aer_irq(int irq, void *context);
119 119
120#ifdef CONFIG_ACPI_APEI 120#ifdef CONFIG_ACPI_APEI
121extern int pcie_aer_get_firmware_first(struct pci_dev *pci_dev); 121int pcie_aer_get_firmware_first(struct pci_dev *pci_dev);
122#else 122#else
123static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) 123static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev)
124{ 124{
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
index eea2ca2375e6..d2eb80aab569 100644
--- a/drivers/pci/pcie/portdrv.h
+++ b/drivers/pci/pcie/portdrv.h
@@ -21,18 +21,18 @@
21#define get_descriptor_id(type, service) (((type - 4) << 4) | service) 21#define get_descriptor_id(type, service) (((type - 4) << 4) | service)
22 22
23extern struct bus_type pcie_port_bus_type; 23extern struct bus_type pcie_port_bus_type;
24extern int pcie_port_device_register(struct pci_dev *dev); 24int pcie_port_device_register(struct pci_dev *dev);
25#ifdef CONFIG_PM 25#ifdef CONFIG_PM
26extern int pcie_port_device_suspend(struct device *dev); 26int pcie_port_device_suspend(struct device *dev);
27extern int pcie_port_device_resume(struct device *dev); 27int pcie_port_device_resume(struct device *dev);
28#endif 28#endif
29extern void pcie_port_device_remove(struct pci_dev *dev); 29void pcie_port_device_remove(struct pci_dev *dev);
30extern int __must_check pcie_port_bus_register(void); 30int __must_check pcie_port_bus_register(void);
31extern void pcie_port_bus_unregister(void); 31void pcie_port_bus_unregister(void);
32 32
33struct pci_dev; 33struct pci_dev;
34 34
35extern void pcie_clear_root_pme_status(struct pci_dev *dev); 35void pcie_clear_root_pme_status(struct pci_dev *dev);
36 36
37#ifdef CONFIG_HOTPLUG_PCI_PCIE 37#ifdef CONFIG_HOTPLUG_PCI_PCIE
38extern bool pciehp_msi_disabled; 38extern bool pciehp_msi_disabled;
@@ -59,7 +59,7 @@ static inline bool pcie_pme_no_msi(void)
59 return pcie_pme_msi_disabled; 59 return pcie_pme_msi_disabled;
60} 60}
61 61
62extern void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable); 62void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable);
63#else /* !CONFIG_PCIE_PME */ 63#else /* !CONFIG_PCIE_PME */
64static inline void pcie_pme_disable_msi(void) {} 64static inline void pcie_pme_disable_msi(void) {}
65static inline bool pcie_pme_no_msi(void) { return false; } 65static inline bool pcie_pme_no_msi(void) { return false; }
@@ -67,7 +67,7 @@ static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {}
67#endif /* !CONFIG_PCIE_PME */ 67#endif /* !CONFIG_PCIE_PME */
68 68
69#ifdef CONFIG_ACPI 69#ifdef CONFIG_ACPI
70extern int pcie_port_acpi_setup(struct pci_dev *port, int *mask); 70int pcie_port_acpi_setup(struct pci_dev *port, int *mask);
71 71
72static inline int pcie_port_platform_notify(struct pci_dev *port, int *mask) 72static inline int pcie_port_platform_notify(struct pci_dev *port, int *mask)
73{ 73{
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
index c8320144fe79..8af4610c2e41 100644
--- a/include/linux/pci-aspm.h
+++ b/include/linux/pci-aspm.h
@@ -23,14 +23,14 @@
23#define PCIE_LINK_STATE_CLKPM 4 23#define PCIE_LINK_STATE_CLKPM 4
24 24
25#ifdef CONFIG_PCIEASPM 25#ifdef CONFIG_PCIEASPM
26extern void pcie_aspm_init_link_state(struct pci_dev *pdev); 26void pcie_aspm_init_link_state(struct pci_dev *pdev);
27extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); 27void pcie_aspm_exit_link_state(struct pci_dev *pdev);
28extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); 28void pcie_aspm_pm_state_change(struct pci_dev *pdev);
29extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); 29void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
30extern void pci_disable_link_state(struct pci_dev *pdev, int state); 30void pci_disable_link_state(struct pci_dev *pdev, int state);
31extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); 31void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
32extern void pcie_clear_aspm(struct pci_bus *bus); 32void pcie_clear_aspm(struct pci_bus *bus);
33extern void pcie_no_aspm(void); 33void pcie_no_aspm(void);
34#else 34#else
35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) 35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
36{ 36{
@@ -56,8 +56,8 @@ static inline void pcie_no_aspm(void)
56#endif 56#endif
57 57
58#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ 58#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
59extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); 59void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
60extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); 60void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
61#else 61#else
62static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) 62static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
63{ 63{
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 7ef68724f0f0..68bcefd7fca0 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -14,9 +14,9 @@ struct pci_ats {
14 14
15#ifdef CONFIG_PCI_ATS 15#ifdef CONFIG_PCI_ATS
16 16
17extern int pci_enable_ats(struct pci_dev *dev, int ps); 17int pci_enable_ats(struct pci_dev *dev, int ps);
18extern void pci_disable_ats(struct pci_dev *dev); 18void pci_disable_ats(struct pci_dev *dev);
19extern int pci_ats_queue_depth(struct pci_dev *dev); 19int pci_ats_queue_depth(struct pci_dev *dev);
20 20
21/** 21/**
22 * pci_ats_enabled - query the ATS status 22 * pci_ats_enabled - query the ATS status
@@ -54,12 +54,12 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
54 54
55#ifdef CONFIG_PCI_PRI 55#ifdef CONFIG_PCI_PRI
56 56
57extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); 57int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58extern void pci_disable_pri(struct pci_dev *pdev); 58void pci_disable_pri(struct pci_dev *pdev);
59extern bool pci_pri_enabled(struct pci_dev *pdev); 59bool pci_pri_enabled(struct pci_dev *pdev);
60extern int pci_reset_pri(struct pci_dev *pdev); 60int pci_reset_pri(struct pci_dev *pdev);
61extern bool pci_pri_stopped(struct pci_dev *pdev); 61bool pci_pri_stopped(struct pci_dev *pdev);
62extern int pci_pri_status(struct pci_dev *pdev); 62int pci_pri_status(struct pci_dev *pdev);
63 63
64#else /* CONFIG_PCI_PRI */ 64#else /* CONFIG_PCI_PRI */
65 65
@@ -95,10 +95,10 @@ static inline int pci_pri_status(struct pci_dev *pdev)
95 95
96#ifdef CONFIG_PCI_PASID 96#ifdef CONFIG_PCI_PASID
97 97
98extern int pci_enable_pasid(struct pci_dev *pdev, int features); 98int pci_enable_pasid(struct pci_dev *pdev, int features);
99extern void pci_disable_pasid(struct pci_dev *pdev); 99void pci_disable_pasid(struct pci_dev *pdev);
100extern int pci_pasid_features(struct pci_dev *pdev); 100int pci_pasid_features(struct pci_dev *pdev);
101extern int pci_max_pasids(struct pci_dev *pdev); 101int pci_max_pasids(struct pci_dev *pdev);
102 102
103#else /* CONFIG_PCI_PASID */ 103#else /* CONFIG_PCI_PASID */
104 104
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2461033a7987..614512bed7b0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -348,7 +348,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
348 return dev; 348 return dev;
349} 349}
350 350
351extern struct pci_dev *alloc_pci_dev(void); 351struct pci_dev *alloc_pci_dev(void);
352 352
353#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 353#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
354#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 354#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -504,10 +504,10 @@ struct pci_ops {
504 * ACPI needs to be able to access PCI config space before we've done a 504 * ACPI needs to be able to access PCI config space before we've done a
505 * PCI bus scan and created pci_bus structures. 505 * PCI bus scan and created pci_bus structures.
506 */ 506 */
507extern int raw_pci_read(unsigned int domain, unsigned int bus, 507int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
508 unsigned int devfn, int reg, int len, u32 *val); 508 int reg, int len, u32 *val);
509extern int raw_pci_write(unsigned int domain, unsigned int bus, 509int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
510 unsigned int devfn, int reg, int len, u32 val); 510 int reg, int len, u32 val);
511 511
512struct pci_bus_region { 512struct pci_bus_region {
513 resource_size_t start; 513 resource_size_t start;
@@ -658,7 +658,7 @@ struct pci_driver {
658/* these external functions are only available when PCI support is enabled */ 658/* these external functions are only available when PCI support is enabled */
659#ifdef CONFIG_PCI 659#ifdef CONFIG_PCI
660 660
661extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); 661void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
662 662
663enum pcie_bus_config_types { 663enum pcie_bus_config_types {
664 PCIE_BUS_TUNE_OFF, 664 PCIE_BUS_TUNE_OFF,
@@ -675,7 +675,7 @@ extern struct bus_type pci_bus_type;
675 * code, or pci core code. */ 675 * code, or pci core code. */
676extern struct list_head pci_root_buses; /* list of all known PCI buses */ 676extern struct list_head pci_root_buses; /* list of all known PCI buses */
677/* Some device drivers need know if pci is initiated */ 677/* Some device drivers need know if pci is initiated */
678extern int no_pci_devices(void); 678int no_pci_devices(void);
679 679
680void pcibios_resource_survey_bus(struct pci_bus *bus); 680void pcibios_resource_survey_bus(struct pci_bus *bus);
681void pcibios_fixup_bus(struct pci_bus *); 681void pcibios_fixup_bus(struct pci_bus *);
@@ -699,7 +699,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
699void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 699void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
700 struct pci_bus_region *region); 700 struct pci_bus_region *region);
701void pcibios_scan_specific_bus(int busn); 701void pcibios_scan_specific_bus(int busn);
702extern struct pci_bus *pci_find_bus(int domain, int busnr); 702struct pci_bus *pci_find_bus(int domain, int busnr);
703void pci_bus_add_devices(const struct pci_bus *bus); 703void pci_bus_add_devices(const struct pci_bus *bus);
704struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 704struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
705 struct pci_ops *ops, void *sysdata); 705 struct pci_ops *ops, void *sysdata);
@@ -732,14 +732,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev,
732u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); 732u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);
733int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 733int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
734u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); 734u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
735extern struct pci_dev *pci_dev_get(struct pci_dev *dev); 735struct pci_dev *pci_dev_get(struct pci_dev *dev);
736extern void pci_dev_put(struct pci_dev *dev); 736void pci_dev_put(struct pci_dev *dev);
737extern void pci_remove_bus(struct pci_bus *b); 737void pci_remove_bus(struct pci_bus *b);
738extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 738void pci_stop_and_remove_bus_device(struct pci_dev *dev);
739void pci_stop_root_bus(struct pci_bus *bus); 739void pci_stop_root_bus(struct pci_bus *bus);
740void pci_remove_root_bus(struct pci_bus *bus); 740void pci_remove_root_bus(struct pci_bus *bus);
741void pci_setup_cardbus(struct pci_bus *bus); 741void pci_setup_cardbus(struct pci_bus *bus);
742extern void pci_sort_breadthfirst(void); 742void pci_sort_breadthfirst(void);
743#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 743#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
744#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) 744#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
745#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) 745#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
@@ -1141,18 +1141,17 @@ static inline int pci_msi_enabled(void)
1141 return 0; 1141 return 0;
1142} 1142}
1143#else 1143#else
1144extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); 1144int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1145extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); 1145int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1146extern void pci_msi_shutdown(struct pci_dev *dev); 1146void pci_msi_shutdown(struct pci_dev *dev);
1147extern void pci_disable_msi(struct pci_dev *dev); 1147void pci_disable_msi(struct pci_dev *dev);
1148extern int pci_msix_table_size(struct pci_dev *dev); 1148int pci_msix_table_size(struct pci_dev *dev);
1149extern int pci_enable_msix(struct pci_dev *dev, 1149int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1150 struct msix_entry *entries, int nvec); 1150void pci_msix_shutdown(struct pci_dev *dev);
1151extern void pci_msix_shutdown(struct pci_dev *dev); 1151void pci_disable_msix(struct pci_dev *dev);
1152extern void pci_disable_msix(struct pci_dev *dev); 1152void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1153extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1153void pci_restore_msi_state(struct pci_dev *dev);
1154extern void pci_restore_msi_state(struct pci_dev *dev); 1154int pci_msi_enabled(void);
1155extern int pci_msi_enabled(void);
1156#endif 1155#endif
1157 1156
1158#ifdef CONFIG_PCIEPORTBUS 1157#ifdef CONFIG_PCIEPORTBUS
@@ -1167,8 +1166,8 @@ extern bool pcie_ports_auto;
1167static inline int pcie_aspm_enabled(void) { return 0; } 1166static inline int pcie_aspm_enabled(void) { return 0; }
1168static inline bool pcie_aspm_support_enabled(void) { return false; } 1167static inline bool pcie_aspm_support_enabled(void) { return false; }
1169#else 1168#else
1170extern int pcie_aspm_enabled(void); 1169int pcie_aspm_enabled(void);
1171extern bool pcie_aspm_support_enabled(void); 1170bool pcie_aspm_support_enabled(void);
1172#endif 1171#endif
1173 1172
1174#ifdef CONFIG_PCIEAER 1173#ifdef CONFIG_PCIEAER
@@ -1186,8 +1185,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1186} 1185}
1187static inline void pcie_ecrc_get_policy(char *str) {}; 1186static inline void pcie_ecrc_get_policy(char *str) {};
1188#else 1187#else
1189extern void pcie_set_ecrc_checking(struct pci_dev *dev); 1188void pcie_set_ecrc_checking(struct pci_dev *dev);
1190extern void pcie_ecrc_get_policy(char *str); 1189void pcie_ecrc_get_policy(char *str);
1191#endif 1190#endif
1192 1191
1193#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1192#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1198,9 +1197,9 @@ int ht_create_irq(struct pci_dev *dev, int idx);
1198void ht_destroy_irq(unsigned int irq); 1197void ht_destroy_irq(unsigned int irq);
1199#endif /* CONFIG_HT_IRQ */ 1198#endif /* CONFIG_HT_IRQ */
1200 1199
1201extern void pci_cfg_access_lock(struct pci_dev *dev); 1200void pci_cfg_access_lock(struct pci_dev *dev);
1202extern bool pci_cfg_access_trylock(struct pci_dev *dev); 1201bool pci_cfg_access_trylock(struct pci_dev *dev);
1203extern void pci_cfg_access_unlock(struct pci_dev *dev); 1202void pci_cfg_access_unlock(struct pci_dev *dev);
1204 1203
1205/* 1204/*
1206 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 1205 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
@@ -1225,7 +1224,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)
1225/* some architectures require additional setup to direct VGA traffic */ 1224/* some architectures require additional setup to direct VGA traffic */
1226typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, 1225typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,
1227 unsigned int command_bits, u32 flags); 1226 unsigned int command_bits, u32 flags);
1228extern void pci_register_set_vga_state(arch_set_vga_state_t func); 1227void pci_register_set_vga_state(arch_set_vga_state_t func);
1229 1228
1230#else /* CONFIG_PCI is not enabled */ 1229#else /* CONFIG_PCI is not enabled */
1231 1230
@@ -1627,8 +1626,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1627int pcibios_add_device(struct pci_dev *dev); 1626int pcibios_add_device(struct pci_dev *dev);
1628 1627
1629#ifdef CONFIG_PCI_MMCONFIG 1628#ifdef CONFIG_PCI_MMCONFIG
1630extern void __init pci_mmcfg_early_init(void); 1629void __init pci_mmcfg_early_init(void);
1631extern void __init pci_mmcfg_late_init(void); 1630void __init pci_mmcfg_late_init(void);
1632#else 1631#else
1633static inline void pci_mmcfg_early_init(void) { } 1632static inline void pci_mmcfg_early_init(void) { }
1634static inline void pci_mmcfg_late_init(void) { } 1633static inline void pci_mmcfg_late_init(void) { }
@@ -1639,12 +1638,12 @@ int pci_ext_cfg_avail(void);
1639void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1638void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1640 1639
1641#ifdef CONFIG_PCI_IOV 1640#ifdef CONFIG_PCI_IOV
1642extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1641int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1643extern void pci_disable_sriov(struct pci_dev *dev); 1642void pci_disable_sriov(struct pci_dev *dev);
1644extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1643irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1645extern int pci_num_vf(struct pci_dev *dev); 1644int pci_num_vf(struct pci_dev *dev);
1646extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); 1645int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1647extern int pci_sriov_get_totalvfs(struct pci_dev *dev); 1646int pci_sriov_get_totalvfs(struct pci_dev *dev);
1648#else 1647#else
1649static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1648static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1650{ 1649{
@@ -1672,8 +1671,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1672#endif 1671#endif
1673 1672
1674#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1673#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1675extern void pci_hp_create_module_link(struct pci_slot *pci_slot); 1674void pci_hp_create_module_link(struct pci_slot *pci_slot);
1676extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1675void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1677#endif 1676#endif
1678 1677
1679/** 1678/**
@@ -1817,13 +1816,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1817/* PCI <-> OF binding helpers */ 1816/* PCI <-> OF binding helpers */
1818#ifdef CONFIG_OF 1817#ifdef CONFIG_OF
1819struct device_node; 1818struct device_node;
1820extern void pci_set_of_node(struct pci_dev *dev); 1819void pci_set_of_node(struct pci_dev *dev);
1821extern void pci_release_of_node(struct pci_dev *dev); 1820void pci_release_of_node(struct pci_dev *dev);
1822extern void pci_set_bus_of_node(struct pci_bus *bus); 1821void pci_set_bus_of_node(struct pci_bus *bus);
1823extern void pci_release_bus_of_node(struct pci_bus *bus); 1822void pci_release_bus_of_node(struct pci_bus *bus);
1824 1823
1825/* Arch may override this (weak) */ 1824/* Arch may override this (weak) */
1826extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); 1825struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1827 1826
1828static inline struct device_node * 1827static inline struct device_node *
1829pci_device_to_OF_node(const struct pci_dev *pdev) 1828pci_device_to_OF_node(const struct pci_dev *pdev)
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 45fc162cbdc0..8db71dcd6337 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -125,12 +125,12 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)
125 return pci_slot_name(slot->pci_slot); 125 return pci_slot_name(slot->pci_slot);
126} 126}
127 127
128extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, 128int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, int nr,
129 int nr, const char *name, 129 const char *name, struct module *owner,
130 struct module *owner, const char *mod_name); 130 const char *mod_name);
131extern int pci_hp_deregister(struct hotplug_slot *slot); 131int pci_hp_deregister(struct hotplug_slot *slot);
132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 132int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot,
133 struct hotplug_slot_info *info); 133 struct hotplug_slot_info *info);
134 134
135/* use a define to avoid include chaining to get THIS_MODULE & friends */ 135/* use a define to avoid include chaining to get THIS_MODULE & friends */
136#define pci_hp_register(slot, pbus, devnr, name) \ 136#define pci_hp_register(slot, pbus, devnr, name) \
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h
index e6f91b1406d8..9572669eea97 100644
--- a/include/linux/pcieport_if.h
+++ b/include/linux/pcieport_if.h
@@ -62,7 +62,7 @@ struct pcie_port_service_driver {
62#define to_service_driver(d) \ 62#define to_service_driver(d) \
63 container_of(d, struct pcie_port_service_driver, driver) 63 container_of(d, struct pcie_port_service_driver, driver)
64 64
65extern int pcie_port_service_register(struct pcie_port_service_driver *new); 65int pcie_port_service_register(struct pcie_port_service_driver *new);
66extern void pcie_port_service_unregister(struct pcie_port_service_driver *new); 66void pcie_port_service_unregister(struct pcie_port_service_driver *new);
67 67
68#endif /* _PCIEPORT_IF_H_ */ 68#endif /* _PCIEPORT_IF_H_ */