From: Adrian M. <ad...@mc...> - 2002-02-03 00:43:05
|
On Sunday 03 Feb 2002 12:38 am, M. R. Brown wrote: > * Adrian McMenamin <ad...@mc...> on Sun, Feb 03, 2002: > > What are the circumstances under which the 'connect' function for a maple > > client device will be called? > > > > I am building an experimental driver - as a module - for the microphone > > and while clearly the init and exit functions are being called and the > > maple core correctly reports the loading of a microphone driver, connect > > doesn't seem to get called. > > Did you register your driver with maple? Your init() routine should have a > call to maple_register_driver() with a pointer to the statically allocated > maple_driver structure in your source. Are you sure this is being setup > correctly? > > static struct maple_driver microphone_driver = { > function: MAPLE_FUNC_MICROPHONE, > name: "Microphone", > connect: my_microphone_connect, > disconnect: my_microphone_disconnect, > }; > > M. R. I think I am - unless you can spot an error here - is this a modularisation problem - ie this can't be done as a module? static struct maple_driver dc_microphone_driver = { function: MAPLE_FUNC_MICROPHONE, name: "Dreamcast microphone", connect: dc_microphone_connect, disconnect: dc_microphone_disconnect, reply: dc_microphone_callback, vblank: maple_getcond_vblank_callback, }; static int __init dc_microphone_init(void) { maple_register_driver(&dc_microphone_driver); return 0; } static void __exit dc_microphone_exit(void) { maple_unregister_driver(&dc_microphone_driver); if (unload_microphone()){ DEBGM("Maple: Microphone did not unload cleanly\n"); } } |