From owner-freebsd-usb@FreeBSD.ORG Mon Jun 27 09:13:55 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C23106564A for ; Mon, 27 Jun 2011 09:13:55 +0000 (UTC) (envelope-from l.pizzamiglio@bally-wulff.de) Received: from mail2.bally-wulff-berlin.de (mail2.bally-wulff-berlin.de [212.144.118.9]) by mx1.freebsd.org (Postfix) with ESMTP id ACD408FC12 for ; Mon, 27 Jun 2011 09:13:55 +0000 (UTC) Received: from bwex.bally-wulff.de (unknown [192.9.204.106]) by mail2.bally-wulff-berlin.de (Postfix) with ESMTP id C4CEB99052 for ; Mon, 27 Jun 2011 10:43:05 +0200 (CEST) Received: from pizzamig.bally.de ([192.9.205.30]) by bwex.bally-wulff.de with Microsoft SMTPSVC(6.0.3790.4675); Mon, 27 Jun 2011 10:43:05 +0200 Message-ID: <4E084297.2040200@bally-wulff.de> Date: Mon, 27 Jun 2011 10:43:03 +0200 From: Luca Pizzamiglio User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.18) Gecko/20110622 Thunderbird/3.1.11 MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Jun 2011 08:43:05.0973 (UTC) FILETIME=[3BD1EA50:01CC34A6] Subject: Read from bulk end point X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 09:13:56 -0000 Hi USB list, I've a little problem, but I'm not able to find a solution... I've a generic custom USB device with several end points. One of them (a bulk one) is read periodically (polled, 64 byte) every second. There was some time inconsistencies, so I checked the USB traffic with a sniffer, and I discovered that transactions are compacted at the start of the loop in a block of 64 read (64 byte * 64 msg = 4096 byte). In other words, on the bus the first read is followed immediately by the next 63 read. I guess that this is a pre-fetch optimization for BULK end points. How can I disable this optimization for this end point? How can I come back to a more "real-time" behavior? I tried to play with open() flags (O_NONBLOCK, O_DIRECT) without luck. Using FreeBSD 7 with HPS stack, this behavior didn't happen. Every read consists in 1 read on the bus and everything is fine. Thanks in advance! Luca