#ifndef _ENV_H_ #define _ENV_H_ #include #include #if IS_ENABLED(CONFIG_AVM_PROM_ENVIRONMENT) extern char *prom_getenv(char *envname); extern char *getcmdline(void); #if IS_ENABLED(CONFIG_AVM_PROM_PLAT) extern int avm_prom_tffs_sync(void); extern int avm_prom_config_server_getloc(struct avm_prom_config_loc *loc); extern struct avm_prom_config_device avm_prom_server_device; /* Old stuff we hopefully get rid of: */ extern int copy_wlan_dect_config2user(char *buffer, size_t bufferlen) __deprecated; extern int test_wlan_dect_config(char *buffer, size_t *bufferlen) __deprecated; #endif /* CONFIG_AVM_PROM_PLAT */ #else #warning AVM PROM environment support is NOT enabled! #endif #if IS_ENABLED(CONFIG_AVM_PROM_GETENV_VIA_EFI) int avm_prom_env_init(void); #else static inline int avm_prom_env_init(void) {} #endif #ifdef CONFIG_AVM_EFIVAR struct avm_efivar_resource; /* One-shot variants */ ssize_t avm_efivar_get_one(const char *varname, void *val, size_t valsize); int _avm_efivar_set_one(const char *varname, void *val, size_t valsize, bool mayblock); static inline int avm_efivar_set_one(const char *varname, void *val, size_t valsize) { return _avm_efivar_set_one(varname, val, valsize, true); } static inline int avm_efivar_set_one_atomic(const char *varname, void *val, size_t valsize) { return _avm_efivar_set_one(varname, val, valsize, false); } /* ... and bulk */ struct avm_efivar_resource *avm_efivar_resource_create(void); void *avm_efivar_get(struct avm_efivar_resource *res, const char *varname, size_t *valsize); int _avm_efivar_set(struct avm_efivar_resource *res, const char *varname, void *value, size_t valsize, bool mayblock); static inline int avm_efivar_set(struct avm_efivar_resource *res, const char *varname, void *val, size_t valsize) { return _avm_efivar_set(res, varname, val, valsize, true); } static inline int avm_efivar_set_atomic(struct avm_efivar_resource *res, const char *varname, void *val, size_t valsize) { return _avm_efivar_set(res, varname, val, valsize, false); } int avm_efivar_resource_attach_var(struct avm_efivar_resource *res, const char *varname); void avm_efivar_resource_destroy(struct avm_efivar_resource *res); #endif /* CONFIG_AVM_EFIVAR */ #if IS_ENABLED(CONFIG_AVM_ENHANCED) && IS_ENABLED(CONFIG_MIPS) #include #endif #endif