mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
b356f76de3
commit
cc1f0f4542
28 changed files with 92 additions and 78 deletions
|
@ -409,7 +409,7 @@ static int gem_can_receive(NetClientState *nc)
|
|||
{
|
||||
GemState *s;
|
||||
|
||||
s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
s = qemu_get_nic_opaque(nc);
|
||||
|
||||
DB_PRINT("\n");
|
||||
|
||||
|
@ -612,7 +612,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size)
|
|||
uint8_t rxbuf[2048];
|
||||
uint8_t *rxbuf_ptr;
|
||||
|
||||
s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
s = qemu_get_nic_opaque(nc);
|
||||
|
||||
/* Do nothing if receive is not enabled. */
|
||||
if (!(s->regs[GEM_NWCTRL] & GEM_NWCTRL_RXENA)) {
|
||||
|
@ -1152,7 +1152,7 @@ static const MemoryRegionOps gem_ops = {
|
|||
|
||||
static void gem_cleanup(NetClientState *nc)
|
||||
{
|
||||
GemState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
GemState *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
DB_PRINT("\n");
|
||||
s->nic = NULL;
|
||||
|
@ -1161,7 +1161,7 @@ static void gem_cleanup(NetClientState *nc)
|
|||
static void gem_set_link(NetClientState *nc)
|
||||
{
|
||||
DB_PRINT("\n");
|
||||
phy_update_link(DO_UPCAST(NICState, nc, nc)->opaque);
|
||||
phy_update_link(qemu_get_nic_opaque(nc));
|
||||
}
|
||||
|
||||
static NetClientInfo net_gem_info = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue