[uClinux-dev] receive multicast ethernet frames on 5329
Andrew Webster
apwebster at gmail.com
Tue Oct 16 10:31:50 EDT 2007
Look like the same problem I ran into a while back. I think that there's a
mistake in the set_multicast_list function you show. All instances of
ep->fec_hash_table_* should in fact be ep->fec_grp_hash_table_*.
Andrew
On 10/16/07, Christian Gieseler <c.gieseler at tiscali.de> wrote:
>
> Hello!
>
> I am now able to receive the multicast frames i want to. For the case
> that somebody has the same problem i want to inform you about the reason
> why it did not work.
>
> In fec.c the function set_multicast_list has the task to choose the
> operating mode. If you set the flags IFF_ALLMULTI and IFF_MULTICAST is
> uses the branch dev->flags & IFF_ALLMULTI so that all multicast packets
> should be received. But in fact this branch changes nothing in the
> decisive registers GAUR and GALR --> fec_grp_hash_table_high and
> fec_grp_hash_table_low.
>
> I tried to set these registers by adding the lines
> ep->fec_grp_hash_table_high = 0xffffffff; and
> ep->fec_grp_hash_table_low = 0xffffffff;
>
> But again i did not receive any packets. So i had a look at the actual
> register values an i saw that the bits are not set even with the added
> code lines.
> At the moment receive the frames by setting the registers directly from
> my userprogram. Certainly not the idial way.
>
> Has anyone a suggestion how to manage it directly in the driver ?
>
> Best regards Christian
>
> > Hello again!
> >
> > I am trying to receive multicast ethernet frames on the ColdFire 5329
> > with linux version 2.6.17-uc0.
> >
> > This is of course possible in promiscous mode, but i don?t want to
> > receive all the traffic. If I set the flags IFF_ALLMULTI and
> > IFF_MULTICAST the driver sets the hash table to receive all frames in
> > set_multicast_list. But in fact no frames are received.
> > Can somebody tell me how to manage this problem. Do i have to set some
> > more flags? Does somebody know a workaround?
> >
> > How can i set my prefered multicast mac address in the hash table?
> > Thanks for any help!
> >
> > Best regards
> >
> > Christian
> > _______________________________________________
> > uClinux-dev mailing list
> > uClinux-dev at uclinux.org
> > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> > This message was resent by uclinux-dev at uclinux.org
> > To unsubscribe see:
> > http://mailman.uclinux.org/mailman/options/uclinux-dev
> >
>
> static void set_multicast_list(struct net_device *dev)
> {
> struct fec_enet_private *fep;
> volatile fec_t *ep;
> struct dev_mc_list *dmi;
> unsigned int i, j, bit, data, crc;
> unsigned char hash;
>
> fep = netdev_priv(dev);
> ep = fep->hwp;
>
> if (dev->flags&IFF_PROMISC) {
> /* Log any net taps. */
> printk("%s: Promiscuous mode enabled.\n", dev->name);
> ep->fec_r_cntrl |= 0x0008;
> } else {
>
> ep->fec_r_cntrl &= ~0x0008;
>
> if (dev->flags & IFF_ALLMULTI) {
> /* Catch all multicast addresses, so set the
> * filter to all 1's.
> */
> ep->fec_hash_table_high = 0xffffffff;
> ep->fec_hash_table_low = 0xffffffff;
> } else {
> /* Clear filter and add the addresses in hash register.
> */
> ep->fec_hash_table_high = 0;
> ep->fec_hash_table_low = 0;
>
> dmi = dev->mc_list;
>
> for (j = 0; j < dev->mc_count; j++, dmi = dmi->next)
> {
> /* Only support group multicast for now.
> */
> if (!(dmi->dmi_addr[0] & 1))
> continue;
>
> /* calculate crc32 value of mac address
> */
> crc = 0xffffffff;
>
> for (i = 0; i < dmi->dmi_addrlen; i++)
> {
> data = dmi->dmi_addr[i];
> for (bit = 0; bit < 8; bit++, data >>= 1)
> {
> crc = (crc >> 1) ^
> (((crc ^ data) & 1) ? CRC32_POLY : 0);
> }
> }
>
> /* only upper 6 bits (HASH_BITS) are used
> which point to specific bit in he hash registers
> */
> hash = (crc >> (32 - HASH_BITS)) & 0x3f;
>
> if (hash > 31)
> ep->fec_hash_table_high |= 1 << (hash - 32);
> else
> ep->fec_hash_table_low |= 1 << hash;
> }
> }
> }
> }
>
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20071016/f5ddc4d2/attachment.html
More information about the uClinux-dev
mailing list