From owner-freebsd-hackers Thu Feb 23 13:28:27 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id NAA13256 for hackers-outgoing; Thu, 23 Feb 1995 13:28:27 -0800 Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id NAA13250; Thu, 23 Feb 1995 13:28:22 -0800 Received: (dufault@localhost) by hda.com (8.6.9/8.3) id QAA04033; Thu, 23 Feb 1995 16:26:07 -0500 From: Peter Dufault Message-Id: <199502232126.QAA04033@hda.com> Subject: Driver switches in conf.c To: julian@freefall.cdrom.com, hackers@freefall.cdrom.com Date: Thu, 23 Feb 1995 16:26:07 -0500 (EST) X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1439 Sender: hackers-owner@FreeBSD.org Precedence: bulk In the current SCSI code there is a fair amount of common code in the type drivers that could be collapsed by something such as: int sdopen(dev_t dev) { return scsiopen(dev, &sd_switch); } where sd_switch is a SCSI specific structure that describes the unique code of a SCSI type driver and the common code is handled in scsiopen and then call sd_open with validated SCSI data structures. However, for new devices (as an example an Optronic's Image Setter produced by one of our valued clients) it seems silly to manually create oisopen, oisclose, oisioctl instead of vectoring directly into scsiopen and passing the appropriate switch from within conf.c. That is, instead of > disk oi0 at scbus0 target 1 unit 1 in config and then essentially oiopen, oiclose, oiioctl functions that go directly to scsiopen, scsiclose, scsiioctl, and I would somehow set it up in conf.c so that an indication of the "oi" device is passed in. I thought of having config generate > extern scsi_device sd_switch; > int sdopen(dev_t dev) { return scsiopen(dev, &sd_switch); } for each SCSI device in ioconf.c, but this seems flakey. Is there a good way to do this? For now I'm just planning on going with the "do it by hand each time" approach but that "offends my aesthetic". -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267