/* Stop the controller so we don't rx any more frames */ /* But first, make sure we clear the bits */ tempval = gfar_read(&priv->regs->dmactrl); tempval &= ~(DMACTRL_GRS | DMACTRL_GTS); gfar_write(&priv->regs->dmactrl, tempval); 
if (dev->flags & IFF_UP) { unsigned long flags; 
int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rvals){	u32 tempval;	struct gfar_private *priv = netdev_priv(dev);	int err = 0;	if (rvals->rx_pending > GFAR_RX_MAX_RING_SIZE)		return -EINVAL;	if (!is_power_of_2(rvals->rx_pending)) {		printk("%s: Ring sizes must be a power of 2\n",				dev->name);		return -EINVAL;	}	if (rvals->tx_pending > GFAR_TX_MAX_RING_SIZE)		return -EINVAL;	if (!is_power_of_2(rvals->tx_pending)) {		printk("%s: Ring sizes must be a power of 2\n",				dev->name);		return -EINVAL;	}	/* Stop the controller so we don't rx any more frames */	/* But first, make sure we clear the bits */	tempval = gfar_read(&priv->regs->dmactrl);	tempval &= ~(DMACTRL_GRS | DMACTRL_GTS);	gfar_write(&priv->regs->dmactrl, tempval);	tempval = gfar_read(&priv->regs->dmactrl);	tempval |= (DMACTRL_GRS | DMACTRL_GTS);	gfar_write(&priv->regs->dmactrl, tempval);	while (!(gfar_read(&priv->regs->ievent) & (IEVENT_GRSC | IEVENT_GTSC)))		cpu_relax();	/* Note that rx is not clean right now */	priv->rxclean = 0;	if (dev->flags & IFF_UP) {		/* Tell the driver to process the rest of the frames */		gfar_receive(0, (void *) dev, NULL);		/* Now wait for it to be done */		wait_event_interruptible(priv->rxcleanupq, priv->rxclean);		/* Ok, all packets have been handled.  Now we bring it down,		 * change the ring size, and bring it up */		stop_gfar(dev);	}	priv->rx_ring_size = rvals->rx_pending;	priv->tx_ring_size = rvals->tx_pending;	if (dev->flags & IFF_UP)		err = startup_gfar(dev);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0bbaf069f053957e8d733784e18a2992afd1dd3c/gianfar_ethtool.c/buggy/drivers/net/gianfar_ethtool.c