1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2020 Intel Corporation
5 #ifndef __DLB2_RESOURCE_NEW_H
6 #define __DLB2_RESOURCE_NEW_H
9 #include "dlb2_osdep_types.h"
12 * dlb2_resource_init() - initialize the device
13 * @hw: pointer to struct dlb2_hw.
14 * @ver: device version.
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.
20 * The dlb2_hw struct must be unique per DLB 2.0 device and persist until the
24 * Returns 0 upon success, <0 otherwise.
26 int dlb2_resource_init(struct dlb2_hw *hw, enum dlb2_hw_ver ver);
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.
33 * Clearing the PMCSR must be done at initialization to make the device fully
36 void dlb2_clr_pmcsr_disable(struct dlb2_hw *hw, enum dlb2_hw_ver ver);
39 * dlb2_finish_unmap_qid_procedures() - finish any pending unmap procedures
40 * @hw: dlb2_hw handle for a particular device.
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.
47 * Returns the number of procedures that weren't completed.
49 unsigned int dlb2_finish_unmap_qid_procedures(struct dlb2_hw *hw);
52 * dlb2_finish_map_qid_procedures() - finish any pending map procedures
53 * @hw: dlb2_hw handle for a particular device.
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.
60 * Returns the number of procedures that weren't completed.
62 unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw);
65 * dlb2_resource_free() - free device state memory
66 * @hw: dlb2_hw handle for a particular device.
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.
71 void dlb2_resource_free(struct dlb2_hw *hw);
73 #endif /* __DLB2_RESOURCE_NEW_H */