Commit 357de006 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: svc: store protocol version

Store the "negotiated" protocol version to use in the svc state
struct instead of the connection struct.

The generic concept of a connection version is going away in favour of
bundle-class versions.
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 47a2e676
...@@ -383,15 +383,15 @@ static int gb_svc_version_request(struct gb_operation *op) ...@@ -383,15 +383,15 @@ static int gb_svc_version_request(struct gb_operation *op)
return -ENOTSUPP; return -ENOTSUPP;
} }
connection->module_major = request->major; svc->protocol_major = request->major;
connection->module_minor = request->minor; svc->protocol_minor = request->minor;
if (!gb_operation_response_alloc(op, sizeof(*response), GFP_KERNEL)) if (!gb_operation_response_alloc(op, sizeof(*response), GFP_KERNEL))
return -ENOMEM; return -ENOMEM;
response = op->response->payload; response = op->response->payload;
response->major = connection->module_major; response->major = svc->protocol_major;
response->minor = connection->module_minor; response->minor = svc->protocol_minor;
return 0; return 0;
} }
......
...@@ -27,6 +27,9 @@ struct gb_svc { ...@@ -27,6 +27,9 @@ struct gb_svc {
u16 endo_id; u16 endo_id;
u8 ap_intf_id; u8 ap_intf_id;
u8 protocol_major;
u8 protocol_minor;
}; };
#define to_gb_svc(d) container_of(d, struct gb_svc, d) #define to_gb_svc(d) container_of(d, struct gb_svc, d)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment