property.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _PCILIB_PROPERTY_H
  2. #define _PCILIB_PROPERTY_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /**
  7. * This is an internal function used to add property views for all model registers. It is automatically
  8. * called from pcilib_add_registers and should not be called by the users. On error no new views are
  9. * initalized.
  10. * @param[in,out] ctx - pcilib context
  11. * @param[in] n - number of views to initialize.
  12. * @param[in] banks - array containing a bank id for each of the considered registers
  13. * @param[in] registers - register descriptions
  14. * @return - error or 0 on success
  15. */
  16. int pcilib_add_properties_from_registers(pcilib_t *ctx, size_t n, const pcilib_register_bank_t *banks, const pcilib_register_description_t *registers);
  17. /**
  18. * This is an internal function used to add registers providing alternative access to values of the properties.
  19. * To reduce number of required interfaces, some of the property views may be also mapped into the
  20. * model as registers. The client application, then, is able to use either register or property APIs
  21. * to access them. This is an internal function which processes the supplied views, finds which views
  22. * have to be mapped in the register space, and finally pushes corresponding registers into the model.
  23. * The function is automatically called from pcilib_add_views and should never be called by the user.
  24. * On error no new registers are added.
  25. * @param[in,out] ctx - pcilib context
  26. * @param[in] n - number of views to analyze.
  27. * @param[in] view_ctx - views to analyze
  28. * @param[in] view - array of pointers to corresponding view descriptions
  29. * @return - error or 0 on success
  30. */
  31. 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);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif /* _PCILIB_PROPERTY_H */
  36. // free'd by user. Do we need it?