Date: Wed, 22 Jul 1998 17:13:40 -0700 From: Mike Smith <mike@smith.net.au> 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 Message-ID: <199807230013.RAA02438@dingo.cdrom.com> In-Reply-To: Your message of "Wed, 22 Jul 1998 16:31:31 PDT." <199807222331.QAA10025@burdell.ece.arizona.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807230013.RAA02438>