/* The R_ETHER_Read() function receives data into the specified receive buffer.  */
int32_t R_ETHER_Read(uint32_t channel, void *pbuf)
/* The R_ETHER_Read() function receives data into the specified receive buffer.  */
int32_t R_ETHER_Read(uint32_t channel, void *pbuf)
{
    int32_t ret;
    int32_t ret2;
    uint8_t * pread_buffer_address;
    if (ETHER_CHANNEL_MAX <= channel)
    {
        return ETHER_ERR_INVALID_CHAN;
    }
    if ((NULL == pbuf) || (FIT_NO_PTR == pbuf))
    {
        return ETHER_ERR_INVALID_PTR;
    }
    ret = R_ETHER_Read_ZC2(channel, (void **) &pread_buffer_address);
    if (ret > ETHER_NO_DATA)
    {
        memcpy(pbuf, pread_buffer_address, (uint32_t )ret);
        ret2 = R_ETHER_Read_ZC2_BufRelease(channel);
        if (ETHER_SUCCESS == ret2)
        {
        }
        else
        {
            ret = ret2;
        }
    }
    else
    {
    }
    return ret;
}