summaryrefslogtreecommitdiffstats
path: root/sys/i386/pci
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-08-20 17:50:59 +0000
committerjhb <jhb@FreeBSD.org>2008-08-20 17:50:59 +0000
commit28d363a7a2c6a13347bd35015181630e5707b4d6 (patch)
treee8768be4db214ce2da2d1476c046340729f2e239 /sys/i386/pci
parenta37514cff965526770ed9ab02283e92313cb47ab (diff)
downloadFreeBSD-src-28d363a7a2c6a13347bd35015181630e5707b4d6.zip
FreeBSD-src-28d363a7a2c6a13347bd35015181630e5707b4d6.tar.gz
Use switch statements instead of if-else for enabling PCI-express config
space support. MFC after: 1 week
Diffstat (limited to 'sys/i386/pci')
-rw-r--r--sys/i386/pci/pci_cfgreg.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index 6c78fd5..2fcc8d3 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -169,15 +169,21 @@ pci_cfgregopen(void)
/* Check for supported chipsets */
vid = pci_cfgregread(0, 0, 0, PCIR_VENDOR, 2);
did = pci_cfgregread(0, 0, 0, PCIR_DEVICE, 2);
- if (vid == 0x8086) {
- if (did == 0x3590 || did == 0x3592) {
+ switch (vid) {
+ case 0x8086:
+ switch (did) {
+ case 0x3590:
+ case 0x3592:
/* Intel 7520 or 7320 */
pciebar = pci_cfgregread(0, 0, 0, 0xce, 2) << 16;
pciereg_cfgopen();
- } else if (did == 0x2580 || did == 0x2584) {
+ break;
+ case 0x2580:
+ case 0x2584:
/* Intel 915 or 925 */
pciebar = pci_cfgregread(0, 0, 0, 0x48, 4);
pciereg_cfgopen();
+ break;
}
}
OpenPOWER on IntegriCloud