1 /* Functions internal to the PCI core code */
3 extern int pci_hotplug (struct device
*dev
, char **envp
, int num_envp
,
4 char *buffer
, int buffer_size
);
5 extern void pci_create_sysfs_dev_files(struct pci_dev
*pdev
);
6 extern int pci_bus_alloc_resource(struct pci_bus
*bus
, struct resource
*res
,
7 unsigned long size
, unsigned long align
,
8 unsigned long min
, unsigned int type_mask
,
9 void (*alignf
)(void *, struct resource
*,
10 unsigned long, unsigned long),
12 /* PCI /proc functions */
14 extern int pci_proc_attach_device(struct pci_dev
*dev
);
15 extern int pci_proc_detach_device(struct pci_dev
*dev
);
16 extern int pci_proc_attach_bus(struct pci_bus
*bus
);
17 extern int pci_proc_detach_bus(struct pci_bus
*bus
);
19 static inline int pci_proc_attach_device(struct pci_dev
*dev
) { return 0; }
20 static inline int pci_proc_detach_device(struct pci_dev
*dev
) { return 0; }
21 static inline int pci_proc_attach_bus(struct pci_bus
*bus
) { return 0; }
22 static inline int pci_proc_detach_bus(struct pci_bus
*bus
) { return 0; }
25 /* Functions for PCI Hotplug drivers to use */
26 extern struct pci_bus
* pci_add_new_bus(struct pci_bus
*parent
, struct pci_dev
*dev
, int busnr
);
27 extern unsigned int pci_do_scan_bus(struct pci_bus
*bus
);
28 extern int pci_remove_device_safe(struct pci_dev
*dev
);
29 extern unsigned char pci_max_busnr(void);
30 extern unsigned char pci_bus_max_busnr(struct pci_bus
*bus
);
31 extern int pci_bus_find_capability (struct pci_bus
*bus
, unsigned int devfn
, int cap
);
33 struct pci_dev_wrapped
{
38 struct pci_bus_wrapped
{
44 int (* pre_visit_pci_bus
) (struct pci_bus_wrapped
*,
45 struct pci_dev_wrapped
*);
46 int (* post_visit_pci_bus
) (struct pci_bus_wrapped
*,
47 struct pci_dev_wrapped
*);
49 int (* pre_visit_pci_dev
) (struct pci_dev_wrapped
*,
50 struct pci_bus_wrapped
*);
51 int (* visit_pci_dev
) (struct pci_dev_wrapped
*,
52 struct pci_bus_wrapped
*);
53 int (* post_visit_pci_dev
) (struct pci_dev_wrapped
*,
54 struct pci_bus_wrapped
*);
57 extern int pci_visit_dev(struct pci_visit
*fn
,
58 struct pci_dev_wrapped
*wrapped_dev
,
59 struct pci_bus_wrapped
*wrapped_parent
);
61 /* Lock for read/write access to pci device and bus lists */
62 extern spinlock_t pci_bus_lock
;
64 extern int pciehp_msi_quirk
;
65 extern struct device_attribute pci_dev_attrs
[];