From owner-freebsd-usb@FreeBSD.ORG Fri Jan 3 13:47:53 2014 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFFB96E6 for ; Fri, 3 Jan 2014 13:47:53 +0000 (UTC) Received: from mta04.bitpro.no (mta04.bitpro.no [92.42.64.203]) by mx1.freebsd.org (Postfix) with ESMTP id 68DD01D74 for ; Fri, 3 Jan 2014 13:47:53 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta04.bitpro.no (Postfix) with ESMTPS id 8A4E31002B7; Fri, 3 Jan 2014 14:47:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 8ECCA8FC4C2; Fri, 3 Jan 2014 14:48:33 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4IiyKXDBbPj6; Fri, 3 Jan 2014 14:48:32 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id A40B18EB874; Fri, 3 Jan 2014 14:48:32 +0100 (CET) Message-ID: <52C6BFCB.9080300@bitfrost.no> Date: Fri, 03 Jan 2014 14:48:59 +0100 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: "Lundberg, Johannes" Subject: Re: usb_interrupt_read speed different on USB 2 vs 3 port. References: <52C6B770.401@bitfrost.no> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jan 2014 13:47:53 -0000 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 bmAttributes = 0x0003 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 bmAttributes = 0x0003 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