mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Use switch statements instead of if-else for enabling PCI-express config
space support. MFC after: 1 week
This commit is contained in:
parent
630d7662c3
commit
5326f07766
1 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue