* [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
@ 2010-11-27 18:26 Hauke Mehrtens
2010-11-27 19:11 ` Ralf Baechle
2010-11-29 14:50 ` Ralf Baechle
0 siblings, 2 replies; 5+ messages in thread
From: Hauke Mehrtens @ 2010-11-27 18:26 UTC (permalink / raw)
To: ralf, linux-mips; +Cc: mb, netdev, Hauke Mehrtens
The nvram_get function was never in the mainline kernel, it only
existed in an external OpenWrt patch. Use nvram_getenv function, which
is in mainline and use an include instead of an extra function
declaration.
et0macaddr contains the mac address in text from like
00:11:22:33:44:55. We have to parse it before adding it into macaddr.
nvram_parse_macaddr will be merged into asm/mach-bcm47xx/nvram.h though
the MIPS git tree and will be available soon. It will not build now
without nvram_parse_macaddr, but it haven't done before.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/linux/ssb/ssb_driver_gige.h | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
index 942e387..eba52a1 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -96,16 +96,21 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
return 0;
}
-extern char * nvram_get(const char *name);
+#ifdef CONFIG_BCM47XX
+#include <asm/mach-bcm47xx/nvram.h>
/* Get the device MAC address */
static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
{
-#ifdef CONFIG_BCM47XX
- char *res = nvram_get("et0macaddr");
- if (res)
- memcpy(macaddr, res, 6);
-#endif
+ char buf[20];
+ if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0)
+ return;
+ nvram_parse_macaddr(buf, macaddr);
}
+#else
+static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
+{
+}
+#endif
extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
struct pci_dev *pdev);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
2010-11-27 18:26 [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform Hauke Mehrtens
@ 2010-11-27 19:11 ` Ralf Baechle
2010-11-27 19:24 ` Ralf Baechle
2010-11-29 14:50 ` Ralf Baechle
1 sibling, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2010-11-27 19:11 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-mips, mb, netdev
On Sat, Nov 27, 2010 at 07:26:32PM +0100, Hauke Mehrtens wrote:
> Date: Sat, 27 Nov 2010 19:26:32 +0100
> From: Hauke Mehrtens <hauke@hauke-m.de>
> To: ralf@linux-mips.org, linux-mips@linux-mips.org
> Cc: mb@bu3sch.de, netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
> Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
This has been applied in August, so bitbucket.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
2010-11-27 19:11 ` Ralf Baechle
@ 2010-11-27 19:24 ` Ralf Baechle
2010-11-27 19:27 ` Michael Büsch
0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2010-11-27 19:24 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-mips, mb, netdev
On Sat, Nov 27, 2010 at 07:11:38PM +0000, Ralf Baechle wrote:
> On Sat, Nov 27, 2010 at 07:26:32PM +0100, Hauke Mehrtens wrote:
> > Date: Sat, 27 Nov 2010 19:26:32 +0100
> > From: Hauke Mehrtens <hauke@hauke-m.de>
> > To: ralf@linux-mips.org, linux-mips@linux-mips.org
> > Cc: mb@bu3sch.de, netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
> > Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
>
> This has been applied in August, so bitbucket.
Sorry - there was a different patch of similar subject which I accepted.
Will feed this one upstream after I seen an ACK from one of the SSB/BCM47xx
folks.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
2010-11-27 19:24 ` Ralf Baechle
@ 2010-11-27 19:27 ` Michael Büsch
0 siblings, 0 replies; 5+ messages in thread
From: Michael Büsch @ 2010-11-27 19:27 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Hauke Mehrtens, linux-mips, netdev
On Sat, 2010-11-27 at 19:24 +0000, Ralf Baechle wrote:
> On Sat, Nov 27, 2010 at 07:11:38PM +0000, Ralf Baechle wrote:
>
> > On Sat, Nov 27, 2010 at 07:26:32PM +0100, Hauke Mehrtens wrote:
> > > Date: Sat, 27 Nov 2010 19:26:32 +0100
> > > From: Hauke Mehrtens <hauke@hauke-m.de>
> > > To: ralf@linux-mips.org, linux-mips@linux-mips.org
> > > Cc: mb@bu3sch.de, netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
> > > Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
> >
> > This has been applied in August, so bitbucket.
>
> Sorry - there was a different patch of similar subject which I accepted.
> Will feed this one upstream after I seen an ACK from one of the SSB/BCM47xx
> folks.
Acked-by: Michael Buesch <mb@bu3sch.de>
--
Greetings Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
2010-11-27 18:26 [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform Hauke Mehrtens
2010-11-27 19:11 ` Ralf Baechle
@ 2010-11-29 14:50 ` Ralf Baechle
1 sibling, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2010-11-29 14:50 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-mips, mb, netdev
And applied as well. Thanks!
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-29 14:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-27 18:26 [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform Hauke Mehrtens
2010-11-27 19:11 ` Ralf Baechle
2010-11-27 19:24 ` Ralf Baechle
2010-11-27 19:27 ` Michael Büsch
2010-11-29 14:50 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).