From e30eddc0aeb368814d2bbe0031e6b6ed768bdfcf Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 18 Nov 2015 06:28:28 +0100 Subject: Enforce 64-bit dma mask from IPEDMA if supported --- pcilib/pci.c | 7 +++++++ pcilib/pci.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'pcilib') diff --git a/pcilib/pci.c b/pcilib/pci.c index 4b8b8bb..e45aaba 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -431,3 +431,10 @@ const pcilib_pcie_link_info_t *pcilib_get_pcie_link_info(pcilib_t *ctx) { return &ctx->link_info; } + +int pcilib_set_dma_mask(pcilib_t *ctx, int mask) { + if (ioctl( ctx->handle, PCIDRIVER_IOC_SET_DMA_MASK, mask ) < 0) + return PCILIB_ERROR_FAILED; + + return 0; +} diff --git a/pcilib/pci.h b/pcilib/pci.h index 50c6c0e..bf977fc 100644 --- a/pcilib/pci.h +++ b/pcilib/pci.h @@ -118,6 +118,8 @@ const pcilib_pcie_link_info_t *pcilib_get_pcie_link_info(pcilib_t *ctx); int pcilib_map_register_space(pcilib_t *ctx); int pcilib_map_data_space(pcilib_t *ctx, uintptr_t addr); +int pcilib_set_dma_mask(pcilib_t *ctx, int mask); + #ifdef __cplusplus } #endif -- cgit v1.2.3