|
@@ -595,19 +595,16 @@ static void imx_eth_do_tx(IMXFECState *s, uint32_t index)
|
|
static void imx_eth_enable_rx(IMXFECState *s, bool flush)
|
|
static void imx_eth_enable_rx(IMXFECState *s, bool flush)
|
|
{
|
|
{
|
|
IMXFECBufDesc bd;
|
|
IMXFECBufDesc bd;
|
|
- bool rx_ring_full;
|
|
|
|
|
|
|
|
imx_fec_read_bd(&bd, s->rx_descriptor);
|
|
imx_fec_read_bd(&bd, s->rx_descriptor);
|
|
|
|
|
|
- rx_ring_full = !(bd.flags & ENET_BD_E);
|
|
|
|
|
|
+ s->regs[ENET_RDAR] = (bd.flags & ENET_BD_E) ? ENET_RDAR_RDAR : 0;
|
|
|
|
|
|
- if (rx_ring_full) {
|
|
|
|
|
|
+ if (!s->regs[ENET_RDAR]) {
|
|
FEC_PRINTF("RX buffer full\n");
|
|
FEC_PRINTF("RX buffer full\n");
|
|
} else if (flush) {
|
|
} else if (flush) {
|
|
qemu_flush_queued_packets(qemu_get_queue(s->nic));
|
|
qemu_flush_queued_packets(qemu_get_queue(s->nic));
|
|
}
|
|
}
|
|
-
|
|
|
|
- s->regs[ENET_RDAR] = rx_ring_full ? 0 : ENET_RDAR_RDAR;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static void imx_eth_reset(DeviceState *d)
|
|
static void imx_eth_reset(DeviceState *d)
|
|
@@ -866,7 +863,6 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,
|
|
case ENET_RDAR:
|
|
case ENET_RDAR:
|
|
if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) {
|
|
if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) {
|
|
if (!s->regs[index]) {
|
|
if (!s->regs[index]) {
|
|
- s->regs[index] = ENET_RDAR_RDAR;
|
|
|
|
imx_eth_enable_rx(s, true);
|
|
imx_eth_enable_rx(s, true);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|