/* If the adapter is link-on, set the auto-negotiate enable/reset bit. autong_complete should be set to 0 when starting auto-negotiation. autong_complete should be set to 1 if we didn't start auto-negotiation. sis900_timer will wait for link on again if autong_complete = 0.  */
static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
/* If the adapter is link-on, set the auto-negotiate enable/reset bit. autong_complete should be set to 0 when starting auto-negotiation. autong_complete should be set to 1 if we didn't start auto-negotiation. sis900_timer will wait for link on again if autong_complete = 0.  */
static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
{
	struct sis900_private *sis_priv = netdev_priv(net_dev);
	int i = 0;
	u32 status;
	for (i = 0; i < 2; i++)
		status = mdio_read(net_dev, phy_addr, MII_STATUS);
	if (!(status & MII_STAT_LINK)){
		if(netif_msg_link(sis_priv))
			printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
		sis_priv->autong_complete = 1;
		netif_carrier_off(net_dev);
		return;
	}
	mdio_write(net_dev, phy_addr, MII_CONTROL,
		   MII_CNTL_AUTO | MII_CNTL_RST_AUTO);
	sis_priv->autong_complete = 0;
}