# Re: [snapscan] More USB Updates

From: Chris Bagwell (cbagwell@sprynet.com)
Date: Mon Nov 20 2000 - 20:06:48 PST

- Next message: Jerry Fritschle: "Newbie can't find his Astra 1220S (Beige G3)"
  - Previous message: Andy Angrick: "RE: Can't scan the second time"
  - Next in thread: Steve Underwood: "Re: [snapscan] More USB Updates"
  - Reply: Steve Underwood: "Re: [snapscan] More USB Updates"
  - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

  Steve,

  Here is a more specific question I have for you regarding a code change
  I made to RGBRouter_remaining(). The original functions logic works out
  to the following (this version is closer to what Lawernce posted).

  if (ps->cb_start < 0)
  remaining = (TxSource_remaining(pself) - ps->cb_size +
  ps->cb_line_size);
  else
  remaining = (TxSource_remaining(pself) + ps->cb_line_size -
  ps->pos);

  return (remaining);

  As far as I can tell, cb_start can only be < 0 at two or three times:
  1) When you start a fake scan to get transfer speed, 2) When you start
  the real scan, 3) when your closing down everything. In case 1 & 2 it
  seems to me that there are a lot of cases where the buffer will not be
  full (because the fake scan doesn't attempt to read a full buffer but
  that might be a bug or in case of the real scan I was thinking that the
  scanner might come back with an EAGAIN error or something and give us a
  partial buffer).

  If I read your original email correctly you said the test for cb_start <
  0 was for the end of the scan but I don't really see any code that would
  drain the circular buffer after the call to RGBRouter_done().

  Would you mind commenting on this part to help clear up my confusion. I
  think my confusion revolves around the difference between the TxSource
  buffer and the circular buffer (is there a difference?).

  Thanks,
  Chris

      --
       Chris Bagwell (mailto:cbagwell@sprynet.com)     |     Dallas, TX
           http://home.sprynet.com/~cbagwell           |         USA
      --
      Source code, list archive, and docs: http://www.mostang.com/sane/
      To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com

  - Next message: Jerry Fritschle: "Newbie can't find his Astra 1220S (Beige G3)"
  - Previous message: Andy Angrick: "RE: Can't scan the second time"
  - Next in thread: Steve Underwood: "Re: [snapscan] More USB Updates"
  - Reply: Steve Underwood: "Re: [snapscan] More USB Updates"
  - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

  This archive was generated by hypermail 2b29 : Mon Nov 20 2000 - 19:52:02 PST