Lines Matching refs:read
103 /* since they are read-only registers */
174 /* read 'base' button status */
179 /* read 'extended' button status */
201 * amount is read, it may no be ready, leading to errors. To work around
202 * it, we read data count one more time before reading.
208 SANE_Word count, read, len, dummy;
215 read = 0;
237 read = 0;
238 while ((read < total) && (count != 0 || (control & 0x08) == 0x08))
243 /* read */
247 /* read even size unless last chunk */
248 if ((len & 1) && (read + len < total))
258 status = sanei_rts88xx_read_data (devnum, &len, image + read);
262 "simple_scan: failed to read from scanner\n");
265 read += len;
269 /* don't try to read data count if we have enough data */
270 if (read < total)
285 if (read < total)
288 total - read);
577 /* reset ? so we don't need to read data */
618 * if there is no data available from scanner. But once read is started,
619 * all the required amount is read. Once wait for data succeeded, we still poll
620 * for data in order no to read it too fast, but we don' take care of non blocking
627 SANE_Int count, read, len, dummy;
638 if (dev->read == 0)
676 { /* start of read for a new block */
696 read = 0;
700 while (read < length && dev->read < dev->to_read
704 if (dev->read == 0)
709 DBG (DBG_error, "read_data: failed to read data count\n");
714 /* if there is data to read, read it */
724 /* we only read even size blocks of data */
731 if (len > length - read)
733 len = length - read;
736 status = sanei_rts88xx_read_data (dev->devnum, &len, dest + read);
739 DBG (DBG_error, "read_data: failed to read from scanner\n");
747 if (dev->read == 0)
763 fwrite (dest + read, 1, len, raw);
768 read += len;
769 dev->read += len;
770 DBG (DBG_io2, "read_data: %d/%d\n", dev->read, dev->to_read);
773 /* in fast scan mode, read data count
774 * in slow scan, head moves by the amount of data read */
778 DBG (DBG_error, "read_data: failed to read data count\n");
783 if (count == 0 && dev->read < dev->to_read)
796 if (dev->read >= dev->to_read)
815 /* we only read even size blocks of data */
843 DBG (DBG_io, "read_data: read %d bytes from scanner\n", length);