Date: Wed, 18 Mar 2009 14:54:17 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: Weongyo Jeong <weongyo@freebsd.org> Cc: Sam Leffler <sam@freebsd.org>, freebsd-usb@freebsd.org, Andrew Thompson <thompsa@freebsd.org> Subject: Re: q: USB_SET_TIMEOUT in ugen. Message-ID: <200903181454.18859.hselasky@c2i.net> In-Reply-To: <20090318114642.GB12632@weongyo.cdnetworks.kr> References: <20090318073032.GA12632@weongyo.cdnetworks.kr> <200903180852.48034.hselasky@c2i.net> <20090318114642.GB12632@weongyo.cdnetworks.kr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 18 March 2009, Weongyo Jeong wrote: > On Wed, Mar 18, 2009 at 08:52:47AM +0100, Hans Petter Selasky wrote: > > 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/weo > > >ngyo /wireless/src/usr.sbin/uathload&HIDEDEL=NO > > > > > > Are there something I missed in here? > > > > See hints above. > > Thank you for advise. :-) I've solve `Invalid argument' error. However > the program looks it still doesn't work. All functions the problem used > are open(2), ioctl(2), read(2) and write(2). I think I can try to use > libusb but it'd be better if it works again using the above 4 system > calls. > > Is it supported in CURRENT or is it a one of regression? > > regards, > Weongyo Jeong What other IOCTL's are used? Can you make a debug trace: sysctl hw.usb2.ugen.debug=15 sysctl hw.usb2.dev.debug=15 ? --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903181454.18859.hselasky>