event/dlb2: add v2.5 create LDB port
[dpdk.git] / drivers / event / dlb2 / pf / base / dlb2_resource_new.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2020 Intel Corporation
3  */
4
5 #ifndef __DLB2_RESOURCE_NEW_H
6 #define __DLB2_RESOURCE_NEW_H
7
8 #include "dlb2_user.h"
9 #include "dlb2_osdep_types.h"
10
11 /**
12  * dlb2_resource_init() - initialize the device
13  * @hw: pointer to struct dlb2_hw.
14  * @ver: device version.
15  *
16  * This function initializes the device's software state (pointed to by the hw
17  * argument) and programs global scheduling QoS registers. This function should
18  * be called during driver initialization.
19  *
20  * The dlb2_hw struct must be unique per DLB 2.0 device and persist until the
21  * device is reset.
22  *
23  * Return:
24  * Returns 0 upon success, <0 otherwise.
25  */
26 int dlb2_resource_init(struct dlb2_hw *hw, enum dlb2_hw_ver ver);
27
28 /**
29  * dlb2_clr_pmcsr_disable() - power on bulk of DLB 2.0 logic
30  * @hw: dlb2_hw handle for a particular device.
31  * @ver: device version.
32  *
33  * Clearing the PMCSR must be done at initialization to make the device fully
34  * operational.
35  */
36 void dlb2_clr_pmcsr_disable(struct dlb2_hw *hw, enum dlb2_hw_ver ver);
37
38 /**
39  * dlb2_finish_unmap_qid_procedures() - finish any pending unmap procedures
40  * @hw: dlb2_hw handle for a particular device.
41  *
42  * This function attempts to finish any outstanding unmap procedures.
43  * This function should be called by the kernel thread responsible for
44  * finishing map/unmap procedures.
45  *
46  * Return:
47  * Returns the number of procedures that weren't completed.
48  */
49 unsigned int dlb2_finish_unmap_qid_procedures(struct dlb2_hw *hw);
50
51 /**
52  * dlb2_finish_map_qid_procedures() - finish any pending map procedures
53  * @hw: dlb2_hw handle for a particular device.
54  *
55  * This function attempts to finish any outstanding map procedures.
56  * This function should be called by the kernel thread responsible for
57  * finishing map/unmap procedures.
58  *
59  * Return:
60  * Returns the number of procedures that weren't completed.
61  */
62 unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw);
63
64 /**
65  * dlb2_resource_free() - free device state memory
66  * @hw: dlb2_hw handle for a particular device.
67  *
68  * This function frees software state pointed to by dlb2_hw. This function
69  * should be called when resetting the device or unloading the driver.
70  */
71 void dlb2_resource_free(struct dlb2_hw *hw);
72
73 #endif /* __DLB2_RESOURCE_NEW_H */