crypto/octeontx2: add init sequence in probe
[dpdk.git] / drivers / crypto / octeontx2 / otx2_cryptodev_mbox.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (C) 2019 Marvell International Ltd.
3  */
4 #include <rte_cryptodev.h>
5
6 #include "otx2_cryptodev.h"
7 #include "otx2_cryptodev_mbox.h"
8 #include "otx2_dev.h"
9 #include "otx2_mbox.h"
10
11 int
12 otx2_cpt_available_queues_get(const struct rte_cryptodev *dev,
13                               uint16_t *nb_queues)
14 {
15         struct otx2_cpt_vf *vf = dev->data->dev_private;
16         struct otx2_dev *otx2_dev = &vf->otx2_dev;
17         struct free_rsrcs_rsp *rsp;
18         int ret;
19
20         otx2_mbox_alloc_msg_free_rsrc_cnt(otx2_dev->mbox);
21
22         ret = otx2_mbox_process_msg(otx2_dev->mbox, (void *)&rsp);
23         if (ret)
24                 return -EIO;
25
26         *nb_queues = rsp->cpt;
27         return 0;
28 }