Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance blocks API #1064

Merged
merged 6 commits into from
Oct 10, 2023
Merged

Enhance blocks API #1064

merged 6 commits into from
Oct 10, 2023

Commits on Oct 5, 2023

  1. block: Sanitize bytes_used in iio_block_enqueue()

    Make sure that the transfer size requested (in bytes) is not bigger than
    the size of the block itself.
    
    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    pcercuei committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    0731b1a View commit details
    Browse the repository at this point in the history
  2. iio.h: Also use bytes_used field in iio_block_enqueue() for RX transfers

    Previously, the 'bytes_used' was only used when enqueueing a TX
    transfer; for RX transfers, the full size of the iio_block was always
    used. This was arbitrary and confusing.
    
    Now, the 'bytes_used' field will be used for RX transfers as well.
    
    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    pcercuei committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    33ca5c1 View commit details
    Browse the repository at this point in the history
  3. iio.h: Default to full buffer if bytes_used == 0 in iio_block_enqueue()

    When calling iio_block_enqueue(), if 'bytes_used' is set to zero, then
    the full block is transferred.
    
    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    pcercuei committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    162a3c9 View commit details
    Browse the repository at this point in the history
  4. stream: Simplify iio_stream_get_next_block()

    The bytes_used field can now be set to 0 to default to the block size.
    
    Note that for RX transfers, iio_block_enqueue() was already called
    with bytes_used == 0, which previously meant "transmit 0 bytes and
    queue for receive". Because the "bytes_used" field is now handled as
    for RX buffers as well, the behaviour is now "queue for receiving a
    block size worth of data" which is functionally the same.
    
    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    pcercuei committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    c6cfa50 View commit details
    Browse the repository at this point in the history
  5. iiod: Fix use of uninitialized variable

    A iio_err() check was performed on the wrong variable.
    
    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    pcercuei committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    ffde142 View commit details
    Browse the repository at this point in the history
  6. iiod: Refuse to enqueue blocks of size 0

    Older development versions of Libiio v1.x will try to enqueue blocks of
    size 0, which is not supported anymore by the current Libiio and IIOD.
    
    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    pcercuei committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    5085ee3 View commit details
    Browse the repository at this point in the history