/* Low power mode shrinks power consumption about 100x, so we'd like the chip to be in that mode whenever it's inactive. (However, we can't stay in lowpower mode during suspend with WOL active.)  */
static void enc28j60_lowpower(struct enc28j60_net *priv, bool is_low)
/* Low power mode shrinks power consumption about 100x, so we'd like the chip to be in that mode whenever it's inactive. (However, we can't stay in lowpower mode during suspend with WOL active.)  */
static void enc28j60_lowpower(struct enc28j60_net *priv, bool is_low)
{
	if (netif_msg_drv(priv))
		dev_dbg(&priv->spi->dev, "%s power...\n",
				is_low ? "low" : "high");
	mutex_lock(&priv->lock);
	if (is_low) {
		nolock_reg_bfclr(priv, ECON1, ECON1_RXEN);
		poll_ready(priv, ESTAT, ESTAT_RXBUSY, 0);
		poll_ready(priv, ECON1, ECON1_TXRTS, 0);
		nolock_reg_bfset(priv, ECON2, ECON2_PWRSV);
	} else {
		nolock_reg_bfclr(priv, ECON2, ECON2_PWRSV);
		poll_ready(priv, ESTAT, ESTAT_CLKRDY, ESTAT_CLKRDY);
	}
	mutex_unlock(&priv->lock);
}