|
| int | FlxCard::dma_max_tlp_bytes () |
| void | FlxCard::dma_to_host (u_int dma_id, u_long dst, size_t size, u_int flags) |
| void | FlxCard::dma_from_host (u_int dma_id, u_long src, size_t size, u_int flags) |
| bool | FlxCard::dma_enabled (u_int dma_id) |
| void | FlxCard::dma_wait (u_int dma_id) |
| void | FlxCard::dma_stop (u_int dma_id) |
| void | FlxCard::dma_advance_ptr (u_int dma_id, u_long dst, size_t size, size_t bytes) |
| void | FlxCard::dma_set_ptr (u_int dma_id, u_long dst) |
| u_long | FlxCard::dma_get_ptr (u_int dma_id) |
|
u_long | FlxCard::dma_get_read_ptr (u_int dma_id) |
| void | FlxCard::dma_reset () |
| u_long | FlxCard::dma_get_fw_ptr (u_int dma_id) |
|
u_long | FlxCard::dma_get_current_address (u_int dma_id) |
| bool | FlxCard::dma_cmp_even_bits (u_int dma_id) |
A set of functions to setup, start and stop DMA transfers and to interact with the circular buffer PC pointers.
| void FlxCard::dma_to_host |
( |
u_int | dma_id, |
|
|
u_long | dst, |
|
|
size_t | size, |
|
|
u_int | flags ) |
First stops the DMA channel identified by dma_id. It does not check if the channel is busy. Then it programs the channel and starts a new DMA from-device-to-host operation.
Note: The bits 10:0 of the DMA descriptor (bitfield NUM_WORDS in the Wupper documentation) will be set to the maximum TLP size supported by the system. Therefore, the transfer size has to be a multiple of that value.
Errors In case of an error, an exception is thrown.
- Parameters
-
| dma_id | The DMA channel (descriptor) to be used; valid numbers are 0..7 |
| dst | The value for the start_address field of the descriptor. NOTE: You have to provide a physical memory address |
| size | The size of the transfer in bytes |
| flags | The value for the wrap_around field of the descriptor; "1" means: enable wrap around, i.e. use continuous DMA |
| void FlxCard::dma_from_host |
( |
u_int | dma_id, |
|
|
u_long | src, |
|
|
size_t | size, |
|
|
u_int | flags ) |
First stops the DMA channel identified by dma_id. It does not check if the channel is busy. Then it programs the channel and starts a new DMA from-host-to-device operation.
Note: The size of the transfer has to be a multiple of 32 bytes.
The method internally computes the optimal value for the bits 10:0 of the DMA descriptor (bitfield NUM_WORDS in the Wupper documentation).
The algorithm used is this:
- if transfersize % 32 != 0: error("number of bytes transferred must be a multiple of 32")
- tlp = get_max_tlp()
- if transfersize % tlp == 0: do transfer
- else: tlp = tlp >> 1 && goto 3
Note: The algorithm above is currently not used: the transfer unit size is set to the minimum of 32 bytes, to make sure small messages are always sent, in particular when continuous DMA is enabled. The upper 16 bits of the flags parameter can be used to force a transfer size unequal to (so larger than) 32 bytes (but must be a multiple of 32).
Errors In case of an error, an exception is thrown.
- Parameters
-
| dma_id | The DMA channel (descriptor) to be used; valid numbers are 0..7 |
| src | The value for the start_address field of the descriptor. NOTE: You have to provide a physical memory address |
| size | The size of the transfer in bytes |
| flags | The value for the wrap_around field of the descriptor. “1” means: enable wrap around, i.e. use continuous DMA |