All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Ritz <daniel.ritz-ml@swissonline.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-input@vger.kernel.org
Subject: Re: usbtouchscreen: version 0.4
Date: Sun, 07 Jun 2015 02:25:17 +0200	[thread overview]
Message-ID: <55738F6D.10001@swissonline.ch> (raw)
In-Reply-To: <20150606165213.GA28331@mwanda>

Hi Dan

On 2015-06-06 18:52 , Dan Carpenter wrote:
> Hi Daniel,
>
> I had a question about patch 5d8926658ce4: "usbtouchscreen: version 0.4"
> from Jul 31, 2006.
That's ancient :)
>
> drivers/input/touchscreen/usbtouchscreen.c
>   1326  static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
>   1327                                     unsigned char *pkt, int len)
>   1328  {
>   1329          unsigned char *buffer;
>   1330          int pkt_len, pos, buf_len, tmp;
>   1331  
>   1332          /* process buffer */
>   1333          if (unlikely(usbtouch->buf_len)) {
>   1334                  /* try to get size */
>   1335                  pkt_len = usbtouch->type->get_pkt_len(
>   1336                                  usbtouch->buffer, usbtouch->buf_len);
>
> ->get_pkt_len() returns -1 on error.

No, it doesn't and never has. In 62aa366d9b015 I added a bit of documentation:

/*
 * used to get the packet len. possible return values:
 * > 0: packet len
 * = 0: skip one byte
 * < 0: -return value more bytes needed
 */
int (*get_pkt_len) (unsigned char *pkt, int len);

So -1 means "need one more byte for a complete data packet". That byte will be
in delivered in the next invocation of usbtouch_irq(). One "touchscreen data packet"
can be split across multiple "usb packets" for some devices.

regards
-Daniel


  reply	other threads:[~2015-06-07  1:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-06 16:52 usbtouchscreen: version 0.4 Dan Carpenter
2015-06-07  0:25 ` Daniel Ritz [this message]
2015-06-07 12:12   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55738F6D.10001@swissonline.ch \
    --to=daniel.ritz-ml@swissonline.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.