Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-21-2010, 08:36 AM   #1
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, 02:10 AM   #2
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, 02:22 AM   #3
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.


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 07:57 AM
dpkg return error :post installation script return an error code (1) grimfold Debian 2 09-10-2009 01:55 PM
ioctl call returns error. HarryBoy Programming 6 09-10-2008 10:08 AM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 06:45 PM
keymap ioctl error during Mandrake 10 install 12_Fish Linux - Newbie 0 09-06-2004 01:06 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration