On Sun, Jul 5, 2009 at 3:42 AM, Vipul Jain <vipulsj@xxxxxxxxx> wrote:
Header file containing ioctl number definitions must be shared by both the driver and user space application making use of that driver. Usually its a same file included at both places
Hi All,
I have written an character device driver and add IOCTL code into the driver. The only functionality that IOCTL provides is dumping the device structure properties in the user specified buffer. Now I would like to write an user application to test the driver. I am not sure how to include the defined IOCTL into the application code (as I have used _IOXX macros to create the IOCTLS and my driver perform checks for MAGIC number and etc.).
Header file containing ioctl number definitions must be shared by both the driver and user space application making use of that driver. Usually its a same file included at both places
I tried defining IOCTLs as simple integer values and remove MAGIC number checks in my driver things looks good from application but I am looking for right way of implementing IOCTL in linux device driver.
Not advisable approach
Any pointers on this will be really helpful.
Regards,
Vipul.
Thanks,
Chetan Nanda