diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2019-09-04 08:15:14 -0400 |
---|---|---|
committer | Felipe Franciosi <felipe@nutanix.com> | 2019-09-05 16:45:35 +0100 |
commit | 41a32228d93968e896ca743235b9026e8e4cb1bf (patch) | |
tree | e8c8812f0ef54c2e84a6e4af2760db881fcbb4fb /lib | |
parent | 2ca8d85a3701f1d62b5afe3112fe009774bc4566 (diff) | |
download | libvfio-user-41a32228d93968e896ca743235b9026e8e4cb1bf.zip libvfio-user-41a32228d93968e896ca743235b9026e8e4cb1bf.tar.gz libvfio-user-41a32228d93968e896ca743235b9026e8e4cb1bf.tar.bz2 |
specify subsystem and subsystem vendor ID in dev_info
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libmuser.c | 10 | ||||
-rw-r--r-- | lib/muser.h | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c index 2e19464..dcb3ee0 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -988,18 +988,16 @@ lm_ctx_destroy(lm_ctx_t * lm_ctx) static void init_pci_hdr(lm_pci_hdr_t * const hdr, const lm_pci_hdr_id_t * const id, - const lm_pci_hdr_cc_t * const cc) + const lm_pci_hdr_cc_t * const cc, const lm_pci_hdr_ss_t *ss) { assert(hdr); assert(id); assert(cc); + assert(ss); hdr->id = *id; hdr->cc = *cc; - - hdr->ss.vid = hdr->id.vid; - hdr->ss.sid = hdr->id.did; - + hdr->ss = *ss; } static int copy_sparse_mmap_areas(lm_reg_info_t *dst, lm_reg_info_t *src) @@ -1118,7 +1116,7 @@ lm_ctx_create(lm_dev_info_t * const dev_info) } init_pci_hdr(&lm_ctx->pci_config_space->hdr, &dev_info->pci_info.id, - &dev_info->pci_info.cc); + &dev_info->pci_info.cc, &dev_info->pci_info.ss) for (i = 0; i < ARRAY_SIZE(lm_ctx->pci_config_space->hdr.bars); i++) { if ((dev_info->pci_info.reg_info[i].flags & LM_REG_FLAG_MEM) == 0) { lm_ctx->pci_config_space->hdr.bars[i].io.region_type |= 0x1; diff --git a/lib/muser.h b/lib/muser.h index 12f9fd0..34d1561 100644 --- a/lib/muser.h +++ b/lib/muser.h @@ -176,6 +176,11 @@ typedef struct { lm_pci_hdr_id_t id; /* + * Subsystem vendor and device ID. + */ + lm_pci_hdr_ss_t ss; + + /* * Class code. */ lm_pci_hdr_cc_t cc; |