LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/forumdisplay.php?f=78)
-   -   vanilla 3.5: ioctl code sent from user level is corrupted (http://www.linuxquestions.org/questions/showthread.php?t=4175431514)

zvivered 10-10-2012 10:40 AM

vanilla 3.5: ioctl code sent from user level is corrupted
 
Hello,

I wrote a device driver that gets IOCTL requests from a user level driver and read/write from/to PCI.

The module+driver works fine under vanilla 2.6.27.35

Now I want to run it under vanilla 3.5

So I recomopiled the module+driver+application with the new toolchain and the new kernel.

When I run it, the ioctl code sent from the application to the module is not the one I'm sending.

The IOCTL codes are assembled in the following way:

#define ACM_IOC_MAGIC 'k'
#define ACM_WRITE_WORD32_REQUEST_CODE _IOW(RCM_IOC_MAGIC,1,int)

What is the meaning of the third parameter ?

What am I doing wrong ?

Thank you in advance,
Zvika

zvivered 10-15-2012 06:30 AM

Solution: Invalid prototype of ioctl
 
Dear Memebers,

The cause to the problem is that I used 4 parameters at the ioctl handler like in 2.6.27.35

I should declare as followed:

static long my_ioctl (struct file *file,unsigned int ioctl_num, unsigned long ioctl_param)

Thanks,
Zvika


All times are GMT -5. The time now is 03:11 AM.