static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size)

{

    MIPSnetState *s = opaque;



#ifdef DEBUG_MIPSNET_RECEIVE

    printf("mipsnet: receiving len=%d\n", size);

#endif

    if (!mipsnet_can_receive(opaque))

        return;



    s->busy = 1;



    /* Just accept everything. */



    /* Write packet data. */

    memcpy(s->rx_buffer, buf, size);



    s->rx_count = size;

    s->rx_read = 0;



    /* Now we can signal we have received something. */

    s->intctl |= MIPSNET_INTCTL_RXDONE;

    mipsnet_update_irq(s);

}

static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size)

{

    MIPSnetState *s = opaque;



#ifdef DEBUG_MIPSNET_RECEIVE

    printf("mipsnet: receiving len=%d\n", size);

#endif

    if (!mipsnet_can_receive(opaque))

        return;



    s->busy = 1;



    



    

    memcpy(s->rx_buffer, buf, size);



    s->rx_count = size;

    s->rx_read = 0;



    

    s->intctl |= MIPSNET_INTCTL_RXDONE;

    mipsnet_update_irq(s);

}

static void FUNC_0(void *VAR_0, const uint8_t *VAR_1, size_t VAR_2)

{

    MIPSnetState *s = VAR_0;



#ifdef DEBUG_MIPSNET_RECEIVE

    printf("mipsnet: receiving len=%d\n", VAR_2);

#endif

    if (!mipsnet_can_receive(VAR_0))

        return;



    s->busy = 1;



    



    

    memcpy(s->rx_buffer, VAR_1, VAR_2);



    s->rx_count = VAR_2;

    s->rx_read = 0;



    

    s->intctl |= MIPSNET_INTCTL_RXDONE;

    mipsnet_update_irq(s);

}

static void FUNC_0(void *VAR_0, const uint8_t *VAR_1, size_t VAR_2)
{ MIPSnetState *s = VAR_0; #ifdef DEBUG_MIPSNET_RECEIVE
printf("mipsnet: receiving len=%d\n", VAR_2); #endif
if (!mipsnet_can_receive(VAR_0))
return; s->busy = 1; memcpy(s->rx_buffer, VAR_1, VAR_2); s->rx_count = VAR_2; s->rx_read = 0; s->intctl |= MIPSNET_INTCTL_RXDONE; mipsnet_update_irq(s); }