lwip - power up emac before reading its settings

emac settings are only available after powered up.

Signed-off-by: Tony Wu <tonywu@realtek.com>
pull/4238/head
Tony Wu 2016-11-03 13:17:47 +08:00 committed by Tony Wu
parent 12ca90e71f
commit cdc40ff3bb
1 changed files with 5 additions and 6 deletions

View File

@ -63,10 +63,13 @@ err_t emac_lwip_if_init(struct netif *netif)
mac->ops.set_link_input_cb(mac, emac_lwip_input, netif);
mac->ops.set_link_state_cb(mac, emac_lwip_state_change, netif);
netif->hwaddr_len = mac->ops.get_hwaddr_size(mac);
mac->ops.get_hwaddr(mac, netif->hwaddr);
if (!mac->ops.power_up(mac)) {
err = ERR_IF;
}
netif->mtu = mac->ops.get_mtu_size(mac);
netif->hwaddr_len = mac->ops.get_hwaddr_size(mac);
mac->ops.get_hwaddr(mac, netif->hwaddr);
/* Interface capabilities */
netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET | NETIF_FLAG_IGMP;
@ -79,10 +82,6 @@ err_t emac_lwip_if_init(struct netif *netif)
netif->linkoutput = emac_lwip_low_level_output;
if (!mac->ops.power_up(mac)) {
err = ERR_IF;
}
return err;
}