Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1664794
| From | Andrey Konovalov <andreyknvl@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | gadgetfs: how to wait for USB device initialization? |
| Date | 2017-06-13 14:30 +0200 |
| Message-ID | <tRT7k-7UN-27@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Hi!
I'm trying to use gadgetfs to fuzz USB device drivers by simply
connecting random devices for now.
What I want to achieve right now is the following:
1. mount gadgetfs
2. emulate connection of a new USB device
3. wait for the device to finish initializing
4. unmount gadgetfs
5. goto 1
The question is how do I wait for the device to finish initializing
(the corresponding USB driver to finish probing?) before unmounting
gadgetfs? As I understand, when I write device description to
"/dev/gadget/dummy_udc" the initialization happens asynchronously
after writing is done.
To mount and unmount gadgetfs right now I do:
mount("none", "/dev/gadget", "gadgetfs", 0, NULL)
umount2("/dev/gadget", MNT_FORCE | MNT_DETACH)
Thanks!
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
gadgetfs: how to wait for USB device initialization? Andrey Konovalov <andreyknvl@google.com> - 2017-06-13 14:30 +0200
Re: gadgetfs: how to wait for USB device initialization? Alan Stern <stern@rowland.harvard.edu> - 2017-06-13 16:50 +0200
Re: gadgetfs: how to wait for USB device initialization? Tal Shorer <tal.shorer@gmail.com> - 2017-06-13 18:10 +0200
Re: gadgetfs: how to wait for USB device initialization? Tal Shorer <tal.shorer@gmail.com> - 2017-06-13 18:30 +0200
Re: gadgetfs: how to wait for USB device initialization? Andrey Konovalov <andreyknvl@google.com> - 2017-06-13 20:10 +0200
csiph-web