1/*
2 * Stubs for NVRAM functions for platforms without flash
3 *
4 * Copyright (C) 2015, Broadcom Corporation. All Rights Reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * $Id: nvramstubs.c 503082 2014-09-17 06:36:56Z $
19 */
20
21#if defined(__NetBSD__)
22#if defined(_KERNEL)
23#include <bcm_cfg.h>
24#endif /* defined(_KERNEL) */
25#endif /* defined(__NetBSD__) */
26
27#include <typedefs.h>
28#include <bcmutils.h>
29#undef strcmp
30#define strcmp(s1,s2)	0	/* always match */
31#include <bcmnvram.h>
32
33int
34nvram_init(void *sih)
35{
36	return 0;
37}
38
39#if defined(_CFE_) && defined(BCM_DEVINFO)
40int
41devinfo_nvram_init(void *sih)
42{
43	return 0;
44}
45#endif
46
47int
48nvram_append(void *sb, char *vars, uint varsz)
49{
50	return 0;
51}
52
53void
54nvram_exit(void *sih)
55{
56}
57
58char *
59nvram_get(const char *name)
60{
61	return (char *) 0;
62}
63
64int
65nvram_set(const char *name, const char *value)
66{
67	return 0;
68}
69
70int
71nvram_unset(const char *name)
72{
73	return 0;
74}
75
76int
77nvram_commit(void)
78{
79	return 0;
80}
81
82int
83nvram_getall(char *buf, int count)
84{
85	/* add null string as terminator */
86	if (count < 1)
87		return BCME_BUFTOOSHORT;
88	*buf = '\0';
89	return 0;
90}
91