dsp: firmware_update: Reimplement decode_pldm_package_header_info_errno()

Do so in terms of the msgbuf APIs for safety, correctness, ergonomics
and performance.

decode_pldm_package_header_info() is re-implemented in terms of the
reworked API for decode_pldm_package_header_info_errno(). This gives us
a common implementation that will be exploited by future changes, with
the accommodations kept on the exceptional path.

gitlint-ignore: T1
Change-Id: Ia57fa007e5896b63e18063704787bbbc3c89f8e2
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/api.h b/src/api.h
index 643fbff..8faee05 100644
--- a/src/api.h
+++ b/src/api.h
@@ -26,8 +26,10 @@
 
 	assert(err < 0);
 	switch (err) {
-	case -EINVAL:
 	case -EBADMSG:
+	case -EINVAL:
+	case -EPROTO:
+	case -EUCLEAN:
 		rc = PLDM_ERROR_INVALID_DATA;
 		break;
 	case -ENOMSG:
@@ -36,6 +38,9 @@
 	case -EOVERFLOW:
 		rc = PLDM_ERROR_INVALID_LENGTH;
 		break;
+	case -ENOTSUP:
+		rc = PLDM_ERROR;
+		break;
 	default:
 		assert(false);
 		rc = PLDM_ERROR;