From: Mike Rapoport <mike@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Add ability to take MAC address from the environment to DM9000 driver
Date: Wed, 08 Aug 2007 08:35:55 +0300 [thread overview]
Message-ID: <46B9563B.1010807@compulab.co.il> (raw)
In-Reply-To: <46B898D3.40107@qstreams.com>
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.
next prev parent reply other threads:[~2007-08-08 5:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-07 10:32 [U-Boot-Users] [PATCH] Add ability to take MAC address from the environment to DM9000 driver Mike Rapoport
2007-08-07 14:56 ` Wolfgang Denk
2007-08-07 15:29 ` Mike Rapoport
2007-08-09 21:04 ` Wolfgang Denk
2007-08-09 21:10 ` Wolfgang Denk
2007-08-12 5:48 ` Mike Rapoport
2007-08-13 14:32 ` Ben Warren
2007-08-07 14:57 ` Wolfgang Denk
2007-08-07 16:07 ` Ben Warren
2007-08-08 5:35 ` Mike Rapoport [this message]
2007-08-08 6:48 ` Wolfgang Denk
2007-08-08 7:10 ` Mike Rapoport
2007-08-08 15:41 ` Ben Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46B9563B.1010807@compulab.co.il \
--to=mike@compulab.co.il \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox