From owner-freebsd-usb@FreeBSD.ORG Wed Mar 18 11:46:51 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 61B501065675; Wed, 18 Mar 2009 11:46:51 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5D18FC15; Wed, 18 Mar 2009 11:46:51 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: by wa-out-1112.google.com with SMTP id m38so6639waf.27 for ; Wed, 18 Mar 2009 04:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:organization :x-operation-sytem; bh=ZbIkAmXqdHldltDq22jB/+MzrnNSwVmQUXmAYGsudB4=; b=lxzGr9Q1Z8Ic/2ImdCTmCxCVT2FEV4un2bFfZSH45jtZ4PkEmoOi2r6SVCJDBaE0p+ QjpxPuBUyQray5UtWlwH1tQtCeTopUrwFhfKAWk3qlz9cy33ts+/6/Q4GJH7CmStTnrN 0kqVcila37Eivnsa0hvrLJ7xS646UVBjTlhVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :organization:x-operation-sytem; b=NJnDajDTQe0m+KAs0itaxlcBHy7Wfvf3Wc7azrhEHUsvt/6gYFEXPLFYzGvWdIOge9 ec3nki/Vo2EUDtNsXyk0e+0cevSzE9bxCEfYu6gv2qrJkm8Lmh7ADAs2wu9gN2iW3p5o 4zf0m5eLQFQZFB/zKpLbiJQ3MgtOS2Pzy23L8= Received: by 10.114.176.1 with SMTP id y1mr745517wae.49.1237376810607; Wed, 18 Mar 2009 04:46:50 -0700 (PDT) Received: from weongyo ([114.111.62.249]) by mx.google.com with ESMTPS id j26sm30774waf.59.2009.03.18.04.46.48 (version=SSLv3 cipher=RC4-MD5); Wed, 18 Mar 2009 04:46:50 -0700 (PDT) Received: by weongyo (sSMTP sendmail emulation); Wed, 18 Mar 2009 20:46:42 +0900 From: Weongyo Jeong Date: Wed, 18 Mar 2009 20:46:42 +0900 To: Hans Petter Selasky Message-ID: <20090318114642.GB12632@weongyo.cdnetworks.kr> References: <20090318073032.GA12632@weongyo.cdnetworks.kr> <200903180852.48034.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903180852.48034.hselasky@c2i.net> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD 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 Reply-To: Weongyo Jeong List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 11:46:51 -0000 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/weongyo > >/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