/* A periodic timer routine Polling PHY Chip Link Status  */
static void r6040_timer(unsigned long data)
/* A periodic timer routine Polling PHY Chip Link Status  */
static void r6040_timer(unsigned long data)
{
	struct net_device *dev = (struct net_device *)data;
	struct r6040_private *lp = netdev_priv(dev);
	void __iomem *ioaddr = lp->base;
	u16 phy_mode;
	if (PHY_MODE == 0x3100)
		phy_mode = r6040_phy_mode_chk(dev);
	else
		phy_mode = (PHY_MODE & 0x0100) ? 0x8000:0x0;
	if (phy_mode != lp->phy_mode) {
		lp->phy_mode = phy_mode;
		lp->mcr0 = (lp->mcr0 & 0x7fff) | phy_mode;
		iowrite16(lp->mcr0, ioaddr);
	}
	mod_timer(&lp->timer, round_jiffies(jiffies + HZ));
}