|
@@ -154,7 +154,7 @@ static err_t eth_netif_device_init(struct netif *netif)
|
|
|
}
|
|
|
|
|
|
/* copy device flags to netif flags */
|
|
|
- netif->flags = ethif->flags;
|
|
|
+ netif->flags = (ethif->flags & 0xff);
|
|
|
|
|
|
/* set default netif */
|
|
|
if (netif_default == RT_NULL)
|
|
@@ -173,9 +173,11 @@ static err_t eth_netif_device_init(struct netif *netif)
|
|
|
netif_set_up(ethif->netif);
|
|
|
}
|
|
|
|
|
|
-#ifdef LWIP_NETIF_LINK_CALLBACK
|
|
|
- netif_set_link_up(ethif->netif);
|
|
|
-#endif
|
|
|
+ if (!(ethif->flags & ETHIF_LINK_PHYUP))
|
|
|
+ {
|
|
|
+ /* set link_up for this netif */
|
|
|
+ netif_set_link_up(ethif->netif);
|
|
|
+ }
|
|
|
|
|
|
return ERR_OK;
|
|
|
}
|
|
@@ -184,7 +186,7 @@ static err_t eth_netif_device_init(struct netif *netif)
|
|
|
}
|
|
|
|
|
|
/* Keep old drivers compatible in RT-Thread */
|
|
|
-rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint8_t flags)
|
|
|
+rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint16_t flags)
|
|
|
{
|
|
|
struct netif* netif;
|
|
|
|
|
@@ -246,7 +248,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint8_
|
|
|
|
|
|
rt_err_t eth_device_init(struct eth_device * dev, char *name)
|
|
|
{
|
|
|
- rt_uint8_t flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP;
|
|
|
+ rt_uint16_t flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP;
|
|
|
|
|
|
#if LWIP_DHCP
|
|
|
/* DHCP support */
|