diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-04-24 23:38:45 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-04-24 23:38:45 +0000 |
commit | a8da3a09a3fb34327cf02306726dad640e309f20 (patch) | |
tree | 313a27bd4a35051dc25ef2c004f3a07212023d9e /contrib/userspace-nvram/nvram.h | |
parent | 18193fa5e9790e5c48ac42bb99f7477be2aed7f9 (diff) |
contrib/userspace-nvram:
- fix checksum calculation
- better handle invalid cli invokation
- get rid of hard coded erase size
- fix data type of crc8 function
Diffstat (limited to 'contrib/userspace-nvram/nvram.h')
-rw-r--r-- | contrib/userspace-nvram/nvram.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/userspace-nvram/nvram.h b/contrib/userspace-nvram/nvram.h index 4061991110..86cc883e13 100644 --- a/contrib/userspace-nvram/nvram.h +++ b/contrib/userspace-nvram/nvram.h @@ -82,7 +82,7 @@ int nvram_close(nvram_handle_t *h); #define nvram_safe_get(h, name) (nvram_get(h, name) ? : "") /* Computes a crc8 over the input data. */ -uint8_t hndcrc8 (uint8_t * pdata, uint32_t nbytes, uint8_t crc ); +uint8_t hndcrc8 (const char * pdata, uint32_t nbytes, uint8_t crc ); /* Returns the crc value of the nvram. */ uint8_t nvram_calc_crc(nvram_header_t * nvh); @@ -113,12 +113,13 @@ const char * nvram_find_staging(void); #define NVRAM_SOFTWARE_VERSION "1" /* NVRAM constants */ +#define NVRAM_SPACE 0x8000 +#define NVRAM_START(x) x - NVRAM_SPACE #define NVRAM_MAGIC 0x48534C46 /* 'FLSH' */ #define NVRAM_CLEAR_MAGIC 0x0 #define NVRAM_INVALID_MAGIC 0xFFFFFFFF #define NVRAM_VERSION 1 #define NVRAM_HEADER_SIZE 20 -#define NVRAM_SPACE 0x8000 #define NVRAM_MAX_VALUE_LEN 255 #define NVRAM_MAX_PARAM_LEN 64 |