dsp: firmware_update: Expand "params" in symbol names

Try to keep the names aligned with the spec so that they're more easily
searched for. We can abbreviate other words such as request, response,
length etc as necessary.

Change-Id: Ia5a2c93c153c70107be0fcddb1043b2e08cdd026
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc61bb7..64025cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,12 @@
    `encode_query_downstream_identifiers_req()` and
    `encode_get_downstream_firmware_params_req()`
 
+7. dsp: firmware_update: Expand "params" in symbol names
+
+   The change only affects structs and functions relating to ABIs that are
+   marked as testing. There should be no impact on users of the stable APIs/
+   ABIs.
+
 ### Fixed
 
 1. dsp: platform: Fix location of closing paren in overflow detection
diff --git a/include/libpldm/firmware_update.h b/include/libpldm/firmware_update.h
index f5d93fa..0dfb3bc 100644
--- a/include/libpldm/firmware_update.h
+++ b/include/libpldm/firmware_update.h
@@ -59,7 +59,7 @@
  * 4 bytes for Data Transfer Handle
  * 1 byte for Transfer Operation Flag
  */
-#define PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_REQ_BYTES 5
+#define PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_REQ_BYTES 5
 
 /** @brief Minimum length of GetDownstreamFirmwareParameters response from
  * DSP0267_1.1.0 if the completion code is success.
@@ -70,7 +70,7 @@
  * 4 bytes for FDP capabilities during update
  * 2 bytes for downstream device count
  */
-#define PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN 12
+#define PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN 12
 
 /** @brief Minimum length of DownstreamDeviceParameterTable entry from
  * DSP0267_1.1.0 table 21 - DownstreamDeviceParameterTable
@@ -87,7 +87,7 @@
  * 2 bytes for Component Activation Methods
  * 4 bytes for Capabilities During Update
  */
-#define PLDM_DOWNSTREAM_DEVICE_PARAMETER_ENTRY_MIN_LEN 36
+#define PLDM_DOWNSTREAM_DEVICE_PARAMETERS_ENTRY_MIN_LEN 36
 
 #define PLDM_GET_FIRMWARE_PARAMETERS_REQ_BYTES 0
 #define PLDM_FWUP_BASELINE_TRANSFER_SIZE       32
@@ -744,12 +744,12 @@
  *
  *  Structure representing QueryDownstreamFirmwareParameters request
  */
-struct pldm_get_downstream_firmware_params_req {
+struct pldm_get_downstream_firmware_parameters_req {
 	uint32_t data_transfer_handle;
 	uint8_t transfer_operation_flag;
 };
 
-/** @struct pldm_query_downstream_firmware_param_resp
+/** @struct pldm_get_downstream_firmware_parameters_resp
  *
  *  Structure representing the fixed part of QueryDownstreamFirmwareParameters
  *  response in Table 19 - GetDownstreamFirmwareParameters command format, and
@@ -759,7 +759,7 @@
  *  Squash the two tables into one since the definition of Table 20 is `Portion
  *  of GetDownstreamFirmwareParameters response`
  */
-struct pldm_get_downstream_firmware_params_resp {
+struct pldm_get_downstream_firmware_parameters_resp {
 	uint8_t completion_code;
 	uint32_t next_data_transfer_handle;
 	uint8_t transfer_flag;
@@ -767,7 +767,7 @@
 	uint16_t downstream_device_count;
 };
 
-/** @struct pldm_downstream_device_parameter_entry
+/** @struct pldm_downstream_device_parameters_entry
  *
  *  Structure representing downstream device parameter table entry defined in
  *  Table 21 - DownstreamDeviceParameterTable in DSP0267_1.1.0
@@ -777,7 +777,7 @@
  *  that the active and pending component version strings are copied from the
  *  message buffer.
  */
-struct pldm_downstream_device_parameter_entry {
+struct pldm_downstream_device_parameters_entry {
 	uint16_t downstream_device_index;
 	uint32_t active_comp_comparison_stamp;
 	uint8_t active_comp_ver_str_type;
@@ -809,7 +809,7 @@
  *  instead of using `pldm_downstream_device_parameter_entry`.
  */
 struct pldm_downstream_device_parameter_entry_versions {
-	struct pldm_downstream_device_parameter_entry entry;
+	struct pldm_downstream_device_parameters_entry entry;
 	/* The "Length of ComponentVersionString" field is 1 byte, so
 	 * "ComponentVersionString" can be at most 255 characters, allocate
 	 * memory for it and append 1 bytes for null termination so that it
@@ -1210,9 +1210,9 @@
  * @note Caller is responsible for memory alloc and dealloc of param
  *        'msg.payload'
  */
-int encode_get_downstream_firmware_params_req(
+int encode_get_downstream_firmware_parameters_req(
 	uint8_t instance_id,
-	const struct pldm_get_downstream_firmware_params_req *params_req,
+	const struct pldm_get_downstream_firmware_parameters_req *params_req,
 	struct pldm_msg *msg, size_t payload_length);
 
 /**
@@ -1231,9 +1231,9 @@
  * @note Caller is responsible for memory alloc and dealloc of param
  *        'resp_data' and 'downstream_device_param_table'
  */
-int decode_get_downstream_firmware_params_resp(
+int decode_get_downstream_firmware_parameters_resp(
 	const struct pldm_msg *msg, size_t payload_length,
-	struct pldm_get_downstream_firmware_params_resp *resp_data,
+	struct pldm_get_downstream_firmware_parameters_resp *resp_data,
 	struct variable_field *downstream_device_param_table);
 
 /**
@@ -1262,7 +1262,7 @@
  */
 int decode_downstream_device_parameter_table_entry(
 	struct variable_field *data,
-	struct pldm_downstream_device_parameter_entry *entry,
+	struct pldm_downstream_device_parameters_entry *entry,
 	struct variable_field *versions);
 
 /**
@@ -1285,7 +1285,7 @@
  */
 int decode_downstream_device_parameter_table_entry_versions(
 	const struct variable_field *versions,
-	struct pldm_downstream_device_parameter_entry *entry, char *active,
+	struct pldm_downstream_device_parameters_entry *entry, char *active,
 	size_t active_len, char *pending, size_t pending_len);
 
 /** @brief Create PLDM request message for RequestUpdate
diff --git a/src/dsp/firmware_update.c b/src/dsp/firmware_update.c
index 59c5c20..c21c118 100644
--- a/src/dsp/firmware_update.c
+++ b/src/dsp/firmware_update.c
@@ -1112,9 +1112,9 @@
 }
 
 LIBPLDM_ABI_TESTING
-int encode_get_downstream_firmware_params_req(
+int encode_get_downstream_firmware_parameters_req(
 	uint8_t instance_id,
-	const struct pldm_get_downstream_firmware_params_req *params_req,
+	const struct pldm_get_downstream_firmware_parameters_req *params_req,
 	struct pldm_msg *msg, size_t payload_length)
 {
 	struct pldm_msgbuf _buf;
@@ -1126,7 +1126,7 @@
 	}
 
 	rc = pldm_msgbuf_init_errno(
-		buf, PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_REQ_BYTES,
+		buf, PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_REQ_BYTES,
 		msg->payload, payload_length);
 	if (rc < 0) {
 		return rc;
@@ -1156,9 +1156,9 @@
 }
 
 LIBPLDM_ABI_TESTING
-int decode_get_downstream_firmware_params_resp(
+int decode_get_downstream_firmware_parameters_resp(
 	const struct pldm_msg *msg, size_t payload_length,
-	struct pldm_get_downstream_firmware_params_resp *resp_data,
+	struct pldm_get_downstream_firmware_parameters_resp *resp_data,
 	struct variable_field *downstream_device_param_table)
 {
 	struct pldm_msgbuf _buf;
@@ -1184,7 +1184,8 @@
 		return 0;
 	}
 
-	if (payload_length < PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN) {
+	if (payload_length <
+	    PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN) {
 		return -EBADMSG;
 	}
 
@@ -1202,7 +1203,7 @@
 LIBPLDM_ABI_TESTING
 int decode_downstream_device_parameter_table_entry(
 	struct variable_field *data,
-	struct pldm_downstream_device_parameter_entry *entry,
+	struct pldm_downstream_device_parameters_entry *entry,
 	struct variable_field *versions)
 {
 	struct pldm_msgbuf _buf;
@@ -1216,7 +1217,7 @@
 	}
 
 	rc = pldm_msgbuf_init_errno(
-		buf, PLDM_DOWNSTREAM_DEVICE_PARAMETER_ENTRY_MIN_LEN, data->ptr,
+		buf, PLDM_DOWNSTREAM_DEVICE_PARAMETERS_ENTRY_MIN_LEN, data->ptr,
 		data->length);
 	if (rc < 0) {
 		return rc;
@@ -1285,7 +1286,7 @@
 LIBPLDM_ABI_TESTING
 int decode_downstream_device_parameter_table_entry_versions(
 	const struct variable_field *versions,
-	struct pldm_downstream_device_parameter_entry *entry, char *active,
+	struct pldm_downstream_device_parameters_entry *entry, char *active,
 	size_t active_len, char *pending, size_t pending_len)
 {
 	struct pldm_msgbuf _buf;
diff --git a/tests/dsp/firmware_update.cpp b/tests/dsp/firmware_update.cpp
index fe71343..ffb25ff 100644
--- a/tests/dsp/firmware_update.cpp
+++ b/tests/dsp/firmware_update.cpp
@@ -2152,19 +2152,20 @@
 TEST(GetDownstreamFirmwareParameters, goodPathEncodeRequest)
 {
     constexpr uint8_t instanceId = 1;
-    constexpr pldm_get_downstream_firmware_params_req params_req{
+    constexpr pldm_get_downstream_firmware_parameters_req params_req{
         0x0, PLDM_GET_FIRSTPART};
     constexpr size_t payload_length =
-        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_REQ_BYTES;
+        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_REQ_BYTES;
     std::array<uint8_t, sizeof(pldm_msg_hdr) + payload_length> requestMsg{};
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
     auto requestPtr = reinterpret_cast<pldm_msg*>(requestMsg.data());
 
-    auto rc = encode_get_downstream_firmware_params_req(
+    auto rc = encode_get_downstream_firmware_parameters_req(
         instanceId, &params_req, requestPtr, payload_length);
     EXPECT_EQ(rc, 0);
 
-    std::array<uint8_t, hdrSize + PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_REQ_BYTES>
+    std::array<uint8_t,
+               hdrSize + PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_REQ_BYTES>
         expectedReq{0x81, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01};
     EXPECT_EQ(requestMsg, expectedReq);
 }
@@ -2175,15 +2176,15 @@
 {
     constexpr uint8_t instanceId = 1;
     // Setup invalid transfer operation flag
-    constexpr pldm_get_downstream_firmware_params_req params_req{
+    constexpr pldm_get_downstream_firmware_parameters_req params_req{
         0x0, PLDM_ACKNOWLEDGEMENT_ONLY};
     constexpr size_t payload_length =
-        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_REQ_BYTES;
+        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_REQ_BYTES;
     std::array<uint8_t, sizeof(pldm_msg_hdr) + payload_length> requestMsg{};
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
     auto requestPtr = reinterpret_cast<pldm_msg*>(requestMsg.data());
 
-    auto rc = encode_get_downstream_firmware_params_req(
+    auto rc = encode_get_downstream_firmware_parameters_req(
         instanceId, &params_req, requestPtr, payload_length);
     EXPECT_EQ(rc, -EBADMSG);
 }
@@ -2194,17 +2195,17 @@
 {
     constexpr uint8_t instanceId = 1;
     // Setup invalid transfer operation flag
-    constexpr pldm_get_downstream_firmware_params_req params_req{
+    constexpr pldm_get_downstream_firmware_parameters_req params_req{
         0x0, PLDM_ACKNOWLEDGEMENT_ONLY};
     constexpr size_t payload_length =
-        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_REQ_BYTES -
+        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_REQ_BYTES -
         1 /* inject erro length*/;
 
     std::array<uint8_t, sizeof(pldm_msg_hdr) + payload_length> requestMsg{};
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
     auto requestPtr = reinterpret_cast<pldm_msg*>(requestMsg.data());
 
-    auto rc = encode_get_downstream_firmware_params_req(
+    auto rc = encode_get_downstream_firmware_parameters_req(
         instanceId, &params_req, requestPtr, payload_length);
     EXPECT_EQ(rc, -EOVERFLOW);
 }
@@ -2228,9 +2229,9 @@
     constexpr uint8_t transfer_flag_resp = PLDM_START_AND_END;
     constexpr bitfield32_t fdp_capabilities_during_update = {.value = 0x0002};
 
-    std::array<uint8_t, hdrSize +
-                            PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN +
-                            downstreamDeviceParamTableLen>
+    std::array<uint8_t,
+               hdrSize + PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN +
+                   downstreamDeviceParamTableLen>
         responseMsg{};
 
     int rc = 0;
@@ -2251,21 +2252,21 @@
      *  is not checked in this test case so filling with 0xff
      */
     std::fill_n(responseMsg.data() + hdrSize +
-                    PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN,
+                    PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN,
                 downstreamDeviceParamTableLen, 0xff);
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
     auto table = reinterpret_cast<pldm_component_parameter_entry*>(
         responseMsg.data() + hdrSize +
-        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN);
+        PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN);
     table->active_comp_ver_str_len = activeComponentVersionStringLength;
     table->pending_comp_ver_str_len = pendingComponentVersionStringLength;
 
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
     auto response = reinterpret_cast<pldm_msg*>(responseMsg.data());
-    struct pldm_get_downstream_firmware_params_resp resp_data = {};
+    struct pldm_get_downstream_firmware_parameters_resp resp_data = {};
     struct variable_field downstreamDeviceParamTable = {};
 
-    rc = decode_get_downstream_firmware_params_resp(
+    rc = decode_get_downstream_firmware_parameters_resp(
         response, responseMsg.size() - hdrSize, &resp_data,
         &downstreamDeviceParamTable);
 
@@ -2276,13 +2277,14 @@
     EXPECT_EQ(resp_data.transfer_flag, transfer_flag_resp);
     EXPECT_EQ(resp_data.downstream_device_count, downstreamDeviceCount);
     EXPECT_EQ(downstreamDeviceParamTable.length, downstreamDeviceParamTableLen);
-    EXPECT_EQ(true,
-              std::equal(downstreamDeviceParamTable.ptr,
-                         downstreamDeviceParamTable.ptr +
-                             downstreamDeviceParamTable.length,
-                         responseMsg.begin() + hdrSize +
-                             PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN,
-                         responseMsg.end()));
+    EXPECT_EQ(
+        true,
+        std::equal(downstreamDeviceParamTable.ptr,
+                   downstreamDeviceParamTable.ptr +
+                       downstreamDeviceParamTable.length,
+                   responseMsg.begin() + hdrSize +
+                       PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN,
+                   responseMsg.end()));
 }
 #endif
 
@@ -2296,7 +2298,7 @@
     constexpr uint8_t activeComponentVersionStringLength = 8;
     constexpr uint8_t pendingComponentVersionStringLength = 8;
     constexpr size_t downstreamDeviceParamTableLen =
-        PLDM_DOWNSTREAM_DEVICE_PARAMETER_ENTRY_MIN_LEN +
+        PLDM_DOWNSTREAM_DEVICE_PARAMETERS_ENTRY_MIN_LEN +
         activeComponentVersionStringLength +
         pendingComponentVersionStringLength;
     constexpr uint8_t complition_code_resp = PLDM_SUCCESS;
@@ -2305,7 +2307,7 @@
     constexpr bitfield32_t fdp_capabilities_during_update = {.value = 0x0002};
 
     std::array<uint8_t,
-               hdrSize + PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN +
+               hdrSize + PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN +
                    downstreamDeviceParamTableLen - 1 /* inject error length*/>
         responseMsg{};
 
@@ -2327,21 +2329,21 @@
      *  is not checked in this test case so filling with 0xff
      */
     std::fill_n(responseMsg.data() + hdrSize +
-                    PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMS_RESP_MIN_LEN,
+                    PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN,
                 downstreamDeviceParamTableLen - 1 /* inject error length*/,
                 0xff);
 
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
     auto response = reinterpret_cast<pldm_msg*>(responseMsg.data());
-    struct pldm_get_downstream_firmware_params_resp resp_data = {};
+    struct pldm_get_downstream_firmware_parameters_resp resp_data = {};
     struct variable_field downstreamDeviceParamTable = {};
 
-    rc = decode_get_downstream_firmware_params_resp(
+    rc = decode_get_downstream_firmware_parameters_resp(
         response, responseMsg.size() - hdrSize, &resp_data,
         &downstreamDeviceParamTable);
     EXPECT_EQ(rc, 0);
 
-    pldm_downstream_device_parameter_entry entry{};
+    pldm_downstream_device_parameters_entry entry{};
     variable_field versions{};
 
     EXPECT_NE(decode_downstream_device_parameter_table_entry(
@@ -2373,7 +2375,7 @@
     constexpr char pendingCompVerStr[pendingCompVerStrLen] = {
         'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
 
-    std::array<uint8_t, PLDM_DOWNSTREAM_DEVICE_PARAMETER_ENTRY_MIN_LEN +
+    std::array<uint8_t, PLDM_DOWNSTREAM_DEVICE_PARAMETERS_ENTRY_MIN_LEN +
                             activeCompVerStrLen + pendingCompVerStrLen>
         responseMsg{};
 
@@ -2382,7 +2384,7 @@
     struct pldm_msgbuf _buf;
     struct pldm_msgbuf* buf = &_buf;
     rc = pldm_msgbuf_init_errno(buf,
-                                PLDM_DOWNSTREAM_DEVICE_PARAMETER_ENTRY_MIN_LEN,
+                                PLDM_DOWNSTREAM_DEVICE_PARAMETERS_ENTRY_MIN_LEN,
                                 responseMsg.data(), responseMsg.size());
     EXPECT_EQ(rc, 0);
 
@@ -2420,7 +2422,7 @@
 
     EXPECT_EQ(rc, 0);
     EXPECT_EQ(rawData.ptr, original_ptr +
-                               PLDM_DOWNSTREAM_DEVICE_PARAMETER_ENTRY_MIN_LEN +
+                               PLDM_DOWNSTREAM_DEVICE_PARAMETERS_ENTRY_MIN_LEN +
                                entry_version.entry.active_comp_ver_str_len +
                                entry_version.entry.pending_comp_ver_str_len);
     EXPECT_EQ(rawData.length, 0);
@@ -2431,7 +2433,7 @@
         sizeof(entry_version.active_comp_ver_str),
         entry_version.pending_comp_ver_str,
         sizeof(entry_version.pending_comp_ver_str));
-    struct pldm_downstream_device_parameter_entry entry = entry_version.entry;
+    struct pldm_downstream_device_parameters_entry entry = entry_version.entry;
     EXPECT_EQ(rc, 0);
 
     // Verify the decoded table entry