Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 10-10-2012, 11:40 AM   #1
Registered: Sep 2007
Posts: 293

Rep: Reputation: 23
vanilla 3.5: ioctl code sent from user level is corrupted


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

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'

What is the meaning of the third parameter ?

What am I doing wrong ?

Thank you in advance,
Old 10-15-2012, 07:30 AM   #2
Registered: Sep 2007
Posts: 293

Original Poster
Rep: Reputation: 23
Solution: Invalid prototype of ioctl

Dear Memebers,

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

I should declare as followed:

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with user permission level--give access to a user 2 use 500 servers svani Linux - Newbie 2 06-17-2010 09:57 PM
accessing SPI from kernel level and user level ramya_ts Programming 1 01-06-2009 08:30 AM
ioctl as non-root user cristianbdg Programming 3 12-21-2005 04:02 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 02:37 AM
code in user level ramu_ak Linux - Networking 0 08-21-2003 02:52 AM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration