Subject: Re: [PATCH net-next 6/7] net: systemport: Add support for WAKE_FILTER

From: Andrew Lunn <[email-masked]>
Date: Tue, 17 Jul 2018 19:06:53 +0200

> >>>> +		if (bitmap_weight(priv->filters, WAKE_FILTER_BITS) >
> >>>> +				  RXCHK_BRCM_TAG_MAX) {
> >>>> +			bitmap_zero(priv->filters, WAKE_FILTER_BITS);
> >>>> +			return -ENOSPC;
> >>>> +		}
> >>>> +
> >>>> +		if (bitmap_weight(priv->filters, WAKE_FILTER_BITS) == 0)
> >>>> +			return -EINVAL;
> >>>> +
> >>>> +		for_each_set_bit(index, priv->filters, WAKE_FILTER_BITS) {
> >>>> +			/* Write the index we want to match within the CID field */
> >>>> +			reg = rxchk_readl(priv, RXCHK_BRCM_TAG(i));
> >>>> +			reg &= ~(RXCHK_BRCM_TAG_CID_MASK <<
> >>>> +				 RXCHK_BRCM_TAG_CID_SHIFT);
> >>>> +			reg |= index << RXCHK_BRCM_TAG_CID_SHIFT;
> >>>> +			rxchk_writel(priv, reg, RXCHK_BRCM_TAG(i));
> >>>> +			rxchk_writel(priv, 0xff00ffff, RXCHK_BRCM_TAG_MASK(i));
> >>>> +			i++;
> >>>> +		}
> >>>> +	}
> >>>

Just to convince me, can you dump the contents of reg. And execute the
commands:

ethtool -s gphy wol f filters 0x1
ethtool -s gphy wol f filters 0x2

After these two commands, we expect only one filter bit to be set, bit
1. Filter Bit 0 should of been cleared when the second command was
executed.

  Andrew