Netdev List
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: bryan.wu@analog.com
Cc: michael.hennerich@analog.com, mb@bu3sch.de, vapier.adi@gmail.com,
	jeff@garzik.org, hch@infradead.org, dcbw@redhat.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, joe@perches.com, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH try#5] Blackfin ethernet driver: on chip ethernet MAC controller driver
Date: Tue, 17 Jul 2007 02:11:53 +0900 (JST)	[thread overview]
Message-ID: <20070717.021153.74661454.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <1184604542.6107.44.camel@roc-laptop>

Hello.

In article <1184604542.6107.44.camel@roc-laptop> (at Tue, 17 Jul 2007 00:49:02 +0800), Bryan Wu <bryan.wu@analog.com> says:

> +static void bf537mac_set_multicast_list(struct net_device *dev)
> +{
> +	u32 sysctl;
> +
> +	if (dev->flags & IFF_PROMISC) {
> +		printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
> +		sysctl = bfin_read_EMAC_OPMODE();
> +		sysctl |= RAF;
> +		bfin_write_EMAC_OPMODE(sysctl);
> +	} else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) {
> +		/* accept all multicast */
> +		sysctl = bfin_read_EMAC_OPMODE();
> +		sysctl |= PAM;
> +		bfin_write_EMAC_OPMODE(sysctl);
> +	} else if (dev->mc_count) {
> +		/* set multicast */
> +	} else {
> +		/* clear promisc or multicast mode */
> +		sysctl = bfin_read_EMAC_OPMODE();
> +		sysctl &= ~(RAF | PAM);
> +		bfin_write_EMAC_OPMODE(sysctl);
> +	}
> +}
> +

Is this function really correct?

Please make sure to set up multicast list on device, or
set "all multi" on device if you do not know what to do; e.g.

static void bf537mac_set_multicast_list(struct net_device *dev)
{
     u32 sysctl;

     if (dev->flags & IFF_PROMISC) {
             printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
             sysctl = bfin_read_EMAC_OPMODE();
             sysctl |= RAF;
             bfin_write_EMAC_OPMODE(sysctl);
     } else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
             /* accept all multicast */
             sysctl = bfin_read_EMAC_OPMODE();
             sysctl |= PAM;
             bfin_write_EMAC_OPMODE(sysctl);
     } else {
             /* clear promisc or multicast mode */
             sysctl = bfin_read_EMAC_OPMODE();
             sysctl &= ~(RAF | PAM);
             bfin_write_EMAC_OPMODE(sysctl);
     }
}
--yoshfuji

      reply	other threads:[~2007-07-16 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 16:49 [PATCH try#5] Blackfin ethernet driver: on chip ethernet MAC controller driver Bryan Wu
2007-07-16 17:11 ` YOSHIFUJI Hideaki / 吉藤英明 [this message]

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=20070717.021153.74661454.yoshfuji@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=akpm@linux-foundation.org \
    --cc=bryan.wu@analog.com \
    --cc=dcbw@redhat.com \
    --cc=hch@infradead.org \
    --cc=jeff@garzik.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=michael.hennerich@analog.com \
    --cc=netdev@vger.kernel.org \
    --cc=vapier.adi@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