From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 18 18:07:36 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 82D4A16A41F for ; Tue, 18 Oct 2005 18:07:36 +0000 (GMT) (envelope-from dr2867@pacbell.net) Received: from smtp105.sbc.mail.mud.yahoo.com (smtp105.sbc.mail.mud.yahoo.com [68.142.198.204]) by mx1.FreeBSD.org (Postfix) with SMTP id 0F37543D45 for ; Tue, 18 Oct 2005 18:07:35 +0000 (GMT) (envelope-from dr2867@pacbell.net) Received: (qmail 66028 invoked from network); 18 Oct 2005 17:36:04 -0000 Received: from unknown (HELO ?192.168.0.190?) (dr2867.business@pacbell.net@68.126.216.127 with plain) by smtp105.sbc.mail.mud.yahoo.com with SMTP; 18 Oct 2005 17:36:04 -0000 Message-ID: <43553287.4030907@pacbell.net> Date: Tue, 18 Oct 2005 10:36:07 -0700 From: Daniel Rudy User-Agent: Mozilla/5.0 (X11R6; UNIX; FreeBSD/i386 5.4-RELEASE-p7; en-US; ja-JP; rv:1.7.12) Gecko/20050915 MultiZilla/1.6.2.0c Mnenhy/0.7.2.0 X-Accept-Language: en-us, en, ja MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Accessing USB Mass Storage Device 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: Tue, 18 Oct 2005 18:07:36 -0000 When the umass driver is compiled into the kernel, and one inserts a USB mass storage device, how does one access the device descriptors (serial number) while the device is listed as a da device? I would perfer to have the OS do all the work of accessing the hardware. But if it cannot be done, then I have the following questions: How does one read and write data to the device using /dev/ugen? I have a reasonable idea as to how something like that would work as the following steps illustrate: 1. open bulk descriptor in for read. 2. open bulk descriptor out for write. 3. send CBW read data to device via write. 4. read result from device via read. 5. read CSW from device. etc.. I have the standards documents on the SCSI commands, the USB data structures, and other information, but at this point, I'm kinda stuck. Will the above method work? Or is there something else that needs to be done to program data access against /dev/ugen? Or am I entirely wrong. I have tried using google, but I just keep getting back junk which is of little value. -- Daniel Rudy