From: Peter Crosthwaite Date: Wed, 4 Dec 2013 05:54:30 +0000 (-0800) Subject: net/cadence_gem: Implement mac level loopback mode X-Git-Tag: v2.0.0-rc0~186^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24e822ea4669145c94552cef67751fbd9a42b4c8;p=thirdparty%2Fqemu.git net/cadence_gem: Implement mac level loopback mode Cadence GEM has a MAC level loopback mode. Implement. Use the same basic operation as the already implemented PHY loopback. Reported-by: Deepika Dhamija Signed-off-by: Peter Crosthwaite Reviewed-by: Peter Maydell Message-id: 3a0baf1b6b2fc1be638bdf1a37408ec38988e970.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell --- diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 4a355bbbef0..a31801d659a 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -893,7 +893,7 @@ static void gem_transmit(GemState *s) gem_transmit_updatestats(s, tx_packet, total_bytes); /* Send the packet somewhere */ - if (s->phy_loop) { + if (s->phy_loop || (s->regs[GEM_NWCTRL] & GEM_NWCTRL_LOCALLOOP)) { gem_receive(qemu_get_queue(s->nic), tx_packet, total_bytes); } else { qemu_send_packet(qemu_get_queue(s->nic), tx_packet,