Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Jan 2014 14:48:59 +0100
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        "Lundberg, Johannes" <johannes@brilliantservice.co.jp>
Cc:        "freebsd-usb@freebsd.org" <freebsd-usb@freebsd.org>
Subject:   Re: usb_interrupt_read speed different on USB 2 vs 3 port.
Message-ID:  <52C6BFCB.9080300@bitfrost.no>
In-Reply-To: <CAASDrVnA5Gv3svFrrkoH0kdRcEec2O7YvG=rDdPf-8rOVD6PkQ@mail.gmail.com>
References:  <CAASDrV=Onk2VbnSp-1s=XxJ0b89-M8--NWOeFPXjSgMLC8sVEA@mail.gmail.com> <52C6B770.401@bitfrost.no> <CAASDrVnA5Gv3svFrrkoH0kdRcEec2O7YvG=rDdPf-8rOVD6PkQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

For USB 3.0, sys/dev/usb/controller/xhci.c, the interval is set by:

         switch (type) {
         case UE_INTERRUPT:
                 if (fps_shift > 3)
                         fps_shift--;
                 temp |= XHCI_EPCTX_0_IVAL_SET(fps_shift);
                 break;
         case UE_ISOCHRONOUS:

Add some prints to the kernel and print "fps_shift" in the UE_INTERRUPT 
case. The value has unit 125 * (2**fps_shift) us.

The call is:
usb_interrupt_read(devh, 0x00000083, buf, 0x000002a, 1000);

BTW:

      Endpoint 0
         bLength = 0x0007
         bDescriptorType = 0x0005
         bEndpointAddress = 0x0083  <IN>
         bmAttributes = 0x0003  <INTERRUPT>
         wMaxPacketSize = 0x002a
         bInterval = 0x000a
^^^^ 10ms I think for FULL speed (XHCI will use 16ms interval)
         bRefresh = 0x0000
         bSynchAddress = 0x0000

      Endpoint 1
         bLength = 0x0007
         bDescriptorType = 0x0005
         bEndpointAddress = 0x0004  <OUT>
         bmAttributes = 0x0003  <INTERRUPT>
         wMaxPacketSize = 0x0040
         bInterval = 0x000a
^^^^ 10ms I think for FULL speed
         bRefresh = 0x0000
         bSynchAddress = 0x0000

So a round trip of 20ms is like expected. Maybe the EHCI driver will 
schedule a bit differently.

If in the kernel, it is possible to override this value.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52C6BFCB.9080300>