/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 protocols/software.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-09-24 02:28:45 UTC
  • mfrom: (305.1.19 views)
  • Revision ID: csa@suren.me-20150924022845-p7hc8lh8v0q48g0r
Finalyze XML support and provide initial support for views (only descriptions so far)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * @file software.h
3
 
 * @skip author nicolas zilio, nicolas.zilio@hotmail.fr
4
 
 * @brief header file for implementation of the protocol with software registers allocated in the main memory.
 
3
 * @brief header file for implementation of the protocol with software registers allocated in the kernel space, for parameters sharing between concurrent pcitool instances
5
4
 */
6
5
 
7
6
#ifndef _PCILIB_SOFTWARE_H
13
12
 
14
13
/**
15
14
 * this function initialize the kernel space memory for the use of software register. it initializes the kernel space memory and stores in it the default values of the registers of the given bank index, if it was not initialized by a concurrent process, and return a bank context containing the adress of this kernel space. If the kernel space memory was already initialized by a concurrent process, then this function just return the bank context with the adress of this kernel space already used
16
 
 * @param[in] ctx the pcilib_t structure running
17
 
 * @param[in] bank the bank index that will permits to get the bank we want registers from
18
 
 * @param[in] model not used
19
 
 * @param[in] args not used
20
 
 * @return a bank context with the adress of the kernel space memory related to it
 
15
 * @param[in] - ctx the pcilib_t structure running
 
16
 * @param[in] - bank the bank index that will permits to get the bank we want registers from
 
17
 * @param[in] - model not used
 
18
 * @param[in] - args not used
 
19
 * @return a bank context with the adress of the kernel space memory related to it, as we could have for BAR
21
20
 */
22
21
pcilib_register_bank_context_t* pcilib_software_registers_open(pcilib_t *ctx, pcilib_register_bank_t bank, const char* model, const void *args);
23
22
 
24
23
/**
25
 
 * this function clear the kernel memory space that could have been allocated for software registers.
26
 
 * @param[in] ctx the pcilib_t structure runnning
27
 
 * @param[in] bank_ctx the bank context running that we get from the initialisation function
 
24
 * this function clear the kernel memory space that could have been allocated for software registers and the bank context that correspond to it too
 
25
 * @param[in] ctx - the pcilib_t structure runnning
 
26
 * @param[in] bank_ctx - the bank context running that we get from the initialisation function
28
27
 */
29
28
void pcilib_software_registers_close(pcilib_t *ctx, pcilib_register_bank_context_t *bank_ctx);
30
29
 
31
30
/**
32
31
 * this function read the value of a said register in the kernel space.
33
 
 * @param[in] ctx the pcilib_t structure runnning
34
 
 * @param[in] bank_ctx the bank context that was returned by the initialisation function
35
 
 * @param[in] addr the adress of the register we want to read
36
 
 * @param[out] value the value of the register
37
 
 * @return 0 in case of success
 
32
 * @param[in] - ctx the pcilib_t structure runnning
 
33
 * @param[in] - bank_ctx the bank context that was returned by the initialisation function
 
34
 * @param[in] - addr the adress of the register we want to read
 
35
 * @param[out] - value the value of the register
 
36
 * @return error code : 0 in case of success
38
37
 */
39
38
int  pcilib_software_registers_read(pcilib_t *ctx, pcilib_register_bank_context_t* bank_ctx, pcilib_register_addr_t addr, pcilib_register_value_t *value);
40
39
 
41
40
/**
42
 
 * this function write the said value to a said register in the kernel space
43
 
 * @param[in] ctx the pcilib_t structure runnning
44
 
 * @param[in] bank_ctx the bank context that was returned by the initialisation function
45
 
 * @param[in] addr the adress of the register we want to write in
46
 
 * @param[out] value the value we want to write in the register
47
 
 * @return 0 in case of success
 
41
 * this function write the given value to a given register in the kernel space
 
42
 * @param[in] ctx - the pcilib_t structure runnning
 
43
 * @param[in] bank_ctx - the bank context that was returned by the initialisation function
 
44
 * @param[in] addr - the adress of the register we want to write in
 
45
 * @param[in] value - the value we want to write in the register
 
46
 * @return error code : 0 in case of success
48
47
 */
49
48
int pcilib_software_registers_write(pcilib_t *ctx,pcilib_register_bank_context_t* bank_ctx, pcilib_register_addr_t addr, pcilib_register_value_t value);
50
49
 
51
50
#ifdef _PCILIB_EXPORT_C
52
51
/**
53
 
 * new protocol addition to the protocol api.
 
52
 * software protocol addition to the protocol api.
54
53
 */
55
54
const pcilib_register_protocol_api_description_t pcilib_register_software_protocol_api =
56
55
  { PCILIB_VERSION, pcilib_software_registers_open, pcilib_software_registers_close,pcilib_software_registers_read, pcilib_software_registers_write }; /**< we add there the protocol to the list of possible protocols*/