Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raw gadget can be use to right mass storage device #22

Closed
Avni22 opened this issue Feb 22, 2022 · 5 comments
Closed

raw gadget can be use to right mass storage device #22

Avni22 opened this issue Feb 22, 2022 · 5 comments

Comments

@Avni22
Copy link

Avni22 commented Feb 22, 2022

Hi

I am exploring the raw gadget driver for masss storage with dummy_hcd driver.

I am getting the raw data in user space for mass storage with dummy_hcd. I want to pass that data to target pc using OTG gadget driver.

is there any way to use these raw usb as bridge between them?

and can we read/wright directly to pendrive or sd card with raw driver?
if you have any example for these can you please point me. any help will be appreciable.

Thanks

@xairy
Copy link
Owner

xairy commented Feb 22, 2022

Hi,

I don't understand what you want to do.

I am getting the raw data in user space for mass storage with dummy_hcd. I want to pass that data to target pc using OTG gadget driver.

So you have a program that emulates a USB mass-storage device and works with dummy_hcd, right? Then you likely only need to use a hardware UDC instead of dummy_hcd.

is there any way to use these raw usb as bridge between them?

Don't understand this part. A bridge between what?

and can we read/wright directly to pendrive or sd card with raw driver?

No. Raw Gadget is for emulating USB devices. You can have an SD card connected to the hardware emulating a USB device via Raw Gadget, but Raw Gadget has nothing to do with the SD card.

@AristoChen
Copy link
Contributor

is there any way to use these raw usb as bridge between them?

Hi, I guess what you want is a usb proxy? if so, then maybe you can check out this repo(usb-proxy) that I created few days ago, it is based on raw-gadget and libusb.

raw-gadget is for communicating with USB host, and libusb is for communicating with USB device.

There might be still some bugs or silly mistakes, but at least my project is trying to act as a usb proxy, then user does not need to compose his/her own program to emulate USB devices (such as USB pendrive, keyboard, mouse, etc) based on raw-gadget.

I have tested with the following USB devices, and the result seems ok

  • USB keyboard(made by Logitech)
  • USB mouse(made by Logitech. Sadly there is a big latency)
  • USB Mass storage(Made by Transcend)
  • g_printer kernel module
  • g_zero kernel module(sometimes a bit buggy with control request, I haven’t figure out a solution yet)

@xairy
Copy link
Owner

xairy commented Mar 8, 2022

@AristoChen Awesome project! Happy to see Raw Gadget in use! :)

@AristoChen
Copy link
Contributor

@xairy I noticed you have shared it on your twitter, Thanks!

@xairy
Copy link
Owner

xairy commented May 21, 2022

This seems to be resolved. Please reopen and update if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants