* this for SVC as that is initiated by the SVC.
*/
if (connection->hd_cport_id != GB_SVC_CPORT_ID) {
- ret = gb_protocol_get_version(connection, NULL, 0);
+ ret = gb_protocol_get_version(connection, false);
if (ret) {
dev_err(&connection->dev,
"Failed to get version CPort-%d (%d)\n",
return protocol;
}
-int gb_protocol_get_version(struct gb_connection *connection, void *request,
- int request_size)
+int gb_protocol_get_version(struct gb_connection *connection, bool send_request)
{
struct gb_protocol_version_response response;
+ struct gb_protocol_version_response *request = NULL;
+ int request_size = 0;
int retval;
+ if (send_request) {
+ response.major = connection->protocol->major;
+ response.minor = connection->protocol->minor;
+ request = &response;
+ request_size = sizeof(*request);
+ }
+
retval = gb_operation_sync(connection, GB_REQUEST_TYPE_PROTOCOL_VERSION,
request, request_size, &response,
sizeof(response));
__gb_protocol_register(protocol, THIS_MODULE)
struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor);
-int gb_protocol_get_version(struct gb_connection *connection, void *request,
- int request_size);
+int gb_protocol_get_version(struct gb_connection *connection, bool send_request);
void gb_protocol_put(struct gb_protocol *protocol);