|
Lines 604-619
static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
Link Here
|
| 604 |
|
604 |
|
| 605 |
/* |
605 |
/* |
| 606 |
* Certain VMD devices may have a root port configuration option which |
606 |
* Certain VMD devices may have a root port configuration option which |
| 607 |
* limits the bus range to between 0-127 or 128-255 |
607 |
* limits the bus range to between 0-127, 128-255, or 224-255 |
| 608 |
*/ |
608 |
*/ |
| 609 |
if (features & VMD_FEAT_HAS_BUS_RESTRICTIONS) { |
609 |
if (features & VMD_FEAT_HAS_BUS_RESTRICTIONS) { |
| 610 |
u32 vmcap, vmconfig; |
610 |
u16 reg16; |
| 611 |
|
611 |
|
| 612 |
pci_read_config_dword(vmd->dev, PCI_REG_VMCAP, &vmcap); |
612 |
pci_read_config_word(vmd->dev, PCI_REG_VMCAP, ®16); |
| 613 |
pci_read_config_dword(vmd->dev, PCI_REG_VMCONFIG, &vmconfig); |
613 |
if (BUS_RESTRICT_CAP(reg16)) { |
| 614 |
if (BUS_RESTRICT_CAP(vmcap) && |
614 |
pci_read_config_word(vmd->dev, PCI_REG_VMCONFIG, |
| 615 |
(BUS_RESTRICT_CFG(vmconfig) == 0x1)) |
615 |
®16); |
| 616 |
vmd->busn_start = 128; |
616 |
|
|
|
617 |
switch (BUS_RESTRICT_CFG(reg16)) { |
| 618 |
case 1: |
| 619 |
vmd->busn_start = 128; |
| 620 |
break; |
| 621 |
case 2: |
| 622 |
vmd->busn_start = 224; |
| 623 |
break; |
| 624 |
case 3: |
| 625 |
pci_err(vmd->dev, "Unknown Bus Offset Setting\n"); |
| 626 |
return -ENODEV; |
| 627 |
default: |
| 628 |
break; |
| 629 |
} |
| 630 |
} |
| 617 |
} |
631 |
} |
| 618 |
|
632 |
|
| 619 |
res = &vmd->dev->resource[VMD_CFGBAR]; |
633 |
res = &vmd->dev->resource[VMD_CFGBAR]; |
| 620 |
- |
|
|