34966b27f18a80d6cd0b959ee3e5ff3a11f14173
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-3.6 / 429-MIPS-BCM63XX-export-PSI-size-from-nvram.patch
1 From ffbeb183bf0e9e12fd607c5352f48420c32f588f Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sat, 12 May 2012 23:04:17 +0200
4 Subject: [PATCH 61/79] MIPS: BCM63XX: export PSI size from nvram
5
6 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 ---
8 arch/mips/bcm63xx/nvram.c | 11 +++++++++++
9 arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h | 2 ++
10 2 files changed, 13 insertions(+)
11
12 --- a/arch/mips/bcm63xx/nvram.c
13 +++ b/arch/mips/bcm63xx/nvram.c
14 @@ -14,6 +14,8 @@
15
16 #include <bcm63xx_nvram.h>
17
18 +#define BCM63XX_DEFAULT_PSI_SIZE 64
19 +
20 static struct bcm963xx_nvram nvram;
21 static int mac_addr_used;
22
23 @@ -82,3 +84,12 @@ int bcm63xx_nvram_get_mac_address(u8 *ma
24 return 0;
25 }
26 EXPORT_SYMBOL(bcm63xx_nvram_get_mac_address);
27 +
28 +int bcm63xx_nvram_get_psi_size(void)
29 +{
30 + if (nvram.psi_size > 0)
31 + return nvram.psi_size;
32 +
33 + return BCM63XX_DEFAULT_PSI_SIZE;
34 +}
35 +EXPORT_SYMBOL(bcm63xx_nvram_get_psi_size);
36 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h
37 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h
38 @@ -31,4 +31,6 @@ u8 *bcm63xx_nvram_get_name(void);
39 */
40 int bcm63xx_nvram_get_mac_address(u8 *mac);
41
42 +int bcm63xx_nvram_get_psi_size(void);
43 +
44 #endif /* BCM63XX_NVRAM_H */