mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #4238 from tung7970/fix-mbedos
lwip - power up emac before reading its settingspull/4286/head
commit
3b11b23371
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -393,8 +393,6 @@ nsapi_error_t mbed_lwip_init(emac_interface_t *emac)
|
|||
// Check if we've already brought up lwip
|
||||
if (!mbed_lwip_get_mac_address()) {
|
||||
// Set up network
|
||||
mbed_lwip_set_mac_address();
|
||||
|
||||
sys_sem_new(&lwip_tcpip_inited, 0);
|
||||
sys_sem_new(&lwip_netif_linked, 0);
|
||||
sys_sem_new(&lwip_netif_has_addr, 0);
|
||||
|
@ -411,6 +409,7 @@ nsapi_error_t mbed_lwip_init(emac_interface_t *emac)
|
|||
return NSAPI_ERROR_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
mbed_lwip_set_mac_address();
|
||||
netif_set_default(&lwip_netif);
|
||||
|
||||
netif_set_link_callback(&lwip_netif, mbed_lwip_netif_link_irq);
|
||||
|
|
Loading…
Reference in New Issue