// SPDX-License-Identifier: GPL-2 /* * avm-prom config over mrpc * * Copyright 2017,2019 AVM GmbH. */ #ifndef __AVMCFG_MRPC_H__ #define __AVMCFG_MRPC_H__ #include #include #include #include enum { MRPC_AVMCFG_PROC_GETLOC = 0, MRPC_AVMCFG_PROC_RAW_READ = 1, }; struct avmcfg_read_request { __be32 offset; __be32 len; }; struct avm_prom_config_remote_loc { __be32 offset; __be32 len; __be32 align_at; } __packed; #define AVMCFG_MRPC_MAX_PAYLOAD 128 struct avmcfg_read_reply { __be32 result; char data[AVMCFG_MRPC_MAX_PAYLOAD]; }; struct avmcfg_probe_reply { __be32 result; struct avm_prom_config_remote_loc rloc; }; static inline void avm_prom_config_rloc2loc(const struct avm_prom_config_remote_loc *rloc, struct avm_prom_config_loc *loc) { loc->offset = be32_to_cpu(rloc->offset); loc->len = be32_to_cpu(rloc->len); loc->align_at = be32_to_cpu(rloc->align_at); } static inline void avm_prom_config_loc2rloc(const struct avm_prom_config_loc *loc, struct avm_prom_config_remote_loc *rloc) { rloc->offset = cpu_to_be32(loc->offset); rloc->len = cpu_to_be32(loc->len); rloc->align_at = cpu_to_be32(loc->align_at); BUILD_BUG_ON(sizeof(struct avm_prom_config_loc) != sizeof(struct avm_prom_config_remote_loc)); } #endif /* __AVMCFG_MRPC_H__ */