Add a callback to be notified about negotiated features.
Submitted by: luigi Obtained from: Vincenzo Maffione, Universita` di Pisa MFC after: 3 days
This commit is contained in:
parent
e5ddfb30ab
commit
9571b40fbe
@ -133,6 +133,7 @@ static struct virtio_consts vtblk_vi_consts = {
|
||||
pci_vtblk_notify, /* device-wide qnotify */
|
||||
pci_vtblk_cfgread, /* read PCI config */
|
||||
pci_vtblk_cfgwrite, /* write PCI config */
|
||||
NULL, /* apply negotiated features */
|
||||
VTBLK_S_HOSTCAPS, /* our capabilities */
|
||||
};
|
||||
|
||||
|
@ -160,6 +160,7 @@ static struct virtio_consts vtnet_vi_consts = {
|
||||
NULL, /* device-wide qnotify -- not used */
|
||||
pci_vtnet_cfgread, /* read PCI config */
|
||||
pci_vtnet_cfgwrite, /* write PCI config */
|
||||
NULL, /* apply negotiated features */
|
||||
VTNET_S_HOSTCAPS, /* our capabilities */
|
||||
};
|
||||
|
||||
|
@ -80,6 +80,7 @@ static struct virtio_consts vtrnd_vi_consts = {
|
||||
pci_vtrnd_notify, /* device-wide qnotify */
|
||||
NULL, /* read virtio config */
|
||||
NULL, /* write virtio config */
|
||||
NULL, /* apply negotiated features */
|
||||
0, /* our capabilities */
|
||||
};
|
||||
|
||||
|
@ -698,6 +698,9 @@ bad:
|
||||
switch (offset) {
|
||||
case VTCFG_R_GUESTCAP:
|
||||
vs->vs_negotiated_caps = value & vc->vc_hv_caps;
|
||||
if (vc->vc_apply_features)
|
||||
(*vc->vc_apply_features)(DEV_SOFTC(vs),
|
||||
vs->vs_negotiated_caps);
|
||||
break;
|
||||
case VTCFG_R_PFN:
|
||||
if (vs->vs_curq >= vc->vc_nvq)
|
||||
|
@ -352,6 +352,8 @@ struct virtio_consts {
|
||||
/* called to read config regs */
|
||||
int (*vc_cfgwrite)(void *, int, int, uint32_t);
|
||||
/* called to write config regs */
|
||||
void (*vc_apply_features)(void *, uint64_t);
|
||||
/* called to apply negotiated features */
|
||||
uint64_t vc_hv_caps; /* hypervisor-provided capabilities */
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user