/* If the link status changed (previous != current), call netif_carrier_on() if current link status is Up or call netif_carrier_off() if current link status is Down.  */
void mii_check_link(struct mii_if_info *mii)
/* If the link status changed (previous != current), call netif_carrier_on() if current link status is Up or call netif_carrier_off() if current link status is Down.  */
void mii_check_link(struct mii_if_info *mii)
{
	int cur_link = mii_link_ok(mii);
	int prev_link = netif_carrier_ok(mii->dev);
	if (cur_link && !prev_link)
		netif_carrier_on(mii->dev);
	else if (prev_link && !cur_link)
		netif_carrier_off(mii->dev);
}