From d40a07ddd33e67937a547d95f684c9f5aba78d7f Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Tue, 23 Jul 2013 10:43:50 +0400 Subject: [PATCH] [PROTO] expand field 'use_features' 8 --> 16 byte --- parser/features.c | 7 +++++-- parser/msg_cmd.c | 3 ++- parser/msg_parser.c | 12 +++++++++--- parser/msg_parser.h | 3 ++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/parser/features.c b/parser/features.c index ffbde0f..b105687 100644 --- a/parser/features.c +++ b/parser/features.c @@ -318,7 +318,10 @@ int set_features(struct conf_data *conf) { int i, ret; u64 feature_XOR; - u64 features = conf->use_features; + u64 features, features_backup; + + /* TODO: field use_features1 is not used*/ + features_backup = features = conf->use_features0; features &= feature_mask; feature_XOR = features ^ feature_inst; @@ -340,7 +343,7 @@ int set_features(struct conf_data *conf) } f_mask = ~(1 << i); feature_inst = (feature_inst & f_mask) | - (conf->use_features & ~f_mask); + (features_backup & ~f_mask); } features >>= 1; diff --git a/parser/msg_cmd.c b/parser/msg_cmd.c index 61c7bf1..e59f720 100644 --- a/parser/msg_cmd.c +++ b/parser/msg_cmd.c @@ -127,7 +127,8 @@ int msg_stop(struct msg_buf *mb) return -EINVAL; } - conf.use_features = 0; + conf.use_features0 = 0; + conf.use_features1 = 0; ret = set_config(&conf); if (ret) printk("Cannot set config, ret = %d\n", ret); diff --git a/parser/msg_parser.c b/parser/msg_parser.c index 438351b..cdab15b 100644 --- a/parser/msg_parser.c +++ b/parser/msg_parser.c @@ -149,13 +149,18 @@ void destroy_app_info(struct app_info_data *ai) struct conf_data *create_conf_data(struct msg_buf *mb) { struct conf_data *conf; - u64 uf; + u64 use_features0, use_features1; u32 stp, dmp; print_parse_debug("conf_data:\n"); print_parse_debug("features:"); - if (get_u64(mb, &uf)) { + if (get_u64(mb, &use_features0)) { + print_err("failed to read use_features\n"); + return NULL; + } + + if (get_u64(mb, &use_features1)) { print_err("failed to read use_features\n"); return NULL; } @@ -178,7 +183,8 @@ struct conf_data *create_conf_data(struct msg_buf *mb) return NULL; } - conf->use_features = uf; + conf->use_features0 = use_features0; + conf->use_features1 = use_features1; conf->sys_trace_period = stp; conf->data_msg_period = dmp; diff --git a/parser/msg_parser.h b/parser/msg_parser.h index 36e5bf8..c2f1e54 100644 --- a/parser/msg_parser.h +++ b/parser/msg_parser.h @@ -49,7 +49,8 @@ struct app_info_data { /* Configuration struct */ struct conf_data { - u64 use_features; + u64 use_features0; + u64 use_features1; u32 sys_trace_period; u32 data_msg_period; }; -- 2.7.4