Skip to content

Commit 72f86cd

Browse files
committed
IIOD: Don't resize buffer before writing samples
IIOD supported using one single IIO buffer for both receiving and sending samples. While this worked *in theory*, it has never really been tested in that configuration, as the associated IIO devices seem to always be either receive-only, or transmit-only. As it does rely on libiio internals, with no way to re-implement cleanly on top of the public libiio API, disable this functionality for now. Signed-off-by: Paul Cercueil <[email protected]>
1 parent 0ade7a8 commit 72f86cd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

iiod/ops.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,17 @@ static void rw_thd(struct thread_pool *pool, void *d)
712712

713713
pthread_mutex_lock(&entry->thdlist_lock);
714714

715-
/* Reset the size of the buffer to its maximum size */
716-
entry->buf->data_length = entry->buf->length;
715+
/* Reset the size of the buffer to its maximum size.
716+
*
717+
* XXX(pcercuei): There is no way to perform this with
718+
* the public libiio API. However, it probably does not
719+
* matter; we only need to reset the size of the buffer
720+
* if the buffer was used for receiving samples, and
721+
* to date there is no IIO device that supports both
722+
* receiving and sending samples.
723+
*
724+
* entry->buf->data_length = entry->buf->length;
725+
*/
717726

718727
/* Same comment as above */
719728
for (thd = SLIST_FIRST(&entry->thdlist_head);

0 commit comments

Comments
 (0)