UIO driver test

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Fri Apr 15 13:36:56 EDT 2016


>>  * Main initialization/remove routines
>>  */
>> static int __init uio_dummy_init(void)
>> {
>>         printk("uio_dummy_init( )\n" );
>>         uio_dummy_device = platform_device_register_simple("uio_dummy", -1,
>>                                                            NULL, 0);

You also need to register the UIO driver by calling
uio_register_device() after populating your "struct uio_info"
appropriately.

>
> Why are you using a platform driver and device on x86?  That's not going
> to work at all, as your device doesn't have an irq.  Please use this on
> a "real" device that has an interrupt assigned to it.

If it's only for learning purpose, I guess one can skip registering a
IRQ handler and use UIO_IRQ_CUSTOM, right?

I did something similar for testing a UIO hotplug bug once. I used to
fake an IRQ event from a timer by using uio_event_notify().
https://github.com/mandeepsandhu/uio-hotplug-test/blob/master/uio_fake_hotplug.c

Although, I'm not sure if the OP wants to do something similar

HTH,
-mandeep


>
> hope this helps,
>
> greg k-h
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



More information about the Kernelnewbies mailing list