From owner-freebsd-usb@FreeBSD.ORG Wed Mar 18 07:50:19 2009 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 9C1571065670; Wed, 18 Mar 2009 07:50:19 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.swip.net [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id D12EC8FC08; Wed, 18 Mar 2009 07:50:18 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=43LKmNx98UoA:10 a=j+k/Ze5hWUCaCztCgEjzDQ==:17 a=6I5d2MoRAAAA:8 a=tvf_CbeH7eBSgVi82vUA:9 a=z05f_VU47Xxj0qSpKmcA:7 a=_2dsPlJt2eAaEAyhkwp07hUIvH0A:4 a=50e4U0PicR4A:10 Received: from [81.191.55.181] (account mc467741@c2i.net HELO laptop) by mailfe14.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 468471919; Wed, 18 Mar 2009 08:50:16 +0100 From: Hans Petter Selasky To: Weongyo Jeong Date: Wed, 18 Mar 2009 08:52:47 +0100 User-Agent: KMail/1.9.7 References: <20090318073032.GA12632@weongyo.cdnetworks.kr> In-Reply-To: <20090318073032.GA12632@weongyo.cdnetworks.kr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903180852.48034.hselasky@c2i.net> Cc: Sam Leffler , freebsd-usb@freebsd.org, Andrew Thompson Subject: Re: q: USB_SET_TIMEOUT in ugen. 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: Wed, 18 Mar 2009 07:50:19 -0000 Hi, On Wednesday 18 March 2009, Weongyo Jeong wrote: > Hello, > > During porting uath(4) to usb2 I found the following code failed to run: > > data = open("/dev/usb/0.2.2", O_WRONLY, 0); > timeout = UATH_DATA_TIMEOUT; > if (ioctl(data, USB_SET_TIMEOUT, &timeout) < 0) > err(-1, "%s: USB_SET_TIMEOUT(%u)", datadev, > UATH_DATA_TIMEOUT); > > and the error was: > > uathload: /dev/usb/0.2.2: USB_SET_TIMEOUT(1000): Invalid > argument Use the following macro instead: #define USB_SET_TX_TIMEOUT _IOW ('U', 137, int) There also is a match for USB_SET_RX_TIMEOUT . USB_SET_TIMEOUT has been removed. Also don't forget to include "usb_ioctl.h" . Another idea: Port the program to libusb .... > > It looks it's ok with calling ioctl(msg, USB_SET_TIMEOUT, ..) to > /dev/usb/0.2.1 > > And the behaviour of program isn't likely with usb1 that it worked well > in usb1. After writing some data into msg and data pipe there was no > any response using read(2). The problem source can be found at:. > > http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/weongyo >/wireless/src/usr.sbin/uathload&HIDEDEL=NO > > Are there something I missed in here? > See hints above. --HPS