Subject: what gives with xx_softc?
To: None <tech-kern@netbsd.org>
From: None <davem@eastcoast.co.za>
List: tech-kern
Date: 02/17/1999 18:05:08
Summary:
I'm trying to write a trivial pseudo device driver for learning
purposes. I'll progress to something more serious at a later stage.
My driver is called mypseudo.
Do I need a mypseudo_softc or don't I? Some drivers seem to have
them and others dont. Is it lake taking sugar in your
coffee?:-) or is there a deeper reason that some do and some dont?
Also, my (limited) understanding is that it should look like:
struct pseudo_softc {
struct device sc_dev;
/*Other stuff here*/
}
and yet (for e.g.), I see in arch/x68k/dev/kbd.c
struct kbd_softc {
int k_event_mode; /* if true, collect events, else pass to ite */
struct evvar k_events; /* event queue state */
} kbd_softc;
i.e. the first field is not a "struct device".
BTW, I'm on the i386 at the moment.
At this stage, I'm quite happy for there to be only one instance of
the driver (no. of drivers seem to have something to do with it). If I
could just get it compiled into the Kernel and be able to enter it
appropriately, I'd be a happy man! (well for a day or so anyway:-)
Thanks
Dave