Re: advice

From: YH
Date: Sat Sep 03 2005 - 19:47:57 EST


Hello,

Apologize for off topic questions. While I am working on a device driver in kernel 2.4.21, I need advices from kernel developers.

1. When the read() or write() is called from user applications, the driver can either have a static buffer with limited size or dynamic memory allocation (kmalloc).

The static buffer is simple and reliable, but limited buffer size to applications.

Personally, I would like to use dynamic kernel memory allocation (kmalloc), the question is whether it could be any issues (reliability) to frequently call kmalloc / kfree in a high speed device (100mpbs)?

2. Although there is a mechanism for user applications to access the driver through function call read(), write(), or ioctl(). Can the application passes a callback pointer to the driver in kernel space so that the driver can call the callback function when some special event is received. Or if there is a mechanism to let the driver to send a notification to the user application?

Thank you and appreciate your helps.

Jim

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/