1 /* Copyright 2013-2016 Freescale Semiconductor Inc.
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
5 * * Redistributions of source code must retain the above copyright
6 * notice, this list of conditions and the following disclaimer.
7 * * Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 * * Neither the name of the above-listed copyright holders nor the
11 * names of any contributors may be used to endorse or promote products
12 * derived from this software without specific prior written permission.
15 * ALTERNATIVELY, this software may be distributed under the terms of the
16 * GNU General Public License ("GPL") as published by the Free Software
17 * Foundation, either version 2 of that License or (at your option) any
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
35 /* Data Path Concentrator API
36 * Contains initialization APIs and runtime control APIs for DPCON
41 /** General DPCON macros */
44 * Use it to disable notifications; see dpcon_set_notification()
46 #define DPCON_INVALID_DPIO_ID (int)(-1)
48 int dpcon_open(struct fsl_mc_io *mc_io,
53 int dpcon_close(struct fsl_mc_io *mc_io,
57 int dpcon_enable(struct fsl_mc_io *mc_io,
61 int dpcon_disable(struct fsl_mc_io *mc_io,
65 int dpcon_is_enabled(struct fsl_mc_io *mc_io,
70 int dpcon_reset(struct fsl_mc_io *mc_io,
75 * struct dpcon_attr - Structure representing DPCON attributes
76 * @id: DPCON object ID
77 * @qbman_ch_id: Channel ID to be used by dequeue operation
78 * @num_priorities: Number of priorities for the DPCON channel (1-8)
86 int dpcon_get_attributes(struct fsl_mc_io *mc_io,
89 struct dpcon_attr *attr);
92 * struct dpcon_notification_cfg - Structure representing notification params
93 * @dpio_id: DPIO object ID; must be configured with a notification channel;
94 * to disable notifications set it to 'DPCON_INVALID_DPIO_ID';
95 * @priority: Priority selection within the DPIO channel; valid values
96 * are 0-7, depending on the number of priorities in that channel
97 * @user_ctx: User context value provided with each CDAN message
99 struct dpcon_notification_cfg {
105 int dpcon_set_notification(struct fsl_mc_io *mc_io,
108 struct dpcon_notification_cfg *cfg);
110 int dpcon_get_api_version(struct fsl_mc_io *mc_io,
115 #endif /* __FSL_DPCON_H */