diff options
author | jhb <jhb@FreeBSD.org> | 2005-03-25 03:10:51 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-03-25 03:10:51 +0000 |
commit | 947b14c9bfec56419ec1b06f736b6ef62efc37ad (patch) | |
tree | 273711a5955d52e3d0587d18a9e7ab63376ef343 /sys/dev/rp | |
parent | f5cbb5f36a4e70f668a5906defaec7cbc5f2b661 (diff) | |
download | FreeBSD-src-947b14c9bfec56419ec1b06f736b6ef62efc37ad.zip FreeBSD-src-947b14c9bfec56419ec1b06f736b6ef62efc37ad.tar.gz |
- Use pci_get_device() and pci_get_vendor() when we only want one part
of the device id.
- Use BAR2 rather than BAR0 for the Rocketport UPCI 8O card. I suspect
that other UPCI cards might need to use BAR2 as well.
Tested by: wsk at gddsn dot org dot cn
MFC after: 1 week
Diffstat (limited to 'sys/dev/rp')
-rw-r--r-- | sys/dev/rp/rp_pci.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/rp/rp_pci.c b/sys/dev/rp/rp_pci.c index 223cd83..f7a080c 100644 --- a/sys/dev/rp/rp_pci.c +++ b/sys/dev/rp/rp_pci.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #define RP_DEVICE_ID_4J 0x0007 #define RP_DEVICE_ID_6M 0x000C #define RP_DEVICE_ID_4M 0x000D +#define RP_DEVICE_ID_UPCI_8O 0x0805 /************************************************************************** MUDBAC remapped for PCI @@ -129,7 +130,7 @@ rp_pciprobe(device_t dev) char *s; s = NULL; - if ((pci_get_devid(dev) & 0xffff) == RP_VENDOR_ID) + if (pci_get_vendor(dev) == RP_VENDOR_ID) s = "RocketPort PCI"; if (s != NULL) { @@ -177,7 +178,14 @@ rp_pciattach(device_t dev) ctlp->bus_ctlp = NULL; - ctlp->io_rid[0] = 0x10; + switch (pci_get_device(dev)) { + case RP_DEVICE_ID_UPCI_8O: + ctlp->io_rid[0] = PCIR_BAR(2); + break; + default: + ctlp->io_rid[0] = PCIR_BAR(0); + break; + } ctlp->io[0] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], RF_ACTIVE); if(ctlp->io[0] == NULL) { @@ -188,7 +196,7 @@ rp_pciattach(device_t dev) num_aiops = sPCIInitController(ctlp, MAX_AIOPS_PER_BOARD, 0, - FREQ_DIS, 0, (pci_get_devid(dev) >> 16) & 0xffff); + FREQ_DIS, 0, pci_get_device(dev)); num_ports = 0; for(aiop=0; aiop < num_aiops; aiop++) { |