LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-10-2012, 10:40 AM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 300

Rep: Reputation: 23
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
 
Old 10-15-2012, 06:30 AM   #2
zvivered
Member
 
Registered: Sep 2007
Posts: 300

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 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
 
  


Reply


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 08:57 PM
accessing SPI from kernel level and user level ramya_ts Programming 1 01-06-2009 07:30 AM
ioctl as non-root user cristianbdg Programming 3 12-21-2005 03:02 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
code in user level ramu_ak Linux - Networking 0 08-21-2003 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:23 PM.

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