LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-21-2010, 09:36 AM   #1
wybourn
LQ Newbie
 
Registered: Jul 2010
Posts: 14

Rep: Reputation: 0
Return error from ioctl command


I'm creating a usb device driver that needs to be able to read from two different endpoints. I couldn't see any way of having two read functions in the driver, so I got round this by reading from one of the endpoints with read, and the other with ioctl.

However this hasn't worked, the ioctl call from c returns -1. I added a printk command in the driver in the ioctl function, however looking at kern.log I can see that this function is never being called.

Does anyone have any ideas as to what the problem called be, or a better method of being able to read from two different endpoints?
 
Old 07-22-2010, 03:10 AM   #2
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
very little info.. for debugging, check if printing in the kernel is enabled, maybe debug printing is not enabled in your kernel source so there are no prints. then check if your driver is registered properly, along with its file operations. your read/ioctl call could be using the read/ioctl function of an existing usb driver.
 
Old 07-22-2010, 03:22 AM   #3
wybourn
LQ Newbie
 
Registered: Jul 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Debugging is enabled, and the read command works fine, so does write, flush, release, probe etc, its just the ioctl command. I've changed the contents of the ioctl command to just a printk statement, however I'm still getting -1 returned and no debug messages from the function are being displayed.
 
  


Reply

Tags
ioctl, usb


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
get console window width: why ioctl always return 0 width? karatelambda Programming 2 07-07-2010 08:57 AM
dpkg return error :post installation script return an error code (1) grimfold Debian 2 09-10-2009 02:55 PM
ioctl call returns error. HarryBoy Programming 6 09-10-2008 11:08 AM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 07:45 PM
keymap ioctl error during Mandrake 10 install 12_Fish Linux - Newbie 0 09-06-2004 02:06 AM


All times are GMT -5. The time now is 12:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration