Hello all,
We use ubuntu 10.04.
We are currently working on retrieving the kernel time in nanoseconds to userspace and have arrived at a conclusion that writing an ioctl would fulfill the purpose. We read linux/sockios.h and found that SIOCDEVPRIVATE to SIOCDEVPRIVATE+15 are reserved for writing private ioctls.
It mentioned that your driver must redefine them in its code.
So does this mean that, if my ioctl function is abc , then i have to #define it as-


in the driver code
then dev->do_ioctl=&abc

and then write a function named abc with all the appropriate arguments and in switch case
when cmd=SIOCDEVPRIVATE, implement my own logic ???

Then from userspace simply call socket ioctl with ifreq structure pointer as its third argument.

Is this the correct approach?? If not then how should this be implemented???

Any guidance would be appreciated....