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
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);
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
29
28
void pcilib_software_registers_close(pcilib_t *ctx, pcilib_register_bank_context_t *bank_ctx);
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
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);
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
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);
51
50
#ifdef _PCILIB_EXPORT_C
53
* new protocol addition to the protocol api.
52
* software protocol addition to the protocol api.
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*/