Revision 8172539d hw/syborg_virtio.c
b/hw/syborg_virtio.c | ||
---|---|---|
25 | 25 |
#include "syborg.h" |
26 | 26 |
#include "sysbus.h" |
27 | 27 |
#include "virtio.h" |
28 |
#include "virtio-net.h" |
|
28 | 29 |
#include "sysemu.h" |
29 | 30 |
|
30 | 31 |
//#define DEBUG_SYBORG_VIRTIO |
... | ... | |
66 | 67 |
uint32_t int_enable; |
67 | 68 |
uint32_t id; |
68 | 69 |
NICConf nic; |
70 |
uint32_t host_features; |
|
69 | 71 |
} SyborgVirtIOProxy; |
70 | 72 |
|
71 | 73 |
static uint32_t syborg_virtio_readl(void *opaque, target_phys_addr_t offset) |
... | ... | |
86 | 88 |
ret = s->id; |
87 | 89 |
break; |
88 | 90 |
case SYBORG_VIRTIO_HOST_FEATURES: |
89 |
ret = vdev->get_features(vdev); |
|
90 |
ret |= vdev->binding->get_features(s); |
|
91 |
ret = s->host_features; |
|
91 | 92 |
break; |
92 | 93 |
case SYBORG_VIRTIO_GUEST_FEATURES: |
93 | 94 |
ret = vdev->guest_features; |
... | ... | |
244 | 245 |
|
245 | 246 |
static unsigned syborg_virtio_get_features(void *opaque) |
246 | 247 |
{ |
247 |
unsigned ret = 0; |
|
248 |
ret |= (1 << VIRTIO_F_NOTIFY_ON_EMPTY); |
|
249 |
return ret; |
|
248 |
SyborgVirtIOProxy *proxy = opaque; |
|
249 |
return proxy->host_features; |
|
250 | 250 |
} |
251 | 251 |
|
252 | 252 |
static VirtIOBindings syborg_virtio_bindings = { |
... | ... | |
272 | 272 |
qemu_register_reset(virtio_reset, vdev); |
273 | 273 |
|
274 | 274 |
virtio_bind_device(vdev, &syborg_virtio_bindings, proxy); |
275 |
proxy->host_features |= (0x1 << VIRTIO_F_NOTIFY_ON_EMPTY); |
|
276 |
proxy->host_features = vdev->get_features(vdev, proxy->host_features); |
|
275 | 277 |
return 0; |
276 | 278 |
} |
277 | 279 |
|
... | ... | |
292 | 294 |
.qdev.size = sizeof(SyborgVirtIOProxy), |
293 | 295 |
.qdev.props = (Property[]) { |
294 | 296 |
DEFINE_NIC_PROPERTIES(SyborgVirtIOProxy, nic), |
297 |
DEFINE_VIRTIO_NET_FEATURES(SyborgVirtIOProxy, host_features), |
|
295 | 298 |
DEFINE_PROP_END_OF_LIST(), |
296 | 299 |
} |
297 | 300 |
}; |
Also available in: Unified diff