From f923add0a9b6bd17d43f72c21eec4e01e19240cf Mon Sep 17 00:00:00 2001 From: zilio nicolas Date: Tue, 7 Jul 2015 11:12:52 +0200 Subject: clean version for locks --- pcilib/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcilib/pci.h') diff --git a/pcilib/pci.h b/pcilib/pci.h index d176caf..a7b3d50 100644 --- a/pcilib/pci.h +++ b/pcilib/pci.h @@ -69,7 +69,7 @@ struct pcilib_s { pcilib_register_bank_context_t *bank_ctx[PCILIB_MAX_REGISTER_BANKS]; /**< Contexts for registers banks if required by register protocol */ pcilib_dma_context_t *dma_ctx; /**< DMA context */ pcilib_context_t *event_ctx; /**< Implmentation context */ - + void* locks_handle; /**< adress of the kernel memory use for locks from user space*/ #ifdef PCILIB_FILE_IO int file_io_handle; #endif /* PCILIB_FILE_IO */ -- cgit v1.2.3 From d60dd48eec0ef5d7bf2feca9b3f06374a2f444aa Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 6 Aug 2015 04:24:58 +0200 Subject: Protect access to the DMA engine with locks --- pcilib/pci.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pcilib/pci.h') diff --git a/pcilib/pci.h b/pcilib/pci.h index c97f753..51bb352 100644 --- a/pcilib/pci.h +++ b/pcilib/pci.h @@ -71,6 +71,9 @@ struct pcilib_s { pcilib_dma_context_t *dma_ctx; /**< DMA context */ pcilib_context_t *event_ctx; /**< Implmentation context */ + pcilib_lock_t *dma_rlock[PCILIB_MAX_DMA_ENGINES]; /**< Per-engine locks to serialize streaming and read operations */ + pcilib_lock_t *dma_wlock[PCILIB_MAX_DMA_ENGINES]; /**< Per-engine locks to serialize write operations */ + struct pcilib_locking_s locks; /**< Context of locking subsystem */ #ifdef PCILIB_FILE_IO -- cgit v1.2.3 From 5001621745651443d3825a30a92897cac7f1ec53 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 12 Aug 2015 20:57:37 +0200 Subject: Do not fail if PCI configuration is not fully available to unprivileged user --- pcilib/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'pcilib/pci.h') diff --git a/pcilib/pci.h b/pcilib/pci.h index 51bb352..340abd3 100644 --- a/pcilib/pci.h +++ b/pcilib/pci.h @@ -42,6 +42,7 @@ struct pcilib_s { int pci_cfg_space_fd; /**< File descriptor linking to PCI configuration space in sysfs */ uint32_t pci_cfg_space_cache[64]; /**< Cached PCI configuration space */ + size_t pci_cfg_space_size; /**< Size of the cached PCI configuration space, sometimes not fully is available for unpriveledged user */ const uint32_t *pcie_capabilities; /**< PCI Capbility structure (just a pointer at appropriate place in the pci_cfg_space) */ int reg_bar_mapped; /**< Indicates that all BARs used to access registers are mapped */ -- cgit v1.2.3