2 * Copyright (C) 2012-2017 ARM Limited or its affiliates.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 /* \file request_mgr.h
21 #ifndef __REQUEST_MGR_H__
22 #define __REQUEST_MGR_H__
24 #include "cc_hw_queue_defs.h"
26 int request_mgr_init(struct ssi_drvdata *drvdata);
29 * Enqueue caller request to crypto hardware.
32 * \param ssi_req The request to enqueue
33 * \param desc The crypto sequence
34 * \param len The crypto sequence length
35 * \param is_dout If "true": completion is handled by the caller
36 * If "false": this function adds a dummy descriptor completion
37 * and waits upon completion signal.
39 * \return int Returns -EINPROGRESS if "is_dout=ture"; "0" if "is_dout=false"
42 struct ssi_drvdata *drvdata, struct ssi_crypto_req *ssi_req,
43 struct cc_hw_desc *desc, unsigned int len, bool is_dout);
45 int send_request_init(
46 struct ssi_drvdata *drvdata, struct cc_hw_desc *desc, unsigned int len);
48 void complete_request(struct ssi_drvdata *drvdata);
50 void request_mgr_fini(struct ssi_drvdata *drvdata);
52 #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP)
53 int ssi_request_mgr_runtime_resume_queue(struct ssi_drvdata *drvdata);
55 int ssi_request_mgr_runtime_suspend_queue(struct ssi_drvdata *drvdata);
57 bool ssi_request_mgr_is_queue_runtime_suspend(struct ssi_drvdata *drvdata);
60 #endif /*__REQUEST_MGR_H__*/