All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Hauke Mehrtens <hauke@hauke-m.de>, ralf@linux-mips.org
Cc: zajec5@gmail.com, linux-mips@linux-mips.org
Subject: Re: [PATCH v2] MIPS: BCM47XX: fixup broken MAC addresses in nvram
Date: Tue, 29 Jul 2014 16:08:40 +0400	[thread overview]
Message-ID: <53D78EC8.6010603@cogentembedded.com> (raw)
In-Reply-To: <1406585281-13054-1-git-send-email-hauke@hauke-m.de>

Hello.

On 07/29/2014 02:08 AM, Hauke Mehrtens wrote:

> The address prefix 00:90:4C is used by Broadcom in their initial
> configuration. When a mac address with the prefix 00:90:4C is used all
> devices from the same series are sharing the same mac address. To
> prevent mac address collisions we replace them with a mac address based
> on the base address. To generate such addresses we take the main mac
> address from et0macaddr and increase it by two for the first wifi
> device and by 3 for the second one. This matches the printed mac
> address on the device. The main mac address increased by one is used as
> wan address by the vendor code.

> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---

> v1: fix checkpatch warnings

>   arch/mips/bcm47xx/sprom.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 48 insertions(+)

> diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c
> index da4cdb1..41226b6 100644
> --- a/arch/mips/bcm47xx/sprom.c
> +++ b/arch/mips/bcm47xx/sprom.c
[...]
> @@ -648,6 +677,25 @@ static void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom,
>
>   	nvram_read_macaddr(prefix, "macaddr", sprom->il0mac, fallback);
>   	nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback);
> +
> +	/* The address prefix 00:90:4C is used by Broadcom in their initial
> +	   configuration. When a mac address with the prefix 00:90:4C is used
> +	   all devices from the same series are sharing the same mac address.
> +	   To prevent mac address collisions we replace them with a mac address
> +	   based on the base address. */

    The preferred multi-line comment style in the kernel is this:

/*
  * bla
  * bla
  */

WBR, Sergei

      reply	other threads:[~2014-07-29 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 21:54 [PATCH] MIPS: BCM47XX: fixup broken MAC addresses in nvram Hauke Mehrtens
2014-07-28 22:08 ` [PATCH v2] " Hauke Mehrtens
2014-07-29 12:08   ` Sergei Shtylyov [this message]

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=53D78EC8.6010603@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=hauke@hauke-m.de \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=zajec5@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.