dm: set pass-thru dev virtual class id
For pass-thru PCI dev, get the class id from the physical pci config space, then set the value in virtual config space class id. Tracked-On: #6357 Signed-off-by: Liu,Junming <junming.liu@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
parent
1013b291d3
commit
d56442bed5
|
@ -561,6 +561,7 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
|||
int vmsix_on_msi_bar_id = -1;
|
||||
struct acrn_pcidev pcidev = {};
|
||||
uint16_t vendor = 0, device = 0;
|
||||
uint8_t class = 0;
|
||||
|
||||
ptdev = NULL;
|
||||
error = -EINVAL;
|
||||
|
@ -656,8 +657,10 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
|||
*/
|
||||
vendor = read_config(ptdev->phys_dev, PCIR_VENDOR, 2);
|
||||
device = read_config(ptdev->phys_dev, PCIR_DEVICE, 2);
|
||||
class = read_config(ptdev->phys_dev, PCIR_CLASS, 1);
|
||||
pci_set_cfgdata16(dev, PCIR_VENDOR, vendor);
|
||||
pci_set_cfgdata16(dev, PCIR_DEVICE, device);
|
||||
pci_set_cfgdata8(dev, PCIR_CLASS, class);
|
||||
|
||||
#if AUDIO_NHLT_HACK
|
||||
/* device specific handling:
|
||||
|
|
Loading…
Reference in New Issue