1// Copyright 2016 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto2"; 16 17package android.vts; 18 19import "test/vts/proto/VtsResourceControllerMessage.proto"; 20 21// Type of a command. 22enum VtsDriverCommandType { 23 UNKNOWN_VTS_DRIVER_COMMAND_TYPE = 0; 24 25 // To request to exit a driver. 26 EXIT = 1; 27 // To get the status of a driver. 28 GET_STATUS = 2; 29 30 // for a HAL driver 31 // To request to load a HAL. 32 LOAD_HAL = 101; 33 // To get a list of available functions. 34 LIST_FUNCTIONS = 102; 35 // To call a function. 36 CALL_FUNCTION = 103; 37 // To get the value of an attribute. 38 GET_ATTRIBUTE = 104; 39 // To read the specification message of a component. 40 VTS_DRIVER_COMMAND_READ_SPECIFICATION = 105; 41 42 // for a shell driver 43 // To execute a shell command. 44 EXECUTE_COMMAND = 201; 45 46 // To invoke a system call. 47 INVOKE_SYSCALL = 202; 48 49 // To request FMQ resource. 50 FMQ_OPERATION = 301; 51 // To request hidl_memory resource. 52 HIDL_MEMORY_OPERATION = 302; 53 // To request hidl_handle resource. 54 HIDL_HANDLE_OPERATION = 303; 55} 56 57 58// Type of a response. 59enum VtsDriverResponseCode { 60 UNKNOWN_VTS_DRIVER_RESPONSE_CODE = 0; 61 // successful 62 VTS_DRIVER_RESPONSE_SUCCESS = 1; 63 // failed 64 VTS_DRIVER_RESPONSE_FAIL = 2; 65} 66 67 68// To specify a command. 69message VtsDriverControlCommandMessage { 70 // Command type. 71 optional VtsDriverCommandType command_type = 1; 72 73 // for EXIT 74 // none 75 76 // for GET_STATUS 77 optional int32 status_type = 1101; 78 79 // for LOAD_HAL 80 // The name of a target. 81 optional bytes file_path = 1201; 82 // target class 83 optional int32 target_class = 1202; 84 // target type 85 optional int32 target_type = 1203; 86 // target version (should be divided by 100) - float has a compatibility issue 87 // between C/C++ and python protoc. 88 // Deprecated, use target_version_major and target_version_minor instead. 89 optional float target_version = 1204 [deprecated = true]; 90 // the name of a HAL module to open. 91 optional bytes module_name = 1205; 92 // the package of a HIDL HAL to open. 93 optional bytes target_package = 1206; 94 // the name of a target component (currently used for HIDL HALs only). 95 optional bytes target_component_name = 1207; 96 97 // use two ints to represent major and minor versions separately. 98 // HAL major version of target component (e.g. 1.0 -> 1). 99 optional int32 target_version_major = 1208 [default = -1]; 100 // HAL minor version of target component (e.g. 1.0 -> 0). 101 optional int32 target_version_minor = 1209 [default = -1]; 102 103 // the name of a HW Binder service to use (only needed for HIDL HAL). 104 optional bytes hw_binder_service_name = 1221; 105 106 // for LIST_FUNCTIONS 107 // none 108 109 // for CALL_FUNCTION 110 optional bytes arg = 1401; 111 112 // UID of a caller on the driver-side. 113 optional bytes driver_caller_uid = 1501; 114 115 // for EXECUTE_COMMAND 116 repeated bytes shell_command = 2001; 117 118 // Arguments for operation on FMQ 119 optional FmqRequestMessage fmq_request = 3001; 120 // Arguments for operation on hidl_memory 121 optional HidlMemoryRequestMessage hidl_memory_request = 3002; 122 // Arguments for operation on hidl_handle 123 optional HidlHandleRequestMessage hidl_handle_request = 3003; 124} 125 126 127// To specify a response. 128message VtsDriverControlResponseMessage { 129 // Response type. 130 optional VtsDriverResponseCode response_code = 1; 131 132 // Return value. 133 optional int32 return_value = 11; 134 // Return message. 135 optional bytes return_message = 12; 136 137 // The stdout message for each command 138 repeated bytes stdout = 1001; 139 // The stderr message for each command 140 repeated bytes stderr = 1002; 141 // The exit code for each command 142 repeated int32 exit_code = 1003; 143 144 // The retrieved specifications. 145 repeated bytes spec = 2001; 146 147 // read data and return values from FMQ driver 148 optional FmqResponseMessage fmq_response = 3001; 149 // response from hidl_memory driver 150 optional HidlMemoryResponseMessage hidl_memory_response = 3002; 151 // response from hidl_handle driver 152 optional HidlHandleResponseMessage hidl_handle_response = 3003; 153} 154