bus/fslmc: fix mempool ops registration
[dpdk.git] / drivers / bus / fslmc / mc / fsl_dpcon.h
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  *
3  * Copyright 2013-2016 Freescale Semiconductor Inc.
4  *
5  */
6 #ifndef __FSL_DPCON_H
7 #define __FSL_DPCON_H
8
9 /* Data Path Concentrator API
10  * Contains initialization APIs and runtime control APIs for DPCON
11  */
12
13 struct fsl_mc_io;
14
15 /** General DPCON macros */
16
17 /**
18  * Use it to disable notifications; see dpcon_set_notification()
19  */
20 #define DPCON_INVALID_DPIO_ID           (int)(-1)
21
22 int dpcon_open(struct fsl_mc_io *mc_io,
23                uint32_t cmd_flags,
24                int dpcon_id,
25                uint16_t *token);
26
27 int dpcon_close(struct fsl_mc_io *mc_io,
28                 uint32_t cmd_flags,
29                 uint16_t token);
30
31 /**
32  * struct dpcon_cfg - Structure representing DPCON configuration
33  * @num_priorities: Number of priorities for the DPCON channel (1-8)
34  */
35 struct dpcon_cfg {
36         uint8_t num_priorities;
37 };
38
39 int dpcon_create(struct fsl_mc_io *mc_io,
40                  uint16_t dprc_token,
41                  uint32_t cmd_flags,
42                  const struct dpcon_cfg *cfg,
43                  uint32_t *obj_id);
44
45 int dpcon_destroy(struct fsl_mc_io *mc_io,
46                   uint16_t dprc_token,
47                   uint32_t cmd_flags,
48                   uint32_t obj_id);
49
50 int dpcon_enable(struct fsl_mc_io *mc_io,
51                  uint32_t cmd_flags,
52                  uint16_t token);
53
54 int dpcon_disable(struct fsl_mc_io *mc_io,
55                   uint32_t cmd_flags,
56                   uint16_t token);
57
58 int dpcon_is_enabled(struct fsl_mc_io *mc_io,
59                      uint32_t cmd_flags,
60                      uint16_t token,
61                      int *en);
62
63 int dpcon_reset(struct fsl_mc_io *mc_io,
64                 uint32_t cmd_flags,
65                 uint16_t token);
66
67 /**
68  * struct dpcon_attr - Structure representing DPCON attributes
69  * @id:                 DPCON object ID
70  * @qbman_ch_id:        Channel ID to be used by dequeue operation
71  * @num_priorities:     Number of priorities for the DPCON channel (1-8)
72  */
73 struct dpcon_attr {
74         int id;
75         uint16_t qbman_ch_id;
76         uint8_t num_priorities;
77 };
78
79 int dpcon_get_attributes(struct fsl_mc_io *mc_io,
80                          uint32_t cmd_flags,
81                          uint16_t token,
82                          struct dpcon_attr *attr);
83
84 int dpcon_get_api_version(struct fsl_mc_io *mc_io,
85                           uint32_t cmd_flags,
86                           uint16_t *major_ver,
87                           uint16_t *minor_ver);
88
89 #endif /* __FSL_DPCON_H */