LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-22-2010, 06:56 AM   #1
wybourn
LQ Newbie
 
Registered: Jul 2010
Posts: 14

Rep: Reputation: 0
Usb driver programming, ioctl returns -1


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.

Just to mention, debugging is enabled, the other drivers work fine and the ioctl function has been added to the file_operations structure.
 
Old 07-23-2010, 06:07 AM   #2
greplinux
Member
 
Registered: Jun 2007
Posts: 118

Rep: Reputation: 17
Hi,

What endpoints you are trying to read? Can you post your code ?

Thanks,
 
Old 07-23-2010, 06:54 AM   #3
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Quote:
I'm creating a usb device driver that needs to be able to read from two different endpoints.
Sorry to not answer to your question but I think doing it that way is not a good solution... Are you sure there's any way to put all your glue inside a user-land library which open two USB link and fusion datas?
I say that for at least 2 reasons:
-the tools / policies idea (kernel provides tools, policies, that use these tools, must be done elsewhere)
-this kind of scheme goes against what I know of USB drivers, thus you're using tricks and tricks are the last solutions, when nothing else could work.
 
  


Reply



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
ioctl(SIOCGIFCONF) returns only loopback interface info Braiam Linux - Software 0 03-08-2010 01:42 PM
ioctl call returns error. HarryBoy Programming 6 09-10-2008 10:08 AM
(ioctl(ts->fd, EVIOCGVERSION, &version) returns me -1, why?? webquinty Linux - Newbie 3 07-07-2008 07:54 AM
Linux USB device driver programming? redarrow Programming 6 02-03-2008 02:54 AM
need some usb driver programming help glo Programming 3 10-27-2003 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:04 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