From 6ce9a5d0fefe6e2ca50f33cbdf32c7a7301b2e7a Mon Sep 17 00:00:00 2001 From: Chris Cain Date: Thu, 30 May 2019 13:15:52 -0500 Subject: Allow maximum number of sensors to be returned in debug command Change-Id: Id389f6ab4815cc96b0a528b64cb219b6215d65bc RTC: 209325 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78081 Tested-by: FSP CI Jenkins Reviewed-by: Martha Broyles Reviewed-by: William A. Bryan Reviewed-by: Christopher J. Cain --- src/occ_405/cmdh/cmdh_dbug_cmd.c | 5 ++--- src/occ_405/cmdh/cmdh_dbug_cmd.h | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/occ_405') diff --git a/src/occ_405/cmdh/cmdh_dbug_cmd.c b/src/occ_405/cmdh/cmdh_dbug_cmd.c index d613c18..fffd9a1 100755 --- a/src/occ_405/cmdh/cmdh_dbug_cmd.c +++ b/src/occ_405/cmdh/cmdh_dbug_cmd.c @@ -249,9 +249,8 @@ void cmdh_dbug_get_ame_sensor (const cmdh_fsp_cmd_t * i_cmd_ptr, }while(0); - // Populate the response data header - l_resp_data_length = sizeof(cmdh_dbug_get_sensor_resp_t) - - CMDH_DBUG_FSP_RESP_LEN; + // Populate the response data header (with actual number of sensors collected) + l_resp_data_length = sizeof(l_num_of_sensors) + (l_num_of_sensors * sizeof(cmdh_dbug_sensor_list_t)); G_rsp_status = l_rc; o_rsp_ptr->data_length[0] = ((uint8_t *)&l_resp_data_length)[0]; o_rsp_ptr->data_length[1] = ((uint8_t *)&l_resp_data_length)[1]; diff --git a/src/occ_405/cmdh/cmdh_dbug_cmd.h b/src/occ_405/cmdh/cmdh_dbug_cmd.h index 16ab04b..281e6a3 100755 --- a/src/occ_405/cmdh/cmdh_dbug_cmd.h +++ b/src/occ_405/cmdh/cmdh_dbug_cmd.h @@ -128,9 +128,9 @@ typedef struct __attribute__ ((packed)) uint16_t location; }cmdh_dbug_get_sensor_query_t; -// Max number of sensors that can be returned with cmdh_dbug_get_ame_sensor command +// Max number of sensors that can be returned with cmdh_dbug_get_ame_sensor command (subtract 2 bytes for num_sensors) +#define CMDH_DBUG_MAX_NUM_SENSORS ((CMDH_FSP_RSP_DATA_SIZE-2) / sizeof(cmdh_dbug_sensor_list_t)) -#define CMDH_DBUG_MAX_NUM_SENSORS 50 // Size of standard response header (5 bytes) plus checksum (2 bytes) #define CMDH_DBUG_FSP_RESP_LEN 7 @@ -140,8 +140,6 @@ typedef struct __attribute__ ((packed)) struct cmdh_fsp_rsp_header; uint16_t num_sensors; cmdh_dbug_sensor_list_t sensor[CMDH_DBUG_MAX_NUM_SENSORS]; - uint8_t filler; - uint16_t checksum; }cmdh_dbug_get_sensor_resp_t; /** -- cgit v1.2.1