/* Change Logs: Date Author Notes  Bernard add file header export bsd socket symbol for RT-Thread Application Module  Bernard add lock for init_done callback. Initialize the network interface device */
static err_t netif_device_init(struct netif *netif)
/* Change Logs: Date Author Notes  Bernard add file header export bsd socket symbol for RT-Thread Application Module  Bernard add lock for init_done callback. Initialize the network interface device */
static err_t netif_device_init(struct netif *netif)
{
    struct eth_device *ethif;
    ethif = (struct eth_device *)netif->state;
    if (ethif != RT_NULL)
    {
        rt_device_t device;
        device = (rt_device_t) ethif;
        if (rt_device_init(device) != RT_EOK)
        {
            return ERR_IF;
        }
        netif->flags = ethif->flags;
        return ERR_OK;
    }
    return ERR_IF;
}