From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Date: Wed, 08 Aug 2007 10:10:21 +0300 Subject: [U-Boot-Users] [PATCH] Add ability to take MAC address from the environment to DM9000 driver In-Reply-To: <20070808064804.F22F2353428@atlas.denx.de> References: <20070808064804.F22F2353428@atlas.denx.de> Message-ID: <46B96C5D.60505@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message <46B9563B.1010807@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.