[uClinux-dev] 2.4.X coldfire fec multicast

Greg Ungerer gerg at snapgear.com
Tue Feb 5 02:18:39 EST 2008


Hi Mathias,

Mathias Kuester wrote:
>> the current fec driver (kernel 2.4.X) is not able to receive multicast
>> packages. Please initialise the registers of the fec like this:
>>
>> fec_grp_hash_table_high = 0xffffffff;
>> fec_grp_hash_table_low = 0xffffffff;

Looking at this it seems to me that the renaming the fields of
the 5272 struct to "fec_grp_hash_table*" is probably more correct.
According to the 5272 documentation those registers are a group
hash setup. So I think the struct fields are actually misnamed.

If we change the field names in the 5272 fec struct, and
then change all occurrences in fec.c then there is no need
for all the "#ifdef"ery. Much cleaner.

Regards
Greg




>> The command (from remote computer on the same network)
>>
>>> ping 224.0.0.1
>> works then.
>>
>>
>>
>> Thanks,
>>
>>
>> Mathias
>> _______________________________________________
>> 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
>>
> 
> 
> ------------------------------------------------------------------------
> 
> --- fec_orig.c	2007-01-17 07:41:08.000000000 +0100
> +++ fec.c	2008-01-30 14:47:50.000000000 +0100
> @@ -2275,14 +2275,27 @@
>  			/* Catch all multicast addresses, so set the
>  			 * filter to all 1's.
>  			 */
> +#if defined(CONFIG_M5235) || defined(CONFIG_M527x) || \
> +    defined(CONFIG_M5282) || defined(CONFIG_M5280) || \
> +    defined(CONFIG_M5208)
> +			ep->fec_grp_hash_table_high = 0xffffffff;
> +			ep->fec_grp_hash_table_low = 0xffffffff;
> +#else
>  			ep->fec_hash_table_high = 0xffffffff;
>  			ep->fec_hash_table_low = 0xffffffff;
> +#endif
>  		} else {
>  			/* Clear filter and add the addresses in hash register.
>  			*/
> +#if defined(CONFIG_M5235) || defined(CONFIG_M527x) || \
> +    defined(CONFIG_M5282) || defined(CONFIG_M5280) || \
> +    defined(CONFIG_M5208)
> +			ep->fec_grp_hash_table_high = 0;
> +			ep->fec_grp_hash_table_low = 0;
> +#else
>  			ep->fec_hash_table_high = 0;
>  			ep->fec_hash_table_low = 0;
> -            
> +#endif            
>  			dmi = dev->mc_list;
>  
>  			for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) {
> @@ -2309,10 +2322,23 @@
>  				*/
>  				hash = (crc >> (32 - HASH_BITS)) & 0x3f;
>  			
> -				if (hash > 31)
> +				if (hash > 31) {
> +#if defined(CONFIG_M5235) || defined(CONFIG_M527x) || \
> +    defined(CONFIG_M5282) || defined(CONFIG_M5280) || \
> +    defined(CONFIG_M5208)
> +					ep->fec_grp_hash_table_high |= 1 << (hash - 32);
> +#else
>  					ep->fec_hash_table_high |= 1 << (hash - 32);
> -				else
> +#endif
> +				} else {
> +#if defined(CONFIG_M5235) || defined(CONFIG_M527x) || \
> +    defined(CONFIG_M5282) || defined(CONFIG_M5280) || \
> +    defined(CONFIG_M5208)
> +					ep->fec_grp_hash_table_low |= 1 << hash;
> +#else
>  					ep->fec_hash_table_low |= 1 << hash;
> +#endif
> +				}
>  			}
>  		}
>  	}
> @@ -2406,6 +2432,14 @@
>  		FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII);
>  	fecp->fec_hash_table_high = 0;
>  	fecp->fec_hash_table_low = 0;
> +	/* Set initial multicast address filter.
> +	*/
> +#if defined(CONFIG_M5235) || defined(CONFIG_M527x) || \
> +    defined(CONFIG_M5282) || defined(CONFIG_M5280) || \
> +    defined(CONFIG_M5208)
> +	fecp->fec_grp_hash_table_high = 0;
> +	fecp->fec_grp_hash_table_low  = 0;
> +#endif
>  	fecp->fec_r_buff_size = PKT_MAXBLR_SIZE;
>          //fecp->fec_ecntrl = 2; // this is too early PSW
>          fecp->fec_r_des_active = 0x01000000;
> 
> 
> ------------------------------------------------------------------------
> 
> --- fec_orig.h	2005-08-10 07:13:34.000000000 +0200
> +++ fec.h	2008-01-30 13:10:34.000000000 +0100
> @@ -148,6 +148,8 @@
>  #define BD_ENET_RX_LAST         ((ushort)0x0800)
>  #define BD_ENET_RX_FIRST        ((ushort)0x0400)
>  #define BD_ENET_RX_MISS         ((ushort)0x0100)
> +#define BD_ENET_RX_BC           ((ushort)0x0080)
> +#define BD_ENET_RX_MC           ((ushort)0x0040)
>  #define BD_ENET_RX_LG           ((ushort)0x0020)
>  #define BD_ENET_RX_NO           ((ushort)0x0010)
>  #define BD_ENET_RX_SH           ((ushort)0x0008)
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg at snapgear.com
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com


More information about the uClinux-dev mailing list