diff options
| author | Nipun Gupta <[email protected]> | 2023-09-15 04:54:21 +0000 |
|---|---|---|
| committer | Alex Williamson <[email protected]> | 2023-09-28 18:12:07 +0000 |
| commit | a941b784b15ff65e1a3b6a259c6d6cf7fa0bb3c3 (patch) | |
| tree | 10bcc48828fc5741e1cbce64efe13916ab971288 /drivers/cdx/controller/mcdi_functions.h | |
| parent | Merge branch 'mlx5-vfio' of https://git.kernel.org/pub/scm/linux/kernel/git/m... (diff) | |
| download | kernel-a941b784b15ff65e1a3b6a259c6d6cf7fa0bb3c3.tar.gz kernel-a941b784b15ff65e1a3b6a259c6d6cf7fa0bb3c3.zip | |
cdx: add support for bus mastering
Introduce cdx_set_master() and cdx_clear_master() APIs to support
enable and disable of bus mastering. Drivers need to use these APIs to
enable/disable DMAs from the CDX devices.
Signed-off-by: Nipun Gupta <[email protected]>
Reviewed-by: Pieter Jansen van Vuuren <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'drivers/cdx/controller/mcdi_functions.h')
| -rw-r--r-- | drivers/cdx/controller/mcdi_functions.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/cdx/controller/mcdi_functions.h b/drivers/cdx/controller/mcdi_functions.h index 7440ace5539a..a448d6581eb4 100644 --- a/drivers/cdx/controller/mcdi_functions.h +++ b/drivers/cdx/controller/mcdi_functions.h @@ -58,4 +58,17 @@ int cdx_mcdi_get_dev_config(struct cdx_mcdi *cdx, int cdx_mcdi_reset_device(struct cdx_mcdi *cdx, u8 bus_num, u8 dev_num); +/** + * cdx_mcdi_bus_master_enable - Set/Reset bus mastering for cdx device + * represented by bus_num:dev_num + * @cdx: pointer to MCDI interface. + * @bus_num: Bus number. + * @dev_num: Device number. + * @enable: Enable bus mastering if set, disable otherwise. + * + * Return: 0 on success, <0 on failure + */ +int cdx_mcdi_bus_master_enable(struct cdx_mcdi *cdx, u8 bus_num, + u8 dev_num, bool enable); + #endif /* CDX_MCDI_FUNCTIONS_H */ |
