¿Tell Proc_entry-> Write_Proc que use un IOCTL con un argumento?
-
22-09-2019 - |
Pregunta
He visto algún código de muestra que hace esto:
proc_entry->read_proc = module_read;
proc_entry->write_proc = module_write;
Sin embargo, en mi módulo, he usado IOCTL en lugar de leer y escribir. Aquí está mi prototipo de función IOCTL:
int mytimer_ioctl(struct inode *inode, struct file *file, unsigned int fcn, unsigned long args)
Para leer, mi "fcn" es ioctl_get_timer, y para escribir, mi "fcn" es ioctl_set_timer.
De todos modos hacer algo como esto:
proc_entry->read_proc = module_ioctl(IOCTL_GET_TIMER);
proc_entry->write_proc = module_ioctl(IOCTL_SET_TIMER);
¿Pero no pasar en el argumento "Args"?
¿O tal vez la forma más fácil es simplemente escribir la función Module_read y Module_Write, y hacer que llamen al IOCTL?
¡Gracias por la ayuda chicos!
Solución
No hay forma de hacer esto. Solo implementa funciones de reenvío.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow