[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 09:10:21 CEST 2007


Wolfgang Denk wrote:
> In message <46B9563B.1010807 at compulab.co.il> you wrote:
>>> 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.
> 
> Assume the board has an XXX Ethernet controller as eth0, and a DM9000
> as eth1 ?

The only solution I can think of in this case is adding some
#define CONFIG_DM9000_ETHER_INDEX
in the board config
and approptiate '#if' clauses in the driver.
If it's Ok with you I'll do it and resend the patch.
Still, the configuration you mention seems very theoretical for me and I can 
hardly imagine someone designing a board with such configuration.

>>> 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'?
> 
> That's a very long name which is difficult to read, difficult to type,
> and makes for very long source code lines...
> 
> And I will probably have to look up the definition of  this  function
> each  time  I read the code. You use this function exactly once, so I
> suggest to NOT define it at all and write down what it does:
> 
> 	if (!is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr)) ...
> 
> This is IMHO much better to read and to understand.

I agree and I'll fix it.

> Best regards,
> 
> Wolfgang Denk
> 


-- 
Sincerely yours,
Mike.





More information about the U-Boot mailing list