All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices.
@ 2011-11-16 20:49 Florian Fainelli
  2011-11-17 11:56 ` Sergei Shtylyov
  2011-11-17 14:06 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2011-11-16 20:49 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips, Florian Fainelli

In case the MAC address pool is not big enough to also register a WLAN device
prefer registering the Ethernet devices.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
 arch/mips/bcm63xx/boards/board_bcm963xx.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index ac948c2..fcd5a8c 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -791,18 +791,6 @@ void __init board_prom_init(void)
 	}
 
 	bcm_gpio_writel(val, GPIO_MODE_REG);
-
-	/* Generate MAC address for WLAN and
-	 * register our SPROM */
-#ifdef CONFIG_SSB_PCIHOST
-	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
-		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
-		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
-		if (ssb_arch_register_fallback_sprom(
-				&bcm63xx_get_fallback_sprom) < 0)
-			printk(KERN_ERR PFX "failed to register fallback SPROM\n");
-	}
-#endif
 }
 
 /*
@@ -886,6 +874,19 @@ int __init board_register_devices(void)
 	if (board.has_dsp)
 		bcm63xx_dsp_register(&board.dsp);
 
+	/* Generate MAC address for WLAN and register our SPROM,
+	 * do this after registering enet devices
+	 */
+#ifdef CONFIG_SSB_PCIHOST
+	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
+		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+		if (ssb_arch_register_fallback_sprom(
+			&bcm63xx_get_fallback_sprom) < 0)
+			pr_err(PFX "failed to register fallback SPROM\n");
+	}
+#endif
+
 	/* read base address of boot chip select (0) */
 	val = bcm_mpi_readl(MPI_CSBASE_REG(0));
 	val &= MPI_CSBASE_BASE_MASK;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices.
  2011-11-16 20:49 [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices Florian Fainelli
@ 2011-11-17 11:56 ` Sergei Shtylyov
  2011-11-17 14:06 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2011-11-17 11:56 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: ralf, linux-mips

Hello.

On 17-11-2011 0:49, Florian Fainelli wrote:

> In case the MAC address pool is not big enough to also register a WLAN device
> prefer registering the Ethernet devices.

> Signed-off-by: Florian Fainelli<florian@openwrt.org>
> ---
>   arch/mips/bcm63xx/boards/board_bcm963xx.c |   25 +++++++++++++------------
>   1 files changed, 13 insertions(+), 12 deletions(-)

> diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
> index ac948c2..fcd5a8c 100644
> --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
> +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
> @@ -791,18 +791,6 @@ void __init board_prom_init(void)
>   	}
>
>   	bcm_gpio_writel(val, GPIO_MODE_REG);
> -
> -	/* Generate MAC address for WLAN and
> -	 * register our SPROM */
> -#ifdef CONFIG_SSB_PCIHOST
> -	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
> -		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
> -		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
> -		if (ssb_arch_register_fallback_sprom(
> -				&bcm63xx_get_fallback_sprom)<  0)
> -			printk(KERN_ERR PFX "failed to register fallback SPROM\n");
> -	}
> -#endif
>   }
>
>   /*
> @@ -886,6 +874,19 @@ int __init board_register_devices(void)
>   	if (board.has_dsp)
>   		bcm63xx_dsp_register(&board.dsp);
>
> +	/* Generate MAC address for WLAN and register our SPROM,
> +	 * do this after registering enet devices
> +	 */
> +#ifdef CONFIG_SSB_PCIHOST
> +	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
> +		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
> +		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
> +		if (ssb_arch_register_fallback_sprom(
> +			&bcm63xx_get_fallback_sprom) < 0)

    Please keep the old indentation. This one makes the code harder to read.

> +			pr_err(PFX "failed to register fallback SPROM\n");
> +	}
> +#endif
> +
>   	/* read base address of boot chip select (0) */
>   	val = bcm_mpi_readl(MPI_CSBASE_REG(0));
>   	val&= MPI_CSBASE_BASE_MASK;

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices.
  2011-11-16 20:49 [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices Florian Fainelli
  2011-11-17 11:56 ` Sergei Shtylyov
@ 2011-11-17 14:06 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2011-11-17 14:06 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-mips

Thanks, queued for 3.3.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-17 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 20:49 [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices Florian Fainelli
2011-11-17 11:56 ` Sergei Shtylyov
2011-11-17 14:06 ` Ralf Baechle

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.