xref: /freebsd/sys/dev/dpaa2/dpaa2_cmd_if.m (revision ba7319e9091b4f6ef15a9c4be3d3d076f3047f72)
1*ba7319e9SDmitry Salychev#-
2*ba7319e9SDmitry Salychev# SPDX-License-Identifier: BSD-2-Clause
3*ba7319e9SDmitry Salychev#
4*ba7319e9SDmitry Salychev# Copyright © 2021-2022 Dmitry Salychev
5*ba7319e9SDmitry Salychev#
6*ba7319e9SDmitry Salychev# Redistribution and use in source and binary forms, with or without
7*ba7319e9SDmitry Salychev# modification, are permitted provided that the following conditions
8*ba7319e9SDmitry Salychev# are met:
9*ba7319e9SDmitry Salychev# 1. Redistributions of source code must retain the above copyright
10*ba7319e9SDmitry Salychev#    notice, this list of conditions and the following disclaimer.
11*ba7319e9SDmitry Salychev# 2. Redistributions in binary form must reproduce the above copyright
12*ba7319e9SDmitry Salychev#    notice, this list of conditions and the following disclaimer in the
13*ba7319e9SDmitry Salychev#    documentation and/or other materials provided with the distribution.
14*ba7319e9SDmitry Salychev#
15*ba7319e9SDmitry Salychev# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*ba7319e9SDmitry Salychev# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*ba7319e9SDmitry Salychev# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*ba7319e9SDmitry Salychev# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*ba7319e9SDmitry Salychev# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*ba7319e9SDmitry Salychev# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*ba7319e9SDmitry Salychev# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*ba7319e9SDmitry Salychev# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*ba7319e9SDmitry Salychev# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*ba7319e9SDmitry Salychev# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*ba7319e9SDmitry Salychev# SUCH DAMAGE.
26*ba7319e9SDmitry Salychev#
27*ba7319e9SDmitry Salychev
28*ba7319e9SDmitry Salychev#include <machine/bus.h>
29*ba7319e9SDmitry Salychev#include <dev/dpaa2/dpaa2_types.h>
30*ba7319e9SDmitry Salychev#include <dev/dpaa2/dpaa2_mc.h>
31*ba7319e9SDmitry Salychev#include <dev/dpaa2/dpaa2_mcp.h>
32*ba7319e9SDmitry Salychev
33*ba7319e9SDmitry Salychev/**
34*ba7319e9SDmitry Salychev * @brief DPAA2 MC command interface.
35*ba7319e9SDmitry Salychev *
36*ba7319e9SDmitry Salychev * The primary purpose of the MC provided DPAA2 objects is to simplify DPAA2
37*ba7319e9SDmitry Salychev * hardware block usage through abstraction and encapsulation.
38*ba7319e9SDmitry Salychev */
39*ba7319e9SDmitry SalychevINTERFACE dpaa2_cmd;
40*ba7319e9SDmitry Salychev
41*ba7319e9SDmitry Salychev#
42*ba7319e9SDmitry Salychev# Default implementation of the commands.
43*ba7319e9SDmitry Salychev#
44*ba7319e9SDmitry SalychevCODE {
45*ba7319e9SDmitry Salychev	static void
46*ba7319e9SDmitry Salychev	panic_on_mc(device_t dev)
47*ba7319e9SDmitry Salychev	{
48*ba7319e9SDmitry Salychev		if (strcmp(device_get_name(dev), "dpaa2_mc") == 0)
49*ba7319e9SDmitry Salychev			panic("No one can handle a command above DPAA2 MC");
50*ba7319e9SDmitry Salychev	}
51*ba7319e9SDmitry Salychev
52*ba7319e9SDmitry Salychev	static int
53*ba7319e9SDmitry Salychev	bypass_mng_get_version(device_t dev, device_t child, struct dpaa2_cmd *cmd,
54*ba7319e9SDmitry Salychev		uint32_t *major, uint32_t *minor, uint32_t *rev)
55*ba7319e9SDmitry Salychev	{
56*ba7319e9SDmitry Salychev		panic_on_mc(dev);
57*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
58*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MNG_GET_VERSION(device_get_parent(dev), child,
59*ba7319e9SDmitry Salychev				cmd, major, minor, rev));
60*ba7319e9SDmitry Salychev		return (ENXIO);
61*ba7319e9SDmitry Salychev	}
62*ba7319e9SDmitry Salychev	static int
63*ba7319e9SDmitry Salychev	bypass_mng_get_soc_version(device_t dev, device_t child, struct dpaa2_cmd *cmd,
64*ba7319e9SDmitry Salychev		uint32_t *pvr, uint32_t *svr)
65*ba7319e9SDmitry Salychev	{
66*ba7319e9SDmitry Salychev		panic_on_mc(dev);
67*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
68*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MNG_GET_SOC_VERSION(
69*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, pvr, svr));
70*ba7319e9SDmitry Salychev		return (ENXIO);
71*ba7319e9SDmitry Salychev	}
72*ba7319e9SDmitry Salychev	static int
73*ba7319e9SDmitry Salychev	bypass_mng_get_container_id(device_t dev, device_t child, struct dpaa2_cmd *cmd,
74*ba7319e9SDmitry Salychev		uint32_t *cont_id)
75*ba7319e9SDmitry Salychev	{
76*ba7319e9SDmitry Salychev		panic_on_mc(dev);
77*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
78*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MNG_GET_CONTAINER_ID(
79*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cont_id));
80*ba7319e9SDmitry Salychev		return (ENXIO);
81*ba7319e9SDmitry Salychev	}
82*ba7319e9SDmitry Salychev	static int
83*ba7319e9SDmitry Salychev	bypass_rc_open(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t cont_id,
84*ba7319e9SDmitry Salychev		uint16_t *token)
85*ba7319e9SDmitry Salychev	{
86*ba7319e9SDmitry Salychev		panic_on_mc(dev);
87*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
88*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_OPEN(
89*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cont_id, token));
90*ba7319e9SDmitry Salychev		return (ENXIO);
91*ba7319e9SDmitry Salychev	}
92*ba7319e9SDmitry Salychev	static int
93*ba7319e9SDmitry Salychev	bypass_rc_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
94*ba7319e9SDmitry Salychev	{
95*ba7319e9SDmitry Salychev		panic_on_mc(dev);
96*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
97*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_CLOSE(
98*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
99*ba7319e9SDmitry Salychev		return (ENXIO);
100*ba7319e9SDmitry Salychev	}
101*ba7319e9SDmitry Salychev	static int
102*ba7319e9SDmitry Salychev	bypass_rc_get_obj_count(device_t dev, device_t child, struct dpaa2_cmd *cmd,
103*ba7319e9SDmitry Salychev		uint32_t *obj_count)
104*ba7319e9SDmitry Salychev	{
105*ba7319e9SDmitry Salychev		panic_on_mc(dev);
106*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
107*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_OBJ_COUNT(
108*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, obj_count));
109*ba7319e9SDmitry Salychev		return (ENXIO);
110*ba7319e9SDmitry Salychev	}
111*ba7319e9SDmitry Salychev	static int
112*ba7319e9SDmitry Salychev	bypass_rc_get_obj(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t obj_idx,
113*ba7319e9SDmitry Salychev		struct dpaa2_obj *obj)
114*ba7319e9SDmitry Salychev	{
115*ba7319e9SDmitry Salychev		panic_on_mc(dev);
116*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
117*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_OBJ(
118*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, obj_idx, obj));
119*ba7319e9SDmitry Salychev		return (ENXIO);
120*ba7319e9SDmitry Salychev	}
121*ba7319e9SDmitry Salychev	static int
122*ba7319e9SDmitry Salychev	bypass_rc_get_obj_descriptor(device_t dev, device_t child, struct dpaa2_cmd *cmd,
123*ba7319e9SDmitry Salychev		uint32_t obj_id, enum dpaa2_dev_type type, struct dpaa2_obj *obj)
124*ba7319e9SDmitry Salychev	{
125*ba7319e9SDmitry Salychev		panic_on_mc(dev);
126*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
127*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_OBJ_DESCRIPTOR(
128*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, obj_id, type, obj));
129*ba7319e9SDmitry Salychev		return (ENXIO);
130*ba7319e9SDmitry Salychev	}
131*ba7319e9SDmitry Salychev	static int
132*ba7319e9SDmitry Salychev	bypass_rc_get_attributes(device_t dev, device_t child, struct dpaa2_cmd *cmd,
133*ba7319e9SDmitry Salychev		struct dpaa2_rc_attr *attr)
134*ba7319e9SDmitry Salychev	{
135*ba7319e9SDmitry Salychev		panic_on_mc(dev);
136*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
137*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_ATTRIBUTES(
138*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, attr));
139*ba7319e9SDmitry Salychev		return (ENXIO);
140*ba7319e9SDmitry Salychev	}
141*ba7319e9SDmitry Salychev	static int
142*ba7319e9SDmitry Salychev	bypass_rc_get_obj_region(device_t dev, device_t child, struct dpaa2_cmd *cmd,
143*ba7319e9SDmitry Salychev		uint32_t obj_id, uint8_t reg_idx, enum dpaa2_dev_type type,
144*ba7319e9SDmitry Salychev		struct dpaa2_rc_obj_region *reg)
145*ba7319e9SDmitry Salychev	{
146*ba7319e9SDmitry Salychev		panic_on_mc(dev);
147*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
148*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_OBJ_REGION(
149*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, obj_id, reg_idx,
150*ba7319e9SDmitry Salychev				type, reg));
151*ba7319e9SDmitry Salychev		return (ENXIO);
152*ba7319e9SDmitry Salychev	}
153*ba7319e9SDmitry Salychev	static int
154*ba7319e9SDmitry Salychev	bypass_rc_get_api_version(device_t dev, device_t child, struct dpaa2_cmd *cmd,
155*ba7319e9SDmitry Salychev		uint16_t *major, uint16_t *minor)
156*ba7319e9SDmitry Salychev	{
157*ba7319e9SDmitry Salychev		panic_on_mc(dev);
158*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
159*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_API_VERSION(
160*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, major, minor));
161*ba7319e9SDmitry Salychev		return (ENXIO);
162*ba7319e9SDmitry Salychev	}
163*ba7319e9SDmitry Salychev	static int
164*ba7319e9SDmitry Salychev	bypass_rc_set_irq_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd,
165*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint8_t enable)
166*ba7319e9SDmitry Salychev	{
167*ba7319e9SDmitry Salychev		panic_on_mc(dev);
168*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
169*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_SET_IRQ_ENABLE(
170*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, enable));
171*ba7319e9SDmitry Salychev		return (ENXIO);
172*ba7319e9SDmitry Salychev	}
173*ba7319e9SDmitry Salychev	static int
174*ba7319e9SDmitry Salychev	bypass_rc_set_obj_irq(device_t dev, device_t child, struct dpaa2_cmd *cmd,
175*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint64_t addr, uint32_t data, uint32_t irq_usr,
176*ba7319e9SDmitry Salychev		uint32_t obj_id, enum dpaa2_dev_type type)
177*ba7319e9SDmitry Salychev	{
178*ba7319e9SDmitry Salychev		panic_on_mc(dev);
179*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
180*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_SET_OBJ_IRQ(
181*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, addr, data,
182*ba7319e9SDmitry Salychev				irq_usr, obj_id, type));
183*ba7319e9SDmitry Salychev		return (ENXIO);
184*ba7319e9SDmitry Salychev	}
185*ba7319e9SDmitry Salychev	static int
186*ba7319e9SDmitry Salychev	bypass_rc_get_conn(device_t dev, device_t child, struct dpaa2_cmd *cmd,
187*ba7319e9SDmitry Salychev		struct dpaa2_ep_desc *ep1_desc, struct dpaa2_ep_desc *ep2_desc,
188*ba7319e9SDmitry Salychev		uint32_t *link_stat)
189*ba7319e9SDmitry Salychev	{
190*ba7319e9SDmitry Salychev		panic_on_mc(dev);
191*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
192*ba7319e9SDmitry Salychev			return (DPAA2_CMD_RC_GET_CONN(
193*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, ep1_desc, ep2_desc,
194*ba7319e9SDmitry Salychev				link_stat));
195*ba7319e9SDmitry Salychev		return (ENXIO);
196*ba7319e9SDmitry Salychev	}
197*ba7319e9SDmitry Salychev
198*ba7319e9SDmitry Salychev	static int
199*ba7319e9SDmitry Salychev	bypass_ni_open(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t dpni_id,
200*ba7319e9SDmitry Salychev		uint16_t *token)
201*ba7319e9SDmitry Salychev	{
202*ba7319e9SDmitry Salychev		panic_on_mc(dev);
203*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
204*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_OPEN(
205*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpni_id, token));
206*ba7319e9SDmitry Salychev		return (ENXIO);
207*ba7319e9SDmitry Salychev	}
208*ba7319e9SDmitry Salychev	static int
209*ba7319e9SDmitry Salychev	bypass_ni_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
210*ba7319e9SDmitry Salychev	{
211*ba7319e9SDmitry Salychev		panic_on_mc(dev);
212*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
213*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_CLOSE(
214*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
215*ba7319e9SDmitry Salychev		return (ENXIO);
216*ba7319e9SDmitry Salychev	}
217*ba7319e9SDmitry Salychev	static int
218*ba7319e9SDmitry Salychev	bypass_ni_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
219*ba7319e9SDmitry Salychev	{
220*ba7319e9SDmitry Salychev		panic_on_mc(dev);
221*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
222*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_ENABLE(
223*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
224*ba7319e9SDmitry Salychev		return (ENXIO);
225*ba7319e9SDmitry Salychev	}
226*ba7319e9SDmitry Salychev	static int
227*ba7319e9SDmitry Salychev	bypass_ni_disable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
228*ba7319e9SDmitry Salychev	{
229*ba7319e9SDmitry Salychev		panic_on_mc(dev);
230*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
231*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_DISABLE(
232*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
233*ba7319e9SDmitry Salychev		return (ENXIO);
234*ba7319e9SDmitry Salychev	}
235*ba7319e9SDmitry Salychev	static int
236*ba7319e9SDmitry Salychev	bypass_ni_get_api_version(device_t dev, device_t child, struct dpaa2_cmd *cmd,
237*ba7319e9SDmitry Salychev		uint16_t *major, uint16_t *minor)
238*ba7319e9SDmitry Salychev	{
239*ba7319e9SDmitry Salychev		panic_on_mc(dev);
240*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
241*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_API_VERSION(
242*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, major, minor));
243*ba7319e9SDmitry Salychev		return (ENXIO);
244*ba7319e9SDmitry Salychev	}
245*ba7319e9SDmitry Salychev	static int
246*ba7319e9SDmitry Salychev	bypass_ni_reset(device_t dev, device_t child, struct dpaa2_cmd *cmd)
247*ba7319e9SDmitry Salychev	{
248*ba7319e9SDmitry Salychev		panic_on_mc(dev);
249*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
250*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_RESET(
251*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
252*ba7319e9SDmitry Salychev		return (ENXIO);
253*ba7319e9SDmitry Salychev	}
254*ba7319e9SDmitry Salychev	static int
255*ba7319e9SDmitry Salychev	bypass_ni_get_attributes(device_t dev, device_t child, struct dpaa2_cmd *cmd,
256*ba7319e9SDmitry Salychev		struct dpaa2_ni_attr *attr)
257*ba7319e9SDmitry Salychev	{
258*ba7319e9SDmitry Salychev		panic_on_mc(dev);
259*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
260*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_ATTRIBUTES(
261*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, attr));
262*ba7319e9SDmitry Salychev		return (ENXIO);
263*ba7319e9SDmitry Salychev	}
264*ba7319e9SDmitry Salychev	static int
265*ba7319e9SDmitry Salychev	bypass_ni_set_buf_layout(device_t dev, device_t child, struct dpaa2_cmd *cmd,
266*ba7319e9SDmitry Salychev		struct dpaa2_ni_buf_layout *bl)
267*ba7319e9SDmitry Salychev	{
268*ba7319e9SDmitry Salychev		panic_on_mc(dev);
269*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
270*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_BUF_LAYOUT(
271*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, bl));
272*ba7319e9SDmitry Salychev		return (ENXIO);
273*ba7319e9SDmitry Salychev	}
274*ba7319e9SDmitry Salychev	static int
275*ba7319e9SDmitry Salychev	bypass_ni_get_tx_data_off(device_t dev, device_t child, struct dpaa2_cmd *cmd,
276*ba7319e9SDmitry Salychev		uint16_t *offset)
277*ba7319e9SDmitry Salychev	{
278*ba7319e9SDmitry Salychev		panic_on_mc(dev);
279*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
280*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_TX_DATA_OFF(
281*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, offset));
282*ba7319e9SDmitry Salychev		return (ENXIO);
283*ba7319e9SDmitry Salychev	}
284*ba7319e9SDmitry Salychev	static int
285*ba7319e9SDmitry Salychev	bypass_ni_set_link_cfg(device_t dev, device_t child, struct dpaa2_cmd *cmd,
286*ba7319e9SDmitry Salychev		struct dpaa2_ni_link_cfg *cfg)
287*ba7319e9SDmitry Salychev	{
288*ba7319e9SDmitry Salychev		panic_on_mc(dev);
289*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
290*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_LINK_CFG(
291*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
292*ba7319e9SDmitry Salychev		return (ENXIO);
293*ba7319e9SDmitry Salychev	}
294*ba7319e9SDmitry Salychev	static int
295*ba7319e9SDmitry Salychev	bypass_ni_get_link_cfg(device_t dev, device_t child, struct dpaa2_cmd *cmd,
296*ba7319e9SDmitry Salychev		struct dpaa2_ni_link_cfg *cfg)
297*ba7319e9SDmitry Salychev	{
298*ba7319e9SDmitry Salychev		panic_on_mc(dev);
299*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
300*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_LINK_CFG(
301*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
302*ba7319e9SDmitry Salychev		return (ENXIO);
303*ba7319e9SDmitry Salychev	}
304*ba7319e9SDmitry Salychev	static int
305*ba7319e9SDmitry Salychev	bypass_ni_get_link_state(device_t dev, device_t child, struct dpaa2_cmd *cmd,
306*ba7319e9SDmitry Salychev		struct dpaa2_ni_link_state *state)
307*ba7319e9SDmitry Salychev	{
308*ba7319e9SDmitry Salychev		panic_on_mc(dev);
309*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
310*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_LINK_STATE(
311*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, state));
312*ba7319e9SDmitry Salychev		return (ENXIO);
313*ba7319e9SDmitry Salychev	}
314*ba7319e9SDmitry Salychev	static int
315*ba7319e9SDmitry Salychev	bypass_ni_get_port_mac_addr(device_t dev, device_t child, struct dpaa2_cmd *cmd,
316*ba7319e9SDmitry Salychev		uint8_t *mac)
317*ba7319e9SDmitry Salychev	{
318*ba7319e9SDmitry Salychev		panic_on_mc(dev);
319*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
320*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_PORT_MAC_ADDR(
321*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, mac));
322*ba7319e9SDmitry Salychev		return (ENXIO);
323*ba7319e9SDmitry Salychev	}
324*ba7319e9SDmitry Salychev	static int
325*ba7319e9SDmitry Salychev	bypass_ni_set_prim_mac_addr(device_t dev, device_t child, struct dpaa2_cmd *cmd,
326*ba7319e9SDmitry Salychev		uint8_t *mac)
327*ba7319e9SDmitry Salychev	{
328*ba7319e9SDmitry Salychev		panic_on_mc(dev);
329*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
330*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_PRIM_MAC_ADDR(
331*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, mac));
332*ba7319e9SDmitry Salychev		return (ENXIO);
333*ba7319e9SDmitry Salychev	}
334*ba7319e9SDmitry Salychev	static int
335*ba7319e9SDmitry Salychev	bypass_ni_get_prim_mac_addr(device_t dev, device_t child, struct dpaa2_cmd *cmd,
336*ba7319e9SDmitry Salychev		uint8_t *mac)
337*ba7319e9SDmitry Salychev	{
338*ba7319e9SDmitry Salychev		panic_on_mc(dev);
339*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
340*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_PRIM_MAC_ADDR(
341*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, mac));
342*ba7319e9SDmitry Salychev		return (ENXIO);
343*ba7319e9SDmitry Salychev	}
344*ba7319e9SDmitry Salychev	static int
345*ba7319e9SDmitry Salychev	bypass_ni_set_qos_table(device_t dev, device_t child, struct dpaa2_cmd *cmd,
346*ba7319e9SDmitry Salychev		struct dpaa2_ni_qos_table *tbl)
347*ba7319e9SDmitry Salychev	{
348*ba7319e9SDmitry Salychev		panic_on_mc(dev);
349*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
350*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_QOS_TABLE(
351*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, tbl));
352*ba7319e9SDmitry Salychev		return (ENXIO);
353*ba7319e9SDmitry Salychev	}
354*ba7319e9SDmitry Salychev	static int
355*ba7319e9SDmitry Salychev	bypass_ni_clear_qos_table(device_t dev, device_t child, struct dpaa2_cmd *cmd)
356*ba7319e9SDmitry Salychev	{
357*ba7319e9SDmitry Salychev		panic_on_mc(dev);
358*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
359*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_CLEAR_QOS_TABLE(
360*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
361*ba7319e9SDmitry Salychev		return (ENXIO);
362*ba7319e9SDmitry Salychev	}
363*ba7319e9SDmitry Salychev	static int
364*ba7319e9SDmitry Salychev	bypass_ni_set_pools(device_t dev, device_t child, struct dpaa2_cmd *cmd,
365*ba7319e9SDmitry Salychev		struct dpaa2_ni_pools_cfg *cfg)
366*ba7319e9SDmitry Salychev	{
367*ba7319e9SDmitry Salychev		panic_on_mc(dev);
368*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
369*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_POOLS(
370*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
371*ba7319e9SDmitry Salychev		return (ENXIO);
372*ba7319e9SDmitry Salychev	}
373*ba7319e9SDmitry Salychev	static int
374*ba7319e9SDmitry Salychev	bypass_ni_set_err_behavior(device_t dev, device_t child, struct dpaa2_cmd *cmd,
375*ba7319e9SDmitry Salychev		struct dpaa2_ni_err_cfg *cfg)
376*ba7319e9SDmitry Salychev	{
377*ba7319e9SDmitry Salychev		panic_on_mc(dev);
378*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
379*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_ERR_BEHAVIOR(
380*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
381*ba7319e9SDmitry Salychev		return (ENXIO);
382*ba7319e9SDmitry Salychev	}
383*ba7319e9SDmitry Salychev	static int
384*ba7319e9SDmitry Salychev	bypass_ni_get_queue(device_t dev, device_t child, struct dpaa2_cmd *cmd,
385*ba7319e9SDmitry Salychev		struct dpaa2_ni_queue_cfg *cfg)
386*ba7319e9SDmitry Salychev	{
387*ba7319e9SDmitry Salychev		panic_on_mc(dev);
388*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
389*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_QUEUE(
390*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
391*ba7319e9SDmitry Salychev		return (ENXIO);
392*ba7319e9SDmitry Salychev	}
393*ba7319e9SDmitry Salychev	static int
394*ba7319e9SDmitry Salychev	bypass_ni_set_queue(device_t dev, device_t child, struct dpaa2_cmd *cmd,
395*ba7319e9SDmitry Salychev		struct dpaa2_ni_queue_cfg *cfg)
396*ba7319e9SDmitry Salychev	{
397*ba7319e9SDmitry Salychev		panic_on_mc(dev);
398*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
399*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_QUEUE(
400*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
401*ba7319e9SDmitry Salychev		return (ENXIO);
402*ba7319e9SDmitry Salychev	}
403*ba7319e9SDmitry Salychev	static int
404*ba7319e9SDmitry Salychev	bypass_ni_get_qdid(device_t dev, device_t child, struct dpaa2_cmd *cmd,
405*ba7319e9SDmitry Salychev		enum dpaa2_ni_queue_type type, uint16_t *qdid)
406*ba7319e9SDmitry Salychev	{
407*ba7319e9SDmitry Salychev		panic_on_mc(dev);
408*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
409*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_QDID(
410*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, type, qdid));
411*ba7319e9SDmitry Salychev		return (ENXIO);
412*ba7319e9SDmitry Salychev	}
413*ba7319e9SDmitry Salychev	static int
414*ba7319e9SDmitry Salychev	bypass_ni_add_mac_addr(device_t dev, device_t child, struct dpaa2_cmd *cmd,
415*ba7319e9SDmitry Salychev		uint8_t *mac)
416*ba7319e9SDmitry Salychev	{
417*ba7319e9SDmitry Salychev		panic_on_mc(dev);
418*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
419*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_ADD_MAC_ADDR(
420*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, mac));
421*ba7319e9SDmitry Salychev		return (ENXIO);
422*ba7319e9SDmitry Salychev	}
423*ba7319e9SDmitry Salychev	static int
424*ba7319e9SDmitry Salychev	bypass_ni_remove_mac_addr(device_t dev, device_t child, struct dpaa2_cmd *cmd,
425*ba7319e9SDmitry Salychev		uint8_t *mac)
426*ba7319e9SDmitry Salychev	{
427*ba7319e9SDmitry Salychev		panic_on_mc(dev);
428*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
429*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_REMOVE_MAC_ADDR(
430*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, mac));
431*ba7319e9SDmitry Salychev		return (ENXIO);
432*ba7319e9SDmitry Salychev	}
433*ba7319e9SDmitry Salychev	static int
434*ba7319e9SDmitry Salychev	bypass_ni_clear_mac_filters(device_t dev, device_t child, struct dpaa2_cmd *cmd,
435*ba7319e9SDmitry Salychev		bool rm_uni, bool rm_multi)
436*ba7319e9SDmitry Salychev	{
437*ba7319e9SDmitry Salychev		panic_on_mc(dev);
438*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
439*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_CLEAR_MAC_FILTERS(
440*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, rm_uni, rm_multi));
441*ba7319e9SDmitry Salychev		return (ENXIO);
442*ba7319e9SDmitry Salychev	}
443*ba7319e9SDmitry Salychev	static int
444*ba7319e9SDmitry Salychev	bypass_ni_set_mfl(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint16_t length)
445*ba7319e9SDmitry Salychev	{
446*ba7319e9SDmitry Salychev		panic_on_mc(dev);
447*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
448*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_MFL(
449*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, length));
450*ba7319e9SDmitry Salychev		return (ENXIO);
451*ba7319e9SDmitry Salychev	}
452*ba7319e9SDmitry Salychev	static int
453*ba7319e9SDmitry Salychev	bypass_ni_set_offload(device_t dev, device_t child, struct dpaa2_cmd *cmd,
454*ba7319e9SDmitry Salychev		enum dpaa2_ni_ofl_type ofl_type, bool en)
455*ba7319e9SDmitry Salychev	{
456*ba7319e9SDmitry Salychev		panic_on_mc(dev);
457*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
458*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_OFFLOAD(
459*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, ofl_type, en));
460*ba7319e9SDmitry Salychev		return (ENXIO);
461*ba7319e9SDmitry Salychev	}
462*ba7319e9SDmitry Salychev	static int
463*ba7319e9SDmitry Salychev	bypass_ni_set_irq_mask(device_t dev, device_t child, struct dpaa2_cmd *cmd,
464*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint32_t mask)
465*ba7319e9SDmitry Salychev	{
466*ba7319e9SDmitry Salychev		panic_on_mc(dev);
467*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
468*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_IRQ_MASK(
469*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, mask));
470*ba7319e9SDmitry Salychev		return (ENXIO);
471*ba7319e9SDmitry Salychev	}
472*ba7319e9SDmitry Salychev	static int
473*ba7319e9SDmitry Salychev	bypass_ni_set_irq_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd,
474*ba7319e9SDmitry Salychev		uint8_t irq_idx, bool en)
475*ba7319e9SDmitry Salychev	{
476*ba7319e9SDmitry Salychev		panic_on_mc(dev);
477*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
478*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_IRQ_ENABLE(
479*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, en));
480*ba7319e9SDmitry Salychev		return (ENXIO);
481*ba7319e9SDmitry Salychev	}
482*ba7319e9SDmitry Salychev	static int
483*ba7319e9SDmitry Salychev	bypass_ni_get_irq_status(device_t dev, device_t child, struct dpaa2_cmd *cmd,
484*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint32_t *status)
485*ba7319e9SDmitry Salychev	{
486*ba7319e9SDmitry Salychev		panic_on_mc(dev);
487*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
488*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_IRQ_STATUS(
489*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, status));
490*ba7319e9SDmitry Salychev		return (ENXIO);
491*ba7319e9SDmitry Salychev	}
492*ba7319e9SDmitry Salychev	static int
493*ba7319e9SDmitry Salychev	bypass_ni_set_uni_promisc(device_t dev, device_t child, struct dpaa2_cmd *cmd, bool en)
494*ba7319e9SDmitry Salychev	{
495*ba7319e9SDmitry Salychev		panic_on_mc(dev);
496*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
497*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_UNI_PROMISC(
498*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, en));
499*ba7319e9SDmitry Salychev		return (ENXIO);
500*ba7319e9SDmitry Salychev	}
501*ba7319e9SDmitry Salychev	static int
502*ba7319e9SDmitry Salychev	bypass_ni_set_multi_promisc(device_t dev, device_t child, struct dpaa2_cmd *cmd, bool en)
503*ba7319e9SDmitry Salychev	{
504*ba7319e9SDmitry Salychev		panic_on_mc(dev);
505*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
506*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_MULTI_PROMISC(
507*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, en));
508*ba7319e9SDmitry Salychev		return (ENXIO);
509*ba7319e9SDmitry Salychev	}
510*ba7319e9SDmitry Salychev	static int
511*ba7319e9SDmitry Salychev	bypass_ni_get_statistics(device_t dev, device_t child, struct dpaa2_cmd *cmd,
512*ba7319e9SDmitry Salychev		uint8_t page, uint16_t param, uint64_t *cnt)
513*ba7319e9SDmitry Salychev	{
514*ba7319e9SDmitry Salychev		panic_on_mc(dev);
515*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
516*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_GET_STATISTICS(
517*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, page, param, cnt));
518*ba7319e9SDmitry Salychev		return (ENXIO);
519*ba7319e9SDmitry Salychev	}
520*ba7319e9SDmitry Salychev	static int
521*ba7319e9SDmitry Salychev	bypass_ni_set_rx_tc_dist(device_t dev, device_t child, struct dpaa2_cmd *cmd,
522*ba7319e9SDmitry Salychev		uint16_t dist_size, uint8_t tc, enum dpaa2_ni_dist_mode dist_mode,
523*ba7319e9SDmitry Salychev		bus_addr_t key_cfg_buf)
524*ba7319e9SDmitry Salychev	{
525*ba7319e9SDmitry Salychev		panic_on_mc(dev);
526*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
527*ba7319e9SDmitry Salychev			return (DPAA2_CMD_NI_SET_RX_TC_DIST(
528*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dist_size, tc,
529*ba7319e9SDmitry Salychev				dist_mode, key_cfg_buf));
530*ba7319e9SDmitry Salychev		return (ENXIO);
531*ba7319e9SDmitry Salychev	}
532*ba7319e9SDmitry Salychev
533*ba7319e9SDmitry Salychev	static int
534*ba7319e9SDmitry Salychev	bypass_io_open(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t dpio_id,
535*ba7319e9SDmitry Salychev		uint16_t *token)
536*ba7319e9SDmitry Salychev	{
537*ba7319e9SDmitry Salychev		panic_on_mc(dev);
538*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
539*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_OPEN(
540*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpio_id, token));
541*ba7319e9SDmitry Salychev		return (ENXIO);
542*ba7319e9SDmitry Salychev	}
543*ba7319e9SDmitry Salychev	static int
544*ba7319e9SDmitry Salychev	bypass_io_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
545*ba7319e9SDmitry Salychev	{
546*ba7319e9SDmitry Salychev		panic_on_mc(dev);
547*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
548*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_CLOSE(
549*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
550*ba7319e9SDmitry Salychev		return (ENXIO);
551*ba7319e9SDmitry Salychev	}
552*ba7319e9SDmitry Salychev	static int
553*ba7319e9SDmitry Salychev	bypass_io_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
554*ba7319e9SDmitry Salychev	{
555*ba7319e9SDmitry Salychev		panic_on_mc(dev);
556*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
557*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_ENABLE(
558*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
559*ba7319e9SDmitry Salychev		return (ENXIO);
560*ba7319e9SDmitry Salychev	}
561*ba7319e9SDmitry Salychev	static int
562*ba7319e9SDmitry Salychev	bypass_io_disable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
563*ba7319e9SDmitry Salychev	{
564*ba7319e9SDmitry Salychev		panic_on_mc(dev);
565*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
566*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_DISABLE(
567*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
568*ba7319e9SDmitry Salychev		return (ENXIO);
569*ba7319e9SDmitry Salychev	}
570*ba7319e9SDmitry Salychev	static int
571*ba7319e9SDmitry Salychev	bypass_io_reset(device_t dev, device_t child, struct dpaa2_cmd *cmd)
572*ba7319e9SDmitry Salychev	{
573*ba7319e9SDmitry Salychev		panic_on_mc(dev);
574*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
575*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_RESET(
576*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
577*ba7319e9SDmitry Salychev		return (ENXIO);
578*ba7319e9SDmitry Salychev	}
579*ba7319e9SDmitry Salychev	static int
580*ba7319e9SDmitry Salychev	bypass_io_get_attributes(device_t dev, device_t child, struct dpaa2_cmd *cmd,
581*ba7319e9SDmitry Salychev		struct dpaa2_io_attr *attr)
582*ba7319e9SDmitry Salychev	{
583*ba7319e9SDmitry Salychev		panic_on_mc(dev);
584*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
585*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_GET_ATTRIBUTES(
586*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, attr));
587*ba7319e9SDmitry Salychev		return (ENXIO);
588*ba7319e9SDmitry Salychev	}
589*ba7319e9SDmitry Salychev	static int
590*ba7319e9SDmitry Salychev	bypass_io_set_irq_mask(device_t dev, device_t child, struct dpaa2_cmd *cmd,
591*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint32_t mask)
592*ba7319e9SDmitry Salychev	{
593*ba7319e9SDmitry Salychev		panic_on_mc(dev);
594*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
595*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_SET_IRQ_MASK(
596*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, mask));
597*ba7319e9SDmitry Salychev		return (ENXIO);
598*ba7319e9SDmitry Salychev	}
599*ba7319e9SDmitry Salychev	static int
600*ba7319e9SDmitry Salychev	bypass_io_get_irq_status(device_t dev, device_t child, struct dpaa2_cmd *cmd,
601*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint32_t *status)
602*ba7319e9SDmitry Salychev	{
603*ba7319e9SDmitry Salychev		panic_on_mc(dev);
604*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
605*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_GET_IRQ_STATUS(
606*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, status));
607*ba7319e9SDmitry Salychev		return (ENXIO);
608*ba7319e9SDmitry Salychev	}
609*ba7319e9SDmitry Salychev	static int
610*ba7319e9SDmitry Salychev	bypass_io_set_irq_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd,
611*ba7319e9SDmitry Salychev		uint8_t irq_idx, bool en)
612*ba7319e9SDmitry Salychev	{
613*ba7319e9SDmitry Salychev		panic_on_mc(dev);
614*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
615*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_SET_IRQ_ENABLE(
616*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, en));
617*ba7319e9SDmitry Salychev		return (ENXIO);
618*ba7319e9SDmitry Salychev	}
619*ba7319e9SDmitry Salychev	static int
620*ba7319e9SDmitry Salychev	bypass_io_add_static_dq_chan(device_t dev, device_t child, struct dpaa2_cmd *cmd,
621*ba7319e9SDmitry Salychev		uint32_t dpcon_id, uint8_t *chan_idx)
622*ba7319e9SDmitry Salychev	{
623*ba7319e9SDmitry Salychev		panic_on_mc(dev);
624*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
625*ba7319e9SDmitry Salychev			return (DPAA2_CMD_IO_ADD_STATIC_DQ_CHAN(
626*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpcon_id, chan_idx));
627*ba7319e9SDmitry Salychev		return (ENXIO);
628*ba7319e9SDmitry Salychev	}
629*ba7319e9SDmitry Salychev
630*ba7319e9SDmitry Salychev	static int
631*ba7319e9SDmitry Salychev	bypass_bp_open(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t dpbp_id,
632*ba7319e9SDmitry Salychev		uint16_t *token)
633*ba7319e9SDmitry Salychev	{
634*ba7319e9SDmitry Salychev		panic_on_mc(dev);
635*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
636*ba7319e9SDmitry Salychev			return (DPAA2_CMD_BP_OPEN(
637*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpbp_id, token));
638*ba7319e9SDmitry Salychev		return (ENXIO);
639*ba7319e9SDmitry Salychev	}
640*ba7319e9SDmitry Salychev	static int
641*ba7319e9SDmitry Salychev	bypass_bp_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
642*ba7319e9SDmitry Salychev	{
643*ba7319e9SDmitry Salychev		panic_on_mc(dev);
644*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
645*ba7319e9SDmitry Salychev			return (DPAA2_CMD_BP_CLOSE(
646*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
647*ba7319e9SDmitry Salychev		return (ENXIO);
648*ba7319e9SDmitry Salychev	}
649*ba7319e9SDmitry Salychev	static int
650*ba7319e9SDmitry Salychev	bypass_bp_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
651*ba7319e9SDmitry Salychev	{
652*ba7319e9SDmitry Salychev		panic_on_mc(dev);
653*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
654*ba7319e9SDmitry Salychev			return (DPAA2_CMD_BP_ENABLE(
655*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
656*ba7319e9SDmitry Salychev		return (ENXIO);
657*ba7319e9SDmitry Salychev	}
658*ba7319e9SDmitry Salychev	static int
659*ba7319e9SDmitry Salychev	bypass_bp_disable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
660*ba7319e9SDmitry Salychev	{
661*ba7319e9SDmitry Salychev		panic_on_mc(dev);
662*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
663*ba7319e9SDmitry Salychev			return (DPAA2_CMD_BP_DISABLE(
664*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
665*ba7319e9SDmitry Salychev		return (ENXIO);
666*ba7319e9SDmitry Salychev	}
667*ba7319e9SDmitry Salychev	static int
668*ba7319e9SDmitry Salychev	bypass_bp_reset(device_t dev, device_t child, struct dpaa2_cmd *cmd)
669*ba7319e9SDmitry Salychev	{
670*ba7319e9SDmitry Salychev		panic_on_mc(dev);
671*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
672*ba7319e9SDmitry Salychev			return (DPAA2_CMD_BP_RESET(
673*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
674*ba7319e9SDmitry Salychev		return (ENXIO);
675*ba7319e9SDmitry Salychev	}
676*ba7319e9SDmitry Salychev	static int
677*ba7319e9SDmitry Salychev	bypass_bp_get_attributes(device_t dev, device_t child, struct dpaa2_cmd *cmd,
678*ba7319e9SDmitry Salychev		struct dpaa2_bp_attr *attr)
679*ba7319e9SDmitry Salychev	{
680*ba7319e9SDmitry Salychev		panic_on_mc(dev);
681*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
682*ba7319e9SDmitry Salychev			return (DPAA2_CMD_BP_GET_ATTRIBUTES(
683*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, attr));
684*ba7319e9SDmitry Salychev		return (ENXIO);
685*ba7319e9SDmitry Salychev	}
686*ba7319e9SDmitry Salychev
687*ba7319e9SDmitry Salychev	static int
688*ba7319e9SDmitry Salychev	bypass_mac_open(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t dpmac_id,
689*ba7319e9SDmitry Salychev		uint16_t *token)
690*ba7319e9SDmitry Salychev	{
691*ba7319e9SDmitry Salychev		panic_on_mc(dev);
692*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
693*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_OPEN(
694*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpmac_id, token));
695*ba7319e9SDmitry Salychev		return (ENXIO);
696*ba7319e9SDmitry Salychev	}
697*ba7319e9SDmitry Salychev	static int
698*ba7319e9SDmitry Salychev	bypass_mac_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
699*ba7319e9SDmitry Salychev	{
700*ba7319e9SDmitry Salychev		panic_on_mc(dev);
701*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
702*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_CLOSE(
703*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
704*ba7319e9SDmitry Salychev		return (ENXIO);
705*ba7319e9SDmitry Salychev	}
706*ba7319e9SDmitry Salychev	static int
707*ba7319e9SDmitry Salychev	bypass_mac_reset(device_t dev, device_t child, struct dpaa2_cmd *cmd)
708*ba7319e9SDmitry Salychev	{
709*ba7319e9SDmitry Salychev		panic_on_mc(dev);
710*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
711*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_RESET(
712*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
713*ba7319e9SDmitry Salychev		return (ENXIO);
714*ba7319e9SDmitry Salychev	}
715*ba7319e9SDmitry Salychev	static int
716*ba7319e9SDmitry Salychev	bypass_mac_mdio_read(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint8_t phy,
717*ba7319e9SDmitry Salychev		uint16_t reg, uint16_t *val)
718*ba7319e9SDmitry Salychev	{
719*ba7319e9SDmitry Salychev		panic_on_mc(dev);
720*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
721*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_MDIO_READ(
722*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, phy, reg, val));
723*ba7319e9SDmitry Salychev		return (ENXIO);
724*ba7319e9SDmitry Salychev	}
725*ba7319e9SDmitry Salychev	static int
726*ba7319e9SDmitry Salychev	bypass_mac_mdio_write(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint8_t phy,
727*ba7319e9SDmitry Salychev		uint16_t reg, uint16_t val)
728*ba7319e9SDmitry Salychev	{
729*ba7319e9SDmitry Salychev		panic_on_mc(dev);
730*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
731*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_MDIO_WRITE(
732*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, phy, reg, val));
733*ba7319e9SDmitry Salychev		return (ENXIO);
734*ba7319e9SDmitry Salychev	}
735*ba7319e9SDmitry Salychev	static int
736*ba7319e9SDmitry Salychev	bypass_mac_get_addr(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint8_t *mac)
737*ba7319e9SDmitry Salychev	{
738*ba7319e9SDmitry Salychev		panic_on_mc(dev);
739*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
740*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_GET_ADDR(
741*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, mac));
742*ba7319e9SDmitry Salychev		return (ENXIO);
743*ba7319e9SDmitry Salychev	}
744*ba7319e9SDmitry Salychev	static int
745*ba7319e9SDmitry Salychev	bypass_mac_get_attributes(device_t dev, device_t child, struct dpaa2_cmd *cmd,
746*ba7319e9SDmitry Salychev		struct dpaa2_mac_attr *attr)
747*ba7319e9SDmitry Salychev	{
748*ba7319e9SDmitry Salychev		panic_on_mc(dev);
749*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
750*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_GET_ATTRIBUTES(
751*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, attr));
752*ba7319e9SDmitry Salychev		return (ENXIO);
753*ba7319e9SDmitry Salychev	}
754*ba7319e9SDmitry Salychev	static int
755*ba7319e9SDmitry Salychev	bypass_mac_set_link_state(device_t dev, device_t child, struct dpaa2_cmd *cmd,
756*ba7319e9SDmitry Salychev		struct dpaa2_mac_link_state *state)
757*ba7319e9SDmitry Salychev	{
758*ba7319e9SDmitry Salychev		panic_on_mc(dev);
759*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
760*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_SET_LINK_STATE(
761*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, state));
762*ba7319e9SDmitry Salychev		return (ENXIO);
763*ba7319e9SDmitry Salychev	}
764*ba7319e9SDmitry Salychev	static int
765*ba7319e9SDmitry Salychev	bypass_mac_set_irq_mask(device_t dev, device_t child, struct dpaa2_cmd *cmd,
766*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint32_t mask)
767*ba7319e9SDmitry Salychev	{
768*ba7319e9SDmitry Salychev		panic_on_mc(dev);
769*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
770*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_SET_IRQ_MASK(
771*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, mask));
772*ba7319e9SDmitry Salychev		return (ENXIO);
773*ba7319e9SDmitry Salychev	}
774*ba7319e9SDmitry Salychev	static int
775*ba7319e9SDmitry Salychev	bypass_mac_set_irq_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd,
776*ba7319e9SDmitry Salychev		uint8_t irq_idx, bool en)
777*ba7319e9SDmitry Salychev	{
778*ba7319e9SDmitry Salychev		panic_on_mc(dev);
779*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
780*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_SET_IRQ_ENABLE(
781*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, en));
782*ba7319e9SDmitry Salychev		return (ENXIO);
783*ba7319e9SDmitry Salychev	}
784*ba7319e9SDmitry Salychev	static int
785*ba7319e9SDmitry Salychev	bypass_mac_get_irq_status(device_t dev, device_t child, struct dpaa2_cmd *cmd,
786*ba7319e9SDmitry Salychev		uint8_t irq_idx, uint32_t *status)
787*ba7319e9SDmitry Salychev	{
788*ba7319e9SDmitry Salychev		panic_on_mc(dev);
789*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
790*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MAC_GET_IRQ_STATUS(
791*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, irq_idx, status));
792*ba7319e9SDmitry Salychev		return (ENXIO);
793*ba7319e9SDmitry Salychev	}
794*ba7319e9SDmitry Salychev
795*ba7319e9SDmitry Salychev	static int
796*ba7319e9SDmitry Salychev	bypass_con_open(device_t dev, device_t child, struct dpaa2_cmd *cmd, uint32_t dpcon_id,
797*ba7319e9SDmitry Salychev		uint16_t *token)
798*ba7319e9SDmitry Salychev	{
799*ba7319e9SDmitry Salychev		panic_on_mc(dev);
800*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
801*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_OPEN(
802*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpcon_id, token));
803*ba7319e9SDmitry Salychev		return (ENXIO);
804*ba7319e9SDmitry Salychev	}
805*ba7319e9SDmitry Salychev	static int
806*ba7319e9SDmitry Salychev	bypass_con_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
807*ba7319e9SDmitry Salychev	{
808*ba7319e9SDmitry Salychev		panic_on_mc(dev);
809*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
810*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_CLOSE(
811*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
812*ba7319e9SDmitry Salychev		return (ENXIO);
813*ba7319e9SDmitry Salychev	}
814*ba7319e9SDmitry Salychev	static int
815*ba7319e9SDmitry Salychev	bypass_con_reset(device_t dev, device_t child, struct dpaa2_cmd *cmd)
816*ba7319e9SDmitry Salychev	{
817*ba7319e9SDmitry Salychev		panic_on_mc(dev);
818*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
819*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_RESET(
820*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
821*ba7319e9SDmitry Salychev		return (ENXIO);
822*ba7319e9SDmitry Salychev	}
823*ba7319e9SDmitry Salychev	static int
824*ba7319e9SDmitry Salychev	bypass_con_enable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
825*ba7319e9SDmitry Salychev	{
826*ba7319e9SDmitry Salychev		panic_on_mc(dev);
827*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
828*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_ENABLE(
829*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
830*ba7319e9SDmitry Salychev		return (ENXIO);
831*ba7319e9SDmitry Salychev	}
832*ba7319e9SDmitry Salychev	static int
833*ba7319e9SDmitry Salychev	bypass_con_disable(device_t dev, device_t child, struct dpaa2_cmd *cmd)
834*ba7319e9SDmitry Salychev	{
835*ba7319e9SDmitry Salychev		panic_on_mc(dev);
836*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
837*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_DISABLE(
838*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
839*ba7319e9SDmitry Salychev		return (ENXIO);
840*ba7319e9SDmitry Salychev	}
841*ba7319e9SDmitry Salychev	static int
842*ba7319e9SDmitry Salychev	bypass_con_get_attributes(device_t dev, device_t child, struct dpaa2_cmd *cmd,
843*ba7319e9SDmitry Salychev		struct dpaa2_con_attr *attr)
844*ba7319e9SDmitry Salychev	{
845*ba7319e9SDmitry Salychev		panic_on_mc(dev);
846*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
847*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_GET_ATTRIBUTES(
848*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, attr));
849*ba7319e9SDmitry Salychev		return (ENXIO);
850*ba7319e9SDmitry Salychev	}
851*ba7319e9SDmitry Salychev	static int
852*ba7319e9SDmitry Salychev	bypass_con_set_notif(device_t dev, device_t child, struct dpaa2_cmd *cmd,
853*ba7319e9SDmitry Salychev		struct dpaa2_con_notif_cfg *cfg)
854*ba7319e9SDmitry Salychev	{
855*ba7319e9SDmitry Salychev		panic_on_mc(dev);
856*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
857*ba7319e9SDmitry Salychev			return (DPAA2_CMD_CON_SET_NOTIF(
858*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, cfg));
859*ba7319e9SDmitry Salychev		return (ENXIO);
860*ba7319e9SDmitry Salychev	}
861*ba7319e9SDmitry Salychev
862*ba7319e9SDmitry Salychev	/* Data Path MC Portal (DPMCP) commands. */
863*ba7319e9SDmitry Salychev
864*ba7319e9SDmitry Salychev	static int
865*ba7319e9SDmitry Salychev	bypass_mcp_create(device_t dev, device_t child, struct dpaa2_cmd *cmd,
866*ba7319e9SDmitry Salychev		uint32_t portal_id, uint32_t options, uint32_t *dpmcp_id)
867*ba7319e9SDmitry Salychev	{
868*ba7319e9SDmitry Salychev		panic_on_mc(dev);
869*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
870*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MCP_CREATE(
871*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, portal_id,
872*ba7319e9SDmitry Salychev				options, dpmcp_id));
873*ba7319e9SDmitry Salychev		return (ENXIO);
874*ba7319e9SDmitry Salychev	}
875*ba7319e9SDmitry Salychev	static int
876*ba7319e9SDmitry Salychev	bypass_mcp_destroy(device_t dev, device_t child, struct dpaa2_cmd *cmd,
877*ba7319e9SDmitry Salychev		uint32_t dpmcp_id)
878*ba7319e9SDmitry Salychev	{
879*ba7319e9SDmitry Salychev		panic_on_mc(dev);
880*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
881*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MCP_DESTROY(
882*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpmcp_id));
883*ba7319e9SDmitry Salychev		return (ENXIO);
884*ba7319e9SDmitry Salychev	}
885*ba7319e9SDmitry Salychev	static int
886*ba7319e9SDmitry Salychev	bypass_mcp_open(device_t dev, device_t child, struct dpaa2_cmd *cmd,
887*ba7319e9SDmitry Salychev		uint32_t dpmcp_id, uint16_t *token)
888*ba7319e9SDmitry Salychev	{
889*ba7319e9SDmitry Salychev		panic_on_mc(dev);
890*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
891*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MCP_OPEN(
892*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd, dpmcp_id,
893*ba7319e9SDmitry Salychev				token));
894*ba7319e9SDmitry Salychev		return (ENXIO);
895*ba7319e9SDmitry Salychev	}
896*ba7319e9SDmitry Salychev	static int
897*ba7319e9SDmitry Salychev	bypass_mcp_close(device_t dev, device_t child, struct dpaa2_cmd *cmd)
898*ba7319e9SDmitry Salychev	{
899*ba7319e9SDmitry Salychev		panic_on_mc(dev);
900*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
901*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MCP_CLOSE(
902*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
903*ba7319e9SDmitry Salychev		return (ENXIO);
904*ba7319e9SDmitry Salychev	}
905*ba7319e9SDmitry Salychev	static int
906*ba7319e9SDmitry Salychev	bypass_mcp_reset(device_t dev, device_t child, struct dpaa2_cmd *cmd)
907*ba7319e9SDmitry Salychev	{
908*ba7319e9SDmitry Salychev		panic_on_mc(dev);
909*ba7319e9SDmitry Salychev		if (device_get_parent(dev) != NULL)
910*ba7319e9SDmitry Salychev			return (DPAA2_CMD_MCP_RESET(
911*ba7319e9SDmitry Salychev				device_get_parent(dev), child, cmd));
912*ba7319e9SDmitry Salychev		return (ENXIO);
913*ba7319e9SDmitry Salychev	}
914*ba7319e9SDmitry Salychev};
915*ba7319e9SDmitry Salychev
916*ba7319e9SDmitry Salychev/**
917*ba7319e9SDmitry Salychev * @brief Data Path Management (DPMNG) commands.
918*ba7319e9SDmitry Salychev */
919*ba7319e9SDmitry Salychev
920*ba7319e9SDmitry SalychevMETHOD int mng_get_version {
921*ba7319e9SDmitry Salychev	device_t	 dev;
922*ba7319e9SDmitry Salychev	device_t	 child;
923*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
924*ba7319e9SDmitry Salychev	uint32_t	*major;
925*ba7319e9SDmitry Salychev	uint32_t	*minor;
926*ba7319e9SDmitry Salychev	uint32_t	*rev;
927*ba7319e9SDmitry Salychev} DEFAULT bypass_mng_get_version;
928*ba7319e9SDmitry Salychev
929*ba7319e9SDmitry SalychevMETHOD int mng_get_soc_version {
930*ba7319e9SDmitry Salychev	device_t	 dev;
931*ba7319e9SDmitry Salychev	device_t	 child;
932*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
933*ba7319e9SDmitry Salychev	uint32_t	*pvr;
934*ba7319e9SDmitry Salychev	uint32_t	*svr;
935*ba7319e9SDmitry Salychev} DEFAULT bypass_mng_get_soc_version;
936*ba7319e9SDmitry Salychev
937*ba7319e9SDmitry SalychevMETHOD int mng_get_container_id {
938*ba7319e9SDmitry Salychev	device_t	 dev;
939*ba7319e9SDmitry Salychev	device_t	 child;
940*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
941*ba7319e9SDmitry Salychev	uint32_t	*cont_id;
942*ba7319e9SDmitry Salychev} DEFAULT bypass_mng_get_container_id;
943*ba7319e9SDmitry Salychev
944*ba7319e9SDmitry Salychev/**
945*ba7319e9SDmitry Salychev * @brief Data Path Resource Containter (DPRC) commands.
946*ba7319e9SDmitry Salychev */
947*ba7319e9SDmitry Salychev
948*ba7319e9SDmitry SalychevMETHOD int rc_open {
949*ba7319e9SDmitry Salychev	device_t	 dev;
950*ba7319e9SDmitry Salychev	device_t	 child;
951*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
952*ba7319e9SDmitry Salychev	uint32_t	 cont_id;
953*ba7319e9SDmitry Salychev	uint16_t	*token;
954*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_open;
955*ba7319e9SDmitry Salychev
956*ba7319e9SDmitry SalychevMETHOD int rc_close {
957*ba7319e9SDmitry Salychev	device_t	 dev;
958*ba7319e9SDmitry Salychev	device_t	 child;
959*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
960*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_close;
961*ba7319e9SDmitry Salychev
962*ba7319e9SDmitry SalychevMETHOD int rc_get_obj_count {
963*ba7319e9SDmitry Salychev	device_t	 dev;
964*ba7319e9SDmitry Salychev	device_t	 child;
965*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
966*ba7319e9SDmitry Salychev	uint32_t	*obj_count;
967*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_obj_count;
968*ba7319e9SDmitry Salychev
969*ba7319e9SDmitry SalychevMETHOD int rc_get_obj {
970*ba7319e9SDmitry Salychev	device_t	 dev;
971*ba7319e9SDmitry Salychev	device_t	 child;
972*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
973*ba7319e9SDmitry Salychev	uint32_t	 obj_idx;
974*ba7319e9SDmitry Salychev	struct dpaa2_obj *obj;
975*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_obj;
976*ba7319e9SDmitry Salychev
977*ba7319e9SDmitry SalychevMETHOD int rc_get_obj_descriptor {
978*ba7319e9SDmitry Salychev	device_t	 dev;
979*ba7319e9SDmitry Salychev	device_t	 child;
980*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
981*ba7319e9SDmitry Salychev	uint32_t	 obj_id;
982*ba7319e9SDmitry Salychev	enum dpaa2_dev_type type;
983*ba7319e9SDmitry Salychev	struct dpaa2_obj *obj;
984*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_obj_descriptor;
985*ba7319e9SDmitry Salychev
986*ba7319e9SDmitry SalychevMETHOD int rc_get_attributes {
987*ba7319e9SDmitry Salychev	device_t	 dev;
988*ba7319e9SDmitry Salychev	device_t	 child;
989*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
990*ba7319e9SDmitry Salychev	struct dpaa2_rc_attr *attr;
991*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_attributes;
992*ba7319e9SDmitry Salychev
993*ba7319e9SDmitry SalychevMETHOD int rc_get_obj_region {
994*ba7319e9SDmitry Salychev	device_t	 dev;
995*ba7319e9SDmitry Salychev	device_t	 child;
996*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
997*ba7319e9SDmitry Salychev	uint32_t	 obj_id;
998*ba7319e9SDmitry Salychev	uint8_t		 reg_idx;
999*ba7319e9SDmitry Salychev	enum dpaa2_dev_type type;
1000*ba7319e9SDmitry Salychev	struct dpaa2_rc_obj_region *reg;
1001*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_obj_region;
1002*ba7319e9SDmitry Salychev
1003*ba7319e9SDmitry SalychevMETHOD int rc_get_api_version {
1004*ba7319e9SDmitry Salychev	device_t	 dev;
1005*ba7319e9SDmitry Salychev	device_t	 child;
1006*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1007*ba7319e9SDmitry Salychev	uint16_t	*major;
1008*ba7319e9SDmitry Salychev	uint16_t	*minor;
1009*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_api_version;
1010*ba7319e9SDmitry Salychev
1011*ba7319e9SDmitry SalychevMETHOD int rc_set_irq_enable {
1012*ba7319e9SDmitry Salychev	device_t	 dev;
1013*ba7319e9SDmitry Salychev	device_t	 child;
1014*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1015*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1016*ba7319e9SDmitry Salychev	uint8_t		 enable;
1017*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_set_irq_enable;
1018*ba7319e9SDmitry Salychev
1019*ba7319e9SDmitry SalychevMETHOD int rc_set_obj_irq {
1020*ba7319e9SDmitry Salychev	device_t	 dev;
1021*ba7319e9SDmitry Salychev	device_t	 child;
1022*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1023*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1024*ba7319e9SDmitry Salychev	uint64_t	 addr;
1025*ba7319e9SDmitry Salychev	uint32_t	 data;
1026*ba7319e9SDmitry Salychev	uint32_t	 irq_usr;
1027*ba7319e9SDmitry Salychev	uint32_t	 obj_id;
1028*ba7319e9SDmitry Salychev	enum dpaa2_dev_type type;
1029*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_set_obj_irq;
1030*ba7319e9SDmitry Salychev
1031*ba7319e9SDmitry SalychevMETHOD int rc_get_conn {
1032*ba7319e9SDmitry Salychev	device_t	 dev;
1033*ba7319e9SDmitry Salychev	device_t	 child;
1034*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1035*ba7319e9SDmitry Salychev	struct dpaa2_ep_desc *ep1_desc;
1036*ba7319e9SDmitry Salychev	struct dpaa2_ep_desc *ep2_desc;
1037*ba7319e9SDmitry Salychev	uint32_t	*link_stat;
1038*ba7319e9SDmitry Salychev} DEFAULT bypass_rc_get_conn;
1039*ba7319e9SDmitry Salychev
1040*ba7319e9SDmitry Salychev/**
1041*ba7319e9SDmitry Salychev * @brief Data Path Network Interface (DPNI) commands.
1042*ba7319e9SDmitry Salychev */
1043*ba7319e9SDmitry Salychev
1044*ba7319e9SDmitry SalychevMETHOD int ni_open {
1045*ba7319e9SDmitry Salychev	device_t	 dev;
1046*ba7319e9SDmitry Salychev	device_t	 child;
1047*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1048*ba7319e9SDmitry Salychev	uint32_t	 dpni_id;
1049*ba7319e9SDmitry Salychev	uint16_t	*token;
1050*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_open;
1051*ba7319e9SDmitry Salychev
1052*ba7319e9SDmitry SalychevMETHOD int ni_close {
1053*ba7319e9SDmitry Salychev	device_t	 dev;
1054*ba7319e9SDmitry Salychev	device_t	 child;
1055*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1056*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_close;
1057*ba7319e9SDmitry Salychev
1058*ba7319e9SDmitry SalychevMETHOD int ni_enable {
1059*ba7319e9SDmitry Salychev	device_t	 dev;
1060*ba7319e9SDmitry Salychev	device_t	 child;
1061*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1062*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_enable;
1063*ba7319e9SDmitry Salychev
1064*ba7319e9SDmitry SalychevMETHOD int ni_disable {
1065*ba7319e9SDmitry Salychev	device_t	 dev;
1066*ba7319e9SDmitry Salychev	device_t	 child;
1067*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1068*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_disable;
1069*ba7319e9SDmitry Salychev
1070*ba7319e9SDmitry SalychevMETHOD int ni_get_api_version {
1071*ba7319e9SDmitry Salychev	device_t	 dev;
1072*ba7319e9SDmitry Salychev	device_t	 child;
1073*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1074*ba7319e9SDmitry Salychev	uint16_t	*major;
1075*ba7319e9SDmitry Salychev	uint16_t	*minor;
1076*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_api_version;
1077*ba7319e9SDmitry Salychev
1078*ba7319e9SDmitry SalychevMETHOD int ni_reset {
1079*ba7319e9SDmitry Salychev	device_t	 dev;
1080*ba7319e9SDmitry Salychev	device_t	 child;
1081*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1082*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_reset;
1083*ba7319e9SDmitry Salychev
1084*ba7319e9SDmitry SalychevMETHOD int ni_get_attributes {
1085*ba7319e9SDmitry Salychev	device_t	 dev;
1086*ba7319e9SDmitry Salychev	device_t	 child;
1087*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1088*ba7319e9SDmitry Salychev	struct dpaa2_ni_attr *attr;
1089*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_attributes;
1090*ba7319e9SDmitry Salychev
1091*ba7319e9SDmitry SalychevMETHOD int ni_set_buf_layout {
1092*ba7319e9SDmitry Salychev	device_t	 dev;
1093*ba7319e9SDmitry Salychev	device_t	 child;
1094*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1095*ba7319e9SDmitry Salychev	struct dpaa2_ni_buf_layout *bl;
1096*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_buf_layout;
1097*ba7319e9SDmitry Salychev
1098*ba7319e9SDmitry SalychevMETHOD int ni_get_tx_data_off {
1099*ba7319e9SDmitry Salychev	device_t	 dev;
1100*ba7319e9SDmitry Salychev	device_t	 child;
1101*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1102*ba7319e9SDmitry Salychev	uint16_t	*offset;
1103*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_tx_data_off;
1104*ba7319e9SDmitry Salychev
1105*ba7319e9SDmitry SalychevMETHOD int ni_set_link_cfg {
1106*ba7319e9SDmitry Salychev	device_t	 dev;
1107*ba7319e9SDmitry Salychev	device_t	 child;
1108*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1109*ba7319e9SDmitry Salychev	struct dpaa2_ni_link_cfg *cfg;
1110*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_link_cfg;
1111*ba7319e9SDmitry Salychev
1112*ba7319e9SDmitry SalychevMETHOD int ni_get_link_cfg {
1113*ba7319e9SDmitry Salychev	device_t	 dev;
1114*ba7319e9SDmitry Salychev	device_t	 child;
1115*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1116*ba7319e9SDmitry Salychev	struct dpaa2_ni_link_cfg *cfg;
1117*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_link_cfg;
1118*ba7319e9SDmitry Salychev
1119*ba7319e9SDmitry SalychevMETHOD int ni_get_link_state {
1120*ba7319e9SDmitry Salychev	device_t	 dev;
1121*ba7319e9SDmitry Salychev	device_t	 child;
1122*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1123*ba7319e9SDmitry Salychev	struct dpaa2_ni_link_state *state;
1124*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_link_state;
1125*ba7319e9SDmitry Salychev
1126*ba7319e9SDmitry SalychevMETHOD int ni_get_port_mac_addr {
1127*ba7319e9SDmitry Salychev	device_t	 dev;
1128*ba7319e9SDmitry Salychev	device_t	 child;
1129*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1130*ba7319e9SDmitry Salychev	uint8_t		*mac;
1131*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_port_mac_addr;
1132*ba7319e9SDmitry Salychev
1133*ba7319e9SDmitry SalychevMETHOD int ni_set_prim_mac_addr {
1134*ba7319e9SDmitry Salychev	device_t	 dev;
1135*ba7319e9SDmitry Salychev	device_t	 child;
1136*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1137*ba7319e9SDmitry Salychev	uint8_t		*mac;
1138*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_prim_mac_addr;
1139*ba7319e9SDmitry Salychev
1140*ba7319e9SDmitry SalychevMETHOD int ni_get_prim_mac_addr {
1141*ba7319e9SDmitry Salychev	device_t	 dev;
1142*ba7319e9SDmitry Salychev	device_t	 child;
1143*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1144*ba7319e9SDmitry Salychev	uint8_t		*mac;
1145*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_prim_mac_addr;
1146*ba7319e9SDmitry Salychev
1147*ba7319e9SDmitry SalychevMETHOD int ni_set_qos_table {
1148*ba7319e9SDmitry Salychev	device_t	 dev;
1149*ba7319e9SDmitry Salychev	device_t	 child;
1150*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1151*ba7319e9SDmitry Salychev	struct dpaa2_ni_qos_table *tbl;
1152*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_qos_table;
1153*ba7319e9SDmitry Salychev
1154*ba7319e9SDmitry SalychevMETHOD int ni_clear_qos_table {
1155*ba7319e9SDmitry Salychev	device_t	 dev;
1156*ba7319e9SDmitry Salychev	device_t	 child;
1157*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1158*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_clear_qos_table;
1159*ba7319e9SDmitry Salychev
1160*ba7319e9SDmitry SalychevMETHOD int ni_set_pools {
1161*ba7319e9SDmitry Salychev	device_t	 dev;
1162*ba7319e9SDmitry Salychev	device_t	 child;
1163*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1164*ba7319e9SDmitry Salychev	struct dpaa2_ni_pools_cfg *cfg;
1165*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_pools;
1166*ba7319e9SDmitry Salychev
1167*ba7319e9SDmitry SalychevMETHOD int ni_set_err_behavior {
1168*ba7319e9SDmitry Salychev	device_t	 dev;
1169*ba7319e9SDmitry Salychev	device_t	 child;
1170*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1171*ba7319e9SDmitry Salychev	struct dpaa2_ni_err_cfg *cfg;
1172*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_err_behavior;
1173*ba7319e9SDmitry Salychev
1174*ba7319e9SDmitry SalychevMETHOD int ni_get_queue {
1175*ba7319e9SDmitry Salychev	device_t	 dev;
1176*ba7319e9SDmitry Salychev	device_t	 child;
1177*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1178*ba7319e9SDmitry Salychev	struct dpaa2_ni_queue_cfg *cfg;
1179*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_queue;
1180*ba7319e9SDmitry Salychev
1181*ba7319e9SDmitry SalychevMETHOD int ni_set_queue {
1182*ba7319e9SDmitry Salychev	device_t	 dev;
1183*ba7319e9SDmitry Salychev	device_t	 child;
1184*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1185*ba7319e9SDmitry Salychev	struct dpaa2_ni_queue_cfg *cfg;
1186*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_queue;
1187*ba7319e9SDmitry Salychev
1188*ba7319e9SDmitry SalychevMETHOD int ni_get_qdid {
1189*ba7319e9SDmitry Salychev	device_t	 dev;
1190*ba7319e9SDmitry Salychev	device_t	 child;
1191*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1192*ba7319e9SDmitry Salychev	enum dpaa2_ni_queue_type type;
1193*ba7319e9SDmitry Salychev	uint16_t	*qdid;
1194*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_qdid;
1195*ba7319e9SDmitry Salychev
1196*ba7319e9SDmitry SalychevMETHOD int ni_add_mac_addr {
1197*ba7319e9SDmitry Salychev	device_t	 dev;
1198*ba7319e9SDmitry Salychev	device_t	 child;
1199*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1200*ba7319e9SDmitry Salychev	uint8_t		*mac;
1201*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_add_mac_addr;
1202*ba7319e9SDmitry Salychev
1203*ba7319e9SDmitry SalychevMETHOD int ni_remove_mac_addr {
1204*ba7319e9SDmitry Salychev	device_t	 dev;
1205*ba7319e9SDmitry Salychev	device_t	 child;
1206*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1207*ba7319e9SDmitry Salychev	uint8_t		*mac;
1208*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_remove_mac_addr;
1209*ba7319e9SDmitry Salychev
1210*ba7319e9SDmitry SalychevMETHOD int ni_clear_mac_filters {
1211*ba7319e9SDmitry Salychev	device_t	 dev;
1212*ba7319e9SDmitry Salychev	device_t	 child;
1213*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1214*ba7319e9SDmitry Salychev	bool		 rm_uni;
1215*ba7319e9SDmitry Salychev	bool		 rm_multi;
1216*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_clear_mac_filters;
1217*ba7319e9SDmitry Salychev
1218*ba7319e9SDmitry SalychevMETHOD int ni_set_mfl {
1219*ba7319e9SDmitry Salychev	device_t	 dev;
1220*ba7319e9SDmitry Salychev	device_t	 child;
1221*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1222*ba7319e9SDmitry Salychev	uint16_t	 length;
1223*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_mfl;
1224*ba7319e9SDmitry Salychev
1225*ba7319e9SDmitry SalychevMETHOD int ni_set_offload {
1226*ba7319e9SDmitry Salychev	device_t	 dev;
1227*ba7319e9SDmitry Salychev	device_t	 child;
1228*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1229*ba7319e9SDmitry Salychev	enum dpaa2_ni_ofl_type ofl_type;
1230*ba7319e9SDmitry Salychev	bool		 en;
1231*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_offload;
1232*ba7319e9SDmitry Salychev
1233*ba7319e9SDmitry SalychevMETHOD int ni_set_irq_mask {
1234*ba7319e9SDmitry Salychev	device_t	 dev;
1235*ba7319e9SDmitry Salychev	device_t	 child;
1236*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1237*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1238*ba7319e9SDmitry Salychev	uint32_t	 mask;
1239*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_irq_mask;
1240*ba7319e9SDmitry Salychev
1241*ba7319e9SDmitry SalychevMETHOD int ni_set_irq_enable {
1242*ba7319e9SDmitry Salychev	device_t	 dev;
1243*ba7319e9SDmitry Salychev	device_t	 child;
1244*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1245*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1246*ba7319e9SDmitry Salychev	bool		 en;
1247*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_irq_enable;
1248*ba7319e9SDmitry Salychev
1249*ba7319e9SDmitry SalychevMETHOD int ni_get_irq_status {
1250*ba7319e9SDmitry Salychev	device_t	 dev;
1251*ba7319e9SDmitry Salychev	device_t	 child;
1252*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1253*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1254*ba7319e9SDmitry Salychev	uint32_t	*status;
1255*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_irq_status;
1256*ba7319e9SDmitry Salychev
1257*ba7319e9SDmitry SalychevMETHOD int ni_set_uni_promisc {
1258*ba7319e9SDmitry Salychev	device_t	 dev;
1259*ba7319e9SDmitry Salychev	device_t	 child;
1260*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1261*ba7319e9SDmitry Salychev	bool		 en;
1262*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_uni_promisc;
1263*ba7319e9SDmitry Salychev
1264*ba7319e9SDmitry SalychevMETHOD int ni_set_multi_promisc {
1265*ba7319e9SDmitry Salychev	device_t	 dev;
1266*ba7319e9SDmitry Salychev	device_t	 child;
1267*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1268*ba7319e9SDmitry Salychev	bool		 en;
1269*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_multi_promisc;
1270*ba7319e9SDmitry Salychev
1271*ba7319e9SDmitry SalychevMETHOD int ni_get_statistics {
1272*ba7319e9SDmitry Salychev	device_t	 dev;
1273*ba7319e9SDmitry Salychev	device_t	 child;
1274*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1275*ba7319e9SDmitry Salychev	uint8_t		 page;
1276*ba7319e9SDmitry Salychev	uint16_t	 param;
1277*ba7319e9SDmitry Salychev	uint64_t	*cnt;
1278*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_get_statistics;
1279*ba7319e9SDmitry Salychev
1280*ba7319e9SDmitry SalychevMETHOD int ni_set_rx_tc_dist {
1281*ba7319e9SDmitry Salychev	device_t	 dev;
1282*ba7319e9SDmitry Salychev	device_t	 child;
1283*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1284*ba7319e9SDmitry Salychev	uint16_t	 dist_size;
1285*ba7319e9SDmitry Salychev	uint8_t		 tc;
1286*ba7319e9SDmitry Salychev	enum dpaa2_ni_dist_mode dist_mode;
1287*ba7319e9SDmitry Salychev	bus_addr_t	 key_cfg_buf;
1288*ba7319e9SDmitry Salychev} DEFAULT bypass_ni_set_rx_tc_dist;
1289*ba7319e9SDmitry Salychev
1290*ba7319e9SDmitry Salychev/**
1291*ba7319e9SDmitry Salychev * @brief Data Path I/O (DPIO) commands.
1292*ba7319e9SDmitry Salychev */
1293*ba7319e9SDmitry Salychev
1294*ba7319e9SDmitry SalychevMETHOD int io_open {
1295*ba7319e9SDmitry Salychev	device_t	 dev;
1296*ba7319e9SDmitry Salychev	device_t	 child;
1297*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1298*ba7319e9SDmitry Salychev	uint32_t	 dpio_id;
1299*ba7319e9SDmitry Salychev	uint16_t	*token;
1300*ba7319e9SDmitry Salychev} DEFAULT bypass_io_open;
1301*ba7319e9SDmitry Salychev
1302*ba7319e9SDmitry SalychevMETHOD int io_close {
1303*ba7319e9SDmitry Salychev	device_t	 dev;
1304*ba7319e9SDmitry Salychev	device_t	 child;
1305*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1306*ba7319e9SDmitry Salychev} DEFAULT bypass_io_close;
1307*ba7319e9SDmitry Salychev
1308*ba7319e9SDmitry SalychevMETHOD int io_enable {
1309*ba7319e9SDmitry Salychev	device_t	 dev;
1310*ba7319e9SDmitry Salychev	device_t	 child;
1311*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1312*ba7319e9SDmitry Salychev} DEFAULT bypass_io_enable;
1313*ba7319e9SDmitry Salychev
1314*ba7319e9SDmitry SalychevMETHOD int io_disable {
1315*ba7319e9SDmitry Salychev	device_t	 dev;
1316*ba7319e9SDmitry Salychev	device_t	 child;
1317*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1318*ba7319e9SDmitry Salychev} DEFAULT bypass_io_disable;
1319*ba7319e9SDmitry Salychev
1320*ba7319e9SDmitry SalychevMETHOD int io_reset {
1321*ba7319e9SDmitry Salychev	device_t	 dev;
1322*ba7319e9SDmitry Salychev	device_t	 child;
1323*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1324*ba7319e9SDmitry Salychev} DEFAULT bypass_io_reset;
1325*ba7319e9SDmitry Salychev
1326*ba7319e9SDmitry SalychevMETHOD int io_get_attributes {
1327*ba7319e9SDmitry Salychev	device_t	 dev;
1328*ba7319e9SDmitry Salychev	device_t	 child;
1329*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1330*ba7319e9SDmitry Salychev	struct dpaa2_io_attr *attr;
1331*ba7319e9SDmitry Salychev} DEFAULT bypass_io_get_attributes;
1332*ba7319e9SDmitry Salychev
1333*ba7319e9SDmitry SalychevMETHOD int io_set_irq_mask {
1334*ba7319e9SDmitry Salychev	device_t	 dev;
1335*ba7319e9SDmitry Salychev	device_t	 child;
1336*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1337*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1338*ba7319e9SDmitry Salychev	uint32_t	 mask;
1339*ba7319e9SDmitry Salychev} DEFAULT bypass_io_set_irq_mask;
1340*ba7319e9SDmitry Salychev
1341*ba7319e9SDmitry SalychevMETHOD int io_get_irq_status {
1342*ba7319e9SDmitry Salychev	device_t	 dev;
1343*ba7319e9SDmitry Salychev	device_t	 child;
1344*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1345*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1346*ba7319e9SDmitry Salychev	uint32_t	*status;
1347*ba7319e9SDmitry Salychev} DEFAULT bypass_io_get_irq_status;
1348*ba7319e9SDmitry Salychev
1349*ba7319e9SDmitry SalychevMETHOD int io_set_irq_enable {
1350*ba7319e9SDmitry Salychev	device_t	 dev;
1351*ba7319e9SDmitry Salychev	device_t	 child;
1352*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1353*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1354*ba7319e9SDmitry Salychev	bool		 en;
1355*ba7319e9SDmitry Salychev} DEFAULT bypass_io_set_irq_enable;
1356*ba7319e9SDmitry Salychev
1357*ba7319e9SDmitry SalychevMETHOD int io_add_static_dq_chan {
1358*ba7319e9SDmitry Salychev	device_t	 dev;
1359*ba7319e9SDmitry Salychev	device_t	 child;
1360*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1361*ba7319e9SDmitry Salychev	uint32_t	 dpcon_id;
1362*ba7319e9SDmitry Salychev	uint8_t		*chan_idx;
1363*ba7319e9SDmitry Salychev} DEFAULT bypass_io_add_static_dq_chan;
1364*ba7319e9SDmitry Salychev
1365*ba7319e9SDmitry Salychev/**
1366*ba7319e9SDmitry Salychev * @brief Data Path Buffer Pool (DPBP) commands.
1367*ba7319e9SDmitry Salychev */
1368*ba7319e9SDmitry Salychev
1369*ba7319e9SDmitry SalychevMETHOD int bp_open {
1370*ba7319e9SDmitry Salychev	device_t	 dev;
1371*ba7319e9SDmitry Salychev	device_t	 child;
1372*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1373*ba7319e9SDmitry Salychev	uint32_t	 dpbp_id;
1374*ba7319e9SDmitry Salychev	uint16_t	*token;
1375*ba7319e9SDmitry Salychev} DEFAULT bypass_bp_open;
1376*ba7319e9SDmitry Salychev
1377*ba7319e9SDmitry SalychevMETHOD int bp_close {
1378*ba7319e9SDmitry Salychev	device_t	 dev;
1379*ba7319e9SDmitry Salychev	device_t	 child;
1380*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1381*ba7319e9SDmitry Salychev} DEFAULT bypass_bp_close;
1382*ba7319e9SDmitry Salychev
1383*ba7319e9SDmitry SalychevMETHOD int bp_enable {
1384*ba7319e9SDmitry Salychev	device_t	 dev;
1385*ba7319e9SDmitry Salychev	device_t	 child;
1386*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1387*ba7319e9SDmitry Salychev} DEFAULT bypass_bp_enable;
1388*ba7319e9SDmitry Salychev
1389*ba7319e9SDmitry SalychevMETHOD int bp_disable {
1390*ba7319e9SDmitry Salychev	device_t	 dev;
1391*ba7319e9SDmitry Salychev	device_t	 child;
1392*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1393*ba7319e9SDmitry Salychev} DEFAULT bypass_bp_disable;
1394*ba7319e9SDmitry Salychev
1395*ba7319e9SDmitry SalychevMETHOD int bp_reset {
1396*ba7319e9SDmitry Salychev	device_t	 dev;
1397*ba7319e9SDmitry Salychev	device_t	 child;
1398*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1399*ba7319e9SDmitry Salychev} DEFAULT bypass_bp_reset;
1400*ba7319e9SDmitry Salychev
1401*ba7319e9SDmitry SalychevMETHOD int bp_get_attributes {
1402*ba7319e9SDmitry Salychev	device_t	 dev;
1403*ba7319e9SDmitry Salychev	device_t	 child;
1404*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1405*ba7319e9SDmitry Salychev	struct dpaa2_bp_attr *attr;
1406*ba7319e9SDmitry Salychev} DEFAULT bypass_bp_get_attributes;
1407*ba7319e9SDmitry Salychev
1408*ba7319e9SDmitry Salychev/**
1409*ba7319e9SDmitry Salychev * @brief Data Path MAC (DPMAC) commands.
1410*ba7319e9SDmitry Salychev */
1411*ba7319e9SDmitry Salychev
1412*ba7319e9SDmitry SalychevMETHOD int mac_open {
1413*ba7319e9SDmitry Salychev	device_t	 dev;
1414*ba7319e9SDmitry Salychev	device_t	 child;
1415*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1416*ba7319e9SDmitry Salychev	uint32_t	 dpmac_id;
1417*ba7319e9SDmitry Salychev	uint16_t	*token;
1418*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_open;
1419*ba7319e9SDmitry Salychev
1420*ba7319e9SDmitry SalychevMETHOD int mac_close {
1421*ba7319e9SDmitry Salychev	device_t	 dev;
1422*ba7319e9SDmitry Salychev	device_t	 child;
1423*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1424*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_close;
1425*ba7319e9SDmitry Salychev
1426*ba7319e9SDmitry SalychevMETHOD int mac_reset {
1427*ba7319e9SDmitry Salychev	device_t	 dev;
1428*ba7319e9SDmitry Salychev	device_t	 child;
1429*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1430*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_reset;
1431*ba7319e9SDmitry Salychev
1432*ba7319e9SDmitry SalychevMETHOD int mac_mdio_read {
1433*ba7319e9SDmitry Salychev	device_t	 dev;
1434*ba7319e9SDmitry Salychev	device_t	 child;
1435*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1436*ba7319e9SDmitry Salychev	uint8_t		 phy;
1437*ba7319e9SDmitry Salychev	uint16_t	 reg;
1438*ba7319e9SDmitry Salychev	uint16_t	*val;
1439*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_mdio_read;
1440*ba7319e9SDmitry Salychev
1441*ba7319e9SDmitry SalychevMETHOD int mac_mdio_write {
1442*ba7319e9SDmitry Salychev	device_t	 dev;
1443*ba7319e9SDmitry Salychev	device_t	 child;
1444*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1445*ba7319e9SDmitry Salychev	uint8_t		 phy;
1446*ba7319e9SDmitry Salychev	uint16_t	 reg;
1447*ba7319e9SDmitry Salychev	uint16_t	 val;
1448*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_mdio_write;
1449*ba7319e9SDmitry Salychev
1450*ba7319e9SDmitry SalychevMETHOD int mac_get_addr {
1451*ba7319e9SDmitry Salychev	device_t	 dev;
1452*ba7319e9SDmitry Salychev	device_t	 child;
1453*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1454*ba7319e9SDmitry Salychev	uint8_t		*mac;
1455*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_get_addr;
1456*ba7319e9SDmitry Salychev
1457*ba7319e9SDmitry SalychevMETHOD int mac_get_attributes {
1458*ba7319e9SDmitry Salychev	device_t	 dev;
1459*ba7319e9SDmitry Salychev	device_t	 child;
1460*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1461*ba7319e9SDmitry Salychev	struct dpaa2_mac_attr *attr;
1462*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_get_attributes;
1463*ba7319e9SDmitry Salychev
1464*ba7319e9SDmitry SalychevMETHOD int mac_set_link_state {
1465*ba7319e9SDmitry Salychev	device_t	 dev;
1466*ba7319e9SDmitry Salychev	device_t	 child;
1467*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1468*ba7319e9SDmitry Salychev	struct dpaa2_mac_link_state *state;
1469*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_set_link_state;
1470*ba7319e9SDmitry Salychev
1471*ba7319e9SDmitry SalychevMETHOD int mac_set_irq_mask {
1472*ba7319e9SDmitry Salychev	device_t	 dev;
1473*ba7319e9SDmitry Salychev	device_t	 child;
1474*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1475*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1476*ba7319e9SDmitry Salychev	uint32_t	 mask;
1477*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_set_irq_mask;
1478*ba7319e9SDmitry Salychev
1479*ba7319e9SDmitry SalychevMETHOD int mac_set_irq_enable {
1480*ba7319e9SDmitry Salychev	device_t	 dev;
1481*ba7319e9SDmitry Salychev	device_t	 child;
1482*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1483*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1484*ba7319e9SDmitry Salychev	bool		 en;
1485*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_set_irq_enable;
1486*ba7319e9SDmitry Salychev
1487*ba7319e9SDmitry SalychevMETHOD int mac_get_irq_status {
1488*ba7319e9SDmitry Salychev	device_t	 dev;
1489*ba7319e9SDmitry Salychev	device_t	 child;
1490*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1491*ba7319e9SDmitry Salychev	uint8_t		 irq_idx;
1492*ba7319e9SDmitry Salychev	uint32_t	*status;
1493*ba7319e9SDmitry Salychev} DEFAULT bypass_mac_get_irq_status;
1494*ba7319e9SDmitry Salychev
1495*ba7319e9SDmitry Salychev/**
1496*ba7319e9SDmitry Salychev * @brief Data Path Concentrator (DPCON) commands.
1497*ba7319e9SDmitry Salychev */
1498*ba7319e9SDmitry Salychev
1499*ba7319e9SDmitry SalychevMETHOD int con_open {
1500*ba7319e9SDmitry Salychev	device_t	 dev;
1501*ba7319e9SDmitry Salychev	device_t	 child;
1502*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1503*ba7319e9SDmitry Salychev	uint32_t	 dpcon_id;
1504*ba7319e9SDmitry Salychev	uint16_t	*token;
1505*ba7319e9SDmitry Salychev} DEFAULT bypass_con_open;
1506*ba7319e9SDmitry Salychev
1507*ba7319e9SDmitry SalychevMETHOD int con_close {
1508*ba7319e9SDmitry Salychev	device_t	 dev;
1509*ba7319e9SDmitry Salychev	device_t	 child;
1510*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1511*ba7319e9SDmitry Salychev} DEFAULT bypass_con_close;
1512*ba7319e9SDmitry Salychev
1513*ba7319e9SDmitry SalychevMETHOD int con_reset {
1514*ba7319e9SDmitry Salychev	device_t	 dev;
1515*ba7319e9SDmitry Salychev	device_t	 child;
1516*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1517*ba7319e9SDmitry Salychev} DEFAULT bypass_con_reset;
1518*ba7319e9SDmitry Salychev
1519*ba7319e9SDmitry SalychevMETHOD int con_enable {
1520*ba7319e9SDmitry Salychev	device_t	 dev;
1521*ba7319e9SDmitry Salychev	device_t	 child;
1522*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1523*ba7319e9SDmitry Salychev} DEFAULT bypass_con_enable;
1524*ba7319e9SDmitry Salychev
1525*ba7319e9SDmitry SalychevMETHOD int con_disable {
1526*ba7319e9SDmitry Salychev	device_t	 dev;
1527*ba7319e9SDmitry Salychev	device_t	 child;
1528*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1529*ba7319e9SDmitry Salychev} DEFAULT bypass_con_disable;
1530*ba7319e9SDmitry Salychev
1531*ba7319e9SDmitry SalychevMETHOD int con_get_attributes {
1532*ba7319e9SDmitry Salychev	device_t	 dev;
1533*ba7319e9SDmitry Salychev	device_t	 child;
1534*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1535*ba7319e9SDmitry Salychev	struct dpaa2_con_attr *attr;
1536*ba7319e9SDmitry Salychev} DEFAULT bypass_con_get_attributes;
1537*ba7319e9SDmitry Salychev
1538*ba7319e9SDmitry SalychevMETHOD int con_set_notif {
1539*ba7319e9SDmitry Salychev	device_t	 dev;
1540*ba7319e9SDmitry Salychev	device_t	 child;
1541*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1542*ba7319e9SDmitry Salychev	struct dpaa2_con_notif_cfg *cfg;
1543*ba7319e9SDmitry Salychev} DEFAULT bypass_con_set_notif;
1544*ba7319e9SDmitry Salychev
1545*ba7319e9SDmitry Salychev/**
1546*ba7319e9SDmitry Salychev * @brief Data Path MC Portal (DPMCP) commands.
1547*ba7319e9SDmitry Salychev */
1548*ba7319e9SDmitry Salychev
1549*ba7319e9SDmitry SalychevMETHOD int mcp_create {
1550*ba7319e9SDmitry Salychev	device_t	 dev;
1551*ba7319e9SDmitry Salychev	device_t	 child;
1552*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1553*ba7319e9SDmitry Salychev	uint32_t	 portal_id;
1554*ba7319e9SDmitry Salychev	uint32_t	 options;
1555*ba7319e9SDmitry Salychev	uint32_t	*dpmcp_id;
1556*ba7319e9SDmitry Salychev} DEFAULT bypass_mcp_create;
1557*ba7319e9SDmitry Salychev
1558*ba7319e9SDmitry SalychevMETHOD int mcp_destroy {
1559*ba7319e9SDmitry Salychev	device_t	 dev;
1560*ba7319e9SDmitry Salychev	device_t	 child;
1561*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1562*ba7319e9SDmitry Salychev	uint32_t	 dpmcp_id;
1563*ba7319e9SDmitry Salychev} DEFAULT bypass_mcp_destroy;
1564*ba7319e9SDmitry Salychev
1565*ba7319e9SDmitry SalychevMETHOD int mcp_open {
1566*ba7319e9SDmitry Salychev	device_t	 dev;
1567*ba7319e9SDmitry Salychev	device_t	 child;
1568*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1569*ba7319e9SDmitry Salychev	uint32_t	 dpmcp_id;
1570*ba7319e9SDmitry Salychev	uint16_t	*token;
1571*ba7319e9SDmitry Salychev} DEFAULT bypass_mcp_open;
1572*ba7319e9SDmitry Salychev
1573*ba7319e9SDmitry SalychevMETHOD int mcp_close {
1574*ba7319e9SDmitry Salychev	device_t	 dev;
1575*ba7319e9SDmitry Salychev	device_t	 child;
1576*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1577*ba7319e9SDmitry Salychev} DEFAULT bypass_mcp_close;
1578*ba7319e9SDmitry Salychev
1579*ba7319e9SDmitry SalychevMETHOD int mcp_reset {
1580*ba7319e9SDmitry Salychev	device_t	 dev;
1581*ba7319e9SDmitry Salychev	device_t	 child;
1582*ba7319e9SDmitry Salychev	struct dpaa2_cmd *cmd;
1583*ba7319e9SDmitry Salychev} DEFAULT bypass_mcp_reset;
1584