diff options
author | gallatin <gallatin@FreeBSD.org> | 1999-10-12 22:10:53 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 1999-10-12 22:10:53 +0000 |
commit | aaf5afc559ee01cf65d4a7cc2e849052a96534a7 (patch) | |
tree | 1c58bf2d0c15553dbd0c5adecbebbe14db4b5a8e /sys/alpha/pci/tsunami_pci.c | |
parent | 229cdb91443142db582b7e32098f62f6446c3f3a (diff) | |
download | FreeBSD-src-aaf5afc559ee01cf65d4a7cc2e849052a96534a7.zip FreeBSD-src-aaf5afc559ee01cf65d4a7cc2e849052a96534a7.tar.gz |
allow pci_ioctl to work with multi-hose alphas.
Rather than teaching pci_ioctl about hoses, we just pass down a magic number
& let the platform code figure out what the hose is based on what the bus
number is.
concept approved by dfr
Diffstat (limited to 'sys/alpha/pci/tsunami_pci.c')
-rw-r--r-- | sys/alpha/pci/tsunami_pci.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/alpha/pci/tsunami_pci.c b/sys/alpha/pci/tsunami_pci.c index 6f7af88..634260c 100644 --- a/sys/alpha/pci/tsunami_pci.c +++ b/sys/alpha/pci/tsunami_pci.c @@ -41,7 +41,7 @@ static devclass_t pcib_devclass; -int tsunami_hoses[TSUNAMI_MAXHOSES] = {0,0,0,0}; +int tsunami_hoses[TSUNAMI_MAXHOSES+1] = {0,-1,-1,-1,-1}; int tsunami_bus_within_hose(int hose, int bus) @@ -49,6 +49,19 @@ tsunami_bus_within_hose(int hose, int bus) return(bus - tsunami_hoses[hose]); } +int +tsunami_hose_from_bus(int bus) +{ + int i; + for(i = 1; i <= TSUNAMI_MAXHOSES && tsunami_hoses[i] != -1; i++){ + if(tsunami_hoses[i] > bus) + return i-1; + } + return i-1; + +} + + static int tsunami_pcib_probe(device_t dev) { |