/* reset sis900 MAC and wait until finished reset through command register change backoff algorithm for 900B0 & 635 M/B  */
static void sis900_reset(struct net_device *net_dev)
/* reset sis900 MAC and wait until finished reset through command register change backoff algorithm for 900B0 & 635 M/B  */
static void sis900_reset(struct net_device *net_dev)
{
	struct sis900_private *sis_priv = netdev_priv(net_dev);
	long ioaddr = net_dev->base_addr;
	int i = 0;
	u32 status = TxRCMP | RxRCMP;
	outl(0, ioaddr + ier);
	outl(0, ioaddr + imr);
	outl(0, ioaddr + rfcr);
	outl(RxRESET | TxRESET | RESET | inl(ioaddr + cr), ioaddr + cr);
	while (status && (i++ < 1000)) {
		status ^= (inl(isr + ioaddr) & status);
	}
	if( (sis_priv->chipset_rev >= SIS635A_900_REV) ||
			(sis_priv->chipset_rev == SIS900B_900_REV) )
		outl(PESEL | RND_CNT, ioaddr + cfg);
	else
		outl(PESEL, ioaddr + cfg);
}