/* Returns success (0) or appropriate error code (none as of now)  */
static void emac_setmac(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_setmac(struct emac_priv *priv, rt_uint32_t ch, char *mac_addr)
{
    if (priv->rx_addr_type == 0) {
        emac_set_type0addr(priv, ch, mac_addr);
    } else if (priv->rx_addr_type == 1) {
        rt_uint32_t cnt;
        for (cnt = 0; cnt < EMAC_MAX_TXRX_CHANNELS; cnt++)
            emac_set_type1addr(priv, ch, mac_addr);
    } else if (priv->rx_addr_type == 2) {
        emac_set_type2addr(priv, ch, mac_addr, ch, 1);
        emac_set_type0addr(priv, ch, mac_addr);
    } else {
        rt_kprintf("DaVinci EMAC: Wrong addressing\n");
    }
}