LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 06-27-2011, 05:38 AM   #1
ndno
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
USB Gadget control endpoint processing to handle vendor specific requests


Hi,

I hope maybe some knowledgeable Linux USB device driver expert or programmer can help me with this; I guess I can wish for David Brownell's help but that's wishing too much Anyways, here's my situation. I'm doing embedded Linux programming on an OMAP3 (ARM Cortex 8) development board called the BeagleBoard. The board is using a USB gadget (peripheral) driver for network communication; the module is g_ether.ko. For my project, I need to modify that driver (specifically the driver file ether.c) to be able to handle some "vendor specific" traffic on Control Endpoint 0 (ep0). Normally, control endpoints only process standard USB requests (USB_TYPE_STANDARD); for my project, I need to modify it to also process vendor-specific USB request (USB_TYPE_VENDOR). I was able to track the processing in (drivers/usb/gadget) down to the composite.c module and all endpoint request goes through the composite_setup function, which currently only support USB standard requests (such as get USB descriptors, set USB configuration, set USB interface, etc). I was able to modify composite.c to call a vendor callback function I added to ether.c if the type is USB_TYPE_VENDOR.

In the vendor callback function I added to ether.c, I was able to send the USB request data up to a userspace application via a character driver interface. However, a "GET" request requires this vendor callback function to "wait" for the userspace app to send the response down to it via the character driver. It seems to work when I sent a vendor specific USB control message from the host to the target BeagleBoard; the Get request made it through the g_ether driver to the vendor specific callback function and up to the userspace application. However, this is where the driver crashes (waiting for the GET request response data so that it can send it back to the host).

I know I'm violating all kinds of rules but please forgive me as I'm new to Linux kernel programming. I tried searching the web for help or driver examples on how to implement this but I can't find any. I tried to use the libusb API but that is just for "host" programming, not "peripheral" programming. Can someone please provide guidance, advice, links, examples, etc on how I can properly implement this vendor specific control endpoint processing, which will forward the vendor-specific requests from the g_ether driver up to a userspace application and then "waits" for the response data from it so that it can return the data back to the host on the other end?

Thanks,
Andy
 
  


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
[SOLVED] .sh doesn't handle [ ] processing right? error: [: too many arguments jonathansfl Linux - Software 3 12-09-2010 09:53 AM
How do I execute vendor specific SMART commands with c language? biospeter Programming 2 07-19-2008 07:39 PM
Drop all requests from specific ip sir-lancealot Linux - Security 6 04-30-2008 10:17 AM
LXer: Linux Certification: Vendor-Specific or Vendor Neutral LXer Syndicated Linux News 0 01-19-2007 09:33 AM
Dante client problem: control-socket: Transport endpoint is not connected phonic Linux - Networking 1 07-14-2004 04:46 PM


All times are GMT -5. The time now is 04:35 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration