From owner-freebsd-hardware Wed Jul 22 17:17:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA27842 for freebsd-hardware-outgoing; Wed, 22 Jul 1998 17:17:15 -0700 (PDT) (envelope-from owner-freebsd-hardware@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA27810 for ; Wed, 22 Jul 1998 17:16:54 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.8.8/8.8.5) with ESMTP id RAA02438; Wed, 22 Jul 1998 17:13:40 -0700 (PDT) Message-Id: <199807230013.RAA02438@dingo.cdrom.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: john@ece.arizona.edu (John Galbraith) cc: randal@comtest.com, dufault@hda.com, mike@smith.net.au, FreeBSD-hardware@FreeBSD.ORG Subject: Re: new GPIB driver In-reply-to: Your message of "Wed, 22 Jul 1998 16:31:31 PDT." <199807222331.QAA10025@burdell.ece.arizona.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 22 Jul 1998 17:13:40 -0700 From: Mike Smith Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Randal> From your last email I take it that you haven't > Randal> implemented any of NI's 488.2 library calls? So do you > Randal> have a similar interface to Freds code? > > Yeah, it uses ioctl() calls. They are quite similar. It didn't take > me more than a few minutes to convert my code from the stock driver to > mine. If I had thought about it more, I could have just left them > identical (except I would have to add a bunch). Another difference > between his and my driver is how he uses the minor numbers. He likes > to be able to open minor device 4, and write() to a device on the GPIB > bus at address 4. This is sometimes useful, granted, but I personally > don't even need to write to a GPIB printer or anything this way. I don't like this at all (as I pointed out to Randal). GPIB is a bus, and it should be treated like one. The GBIB driver should provide GPIB I/O services to a set of peripheral drivers (consider SCSI as an example). ioctl() is not good for I/O. > Instead, I use the minor number as a card index, so I can have > multiple cards in the machine at the same time. This may not be very > common in real life, but I anticipate this being very useful for > debugging the driver itself. You can encode both the card number and the address in the minor number I expect; there's lots of room there. Again, see how disks are handled. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message