From owner-freebsd-hackers Fri Oct 8 11:55:10 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id F2C8414DC7 for ; Fri, 8 Oct 1999 11:55:05 -0700 (PDT) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id MAA03648; Fri, 8 Oct 1999 12:54:54 -0600 (MDT) (envelope-from ken) Message-Id: <199910081854.MAA03648@panzer.kdm.org> Subject: Re: CAM-ification - documentation In-Reply-To: from Nick Hibma at "Oct 8, 1999 10:09:49 am" To: nick.hibma@jrc.it (Nick Hibma) Date: Fri, 8 Oct 1999 12:54:54 -0600 (MDT) Cc: imp@village.org (Warner Losh), wilko@yedi.iaf.nl (Wilko Bulte), FreeBSD-hackers@FreeBSD.ORG From: "Kenneth D. Merry" X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [ reply moved the bottom... ] Nick Hibma wrote... > > Warner Losh wrote... > > > In message <199910072201.AAA43983@yedi.iaf.nl> Wilko Bulte writes: > > > : How difficult would CAMifying a driver be? > > > > > > Speaking of which, has a "How to CAMify a driver" doc been written? > > > > Nope. You've CAMified a driver, would you like to write it? :) > > > > Ken > > > > While on the topic: What documentation is there for CAM? I've found the > following, but would like to know whether there is more > > - CAM specification (at Digital?) www.t10.org, as Matt pointed out. FreeBSD/CAM is mostly CAM-2, with some CAM-3 thrown in. > - justin's docu on freefall. > > Especially some help on the topic of polling would be appreciated. > Otherwise I'll have to resort to figuring out how to do things in > interrupt context, and that is going to be dirty. Well, first off, are you talking about polling for completion in a peripheral driver or a SIM/HBA driver? If you're looking to poll for CCB completion in a peripheral driver, there's already xpt_polled_action() and an example of how to use it in dadump() in scsi_da.c. If you're talking about polling for transaction completion in a device driver, my guess is that you're going to have to do things in an interrupt context. (Unless you use a kernel process to do it.) The thing to remember is that when you get CCBs down in a CAM device driver, it may well be in an interrupt context. You have to be able to deal with that. My guess is that it might be easiest to just use a timeout handler to poll the device for completion every so often. A kernel process may also be an option, depending on how nasty the device is. I would recommend talking to Justin about it. I'm sure he'll be glad to give you some recommendations on how to proceed. He's also not the only one who knows about this sort of stuff. By now, Matt Jacob has a reasonable amount of experience with CAM drivers and he may also be able to give you some advice. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message