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@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@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@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to