/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/bank.h

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-02 04:47:04 UTC
  • Revision ID: csa@suren.me-20160302044704-wncsxtf6sx0r0tps
Documentation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
 */
172
172
int pcilib_add_register_ranges(pcilib_t *ctx, pcilib_model_modification_flags_t flags, size_t n, const pcilib_register_range_t *ranges);
173
173
 
 
174
/**
 
175
 * Find the register bank id (offset in \a banks array) corresponding to the specified bank address 
 
176
 * @param[in,out] ctx   - pcilib context
 
177
 * @param[in] bank      - the address of register bank
 
178
 * @return              - bank id or PCILIB_REGISTER_BANK_INVALID if bank is not found
 
179
 */
174
180
pcilib_register_bank_t pcilib_find_register_bank_by_addr(pcilib_t *ctx, pcilib_register_bank_addr_t bank);
 
181
 
 
182
/**
 
183
 * Find the register bank id (offset in \a banks array) corresponding to the specified bank name
 
184
 * @param[in,out] ctx   - pcilib context
 
185
 * @param[in] bankname  - the name of register bank
 
186
 * @return              - bank id or PCILIB_REGISTER_BANK_INVALID if bank is not found
 
187
 */
175
188
pcilib_register_bank_t pcilib_find_register_bank_by_name(pcilib_t *ctx, const char *bankname);
 
189
 
 
190
/**
 
191
 * Find the register bank id (offset in \a banks array) corresponding to the specified bank name or address
 
192
 * @param[in,out] ctx   - pcilib context
 
193
 * @param[in] bank      - either the name or the address of the required register bank
 
194
 * @return              - bank id or PCILIB_REGISTER_BANK_INVALID if bank is not found
 
195
 */
176
196
pcilib_register_bank_t pcilib_find_register_bank(pcilib_t *ctx, const char *bank);
177
197
 
 
198
/**
 
199
 * Find the register protocol id (offset in \a protocols array) corresponding to the specified protocol address 
 
200
 * @param[in,out] ctx   - pcilib context
 
201
 * @param[in] protocol  - the address of register protocol
 
202
 * @return              - protocol id or PCILIB_REGISTER_PROTOCOL_INVALID if register protocol is not found
 
203
 */
178
204
pcilib_register_protocol_t pcilib_find_register_protocol_by_addr(pcilib_t *ctx, pcilib_register_protocol_addr_t protocol);
 
205
 
 
206
/**
 
207
 * Find the register protocol id (offset in \a protocols array) corresponding to the specified protocol name
 
208
 * @param[in,out] ctx   - pcilib context
 
209
 * @param[in] name      - the name of register protocol
 
210
 * @return              - protocol id or PCILIB_REGISTER_PROTOCOL_INVALID if register protocol is not found
 
211
 */
179
212
pcilib_register_protocol_t pcilib_find_register_protocol_by_name(pcilib_t *ctx, const char *name);
 
213
 
 
214
/**
 
215
 * Find the register protocol id (offset in \a protocols array) corresponding to the specified protocol name or address
 
216
 * @param[in,out] ctx   - pcilib context
 
217
 * @param[in] name      - either the name or the address of the required register protocol
 
218
 * @return              - protocol id or PCILIB_REGISTER_PROTOCOL_INVALID if register protocol is not found
 
219
 */
180
220
pcilib_register_protocol_t pcilib_find_register_protocol(pcilib_t *ctx, const char *name);
181
221
 
 
222
/**
 
223
 * Resolves the address of the specified register bank. The address of the register0 in the bank is returned.
 
224
 *
 
225
 * All address types (virtual address in process address space, physical address, or bus address) can be resolved.
 
226
 * The caller has also to specify the requested access mode (read, write, read/write) and the error will be returned
 
227
 * if the requested access type is not possible.
 
228
 *
 
229
 * @param[in,out] ctx   - pcilib context
 
230
 * @param[in] flags     - specifies the type of required address (virtual, physical, or bus) and the required access (ro/wo/rw)
 
231
 * @param[in] bank      - the id of register bank
 
232
 * @return              - the resolved address or PCILIB_ADDRESS_INVALID on error
 
233
 */
182
234
uintptr_t pcilib_resolve_bank_address_by_id(pcilib_t *ctx, pcilib_address_resolution_flags_t flags, pcilib_register_bank_t bank);
 
235
 
 
236
/**
 
237
 * Resolves the address of the specified register bank. The address of the register0 in the bank is returned.
 
238
 *
 
239
 * All address types (virtual address in process address space, physical address, or bus address) can be resolved.
 
240
 * The caller has also to specify the requested access mode (read, write, read/write) and the error will be returned
 
241
 * if the requested access type is not possible.
 
242
 *
 
243
 * @param[in,out] ctx   - pcilib context
 
244
 * @param[in] flags     - specifies the type of required address (virtual, physical, or bus) and the required access (ro/wo/rw)
 
245
 * @param[in] bank      - the name of register bank
 
246
 * @return              - the resolved address or PCILIB_ADDRESS_INVALID on error
 
247
 */
183
248
uintptr_t pcilib_resolve_bank_address(pcilib_t *ctx, pcilib_address_resolution_flags_t flags, const char *bank);
184
249
 
 
250
/**
 
251
 * Resolves the address of the specified register.
 
252
 *
 
253
 * All address types (virtual address in process address space, physical address, or bus address) can be resolved.
 
254
 * The caller has also to specify the requested access mode (read, write, read/write) and the error will be returned
 
255
 * if the requested access type is not possible.
 
256
 *
 
257
 * @param[in,out] ctx   - pcilib context
 
258
 * @param[in] flags     - specifies the type of required address (virtual, physical, or bus) and the required access (ro/wo/rw)
 
259
 * @param[in] reg       - the id of register
 
260
 * @return              - the resolved address or PCILIB_ADDRESS_INVALID on error
 
261
 */
185
262
uintptr_t pcilib_resolve_register_address_by_id(pcilib_t *ctx, pcilib_address_resolution_flags_t flags, pcilib_register_t reg);
 
263
 
 
264
/**
 
265
 * Resolves the address of the specified register.
 
266
 *
 
267
 * All address types (virtual address in process address space, physical address, or bus address) can be resolved.
 
268
 * The caller has also to specify the requested access mode (read, write, read/write) and the error will be returned
 
269
 * if the requested access type is not possible.
 
270
 *
 
271
 * @param[in,out] ctx   - pcilib context
 
272
 * @param[in] flags     - specifies the type of required address (virtual, physical, or bus) and the required access (ro/wo/rw)
 
273
 * @param[in] bank      - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
 
274
 * @param[in] regname   - the name of the register
 
275
 * @return              - the resolved address or PCILIB_ADDRESS_INVALID on error
 
276
 */
186
277
uintptr_t pcilib_resolve_register_address(pcilib_t *ctx, pcilib_address_resolution_flags_t flags, const char *bank, const char *regname);
187
278
 
 
279
/**
 
280
 * Extracts additional information about the specified register bank. The additional information
 
281
 * is model-specific and are provided as extra XML attributes in XML-described register bank.
 
282
 * The available attributes are only restricted by used XSD schema.
 
283
 * @param[in,out] ctx   - pcilib context
 
284
 * @param[in] bank      - register bank id
 
285
 * @param[in] attr      - requested attribute name
 
286
 * @param[in,out] val   - the value of attribute is returned here (see \ref public_api_value),
 
287
 *                      pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
 
288
 * @return              - error code or 0 on success
 
289
 */ 
188
290
int pcilib_get_register_bank_attr_by_id(pcilib_t *ctx, pcilib_register_bank_t bank, const char *attr, pcilib_value_t *val);
 
291
 
 
292
/**
 
293
 * Extracts additional information about the specified register bank. The additional information
 
294
 * is model-specific and are provided as extra XML attributes in XML-described register bank.
 
295
 * The available attributes are only restricted by used XSD schema.
 
296
 * @param[in,out] ctx   - pcilib context
 
297
 * @param[in] bankname  - the name of register bank
 
298
 * @param[in] attr      - requested attribute name
 
299
 * @param[in,out] val   - the value of attribute is returned here (see \ref public_api_value),
 
300
 *                      pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
 
301
 * @return              - error code or 0 on success
 
302
 */ 
189
303
int pcilib_get_register_bank_attr(pcilib_t *ctx, const char *bankname, const char *attr, pcilib_value_t *val);
190
304
 
191
305
#ifdef __cplusplus