/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/bank.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-10-18 01:47:47 UTC
  • Revision ID: csa@suren.me-20151018014747-9ji2ygdhz1l9wnt5
Support properties of arbitrary type

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
extern "C" {
97
97
#endif
98
98
 
99
 
    // we don't copy strings, they should be statically allocated
 
99
/**
 
100
 * Initalizes context of register banks. This is an internal function and will
 
101
 * be called automatically when new register banks are added. On error no new
 
102
 * banks are initalized 
 
103
 * @param[in,out] ctx - pcilib context
 
104
 * @return - error or 0 on success
 
105
 */
100
106
int pcilib_init_register_banks(pcilib_t *ctx);
101
 
void pcilib_free_register_banks(pcilib_t *ctx);
102
 
 
 
107
 
 
108
/**
 
109
 * Destroys contexts of register banks. This is an internal function and will
 
110
 * be called during clean-up. 
 
111
 * @param[in,out] ctx - pcilib context
 
112
 * @param[in] start - specifies first bank to clean (used to clean only part of the banks to keep the defined state if pcilib_init_register_banks has failed)
 
113
 */
 
114
void pcilib_free_register_banks(pcilib_t *ctx, pcilib_register_bank_t start);
 
115
 
 
116
 
 
117
/**
 
118
 * Use this function to add new register banks into the model or override configuration
 
119
 * of the existing banks. The function will copy the context of banks structure, but name, 
 
120
 * description, and other strings in the structure are considered to have static duration 
 
121
 * and will not be copied. On error no new banks are initalized.
 
122
 * @param[in,out] ctx - pcilib context
 
123
 * @param[in] flags - instructs if existing banks should be reported as error (default), overriden or ignored
 
124
 * @param[in] n - number of banks to initialize. It is OK to pass 0 if banks variable is NULL terminated (last member of banks array have all members set to 0)
 
125
 * @param[in] banks - bank descriptions
 
126
 * @param[out] ids - if specified will contain the ids of the newly registered and overriden banks
 
127
 * @return - error or 0 on success
 
128
 */
103
129
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);
 
130
 
 
131
/**
 
132
 * Use this function to add new register protocols into the model. It is error to re-register
 
133
 * already registered protocols. The function will copy the context of banks structure, but name, 
 
134
 * description, and other strings in the structure are considered to have static duration 
 
135
 * and will not be copied. On error no new protocols are initalized.
 
136
 * @param[in,out] ctx - pcilib context
 
137
 * @param[in] flags - not used
 
138
 * @param[in] n - number of protocols to initialize. It is OK to pass 0 if protocols variable is NULL terminated (last member of protocols array have all members set to 0)
 
139
 * @param[in] protocols - protocol descriptions
 
140
 * @param[out] ids - if specified will contain the ids of the newly registered protocols
 
141
 * @return - error or 0 on success
 
142
 */
104
143
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);
 
144
 
 
145
/**
 
146
 * Use this function to add new register ranges into the model. It is error register
 
147
 * overlapping registered ranges. On error no new ranges are initalized.
 
148
 * @param[in,out] ctx - pcilib context
 
149
 * @param[in] flags - not used
 
150
 * @param[in] n - number of protocols to initialize. It is OK to pass 0 if protocols variable is NULL terminated.
 
151
 * @param[in] ranges - range descriptions
 
152
 * @return - error or 0 on success
 
153
 */
105
154
int pcilib_add_register_ranges(pcilib_t *ctx, pcilib_model_modification_flags_t flags, size_t n, const pcilib_register_range_t *ranges);
106
155
 
 
156
 
107
157
pcilib_register_bank_t pcilib_find_register_bank_by_addr(pcilib_t *ctx, pcilib_register_bank_addr_t bank);
108
158
pcilib_register_bank_t pcilib_find_register_bank_by_name(pcilib_t *ctx, const char *bankname);
109
159
pcilib_register_bank_t pcilib_find_register_bank(pcilib_t *ctx, const char *bank);