All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Rumler <Steffen.Rumler@icn.siemens.de>
To: "Ludszuweit, Axel" <Axel.Ludszuweit@datentechnik.com>,
	linuxppc-embedded@lists.linuxppc.org
Subject: Re: set_multicast_list function of ppc enet driver
Date: Wed, 19 Jun 2002 13:31:15 +0200	[thread overview]
Message-ID: <3D106B83.79843019@icn.siemens.de> (raw)
In-Reply-To: 3D1069BE.E5CC6632@icn.siemens.de


Sorry, the

  dmi = dmi->next;  !!!

was missing:


static void
set_multicast_list(struct net_device *dev)
{
  struct  fcc_enet_private *cep;
  struct  dev_mc_list *dmi;
  u_char  *mcptr, *tdptr;
  volatile fcc_enet_t *ep;
  int     i, j;

  cep = (struct fcc_enet_private *)dev->priv;

  /* Get pointer to FCC area in parameter RAM.
   */
  ep = (fcc_enet_t *)dev->base_addr;

  if (dev->flags&IFF_PROMISC) {

    /* Log any net taps. */
    printk("%s: Promiscuous mode enabled.\n", dev->name);
    cep->fccp->fcc_fpsmr |= FCC_PSMR_PRO;
  } else {

    cep->fccp->fcc_fpsmr &= ~FCC_PSMR_PRO;

    if (dev->flags & IFF_ALLMULTI) {
      /* Catch all multicast addresses, so set the
       * filter to all 1's.
       */
      ep->fen_gaddrh = 0xffffffff;
      ep->fen_gaddrl = 0xffffffff;
    }
    else {
      /* Clear filter and add the addresses in the list.
       */
      ep->fen_gaddrh = 0;
      ep->fen_gaddrl = 0;

      dmi = dev->mc_list;

      for (i=0; i<dev->mc_count; i++) {

        /* Only support group multicast for now.
	 */
        if (!(dmi->dmi_addr[0] & 1))
          continue;

        /* The address in dmi_addr is LSB first,
	 * and taddr is MSB first.  We have to
	 * copy bytes MSB first from dmi_addr.
	 */
        mcptr = (u_char *)dmi->dmi_addr + 5;
        tdptr = (u_char *)&ep->fen_taddrh;

        for (j=0; j<6; j++)
          *tdptr++ = *mcptr--;

        /* Ask CPM to run CRC and set bit in
	 * filter mask.
	 */
#ifdef CONFIG_MCU
        run_cpcr_cmd(cep->fip->fc_cpmpage,
                     cep->fip->fc_cpmblock,
                     0x0c,
                     CPM_CR_SET_GADDR);
#else  /* CONFIG_MCU */
        cpmp->cp_cpcr = mk_cr_cmd(cep->fip->fc_cpmpage,
                                  cep->fip->fc_cpmblock, 0x0c,
                                  CPM_CR_SET_GADDR) | CPM_CR_FLG;
        udelay(10);
        while (cpmp->cp_cpcr & CPM_CR_FLG);
#endif  /* CONFIG_MCU */

        dmi = dmi->next;  /* S.R. switch to the next list entry */
      }
    }
  }
}



--


--------------------------------------------------------------

Steffen Rumler
ICN ON PNE SB 4
Siemens AG
Hofmannstr. 51                 Email: Steffen.Rumler@icn.siemens.de
D-81359 Munich                 Phone: +49 89 722-44061
Germany                        Fax  : +49 89 722-36703

--------------------------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

      reply	other threads:[~2002-06-19 11:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-19 10:42 set_multicast_list function of ppc enet driver Ludszuweit, Axel
2002-06-19 11:23 ` Steffen Rumler
2002-06-19 11:31   ` Steffen Rumler [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=3D106B83.79843019@icn.siemens.de \
    --to=steffen.rumler@icn.siemens.de \
    --cc=Axel.Ludszuweit@datentechnik.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.