From 2e7a7a3534bcf591c0d6c65105b2d845f293112f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 4 Jul 2011 16:21:23 +0200 Subject: North West Logick DMA implementation --- pci.h | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'pci.h') diff --git a/pci.h b/pci.h index 0785c5b..d01ce86 100644 --- a/pci.h +++ b/pci.h @@ -1,17 +1,45 @@ #ifndef _PCITOOL_PCI_H #define _PCITOOL_PCI_H +#define PCILIB_DMA_TIMEOUT 10000 /**< us */ #define PCILIB_REGISTER_TIMEOUT 10000 /**< us */ #include "driver/pciDriver.h" - +#include "pcilib_types.h" #include "pcilib.h" +#include "kmem.h" -int pcilib_set_dma_engine_description(pcilib_t *ctx, pcilib_dma_t engine, pcilib_dma_engine_description_t *desc); +struct pcilib_s { + int handle; + + uintptr_t page_mask; + pcilib_board_info_t board_info; + pcilib_dma_info_t dma_info; + pcilib_model_t model; + + char *bar_space[PCILIB_MAX_BANKS]; -const pcilib_board_info_t *pcilib_get_board_info(pcilib_t *ctx); -const pcilib_dma_info_t *pcilib_get_dma_info(pcilib_t *ctx); + int reg_bar_mapped; + pcilib_bar_t reg_bar; +// char *reg_space; + + int data_bar_mapped; + pcilib_bar_t data_bar; +// char *data_space; +// size_t data_size; + + pcilib_kmem_list_t *kmem_list; + + pcilib_model_description_t *model_info; + + pcilib_dma_context_t *dma_ctx; + pcilib_context_t *event_ctx; + +#ifdef PCILIB_FILE_IO + int file_io_handle; +#endif /* PCILIB_FILE_IO */ +}; #ifdef _PCILIB_PCI_C # include "ipecamera/model.h" @@ -36,4 +64,11 @@ extern void (*pcilib_warning)(const char *msg, ...); extern pcilib_protocol_description_t pcilib_protocol[]; #endif /* _PCILIB_PCI_C */ +const pcilib_board_info_t *pcilib_get_board_info(pcilib_t *ctx); +const pcilib_dma_info_t *pcilib_get_dma_info(pcilib_t *ctx); + +int pcilib_map_register_space(pcilib_t *ctx); +int pcilib_map_data_space(pcilib_t *ctx, uintptr_t addr); + + #endif /* _PCITOOL_PCI_H */ -- cgit v1.2.3