greybus: update svc_msg_header fields and users to match spec
The Greybus spec has been updated to clarify some of the original
intent of the SVC message definition. The svc_msg_header was:
struct svc_msg_header {
__u8 function;
__u8 message_type;
...
}
and is now
struct svc_msg_header {
__u8 function_id;
__u8 message_type;
...
}
to match the spec. The function_id carries enum svc_function_id values
and message_type is now clarified to be a session layer level field
that is simply "data" or "error".
Change all references of function type to function id. For now, don't
parse the message_type field but add the two allowable svc_msg_type enums.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
diff --git a/drivers/staging/greybus/svc_msg.h b/drivers/staging/greybus/svc_msg.h
index bbc7ef0..3f1a934 100644
--- a/drivers/staging/greybus/svc_msg.h
+++ b/drivers/staging/greybus/svc_msg.h
@@ -12,7 +12,7 @@
#pragma pack(push, 1)
-enum svc_function_type {
+enum svc_function_id {
SVC_FUNCTION_HANDSHAKE = 0x00,
SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT = 0x01,
SVC_FUNCTION_HOTPLUG = 0x02,
@@ -22,9 +22,14 @@
SVC_FUNCTION_SUSPEND = 0x06,
};
+enum svc_msg_type {
+ SVC_MSG_DATA = 0x00,
+ SVC_MSG_ERROR = 0xff,
+};
+
struct svc_msg_header {
- __u8 function;
- __u8 type; /* enum svc_function_type */
+ __u8 function_id; /* enum svc_function_id */
+ __u8 message_type;
__u8 version_major;
__u8 version_minor;
__le16 payload_length;