6841338f5fe953013ea0c6a6e578fc27b27e9c2e
[openwrt/staging/yousong.git] / target / linux / brcm63xx / patches-3.7 / 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 @@ -35,6 +35,8 @@ struct bcm963xx_nvram {
15 u32 checksum_high;
16 };
17
18 +#define BCM63XX_DEFAULT_PSI_SIZE 64
19 +
20 static struct bcm963xx_nvram nvram;
21 static int mac_addr_used;
22
23 @@ -104,3 +106,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 @@ -30,4 +30,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 */