1 /* Copyright 2013-2015 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 Resource Container API
36 * Contains DPRC API for managing and querying DPAA resources
42 * Set this value as the icid value in dprc_cfg structure when creating a
43 * container, in case the ICID is not selected by the user and should be
44 * allocated by the DPRC from the pool of ICIDs.
46 #define DPRC_GET_ICID_FROM_POOL (uint16_t)(~(0))
49 * Set this value as the portal_id value in dprc_cfg structure when creating a
50 * container, in case the portal ID is not specifically selected by the
51 * user and should be allocated by the DPRC from the pool of portal ids.
53 #define DPRC_GET_PORTAL_ID_FROM_POOL (int)(~(0))
56 * dprc_open() - Open DPRC object for use
57 * @mc_io: Pointer to MC portal's I/O object
58 * @container_id: Container ID to open
59 * @token: Returned token of DPRC object
61 * Return: '0' on Success; Error code otherwise.
63 * @warning Required before any operation on the object.
65 int dprc_open(struct fsl_mc_io *mc_io, int container_id, uint16_t *token);
68 * dprc_close() - Close the control session of the object
69 * @mc_io: Pointer to MC portal's I/O object
70 * @token: Token of DPRC object
72 * After this function is called, no further operations are
73 * allowed on the object without opening a new control session.
75 * Return: '0' on Success; Error code otherwise.
77 int dprc_close(struct fsl_mc_io *mc_io, uint16_t token);
80 * Container general options
82 * These options may be selected at container creation by the container creator
83 * and can be retrieved using dprc_get_attributes()
86 /* Spawn Policy Option allowed - Indicates that the new container is allowed
87 * to spawn and have its own child containers.
89 #define DPRC_CFG_OPT_SPAWN_ALLOWED 0x00000001
91 /* General Container allocation policy - Indicates that the new container is
92 * allowed to allocate requested resources from its parent container; if not
93 * set, the container is only allowed to use resources in its own pools; Note
94 * that this is a container's global policy, but the parent container may
95 * override it and set specific quota per resource type.
97 #define DPRC_CFG_OPT_ALLOC_ALLOWED 0x00000002
99 /* Object initialization allowed - software context associated with this
100 * container is allowed to invoke object initialization operations.
102 #define DPRC_CFG_OPT_OBJ_CREATE_ALLOWED 0x00000004
104 /* Topology change allowed - software context associated with this
105 * container is allowed to invoke topology operations, such as attach/detach
106 * of network objects.
108 #define DPRC_CFG_OPT_TOPOLOGY_CHANGES_ALLOWED 0x00000008
110 /* IOMMU bypass - indicates whether objects of this container are permitted
111 * to bypass the IOMMU.
113 #define DPRC_CFG_OPT_IOMMU_BYPASS 0x00000010
115 /* AIOP - Indicates that container belongs to AIOP. */
116 #define DPRC_CFG_OPT_AIOP 0x00000020
119 * struct dprc_cfg - Container configuration options
120 * @icid: Container's ICID; if set to 'DPRC_GET_ICID_FROM_POOL', a free
121 * ICID value is allocated by the DPRC
122 * @portal_id: Portal ID; if set to 'DPRC_GET_PORTAL_ID_FROM_POOL', a free
123 * portal ID is allocated by the DPRC
124 * @options: Combination of 'DPRC_CFG_OPT_<X>' options
133 * dprc_create_container() - Create child container
134 * @mc_io: Pointer to MC portal's I/O object
135 * @token: Token of DPRC object
136 * @cfg: Child container configuration
137 * @child_container_id: Returned child container ID
138 * @child_portal_paddr: Returned base physical address of the
141 * Return: '0' on Success; Error code otherwise.
143 int dprc_create_container(struct fsl_mc_io *mc_io,
145 struct dprc_cfg *cfg,
146 int *child_container_id,
147 uint64_t *child_portal_paddr);
150 * dprc_destroy_container() - Destroy child container.
151 * @mc_io: Pointer to MC portal's I/O object
152 * @token: Token of DPRC object
153 * @child_container_id: ID of the container to destroy
155 * This function terminates the child container, so following this call the
156 * child container ID becomes invalid.
159 * - All resources and objects of the destroyed container are returned to the
160 * parent container or destroyed if were created be the destroyed container.
161 * - This function destroy all the child containers of the specified
162 * container prior to destroying the container itself.
164 * warning: Only the parent container is allowed to destroy a child policy
165 * Container 0 can't be destroyed
167 * Return: '0' on Success; Error code otherwise.
170 int dprc_destroy_container(struct fsl_mc_io *mc_io,
172 int child_container_id);
175 * dprc_reset_container - Reset child container.
176 * @mc_io: Pointer to MC portal's I/O object
177 * @token: Token of DPRC object
178 * @child_container_id: ID of the container to reset
180 * In case a software context crashes or becomes non-responsive, the parent
181 * may wish to reset its resources container before the software context is
184 * This routine informs all objects assigned to the child container that the
185 * container is being reset, so they may perform any cleanup operations that are
186 * needed. All objects handles that were owned by the child container shall be
189 * Note that such request may be submitted even if the child software context
190 * has not crashed, but the resulting object cleanup operations will not be
193 * Return: '0' on Success; Error code otherwise.
195 int dprc_reset_container(struct fsl_mc_io *mc_io,
197 int child_container_id);
201 /* Number of dprc's IRQs */
202 #define DPRC_NUM_OF_IRQS 1
204 /* Object irq events */
206 /* IRQ event - Indicates that a new object assigned to the container */
207 #define DPRC_IRQ_EVENT_OBJ_ADDED 0x00000001
208 /* IRQ event - Indicates that an object was unassigned from the container */
209 #define DPRC_IRQ_EVENT_OBJ_REMOVED 0x00000002
210 /* IRQ event - Indicates that resources assigned to the container */
211 #define DPRC_IRQ_EVENT_RES_ADDED 0x00000004
212 /* IRQ event - Indicates that resources unassigned from the container */
213 #define DPRC_IRQ_EVENT_RES_REMOVED 0x00000008
214 /* IRQ event - Indicates that one of the descendant containers that opened by
215 * this container is destroyed
217 #define DPRC_IRQ_EVENT_CONTAINER_DESTROYED 0x00000010
219 /* IRQ event - Indicates that on one of the container's opened object is
222 #define DPRC_IRQ_EVENT_OBJ_DESTROYED 0x00000020
224 /* Irq event - Indicates that object is created at the container */
225 #define DPRC_IRQ_EVENT_OBJ_CREATED 0x00000040
228 * dprc_set_irq() - Set IRQ information for the DPRC to trigger an interrupt.
229 * @mc_io: Pointer to MC portal's I/O object
230 * @token: Token of DPRC object
231 * @irq_index: Identifies the interrupt index to configure
232 * @irq_addr: Address that must be written to
233 * signal a message-based interrupt
234 * @irq_val: Value to write into irq_addr address
235 * @user_irq_id: Returned a user defined number associated with this IRQ
237 * Return: '0' on Success; Error code otherwise.
239 int dprc_set_irq(struct fsl_mc_io *mc_io,
247 * dprc_get_irq() - Get IRQ information from the DPRC.
248 * @mc_io: Pointer to MC portal's I/O object
249 * @token: Token of DPRC object
250 * @irq_index: The interrupt index to configure
251 * @type: Returned interrupt type: 0 represents message interrupt
252 * type (both irq_addr and irq_val are valid)
253 * @irq_addr: Returned address that must be written to
254 * signal the message-based interrupt
255 * @irq_val: Value to write into irq_addr address
256 * @user_irq_id: A user defined number associated with this IRQ
258 * Return: '0' on Success; Error code otherwise.
260 int dprc_get_irq(struct fsl_mc_io *mc_io,
269 * dprc_set_irq_enable() - Set overall interrupt state.
270 * @mc_io: Pointer to MC portal's I/O object
271 * @token: Token of DPRC object
272 * @irq_index: The interrupt index to configure
273 * @en: Interrupt state - enable = 1, disable = 0
275 * Allows GPP software to control when interrupts are generated.
276 * Each interrupt can have up to 32 causes. The enable/disable control's the
277 * overall interrupt state. if the interrupt is disabled no causes will cause
280 * Return: '0' on Success; Error code otherwise.
282 int dprc_set_irq_enable(struct fsl_mc_io *mc_io,
288 * dprc_get_irq_enable() - Get overall interrupt state.
289 * @mc_io: Pointer to MC portal's I/O object
290 * @token: Token of DPRC object
291 * @irq_index: The interrupt index to configure
292 * @en: Returned interrupt state - enable = 1, disable = 0
294 * Return: '0' on Success; Error code otherwise.
296 int dprc_get_irq_enable(struct fsl_mc_io *mc_io,
302 * dprc_set_irq_mask() - Set interrupt mask.
303 * @mc_io: Pointer to MC portal's I/O object
304 * @token: Token of DPRC object
305 * @irq_index: The interrupt index to configure
306 * @mask: event mask to trigger interrupt;
309 * 1 = consider event for asserting irq
311 * Every interrupt can have up to 32 causes and the interrupt model supports
312 * masking/unmasking each cause independently
314 * Return: '0' on Success; Error code otherwise.
316 int dprc_set_irq_mask(struct fsl_mc_io *mc_io,
322 * dprc_get_irq_mask() - Get interrupt mask.
323 * @mc_io: Pointer to MC portal's I/O object
324 * @token: Token of DPRC object
325 * @irq_index: The interrupt index to configure
326 * @mask: Returned event mask to trigger interrupt
328 * Every interrupt can have up to 32 causes and the interrupt model supports
329 * masking/unmasking each cause independently
331 * Return: '0' on Success; Error code otherwise.
333 int dprc_get_irq_mask(struct fsl_mc_io *mc_io,
339 * dprc_get_irq_status() - Get the current status of any pending interrupts.
340 * @mc_io: Pointer to MC portal's I/O object
341 * @token: Token of DPRC object
342 * @irq_index: The interrupt index to configure
343 * @status: Returned interrupts status - one bit per cause:
344 * 0 = no interrupt pending
345 * 1 = interrupt pending
347 * Return: '0' on Success; Error code otherwise.
349 int dprc_get_irq_status(struct fsl_mc_io *mc_io,
355 * dprc_clear_irq_status() - Clear a pending interrupt's status
356 * @mc_io: Pointer to MC portal's I/O object
357 * @token: Token of DPRC object
358 * @irq_index: The interrupt index to configure
359 * @status: bits to clear (W1C) - one bit per cause:
361 * 1 = clear status bit
363 * Return: '0' on Success; Error code otherwise.
365 int dprc_clear_irq_status(struct fsl_mc_io *mc_io,
371 * struct dprc_attributes - Container attributes
372 * @container_id: Container's ID
373 * @icid: Container's ICID
374 * @portal_id: Container's portal ID
375 * @options: Container's options as set at container's creation
376 * @version: DPRC version
378 struct dprc_attributes {
384 * struct version - DPRC version
385 * @major: DPRC major version
386 * @minor: DPRC minor version
395 * dprc_get_attributes() - Obtains container attributes
396 * @mc_io: Pointer to MC portal's I/O object
397 * @token: Token of DPRC object
398 * @attributes Returned container attributes
400 * Return: '0' on Success; Error code otherwise.
402 int dprc_get_attributes(struct fsl_mc_io *mc_io,
404 struct dprc_attributes *attributes);
407 * dprc_set_res_quota() - Set allocation policy for a specific resource/object
408 * type in a child container
409 * @mc_io: Pointer to MC portal's I/O object
410 * @token: Token of DPRC object
411 * @child_container_id: ID of the child container
412 * @type: Resource/object type
413 * @quota: Sets the maximum number of resources of the selected type
414 * that the child container is allowed to allocate from its parent;
415 * when quota is set to -1, the policy is the same as container's
418 * Allocation policy determines whether or not a container may allocate
419 * resources from its parent. Each container has a 'global' allocation policy
420 * that is set when the container is created.
422 * This function sets allocation policy for a specific resource type.
423 * The default policy for all resource types matches the container's 'global'
426 * Return: '0' on Success; Error code otherwise.
428 * @warning Only the parent container is allowed to change a child policy.
430 int dprc_set_res_quota(struct fsl_mc_io *mc_io,
432 int child_container_id,
437 * dprc_get_res_quota() - Gets the allocation policy of a specific
438 * resource/object type in a child container
439 * @mc_io: Pointer to MC portal's I/O object
440 * @token: Token of DPRC object
441 * @child_container_id; ID of the child container
442 * @type: resource/object type
443 * @quota: Returnes the maximum number of resources of the selected type
444 * that the child container is allowed to allocate from the parent;
445 * when quota is set to -1, the policy is the same as container's
448 * Return: '0' on Success; Error code otherwise.
450 int dprc_get_res_quota(struct fsl_mc_io *mc_io,
452 int child_container_id,
456 /* Resource request options */
458 /* Explicit resource ID request - The requested objects/resources
459 * are explicit and sequential (in case of resources).
460 * The base ID is given at res_req at base_align field
462 #define DPRC_RES_REQ_OPT_EXPLICIT 0x00000001
464 /* Aligned resources request - Relevant only for resources
465 * request (and not objects). Indicates that resources base ID should be
466 * sequential and aligned to the value given at dprc_res_req base_align field
468 #define DPRC_RES_REQ_OPT_ALIGNED 0x00000002
470 /* Plugged Flag - Relevant only for object assignment request.
471 * Indicates that after all objects assigned. An interrupt will be invoked at
472 * the relevant GPP. The assigned object will be marked as plugged.
473 * plugged objects can't be assigned from their container
475 #define DPRC_RES_REQ_OPT_PLUGGED 0x00000004
478 * struct dprc_res_req - Resource request descriptor, to be used in assignment
479 * or un-assignment of resources and objects.
480 * @type: Resource/object type: Represent as a NULL terminated string.
481 * This string may received by using dprc_get_pool() to get resource
482 * type and dprc_get_obj() to get object type;
483 * Note: it is not possible to assign/un-assign DPRC objects
484 * @num: Number of resources
485 * @options: Request options: combination of DPRC_RES_REQ_OPT_ options
486 * @id_base_align: In case of explicit assignment (DPRC_RES_REQ_OPT_EXPLICIT
487 * is set at option), this field represents the required base ID
488 * for resource allocation; In case of aligned assignment
489 * (DPRC_RES_REQ_OPT_ALIGNED is set at option), this field
490 * indicates the required alignment for the resource ID(s) -
491 * use 0 if there is no alignment or explicit ID requirements
493 struct dprc_res_req {
501 * dprc_assign() - Assigns objects or resource to a child container.
502 * @mc_io: Pointer to MC portal's I/O object
503 * @token: Token of DPRC object
504 * @container_id: ID of the child container
505 * @res_req: Describes the type and amount of resources to
506 * assign to the given container
508 * Assignment is usually done by a parent (this DPRC) to one of its child
511 * According to the DPRC allocation policy, the assigned resources may be taken
512 * (allocated) from the container's ancestors, if not enough resources are
513 * available in the container itself.
515 * The type of assignment depends on the dprc_res_req options, as follows:
516 * - DPRC_RES_REQ_OPT_EXPLICIT: indicates that assigned resources should have
517 * the explicit base ID specified at the id_base_align field of res_req.
518 * - DPRC_RES_REQ_OPT_ALIGNED: indicates that the assigned resources should be
519 * aligned to the value given at id_base_align field of res_req.
520 * - DPRC_RES_REQ_OPT_PLUGGED: Relevant only for object assignment,
521 * and indicates that the object must be set to the plugged state.
523 * A container may use this function with its own ID in order to change a
524 * object state to plugged or unplugged.
526 * If IRQ information has been set in the child DPRC, it will signal an
527 * interrupt following every change in its object assignment.
529 * Return: '0' on Success; Error code otherwise.
531 int dprc_assign(struct fsl_mc_io *mc_io,
534 struct dprc_res_req *res_req);
537 * dprc_unassign() - Un-assigns objects or resources from a child container
538 * and moves them into this (parent) DPRC.
539 * @mc_io: Pointer to MC portal's I/O object
540 * @token: Token of DPRC object
541 * @child_container_id: ID of the child container
542 * @res_req: Describes the type and amount of resources to un-assign from
543 * the child container
545 * Un-assignment of objects can succeed only if the object is not in the
546 * plugged or opened state.
548 * Return: '0' on Success; Error code otherwise.
550 int dprc_unassign(struct fsl_mc_io *mc_io,
552 int child_container_id,
553 struct dprc_res_req *res_req);
556 * dprc_get_pool_count() - Get the number of dprc's pools
557 * @mc_io: Pointer to MC portal's I/O object
558 * @token: Token of DPRC object
559 * @pool_count: Returned number of resource pools in the dprc
561 * Return: '0' on Success; Error code otherwise.
563 int dprc_get_pool_count(struct fsl_mc_io *mc_io,
568 * dprc_get_pool() - Get the type (string) of a certain dprc's pool
569 * @mc_io: Pointer to MC portal's I/O object
570 * @token: Token of DPRC object
571 * @pool_index; Index of the pool to be queried (< pool_count)
572 * @type: The type of the pool
574 * The pool types retrieved one by one by incrementing
575 * pool_index up to (not including) the value of pool_count returned
576 * from dprc_get_pool_count(). dprc_get_pool_count() must
577 * be called prior to dprc_get_pool().
579 * Return: '0' on Success; Error code otherwise.
581 int dprc_get_pool(struct fsl_mc_io *mc_io,
587 * dprc_get_obj_count() - Obtains the number of objects in the DPRC
588 * @mc_io: Pointer to MC portal's I/O object
589 * @token: Token of DPRC object
590 * @obj_count: Number of objects assigned to the DPRC
592 * Return: '0' on Success; Error code otherwise.
594 int dprc_get_obj_count(struct fsl_mc_io *mc_io, uint16_t token, int *obj_count);
596 /* Objects Attributes Flags */
598 /* Opened state - Indicates that an object is open by at least one owner */
599 #define DPRC_OBJ_STATE_OPEN 0x00000001
600 /* Plugged state - Indicates that the object is plugged */
601 #define DPRC_OBJ_STATE_PLUGGED 0x00000002
604 * struct dprc_obj_desc - Object descriptor, returned from dprc_get_obj()
605 * @type: Type of object: NULL terminated string
606 * @id: ID of logical object resource
607 * @vendor: Object vendor identifier
608 * @ver_major: Major version number
609 * @ver_minor: Minor version number
610 * @irq_count: Number of interrupts supported by the object
611 * @region_count: Number of mappable regions supported by the object
612 * @state: Object state: combination of DPRC_OBJ_STATE_ states
614 struct dprc_obj_desc {
621 uint8_t region_count;
626 * dprc_get_obj() - Get general information on an object
627 * @mc_io: Pointer to MC portal's I/O object
628 * @token: Token of DPRC object
629 * @obj_index: Index of the object to be queried (< obj_count)
630 * @obj_desc: Returns the requested object descriptor
632 * The object descriptors are retrieved one by one by incrementing
633 * obj_index up to (not including) the value of obj_count returned
634 * from dprc_get_obj_count(). dprc_get_obj_count() must
635 * be called prior to dprc_get_obj().
637 * Return: '0' on Success; Error code otherwise.
639 int dprc_get_obj(struct fsl_mc_io *mc_io,
642 struct dprc_obj_desc *obj_desc);
645 * dprc_get_res_count() - Obtains the number of free resources that are assigned
646 * to this container, by pool type
647 * @mc_io: Pointer to MC portal's I/O object
648 * @token: Token of DPRC object
650 * @res_count: Returned number of free resources of the given
651 * resource type that are assigned to this DPRC
653 * Return: '0' on Success; Error code otherwise.
655 int dprc_get_res_count(struct fsl_mc_io *mc_io,
661 * enum dprc_iter_status - Iteration status
662 * @DPRC_ITER_STATUS_FIRST: Perform first iteration
663 * @DPRC_ITER_STATUS_MORE: Indicates more/next iteration is needed
664 * @DPRC_ITER_STATUS_LAST: Indicates last iteration
666 enum dprc_iter_status {
667 DPRC_ITER_STATUS_FIRST = 0,
668 DPRC_ITER_STATUS_MORE = 1,
669 DPRC_ITER_STATUS_LAST = 2
673 * struct dprc_res_ids_range_desc - Resource ID range descriptor
674 * @base_id: Base resource ID of this range
675 * @last_id: Last resource ID of this range
676 * @iter_status: Iteration status - should be set to DPRC_ITER_STATUS_FIRST at
677 * first iteration; while the returned marker is DPRC_ITER_STATUS_MORE,
678 * additional iterations are needed, until the returned marker is
679 * DPRC_ITER_STATUS_LAST
681 struct dprc_res_ids_range_desc {
684 enum dprc_iter_status iter_status;
688 * dprc_get_res_ids() - Obtains IDs of free resources in the container
689 * @mc_io: Pointer to MC portal's I/O object
690 * @token: Token of DPRC object
692 * @range_desc: range descriptor
694 * Return: '0' on Success; Error code otherwise.
696 int dprc_get_res_ids(struct fsl_mc_io *mc_io,
699 struct dprc_res_ids_range_desc *range_desc);
702 * dprc_get_portal_paddr() - Get the physical address of MC portals
703 * @mc_io: Pointer to MC portal's I/O object
704 * @token: Token of DPRC object
705 * @portal_id: MC portal ID
706 * @portal_addr: The physical address of the MC portal ID
708 * Return: '0' on Success; Error code otherwise.
710 int dprc_get_portal_paddr(struct fsl_mc_io *mc_io,
713 uint64_t *portal_addr);
716 * struct dprc_region_desc - Mappable region descriptor
717 * @base_paddr: Region base physical address
718 * @size: Region size (in bytes)
720 struct dprc_region_desc {
726 * dprc_get_obj_region() - Get region information for a specified object.
727 * @mc_io: Pointer to MC portal's I/O object
728 * @token: Token of DPRC object
729 * @obj_type; Object type as returned in dprc_get_obj()
730 * @obj_id: Unique object instance as returned in dprc_get_obj()
731 * @region_index: The specific region to query
732 * @region_desc: Returns the requested region descriptor
734 * Return: '0' on Success; Error code otherwise.
736 int dprc_get_obj_region(struct fsl_mc_io *mc_io,
740 uint8_t region_index,
741 struct dprc_region_desc *region_desc);
744 * struct dprc_endpoint - Endpoint description for link connect/disconnect
746 * @type: Endpoint object type: NULL terminated string
747 * @id: Endpoint object ID
748 * @interface_id: Interface ID; should be set for endpoints with multiple
749 * interfaces ("dpsw", "dpdmux"); for others, always set to 0
751 struct dprc_endpoint {
758 * dprc_connect() - Connect two endpoints to create a network link between them
759 * @mc_io: Pointer to MC portal's I/O object
760 * @token: Token of DPRC object
761 * @endpoint1: Endpoint 1 configuration parameters
762 * @endpoint2: Endpoint 2 configuration parameters
764 * Return: '0' on Success; Error code otherwise.
766 int dprc_connect(struct fsl_mc_io *mc_io,
768 const struct dprc_endpoint *endpoint1,
769 const struct dprc_endpoint *endpoint2);
772 * dprc_disconnect() - Disconnect one endpoint to remove its network connection
773 * @mc_io: Pointer to MC portal's I/O object
774 * @token: Token of DPRC object
775 * @endpoint: Endpoint configuration parameters
777 * Return: '0' on Success; Error code otherwise.
779 int dprc_disconnect(struct fsl_mc_io *mc_io,
781 const struct dprc_endpoint *endpoint);
784 * dprc_get_connection() - Get connected endpoint and link status if connection
786 * @mc_io Pointer to MC portal's I/O object
787 * @token Token of DPRC object
788 * @endpoint1 Endpoint 1 configuration parameters
789 * @endpoint2 Returned endpoint 2 configuration parameters
790 * @state: Returned link state: 1 - link is up, 0 - link is down
792 * Return: '0' on Success; -ENAVAIL if connection does not exist.
794 int dprc_get_connection(struct fsl_mc_io *mc_io,
796 const struct dprc_endpoint *endpoint1,
797 struct dprc_endpoint *endpoint2,
800 #endif /* _FSL_DPRC_H */