Line data Source code
1 : /* SPDX-License-Identifier: BSD-3-Clause 2 : * Copyright (C) 2022 Intel Corporation. 3 : * All rights reserved. 4 : */ 5 : 6 : #include "accel_iaa.h" 7 : 8 : #include "spdk/rpc.h" 9 : #include "spdk/util.h" 10 : #include "spdk/event.h" 11 : #include "spdk/stdinc.h" 12 : #include "spdk/env.h" 13 : #include "spdk/string.h" 14 : 15 : static void 16 0 : rpc_iaa_scan_accel_module(struct spdk_jsonrpc_request *request, 17 : const struct spdk_json_val *params) 18 : { 19 : int rc; 20 : 21 0 : if (params != NULL) { 22 0 : spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 23 : "iaa_scan_accel_module requires no parameters"); 24 0 : return; 25 : } 26 : 27 0 : rc = accel_iaa_enable_probe(); 28 0 : if (rc != 0) { 29 0 : spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc)); 30 0 : return; 31 : } 32 : 33 0 : SPDK_NOTICELOG("Enabled IAA user-mode\n"); 34 0 : spdk_jsonrpc_send_bool_response(request, true); 35 : } 36 0 : SPDK_RPC_REGISTER("iaa_scan_accel_module", rpc_iaa_scan_accel_module, SPDK_RPC_STARTUP) 37 0 : SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iaa_scan_accel_module, iaa_scan_accel_engine)