All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: xerces8 <xerces8@butn.net>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: USB mouse protocol,
Date: Wed, 30 Apr 2008 16:12:31 +0200	[thread overview]
Message-ID: <20080430141231.GA18693@suse.cz> (raw)
In-Reply-To: <WorldClient-F200804301607.AA07060136@butn.net>

On Wed, Apr 30, 2008 at 04:07:06PM +0200, xerces8 wrote:
> Vojtech Pavlik wrote:
> 
> > On Wed, Apr 30, 2008 at 11:28:59AM +0200, xerces8 wrote:
> > > Hi!
> > > 
> > > I'm curious about some details in the protocol used by USB mice.
> > > A cursory look at the "Device Class Definition for HID 1.11" documents
> > > tells me (note this is the first USB technical document I ever read)
> > > that a mouse can tell the host the format (the protocol) used to report
> > > data (movement, button state etc.).
> > > 
> > > Also a quick look into linuxv2.6.25/drivers/hid/usbhid/usbmouse.c suggests
> > > that 8 bits are used for position.
> > > 
> > > So my questions are:
> > >  - is the position data always 8 bits wide ?
> > 
> > No. The driver you need to look at is usbhid.ko, not usbmouse - that
> > only works for the static "HID Boot Protocol", and is only useful in
> > embedded devices.
> 
> Pretty hard to read there... Can I activate some debug output, to see what
> my mouse is sending ?

Yes, #define DEBUG and possibly also DEBUG_DATA will do the trick.

> 
> > >  - when are reports sent ? Are they polled by host ? Or sent by the device
> > > on its own ?
> > 
> > That depends on how you look at it. The host controller polls the device
> > at a specified rate - typically 100Hz, but the device decides whether it
> > will or won't send a report when polled.
> 
> 100Hz is the linux default ? Is there an USB standard value ?

100Hz is what mice normally ask for. The frequency is in the endpoint
descriptor provided by the mouse.

-- 
Vojtech Pavlik
Director SuSE Labs

  reply	other threads:[~2008-04-30 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30  9:28 USB mouse protocol, xerces8
2008-04-30 11:18 ` Vojtech Pavlik
     [not found]   ` <20080430111816.GA9876-AlSwsSmVLrQ@public.gmane.org>
2008-04-30 14:07     ` xerces8
2008-04-30 14:12       ` Vojtech Pavlik [this message]
2008-05-01 15:29         ` Anssi Hannula

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=20080430141231.GA18693@suse.cz \
    --to=vojtech@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=xerces8@butn.net \
    /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.