summaryrefslogtreecommitdiffstats
path: root/pcilib/property.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-10-19 15:58:46 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-10-19 15:58:46 +0200
commit55255f2ce3a2234850249efcabd9ba32d0a89a9c (patch)
tree586d075665bebbb698e3a84eee6595f47401997f /pcilib/property.h
parent87ef1499bfcaa0ea2a58cb6d3c327162507f6ac8 (diff)
downloadpcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.tar.gz
pcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.tar.bz2
pcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.tar.xz
pcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.zip
Support computed (property-based) registers
Diffstat (limited to 'pcilib/property.h')
-rw-r--r--pcilib/property.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/pcilib/property.h b/pcilib/property.h
index bec11c8..75ec053 100644
--- a/pcilib/property.h
+++ b/pcilib/property.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
/**
- * This is internal function used to add property view for all model registers. It is automatically
+ * This is an internal function used to add property view for all model registers. It is automatically
* called from pcilib_add_registers and should not be called by the users. On error no new views are
* initalized.
* @param[in,out] ctx - pcilib context
@@ -14,7 +14,23 @@ extern "C" {
* @param[in] desc - register descriptions
* @return - error or 0 on success
*/
-int pcilib_add_register_properties(pcilib_t *ctx, size_t n, const pcilib_register_bank_t *banks, const pcilib_register_description_t *desc);
+int pcilib_add_properties_from_registers(pcilib_t *ctx, size_t n, const pcilib_register_bank_t *banks, const pcilib_register_description_t *registers);
+
+
+/**
+ * To reduce number of required interfaces, some of the property views may be also mapped into the
+ * model as registers. The client application, then, is able to use either register or property APIs
+ * to access them. This is an internal function which processes the supplied views, finds which views
+ * have to be mapped in the register space, and finally pushes corresponding registers into the model.
+ * The function is automatically called from pcilib_add_views and should never be called by the user.
+ * On error no new registers are added.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] n - number of views to analyze.
+ * @param[in] view_ctx - views to analyze
+ * @param[in] view - array of pointers to corresponding view descriptions
+ * @return - error or 0 on success
+ */
+int pcilib_add_registers_from_properties(pcilib_t *ctx, size_t n, pcilib_view_context_t* const *view_ctx, pcilib_view_description_t* const *view);
#ifdef __cplusplus
}