common/cnxk: add inline IPsec configuration mailbox
[dpdk.git] / drivers / common / cnxk / roc_cpt_priv.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #ifndef _ROC_CPT_PRIV_H_
6 #define _ROC_CPT_PRIV_H_
7
8 /* Set number of hystbits to 6.
9  * This will trigger the FC writes whenever number of outstanding commands in
10  * the queue becomes multiple of 32.
11  */
12 #define CPT_FC_NUM_HYST_BITS 6
13
14 struct cpt {
15         struct plt_pci_device *pci_dev;
16         struct dev dev;
17         uint16_t lf_msix_off[ROC_CPT_MAX_LFS];
18         uint8_t lf_blkaddr[ROC_CPT_MAX_LFS];
19 } __plt_cache_aligned;
20
21 static inline struct cpt *
22 roc_cpt_to_cpt_priv(struct roc_cpt *roc_cpt)
23 {
24         return (struct cpt *)&roc_cpt->reserved[0];
25 }
26
27 int cpt_lfs_attach(struct dev *dev, uint8_t blkaddr, bool modify,
28                    uint16_t nb_lf);
29 int cpt_lfs_detach(struct dev *dev);
30 int cpt_lfs_alloc(struct dev *dev, uint8_t eng_grpmsk, uint8_t blk,
31                   bool inl_dev_sso);
32 int cpt_lfs_free(struct dev *dev);
33 int cpt_lf_init(struct roc_cpt_lf *lf);
34 void cpt_lf_fini(struct roc_cpt_lf *lf);
35
36 int cpt_lf_outb_cfg(struct dev *dev, uint16_t sso_pf_func, uint16_t nix_pf_func,
37                     uint8_t lf_id, bool ena);
38 int cpt_get_msix_offset(struct dev *dev, struct msix_offset_rsp **msix_rsp);
39 uint64_t cpt_get_blkaddr(struct dev *dev);
40
41 #endif /* _ROC_CPT_PRIV_H_ */