summaryrefslogtreecommitdiffstats
path: root/pcilib/bank.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-09-10 05:08:04 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-09-10 05:08:04 +0200
commitfcc0da28faca832a5d10572ae62ffa0e25436b19 (patch)
tree2869158673db4028dfb89ef85461719ef2bcffd9 /pcilib/bank.h
parent4535ac71e075946f374aef0bb1e2997869f148fe (diff)
parentd996fab54c59ca0b34d4ff7c4ab5ab8247559db0 (diff)
downloadpcitool-fcc0da28faca832a5d10572ae62ffa0e25436b19.tar.gz
pcitool-fcc0da28faca832a5d10572ae62ffa0e25436b19.tar.bz2
pcitool-fcc0da28faca832a5d10572ae62ffa0e25436b19.tar.xz
pcitool-fcc0da28faca832a5d10572ae62ffa0e25436b19.zip
Initial integration of XML support
Diffstat (limited to 'pcilib/bank.h')
-rw-r--r--pcilib/bank.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/pcilib/bank.h b/pcilib/bank.h
index a0ba9fe..602fa67 100644
--- a/pcilib/bank.h
+++ b/pcilib/bank.h
@@ -23,9 +23,14 @@ typedef uint8_t pcilib_register_bank_addr_t; /**< Type holding the bank addr
typedef uint8_t pcilib_register_protocol_t; /**< Type holding the protocol position within the field listing register protocols in the model */
typedef uint8_t pcilib_register_protocol_addr_t; /**< Type holding the protocol address */
-
typedef struct pcilib_register_bank_context_s pcilib_register_bank_context_t;
+typedef enum {
+ PCILIB_MODEL_MODIFICATON_FLAGS_DEFAULT = 0,
+ PCILIB_MODEL_MODIFICATION_FLAG_OVERRIDE = 1, /**< Instructs to override the existing registers/banks/etc... */
+ PCILIB_MODEL_MODIFICATION_FLAG_SKIP_EXISTING = 2 /**< If flag is set, pcilib will just skip existing registers/banks/etc instead of reporting a error */
+} pcilib_model_modification_flags_t;
+
typedef struct {
pcilib_version_t version;
@@ -84,6 +89,7 @@ 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 */
+ pcilib_xml_node_t *xml; /**< Additional XML properties */
};
#ifdef __cplusplus
@@ -94,9 +100,9 @@ extern "C" {
int pcilib_init_register_banks(pcilib_t *ctx);
void pcilib_free_register_banks(pcilib_t *ctx);
-int pcilib_add_register_banks(pcilib_t *ctx, size_t n, const pcilib_register_bank_description_t *banks);
-int pcilib_add_register_protocols(pcilib_t *ctx, size_t n, const pcilib_register_protocol_description_t *protocols);
-int pcilib_add_register_ranges(pcilib_t *ctx, size_t n, const pcilib_register_range_t *ranges);
+int pcilib_add_register_banks(pcilib_t *ctx, pcilib_model_modification_flags_t flags, size_t n, const pcilib_register_bank_description_t *banks, pcilib_register_bank_t *ids);
+int pcilib_add_register_protocols(pcilib_t *ctx, pcilib_model_modification_flags_t flags, size_t n, const pcilib_register_protocol_description_t *protocols, pcilib_register_protocol_t *ids);
+int pcilib_add_register_ranges(pcilib_t *ctx, pcilib_model_modification_flags_t flags, size_t n, const pcilib_register_range_t *ranges);
pcilib_register_bank_t pcilib_find_register_bank_by_addr(pcilib_t *ctx, pcilib_register_bank_addr_t bank);
pcilib_register_bank_t pcilib_find_register_bank_by_name(pcilib_t *ctx, const char *bankname);