Linux-2.3.3 and a short hiatus..
[davej-history.git] / include / asm-alpha / pci.h
blobfa6bd17e108cac8449261a20045e7fe8a6fef898
1 #ifndef __ALPHA_PCI_H
2 #define __ALPHA_PCI_H
4 #include <linux/config.h>
5 #include <linux/pci.h>
8 /*
9 * The following structure is used to manage multiple PCI busses.
11 * XXX: We should solve this problem in an architecture independent
12 * way, rather than hacking something up here.
15 struct linux_hose_info {
16 struct pci_bus pci_bus;
17 struct linux_hose_info *next;
18 unsigned long pci_io_space;
19 unsigned long pci_mem_space;
20 unsigned long pci_config_space;
21 unsigned long pci_sparse_space;
22 unsigned int pci_first_busno;
23 unsigned int pci_last_busno;
24 unsigned int pci_hose_index;
27 /* This is indexed by a pseudo- PCI bus number to obtain the real deal. */
28 extern struct linux_hose_info *bus2hose[256];
30 /* Create a handle that is OR-ed into the reported I/O space address
31 for a device. We use this later to find the bus a device lives on. */
33 #if defined(CONFIG_ALPHA_GENERIC) \
34 || defined(CONFIG_ALPHA_MCPCIA) \
35 || defined(CONFIG_ALPHA_TSUNAMI)
37 #define PCI_HANDLE(bus) ((bus2hose[bus]->pci_hose_index & 3UL) << 32)
38 #define DEV_IS_ON_PRIMARY(dev) \
39 (bus2hose[(dev)->bus->number]->pci_first_busno == (dev)->bus->number)
41 #else
43 #define PCI_HANDLE(bus) 0
44 #define DEV_IS_ON_PRIMARY(dev) ((dev)->bus->number == 0)
46 #endif /* Multiple busses */
48 #endif /* __ALPHA_PCI_H */