From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next 6/7] net: systemport: Add support for WAKE_FILTER Date: Tue, 17 Jul 2018 19:06:53 +0200 Message-ID: <20180717170653.GK968@lunn.ch> References: <20180717153645.7500-1-f.fainelli@gmail.com> <20180717153645.7500-8-f.fainelli@gmail.com> <20180717161459.GG968@lunn.ch> <87910e9c-0783-98e9-eb44-ce85656912d8@gmail.com> <20180717164908.GI968@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, linville@tuxdriver.com, davem@davemloft.net, vivien.didelot@savoirfairelinux.com To: Florian Fainelli Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:37197 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729648AbeGQRka (ORCPT ); Tue, 17 Jul 2018 13:40:30 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: > >>>> + 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