/* Returns success (0) or appropriate error code (none as of now)  */
static void emac_set_type0addr(struct emac_priv *priv, rt_uint32_t ch, char *mac_addr)
/* Returns success (0) or appropriate error code (none as of now)  */
static void emac_set_type0addr(struct emac_priv *priv, rt_uint32_t ch, char *mac_addr)
{
    rt_uint32_t val;
    val = ((mac_addr[5] << 8) | (mac_addr[4]));
    emac_write(EMAC_MACSRCADDRLO, val);
    val = ((mac_addr[3] << 24) | (mac_addr[2] << 16) | \
           (mac_addr[1] << 8) | (mac_addr[0]));
    emac_write(EMAC_MACSRCADDRHI, val);
    val = emac_read(EMAC_RXUNICASTSET);
    val |= BIT(ch);
    emac_write(EMAC_RXUNICASTSET, val);
    val = emac_read(EMAC_RXUNICASTCLEAR);
    val &= ~BIT(ch);
    emac_write(EMAC_RXUNICASTCLEAR, val);
}