From: Florian Fainelli <florian@openwrt.org>
To: Hauke Mehrtens <hauke@hauke-m.de>
Cc: davem@davemloft.net, zajec5@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH 4/4] bgmac: add ndo_set_rx_mode netdev ops
Date: Wed, 06 Feb 2013 15:58:10 +0100 [thread overview]
Message-ID: <51126F82.2030605@openwrt.org> (raw)
In-Reply-To: <1360161900-2330-5-git-send-email-hauke@hauke-m.de>
Hello Hauke,
On 02/06/2013 03:45 PM, Hauke Mehrtens wrote:
> Currently it is only possible to activate or deactivate promisc mode
> while the device is up.
This is required for bridging to work, so it is definitively a good fix
to have.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> drivers/net/ethernet/broadcom/bgmac.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
> index e0775c4..23c8d4a 100644
> --- a/drivers/net/ethernet/broadcom/bgmac.c
> +++ b/drivers/net/ethernet/broadcom/bgmac.c
> @@ -771,6 +771,16 @@ static void bgmac_write_mac_address(struct bgmac *bgmac, u8 *addr)
> bgmac_write(bgmac, BGMAC_MACADDR_LOW, tmp);
> }
>
> +static void bgmac_set_rx_mode(struct net_device *net_dev)
> +{
> + struct bgmac *bgmac = netdev_priv(net_dev);
> +
> + if (net_dev->flags & IFF_PROMISC)
> + bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_PROM, false);
> + else
> + bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_PROM, 0, false);
> +}
> +
> #if 0 /* We don't use that regs yet */
> static void bgmac_chip_stats_update(struct bgmac *bgmac)
> {
> @@ -1024,10 +1034,7 @@ static void bgmac_chip_init(struct bgmac *bgmac, bool full_init)
> /* Enable 802.3x tx flow control (honor received PAUSE frames) */
> bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_RPI, 0, true);
>
> - if (bgmac->net_dev->flags & IFF_PROMISC)
> - bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_PROM, false);
> - else
> - bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_PROM, 0, false);
> + bgmac_set_rx_mode(bgmac->net_dev);
>
> bgmac_write_mac_address(bgmac, bgmac->net_dev->dev_addr);
>
> @@ -1209,6 +1216,7 @@ static const struct net_device_ops bgmac_netdev_ops = {
> .ndo_open = bgmac_open,
> .ndo_stop = bgmac_stop,
> .ndo_start_xmit = bgmac_start_xmit,
> + .ndo_set_rx_mode = bgmac_set_rx_mode,
> .ndo_set_mac_address = bgmac_set_mac_address,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_do_ioctl = bgmac_ioctl,
>
next prev parent reply other threads:[~2013-02-06 15:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 14:44 [PATCH 0/4] bgmac: fixes and more netdev ops Hauke Mehrtens
2013-02-06 14:44 ` [PATCH 1/4] bgmac: implement missing code for BCM53572 Hauke Mehrtens
2013-02-06 14:54 ` Rafał Miłecki
2013-02-06 14:44 ` [PATCH 2/4] bgmac: write mac address to hardware in ndo_set_mac_address Hauke Mehrtens
2013-02-06 14:57 ` Rafał Miłecki
2013-02-06 15:17 ` Hauke Mehrtens
2013-02-06 14:44 ` [PATCH 3/4] bgmac: add generic ndo_validate_addr netdev ops Hauke Mehrtens
2013-02-06 14:45 ` [PATCH 4/4] bgmac: add ndo_set_rx_mode " Hauke Mehrtens
2013-02-06 14:58 ` Florian Fainelli [this message]
2013-02-06 15:51 ` [PATCH v2 " Hauke Mehrtens
2013-02-06 21:07 ` [PATCH 0/4] bgmac: fixes and more " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51126F82.2030605@openwrt.org \
--to=florian@openwrt.org \
--cc=davem@davemloft.net \
--cc=hauke@hauke-m.de \
--cc=netdev@vger.kernel.org \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).