1 // SPDX-License-Identifier: (LGPL-2.1-only OR BSD-3-Clause) 2 /* 3 * Copyright 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 4 */ 5 6 #ifndef _CEC_LOG_H_ 7 #define _CEC_LOG_H_ 8 9 struct cec_arg_enum_values { 10 const char *type_name; 11 __u8 value; 12 }; 13 14 enum cec_arg_type { 15 CEC_ARG_TYPE_U8, 16 CEC_ARG_TYPE_U16, 17 CEC_ARG_TYPE_U32, 18 CEC_ARG_TYPE_STRING, 19 CEC_ARG_TYPE_ENUM, 20 }; 21 22 struct cec_arg { 23 enum cec_arg_type type; 24 __u8 num_enum_values; 25 const struct cec_arg_enum_values *values; 26 }; 27 28 #define CEC_MAX_ARGS 16 29 30 struct cec_msg_args { 31 __u8 msg; 32 __u8 num_args; 33 const char *arg_names[CEC_MAX_ARGS+1]; 34 const struct cec_arg *args[CEC_MAX_ARGS]; 35 const char *msg_name; 36 }; 37 38 const struct cec_msg_args *cec_log_msg_args(unsigned int index); 39 void cec_log_msg(const struct cec_msg *msg); 40 void cec_log_htng_msg(const struct cec_msg *msg); 41 const char *cec_log_ui_cmd_string(__u8 ui_cmd); 42 43 #endif 44