From owner-cvs-all@FreeBSD.ORG Mon Apr 9 17:44:57 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D4C616A403; Mon, 9 Apr 2007 17:44:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id D822713C4B0; Mon, 9 Apr 2007 17:44:56 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id l39Hd5WM057912; Mon, 9 Apr 2007 11:39:06 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <461A7A27.7090609@samsco.org> Date: Mon, 09 Apr 2007 11:38:47 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2pre) Gecko/20070111 SeaMonkey/1.1 MIME-Version: 1.0 To: "Kenneth D. Merry" , Roman Divacky References: <200704071940.l37Jew2t013708@repoman.freebsd.org> <20070407131228.L71232@ns1.feral.com> <46183104.6080904@samsco.org> <20070409165021.GA96611@nargothrond.kdm.org> In-Reply-To: <20070409165021.GA96611@nargothrond.kdm.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Mon, 09 Apr 2007 11:39:06 -0600 (MDT) X-Spam-Status: No, score=-0.8 required=5.5 tests=ALL_TRUSTED,SUBJ_HAS_SPACES autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/cam/scsi scsi_sg.c scsi_sg.h src/sys/modules/cam Makefile src/sys/conf NOTES files src/sys/compat/linux linux_ioctl.c linux_ioctl.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2007 17:44:57 -0000 I guess this work never got into ports? I'd like to see if there, even if it's augmented with other non-CAM versions. Scott Kenneth D. Merry wrote: > That's a pretty neat trick! Thanks Scott! > > For what it's worth, Doug Gilbert already ported sg3_utils and sdparm to > CAM a while back. I see a message from him to -scsi in March, 2006, > announcing it. > > Ken > > On Sat, Apr 07, 2007 at 18:02:12 -0600, Scott Long wrote: >> To tell you the truth, the SG device has one of the worst programming >> interfaces that I've ever seen. Even the various official docs on it >> complain about how bad it is. I've written apps for CAM, including a >> swiss-army-knife java-based management app, and CAM is vastly superior. >> I tried porting the app to linux and gave up due to how limited and >> unpleasant it was. From the kernel side, it's even scarier. >> >> But beyond that, the work I committed here was about opening up FreeBSD >> to more storage management opportunities. So I'm happy with whatever >> anyone wants to do with it that furthers that goal. I'd like to see >> the native interface be used as a bridge to help introduce programmers >> to FreeBSD and CAM; if the sg3_utils package is a step in that >> direction or if it provides tools that camcontrol doesn't, then go for >> it. >> >> Scott >> >> >> mjacob@freebsd.org wrote: >>> Cool- does this mean we should commit sg3_utils to ports then? >>> >>> On Sat, 7 Apr 2007, Scott Long wrote: >>> >>>> scottl 2007-04-07 19:40:58 UTC >>>> >>>> FreeBSD src repository >>>> >>>> Modified files: >>>> sys/modules/cam Makefile >>>> sys/conf files NOTES >>>> sys/compat/linux linux_ioctl.c linux_ioctl.h >>>> Added files: >>>> sys/cam/scsi scsi_sg.c scsi_sg.h >>>> Log: >>>> Add the CAM 'SG' peripheral device. This device implements a subset >>>> of the >>>> Linux SCSI SG passthrough device API. The intention is to allow for >>>> both >>>> running of Linux apps that want to talk to /dev/sg* nodes, and to >>>> facilitate >>>> porting of apps from Linux to FreeBSD. As such, both native and >>>> linuxolator >>>> entry points and definitions are provided. >>>> >>>> Caveats: >>>> - This does not support the procfs and sysfs nodes that the Linux SG >>>> driver provides. Some Linux apps may rely on these for operation, >>>> others may only use them for informational purposes. >>>> - More ioctls need to be implemented. >>>> - Linux uses a naming scheme of "sg[a-z]" for devices, while FreeBSD >>>> uses a >>>> scheme of "sg[0-9]". Devfs aliasis (symlinks) are automatically >>>> created >>>> to link the two together. However, tools like camcontrol only see >>>> the >>>> native names. >>>> - Some operations were originally designed to return byte counts or >>>> other >>>> data directly as the syscall return value. The linuxolator >>>> doesn't appear >>>> to support this well, so this driver just punts for these cases. >>>> >>>> Now that the driver is in place, others are welcome to add missing >>>> functionality. Thanks to Roman Divacky for pushing this work along. >>>> >>>> Revision Changes Path >>>> 1.1 +987 -0 src/sys/cam/scsi/scsi_sg.c (new) >>>> 1.1 +139 -0 src/sys/cam/scsi/scsi_sg.h (new) >>>> 1.138 +27 -0 src/sys/compat/linux/linux_ioctl.c >>>> 1.25 +34 -0 src/sys/compat/linux/linux_ioctl.h >>>> 1.1419 +5 -0 src/sys/conf/NOTES >>>> 1.1191 +1 -0 src/sys/conf/files >>>> 1.15 +1 -0 src/sys/modules/cam/Makefile >>>> >