157
157
error should be returned)
158
158
ignore packets: autoterminate each buffer, depends on engine
160
autogrow: automatic memory allocation, only through streaming
161
To handle differnt cases, the value returned by callback function instructs
162
the DMA library how long to wait for the next data to appear before timing
163
out. The following variants are possible:
164
terminate: just bail out
165
check: no timeout, just check if there is data, otherwise
167
timeout: standard DMA timeout, normaly used while receiving
168
fragments of packet: in this case it is expected
169
that device has already prepared data and only
170
the performance of DMA engine limits transfer speed
171
wait: wait until the data is prepared by the device, this
172
timeout is specified as argument to the dma_stream
173
function (standard DMA timeout is used by default)
162
175
first | new_pkt | bufer
163
176
--------------------------
164
standard wait | term | wait
165
multiple packets wait | check | wait - DMA_READ_FLAG_MULTIPACKET
166
waiting multipacket wait | wait | wait - DMA_READ_FLAG_WAIT
167
exact wait | wait/term | wait - limited by size parameter
168
ignore packets wait | check | check - just autoterminated
177
standard wait | term | timeout
178
multiple packets wait | check | timeout - DMA_READ_FLAG_MULTIPACKET
179
waiting multipacket wait | wait | timeout - DMA_READ_FLAG_WAIT
180
exact wait | wait/term | timeout - limited by size parameter
181
ignore packets wait | wait/check| wait/check - just autoterminated
171
183
Shall we do a special handling in case of overflow?
188
The DMA addresses are limited to 32 bits (~4GB for everything). This means we
189
can't really use DMA pages are sole buffers. Therefore,
190
1. In streaming mode a second thread will be spawned copying the data from the
191
DMA pages into the allocated buffers. On duration expiration this thread
192
will be stopped but processing will continue until all copyied data is
193
passed to the callbacks.
194
2. In synchronous mode, a single event will be extracted from the the DMA
197
- Actually, we can make another in-module buffering. But this hopefully can
173
201
Register Access Synchronization
174
202
===============================
175
203
We need to serialize access to the registers by the different running