Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all! Is it possible to access different endpoints of the same interface of a USB device by a kernel driver and in user space mode at the same time ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Posts
    1

    Question Simultaneous access to USB device in kernel and user space?


    Hi all!

    Is it possible to access different endpoints of the same interface of a USB device by a kernel driver and in user space mode at the same time (for more details on the use case, see below)? As far as I understand, one has to claim the entire interface before using any endpoint (i.e., the answer to the above question would be "no"), but maybe I'm overlooking something. Any ideas?

    Thanks & kind regards,
    Markus

    P.S.: Here is why I would need this: I'm working on a kernel driver for a USB device which has both isochronous endpoints and interrupt endpoints in the same interface. The isochronous endpoints are best handled by a kernel driver, which registers the device as an ALSA sound card. However, the communication on the interrupt endpoints is rather complex and should be handled in user space, e.g., using libusb. Is it possible to split the work this way (kernel talks to isochronous endpoints, user space talks to interrupt endpoints)? An alternative way would be to define an additional interface between kernel and user space (e.g., netlink) and handle all USB communication in the kernel driver, but I would rather avoid such complexity.

  2. #2
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192
    Quote Originally Posted by grabner View Post
    Hi all!

    Is it possible to access different endpoints of the same interface of a USB device by a kernel driver and in user space mode at the same time (for more details on the use case, see below)? As far as I understand, one has to claim the entire interface before using any endpoint (i.e., the answer to the above question would be "no"), but maybe I'm overlooking something. Any ideas?

    Thanks & kind regards,
    Markus

    P.S.: Here is why I would need this: I'm working on a kernel driver for a USB device which has both isochronous endpoints and interrupt endpoints in the same interface. The isochronous endpoints are best handled by a kernel driver, which registers the device as an ALSA sound card. However, the communication on the interrupt endpoints is rather complex and should be handled in user space, e.g., using libusb. Is it possible to split the work this way (kernel talks to isochronous endpoints, user space talks to interrupt endpoints)? An alternative way would be to define an additional interface between kernel and user space (e.g., netlink) and handle all USB communication in the kernel driver, but I would rather avoid such complexity.
    I think you'll need a translation layer unless there's some way of communicating between the UMD and KMD like Windows has. Unfortunately my driver knowledge is lacking (to say the least) so I can't really say much beyond that, but I'm pretty sure you're stuck with said complexity.

    It works nicely once it's implemented (in WDF, anyway).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •