[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Autoconf



Hi all,

I'm trying to write a pseudo driver that has to interface with the high-level audio driver. I've been facing some problems getting my driver to attach to high-level audio driver. I went through the autoconfiguration documentation for NetBSD where they lay-out the fashion in which the kernel probes and calls the attach routines of drivers listed in the character device table to allocate memory for their soft_c structures. The documentation also talks about cfattach and cfdriver stuctures as a means of conveying to the kernel, parameters such as the size of your soft_c structure needed for malloc purposes.

But, when I see the code for other sample pseudo drivers such as pty (/sys/kern/tty_pty.c), I see a completely different implementation. Here the memory for the soft_c structure is allocated in its attach routine itself and the cfattach and cfdriver structures are missing.

I've seen different declarations for the attach routine too. In some driver its as simple as:
void <drv_name>_attach (int num);
while in other cases its more akin to the documentation, i.e.
void <drv_name>_attach (struct device *, struct device *, void *);


Could someone please elaborate on how exactly the autoconfiguration works? Also, my kernel is currently crashing when the high-level driver that I attach to calls config_search() with one of the struct device * passed as an argument to it. I'm thinking there is some issue of memory, coz its an assignment statement inside the config_search() routine thats failing. Any comments on what could be going wrong and how to rectify the error will be thoroughly appreciated.

thanks for your time,
-Ishan.





_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail




Visit your host, monkey.org