From 51ec836689e0d9e2d27f2fa4579ff1088513dacf Mon Sep 17 00:00:00 2001
From: zilio nicolas <nicolas.zilio@kit.edu>
Date: Fri, 12 Jun 2015 19:08:55 +0200
Subject: some modifications

---
 pcilib/bank.h   | 9 ++++++++-
 pcilib/export.c | 3 ++-
 pcilib/model.h  | 2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

(limited to 'pcilib')

diff --git a/pcilib/bank.h b/pcilib/bank.h
index 943c389..bc45ec4 100644
--- a/pcilib/bank.h
+++ b/pcilib/bank.h
@@ -2,6 +2,8 @@
 #define _PCILIB_BANK_H
 
 #include <pcilib.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
 
 #define PCILIB_REGISTER_BANK_INVALID		((pcilib_register_bank_t)-1)
 #define PCILIB_REGISTER_BANK0 			0					/**< First BANK to be used in the event engine */
@@ -13,6 +15,7 @@
 #define PCILIB_REGISTER_PROTOCOL_INVALID	((pcilib_register_protocol_t)-1)
 #define PCILIB_REGISTER_PROTOCOL0		0					/**< First PROTOCOL address to be used in the event engine */
 #define PCILIB_REGISTER_PROTOCOL_DEFAULT	64					/**< Default memmap based protocol */
+#define PCILIB_REGISTER_PROTOCOL_KERNEL 32		/**< Protocol with registers registered in kernel directly*/
 #define PCILIB_REGISTER_PROTOCOL_DMA		96					/**< First PROTOCOL address to be used by DMA engines */
 #define PCILIB_REGISTER_PROTOCOL_DYNAMIC	128					/**< First PROTOCOL address to be used by plugins */
 
@@ -28,7 +31,7 @@ typedef struct {
     pcilib_version_t version;
 
     pcilib_register_bank_context_t *(*init)(pcilib_t *ctx, pcilib_register_bank_t bank, const char *model, const void *args);			/**< Optional API call to initialize bank context */
-    void (*free)(pcilib_register_bank_context_t *ctx);												/**< Optional API call to cleanup bank context */
+    void (*free)(pcilib_register_bank_context_t *bank_ctx);												/**< Optional API call to cleanup bank context */
     int (*read)(pcilib_t *pcilib, pcilib_register_bank_context_t *ctx, pcilib_register_addr_t addr, pcilib_register_value_t *value);		/**< Read from register, mandatory for RO/RW registers */
     int (*write)(pcilib_t *pcilib, pcilib_register_bank_context_t *ctx, pcilib_register_addr_t addr, pcilib_register_value_t value);		/**< Write to register, mandatory for WO/RW registers */
 } pcilib_register_protocol_api_description_t;
@@ -60,6 +63,7 @@ typedef struct {
     const char *format;								/**< printf format for the registers, either %lu for decimal output or 0x%lx for hexdecimal */
     const char *name;								/**< short bank name */
     const char *description;							/**< longer bank description */
+	xmlNodePtr xmlNode;					/**<pointer to xmlNode of the bank in the file*/
 } pcilib_register_bank_description_t;
 
 /**
@@ -82,6 +86,9 @@ typedef struct {
 struct pcilib_register_bank_context_s {
     const pcilib_register_bank_description_t *bank;				/**< Corresponding bank description */
     const pcilib_register_protocol_api_description_t *api;			/**< API functions */
+	xmlNodeSetPtr banks_nodes;
+	void *bank_software_register_adress;
+	pcilib_t *ctx;
 };
 
 
diff --git a/pcilib/export.c b/pcilib/export.c
index e442fc7..ed3b5bf 100644
--- a/pcilib/export.c
+++ b/pcilib/export.c
@@ -5,10 +5,11 @@
 #include "export.h"
 
 #include "protocols/default.h"
-
+#include "protocols/software_registers.h"
 
 const pcilib_register_protocol_description_t pcilib_protocols[] = {
     { PCILIB_REGISTER_PROTOCOL_DEFAULT, &pcilib_default_protocol_api, NULL, NULL, "default", "" },
+    { PCILIB_REGISTER_PROTOCOL_SOFTWARE_REGISTERS, &pcilib_register_software_register_protocol_api, NULL, NULL, "software_registers", "" },
     { 0 }
 };
 
diff --git a/pcilib/model.h b/pcilib/model.h
index ab55adc..b60ff3b 100644
--- a/pcilib/model.h
+++ b/pcilib/model.h
@@ -7,7 +7,6 @@
 #include <pcilib/event.h>
 #include <pcilib/export.h>
 
-
 typedef struct {
     const pcilib_version_t interface_version;
 
@@ -24,6 +23,7 @@ typedef struct {
 
     const char *name;
     const char *description;
+
 } pcilib_model_description_t;
 
 
-- 
cgit v1.2.3


From 8f194817bf33fef401093868fbbbf25a0588d00d Mon Sep 17 00:00:00 2001
From: zilio nicolas <nicolas.zilio@kit.edu>
Date: Mon, 15 Jun 2015 12:04:07 +0200
Subject: ready to run tests

---
 pcilib/bank.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'pcilib')

diff --git a/pcilib/bank.h b/pcilib/bank.h
index bc45ec4..df4df83 100644
--- a/pcilib/bank.h
+++ b/pcilib/bank.h
@@ -18,6 +18,7 @@
 #define PCILIB_REGISTER_PROTOCOL_KERNEL 32		/**< Protocol with registers registered in kernel directly*/
 #define PCILIB_REGISTER_PROTOCOL_DMA		96					/**< First PROTOCOL address to be used by DMA engines */
 #define PCILIB_REGISTER_PROTOCOL_DYNAMIC	128					/**< First PROTOCOL address to be used by plugins */
+#define PCILIB_REGISTER_PROTOCOL_SOFTWARE_REGISTERS 32
 
 typedef uint8_t pcilib_register_bank_t;						/**< Type holding the bank position within the field listing register banks in the model */
 typedef uint8_t pcilib_register_bank_addr_t;					/**< Type holding the bank address number */
-- 
cgit v1.2.3


From 907559d880de032deb31aa5e648c11029bbf9cce Mon Sep 17 00:00:00 2001
From: zilio nicolas <nicolas.zilio@kit.edu>
Date: Thu, 18 Jun 2015 19:47:17 +0200
Subject: new version of software_registers

---
 pcilib/bank.h   | 3 +--
 pcilib/pcilib.h | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'pcilib')

diff --git a/pcilib/bank.h b/pcilib/bank.h
index df4df83..dfd2adb 100644
--- a/pcilib/bank.h
+++ b/pcilib/bank.h
@@ -15,7 +15,6 @@
 #define PCILIB_REGISTER_PROTOCOL_INVALID	((pcilib_register_protocol_t)-1)
 #define PCILIB_REGISTER_PROTOCOL0		0					/**< First PROTOCOL address to be used in the event engine */
 #define PCILIB_REGISTER_PROTOCOL_DEFAULT	64					/**< Default memmap based protocol */
-#define PCILIB_REGISTER_PROTOCOL_KERNEL 32		/**< Protocol with registers registered in kernel directly*/
 #define PCILIB_REGISTER_PROTOCOL_DMA		96					/**< First PROTOCOL address to be used by DMA engines */
 #define PCILIB_REGISTER_PROTOCOL_DYNAMIC	128					/**< First PROTOCOL address to be used by plugins */
 #define PCILIB_REGISTER_PROTOCOL_SOFTWARE_REGISTERS 32
@@ -88,7 +87,7 @@ struct pcilib_register_bank_context_s {
     const pcilib_register_bank_description_t *bank;				/**< Corresponding bank description */
     const pcilib_register_protocol_api_description_t *api;			/**< API functions */
 	xmlNodeSetPtr banks_nodes;
-	void *bank_software_register_adress;
+	void *kmem_base_address;
 	pcilib_t *ctx;
 };
 
diff --git a/pcilib/pcilib.h b/pcilib/pcilib.h
index 6d241c6..6c1d592 100644
--- a/pcilib/pcilib.h
+++ b/pcilib/pcilib.h
@@ -87,6 +87,7 @@ typedef struct {
 #define PCILIB_BAR_INVALID		((pcilib_bar_t)-1)
 #define PCILIB_BAR0			0
 #define PCILIB_BAR1			1
+#define PCILIB_BARUNDEF		-1
 #define PCILIB_DMA_ENGINE_INVALID	((pcilib_dma_engine_t)-1)
 #define PCILIB_DMA_ENGINE_ALL		((pcilib_dma_engine_t)-1)
 #define PCILIB_DMA_FLAGS_DEFAULT	((pcilib_dma_flags_t)0)
-- 
cgit v1.2.3