[U-Boot-Users] [PATCH] Add ability to take MAC address from the environment to DM9000 driver

Mike Rapoport mike at compulab.co.il
Wed Aug 8 07:35:55 CEST 2007


Ben Warren wrote:
> Hi Mike,
> 
> Mike Rapoport wrote:

>> +		s = getenv ("ethaddr");
>>   
> Could this ever be other than the first Ethernet controller on a board? 
> If so, 'ethaddr' won't cut it.

If a board has more than one DM9000, the driver in its current state does not 
support it anyway.

>> +		for (i = 0; i < 6; ++i) {
>> +	}
>>   
> While this is probably fine, it looks scary to me. My little brain is 
> going to need a few more passes...
>> +
>>   	printf("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", bd->bi_enetaddr[0],
>>   	       bd->bi_enetaddr[1], bd->bi_enetaddr[2], bd->bi_enetaddr[3],
>>   	       bd->bi_enetaddr[4], bd->bi_enetaddr[5]);

>> +/**
>> + * is_valid_ether_addr - Determine if the given Ethernet address is valid
>> + * @addr: Pointer to a six-byte array containing the Ethernet address
>> + *
>> + * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
>> + * a multicast address, and is not FF:FF:FF:FF:FF:FF.
>> + *
>> + * Return true if the address is valid.
>> + */
>> +static inline int is_valid_ether_addr(const u8 *addr)
>> +{
>>   
> Please choose a better name for this function. While multicast addresses 
> are poor choices for source, they're perfectly fine for destination.

What about 'is_valid_ether_src_addr'?

> thanks,
> Ben
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 


-- 
Sincerely yours,
Mike.





More information about the U-Boot mailing list