From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 17 14:34:01 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A55116A41F for ; Mon, 17 Oct 2005 14:34:01 +0000 (GMT) (envelope-from alsbergt@zoopee.org) Received: from dexter.zoopee.org (zoopee.org [192.117.108.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9E6B43D48 for ; Mon, 17 Oct 2005 14:33:59 +0000 (GMT) (envelope-from alsbergt@zoopee.org) Received: from alsbergt by dexter.zoopee.org with local (Exim 4.43) id 1ERW3o-0003BX-OY for freebsd-hackers@freebsd.org; Mon, 17 Oct 2005 16:33:56 +0200 Date: Mon, 17 Oct 2005 16:33:56 +0200 From: Tom Alsberg To: FreeBSD Hackers List Message-ID: <20051017143356.GA12188@zoopee.org> Mail-Followup-To: Tom Alsberg , FreeBSD Hackers List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Face: "5"j@Y1Peoz1; ftTv>\|['ox-csmV+:_RDNdi/2lSe2x?0:HVAeVW~ajwQ7RfDlcb^18eJ; t,O,s5-aNdU/DJ2E8h1s,..4}N9$27u`pWmH|; s!zlqqVwr9R^_ji=1\3}Z6gQBYyQ]{gd5-V8s^fYf{$V2*_&S>eA|SH@Y\hOVUjd[5eah{EO@gCr.ydSpJHJIU[QsH~bC?$C@O:SzF=CaUxp80-iknM(]q(W Subject: How to determine link of umass/da devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 14:34:01 -0000 Hi. I need to write some user interface to perform some tasks with USB storage devices. One of the tasks is to show a list of all USB storage connected and all slices/partitions and filesystems in them. With tools like usbdevs and sysctl, I can find out what USB devices are connected, and also what USB drivers handle them (so I can see, for example, that there is a SanDisk Cruzer Micro connected to port 2 in bus 3 and the umass driver under it). I can also find out what da devices there are using camcontrol. However, how can I find out which da device was assigned to which umass/usb device? I see this info in some inconvenient form in dmesg. But I need something easier to handle programmatically to write a program that uses that data. I prefer not to resort to some ugly hack like trying to parse dmesg. Also, I'd be interested if it were possible to have my program informed when devices are connected/disconnected. Can a process ask usbd to send it some signal and somehow provide the details of the event when a device is connected/disconnected? Thanks, -- Tom -- Tom Alsberg - certified insane, complete illiterate. Homepage: http://www.cs.huji.ac.il/~alsbergt/ * An idea is not responsible for the people who believe in it.