From 02924fc49641ca9c000054a7a540b6f1eaa0e8f8 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sat, 9 Jul 2011 05:33:18 +0200 Subject: Support dynamic registers, support register offsets and multiregisters (bitmasks), list NWL DMA registers --- pcilib.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pcilib.h') diff --git a/pcilib.h b/pcilib.h index 314cca7..6f831fa 100644 --- a/pcilib.h +++ b/pcilib.h @@ -28,7 +28,7 @@ typedef unsigned long pcilib_irq_source_t; typedef uint8_t pcilib_bar_t; /**< Type holding the PCI Bar number */ typedef uint8_t pcilib_register_t; /**< Type holding the register ID within the Bank */ -typedef uint8_t pcilib_register_addr_t; /**< Type holding the register ID within the Bank */ +typedef uint32_t pcilib_register_addr_t; /**< Type holding the register ID within the Bank */ typedef uint8_t pcilib_register_bank_t; /**< Type holding the register bank number */ typedef uint8_t pcilib_register_bank_addr_t; /**< Type holding the register bank number */ typedef uint8_t pcilib_register_size_t; /**< Type holding the size in bits of the register */ @@ -53,7 +53,9 @@ typedef enum { typedef enum { PCILIB_REGISTER_R = 1, PCILIB_REGISTER_W = 2, - PCILIB_REGISTER_RW = 3 + PCILIB_REGISTER_RW = 3, + PCILIB_REGISTER_W1C = 4, /**< writting 1 resets the flag */ + PCILIB_REGISTER_RW1C = 5 } pcilib_register_mode_t; typedef enum { @@ -72,7 +74,8 @@ typedef enum { typedef enum { PCILIB_REGISTER_STANDARD = 0, - PCILIB_REGISTER_FIFO + PCILIB_REGISTER_FIFO, + PCILIB_REGISTER_BITS } pcilib_register_type_t; #define PCILIB_BAR_DETECT ((pcilib_bar_t)-1) @@ -126,6 +129,7 @@ typedef struct { pcilib_register_size_t offset; pcilib_register_size_t bits; pcilib_register_value_t defvalue; + pcilib_register_value_t rwmask; /**< 1 - read before write bits, 0 - zero should be written to preserve value */ pcilib_register_mode_t mode; pcilib_register_type_t type; @@ -185,10 +189,6 @@ typedef struct { pcilib_event_api_description_t *event_api; } pcilib_model_description_t; -#ifndef _PCILIB_PCI_C -extern pcilib_model_description_t pcilib_model[]; -#endif /* ! _PCILIB_PCI_C */ - int pcilib_set_error_handler(void (*err)(const char *msg, ...), void (*warn)(const char *msg, ...)); pcilib_model_t pcilib_get_model(pcilib_t *ctx); -- cgit v1.2.3