From owner-freebsd-usb@FreeBSD.ORG Thu Mar 6 17:18:39 2008 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 8B991106566C for ; Thu, 6 Mar 2008 17:18:39 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from mail.united-ware.com (am-productions.biz [69.61.164.22]) by mx1.freebsd.org (Postfix) with ESMTP id 3A73E8FC13 for ; Thu, 6 Mar 2008 17:18:38 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from [192.168.1.100] (adsl-68-250-179-2.dsl.wotnoh.ameritech.net [68.250.179.2]) (authenticated bits=0) by mail.united-ware.com (8.14.2/8.14.2) with ESMTP id m26HRW1W098460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Mar 2008 12:27:32 -0500 (EST) (envelope-from amistry@am-productions.biz) From: Anish Mistry Organization: AM Productions To: Hans Petter Selasky Date: Thu, 6 Mar 2008 12:23:09 -0500 User-Agent: KMail/1.9.7 References: <200803050411.17074.amistry@am-productions.biz> <200803061756.01227.hselasky@c2i.net> In-Reply-To: <200803061756.01227.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6940533.Dvsors8nWP"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200803061223.25223.amistry@am-productions.biz> X-Virus-Scanned: ClamAV 0.91.2/6146/Wed Mar 5 23:57:45 2008 on mail.united-ware.com X-Virus-Status: Clean Cc: Andriy Gapon , freebsd-usb@freebsd.org Subject: Re: Utility to Suspend/Disable/Enable Power Off USB ports 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: Thu, 06 Mar 2008 17:18:39 -0000 --nextPart6940533.Dvsors8nWP Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 06 March 2008, Hans Petter Selasky wrote: > Hi, > > I think that we should have this functionality in the USB kernel > like a separate IOCTL, that only takes an USB address like > argument, hence every USB device in the kernel knows which is its > parent HUB. Yes, this would be ideal. > There is a problem when you do a port reset, and that is that the > USB device goes into the unaddressed state, and starts responding > to address 0. If another device is being enumerated at the same > time, this might cause problems. Hmmm...Any suggestions? > > BTW: What are the main purposes of your program? To shutoff a USB device so that it knows to stop. See my email=20 earlier to the list entitled "Suspend/Sleep/Stop USB device". Basically my built-in camera was getting hot and drawing power. I=20 needed a way to shut it down as not to waste power. > > --HPS > > On Wednesday 05 March 2008, Anish Mistry wrote: > > I've written the upower utility allows you to selectively suspend > > usb ports. It acts similar to the Windows "Stop Removable > > Device" process. It has only been tested on 7.0-RELEASE. > > > > WARNING: This program may eat your lunch and kick your dog.=20 > > You've been warned. > > > > Download and compile. > > > > fetch http://am-productions.biz/docs/upower.c > > gcc -o upower upower.c > > > > You will need to be root or have rw access to the uhub devices. > > eg. /dev/usbX > > > > Use "usbdevs -v" to find the port/device to suspend. > > # usbdevs -v > > Controller /dev/usb0: > > addr 1: full speed, self powered, config 1, UHCI root > > hub(0x0000), Intel(0x0000), rev 1.00 > > port 1 powered > > port 2 powered > > Controller /dev/usb1: > > addr 1: full speed, self powered, config 1, UHCI root > > hub(0x0000), Intel(0x0000), rev 1.00 > > port 1 powered > > port 2 addr 2: low speed, power 100 mA, config 1, product 0x0009 > > (0x0009), vendor 0x045e(0x045e), rev 1.05 > > Controller /dev/usb2: > > addr 1: full speed, self powered, config 1, UHCI root > > hub(0x0000), Intel(0x0000), rev 1.00 > > port 1 powered > > port 2 addr 2: full speed, power 100 mA, config 1, Fingerprint > > Sensor(0x2580), vendor 0x08ff(0x08ff), rev 6.23 > > Controller /dev/usb3: > > addr 1: full speed, self powered, config 1, UHCI root > > hub(0x0000), Intel(0x0000), rev 1.00 > > port 1 powered > > port 2 powered > > Controller /dev/usb4: > > addr 1: high speed, self powered, config 1, EHCI root > > hub(0x0000), Intel(0x0000), rev 1.00 > > port 1 powered > > port 2 powered > > port 3 addr 2: high speed, self powered, config 1, product > > 0x005a(0x005a), vendor 0x0409(0x0409), rev 1.00 > > port 1 powered > > port 2 powered > > port 3 powered > > port 4 powered > > port 4 powered > > Controller /dev/usb5: > > addr 1: high speed, self powered, config 1, EHCI root > > hub(0x0000), Intel(0x0000), rev 1.00 > > port 1 powered > > port 2 powered > > port 3 powered > > port 4 addr 2: high speed, power 320 mA, config 1, Sirius USB2.0 > > Camera(0x3343), Vimicro Corp.(0x0ac8), rev 1.00 > > > > > > Since my built-in USB camera draws power when not in use, I'll > > suspend it to save battery time. > > > > # ./upower /dev/usb5 4 suspend =2D-=20 Anish Mistry amistry@am-productions.biz AM Productions http://am-productions.biz/ --nextPart6940533.Dvsors8nWP Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBH0Ch+xqA5ziudZT0RAqGJAKDGzMfSKx9VXrkg2J+7+NryQu9wYwCfSIc4 ButiVhY7UAS+YjgKZmCZ3Rc= =l6wg -----END PGP SIGNATURE----- --nextPart6940533.Dvsors8nWP--