Subject: Re: Writing a PCI device driver
To: Steven Grunza <>
From: Manuel Bouyer <>
List: tech-kern
Date: 07/26/2000 18:56:10
On Tue, Jul 25, 2000 at 02:44:09PM -0400, Steven Grunza wrote:
> I'm writing a PCI device driver for a proprietary board.  It really
> wants to be a STREAMS driver since the board is a network interface
> card; however, NetBSD doesn't do STREAMS, yet....
> Since the data packet size varies from a couple of characters to a few
> hundred, I'm trying to structure the driver as a character device.  I've
> written a character pseudo-driver for NetBSD but I'm having some
> problems with the what happens after _attach().  My driver currently
> finds my board, supposedly assigns an IRQ to it, and then does nothing.

For what you want to do I guess your should't have a character pseudo-driver;
it's your PCI driver which should have a /dev character device entry.

It's not really hard, I think you can just merge your pseudo-driver back in
the PCI driver. You can for example look at the sys/dev/scsipi/uk.c driver.
It's not a PCI one but also have an attach function. As far as the character
device is concerned it should work the same way.

Manuel Bouyer, LIP6, Universite Paris VI.