summaryrefslogtreecommitdiffstats
path: root/pcilib
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-04-27 01:54:44 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-04-27 01:54:44 +0200
commit8d3ad26d8331c43659d0d4e77e8a50fbc3cfc1e4 (patch)
tree30c74c76115279cdc15437a07fabd8347ac1fdfd /pcilib
parentdcd8ad63316eac672492bc18112bbbb52811c3fc (diff)
downloadpcitool-8d3ad26d8331c43659d0d4e77e8a50fbc3cfc1e4.tar.gz
pcitool-8d3ad26d8331c43659d0d4e77e8a50fbc3cfc1e4.tar.bz2
pcitool-8d3ad26d8331c43659d0d4e77e8a50fbc3cfc1e4.tar.xz
pcitool-8d3ad26d8331c43659d0d4e77e8a50fbc3cfc1e4.zip
Further adjustments to get ready for independent event plugins
Diffstat (limited to 'pcilib')
-rw-r--r--pcilib/CMakeLists.txt6
-rw-r--r--pcilib/config.h.in3
-rw-r--r--pcilib/dma.h4
-rw-r--r--pcilib/error.c2
-rw-r--r--pcilib/event.h3
-rw-r--r--pcilib/export.c (renamed from pcilib/config.c)7
-rw-r--r--pcilib/export.h (renamed from pcilib/config.h)6
-rw-r--r--pcilib/model.h4
-rw-r--r--pcilib/pci.h3
9 files changed, 25 insertions, 13 deletions
diff --git a/pcilib/CMakeLists.txt b/pcilib/CMakeLists.txt
index c5297ab..df3dcd9 100644
--- a/pcilib/CMakeLists.txt
+++ b/pcilib/CMakeLists.txt
@@ -3,8 +3,8 @@ include_directories(
${CMAKE_SOURCE_DIR}/pcilib
)
-set(HEADERS pcilib.h pci.h config.h model.h bank.h register.h kmem.h irq.h dma.h event.h tools.h error.h)
-add_library(pcilib SHARED pci.c config.c model.c bank.c register.c kmem.c irq.c dma.c event.c tools.c error.c)
+set(HEADERS pcilib.h pci.h export.h model.h bank.h register.h kmem.h irq.h dma.h event.h tools.h error.h config.h)
+add_library(pcilib SHARED pci.c export.c model.c bank.c register.c kmem.c irq.c dma.c event.c tools.c error.c)
target_link_libraries(pcilib dma protocols ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} )
add_dependencies(pcilib dma protocols)
@@ -16,6 +16,6 @@ install(FILES pcilib.h
DESTINATION include
)
-install(FILES bank.h register.h dma.h event.h model.h error.h tools.h config.h
+install(FILES bank.h register.h dma.h event.h model.h error.h tools.h export.h
DESTINATION include/pcilib
)
diff --git a/pcilib/config.h.in b/pcilib/config.h.in
new file mode 100644
index 0000000..653fa56
--- /dev/null
+++ b/pcilib/config.h.in
@@ -0,0 +1,3 @@
+#cmakedefine PCILIB_PLUGIN_DIR "${PCILIB_PLUGIN_DIR}"
+#cmakedefine PCILIB_DATA_DIR "${PCILIB_DATA_DIR}"
+#cmakedefine PCILIB_MODEL_DIR "${PCILIB_MODEL_DIR}"
diff --git a/pcilib/dma.h b/pcilib/dma.h
index 83bc0fd..c6e240e 100644
--- a/pcilib/dma.h
+++ b/pcilib/dma.h
@@ -1,6 +1,10 @@
#ifndef _PCILIB_DMA_H
#define _PCILIB_DMA_H
+#include <pcilib.h>
+#include <pcilib/bank.h>
+#include <pcilib/register.h>
+
#define PCILIB_DMA_BUFFER_INVALID ((size_t)-1)
typedef struct {
diff --git a/pcilib/error.c b/pcilib/error.c
index f242209..9df7d9d 100644
--- a/pcilib/error.c
+++ b/pcilib/error.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdarg.h>
-#include "config.h"
+#include "export.h"
#include "error.h"
void pcilib_print_error(const char *msg, ...) {
diff --git a/pcilib/event.h b/pcilib/event.h
index 93f659c..7ab3aae 100644
--- a/pcilib/event.h
+++ b/pcilib/event.h
@@ -2,6 +2,9 @@
#define _PCILIB_EVENT_H
#include <pcilib.h>
+#include <pcilib/dma.h>
+
+#define PCILIB_EVENT_INTERFACE_VERSION 0
typedef struct {
size_t max_events;
diff --git a/pcilib/config.c b/pcilib/export.c
index 21a0e53..2027870 100644
--- a/pcilib/config.c
+++ b/pcilib/export.c
@@ -1,9 +1,9 @@
-#define _PCILIB_CONFIG_C
+#define _PCILIB_EXPORT_C
#include <stdio.h>
#include "error.h"
-#include "config.h"
+#include "export.h"
#include "protocols/default.h"
@@ -20,12 +20,13 @@ const pcilib_register_protocol_description_t pcilib_protocols[] = {
#include "dma/nwl.h"
#include "dma/ipe.h"
-
+/*
const pcilib_dma_description_t pcilib_ipedma =
{ &ipe_dma_api, ipe_dma_banks, ipe_dma_registers, ipe_dma_engines, NULL, NULL, "ipedma", "DMA engine developed by M. Caselle" };
const pcilib_dma_description_t pcilib_nwldma =
{ &nwl_dma_api, nwl_dma_banks, nwl_dma_registers, NULL, NULL, NULL, "nwldma", "North West Logic DMA Engine" };
+*/
const pcilib_dma_description_t pcilib_dma[] = {
{ &ipe_dma_api, ipe_dma_banks, ipe_dma_registers, ipe_dma_engines, NULL, NULL, "ipedma", "DMA engine developed by M. Caselle" },
diff --git a/pcilib/config.h b/pcilib/export.h
index 710bff8..e2e6eca 100644
--- a/pcilib/config.h
+++ b/pcilib/export.h
@@ -1,5 +1,5 @@
-#ifndef _PCILIB_CONFIG_H
-#define _PCILIB_CONFIG_H
+#ifndef _PCILIB_EXPORT_H
+#define _PCILIB_EXPORT_H
#include <pcilib/register.h>
@@ -14,4 +14,4 @@ extern const pcilib_register_protocol_api_description_t pcilib_default_protocol_
extern const pcilib_dma_description_t pcilib_ipedma;
extern const pcilib_dma_description_t pcilib_nwldma;
-#endif /* _PCILIB_CONFIG_H */
+#endif /* _PCILIB_EXPORT_H */
diff --git a/pcilib/model.h b/pcilib/model.h
index 0b18c59..a12ea1a 100644
--- a/pcilib/model.h
+++ b/pcilib/model.h
@@ -5,9 +5,11 @@
#include <pcilib/register.h>
#include <pcilib/dma.h>
#include <pcilib/event.h>
-#include <pcilib/config.h>
+#include <pcilib/export.h>
typedef struct {
+ const unsigned int interface_version;
+
const pcilib_event_api_description_t *api;
const pcilib_dma_description_t *dma;
diff --git a/pcilib/pci.h b/pcilib/pci.h
index fe2ff8a..2e2b509 100644
--- a/pcilib/pci.h
+++ b/pcilib/pci.h
@@ -6,7 +6,6 @@
#define PCILIB_TRIGGER_TIMEOUT 100000 /**< us */
#define PCILIB_DMA_TIMEOUT 10000 /**< us */
#define PCILIB_DMA_SKIP_TIMEOUT 1000000 /**< us */
-#define PCILIB_REGISTER_TIMEOUT 10000 /**< us */
#define PCILIB_MAX_BARS 6 /**< this is defined by PCI specification */
#define PCILIB_DEFAULT_REGISTER_SPACE 1024 /**< number of registers to allocate on init */
#define PCILIB_MAX_REGISTER_BANKS 32 /**< maximum number of register banks to allocate space for */
@@ -24,7 +23,7 @@
#include "dma.h"
#include "event.h"
#include "model.h"
-#include "config.h"
+#include "export.h"
struct pcilib_s {
int handle; /**< file handle of device */