On Fri, 1 Feb 2013, victor yeo wrote:
> Hi,
>
> >> i have list_add_tail() in my ep_queue() function. Prior to ep1
> >> receiving data, my ep_queue() is called to send 0x00 to ep0. then it
> >> is not called. how to make it to be called by file gadget, in order to
> >> queue the request before ep1 interrupt?
> >
> > This should happen when get_next_command() calls start_transfer(),
> > which calls usb_ep_queue().
>
> I put printk in fsg_main_thread. After insmod g_file_storage, the
> fsg_main_thread goes to fsg->running. Then it sleeps.
Do you mean that it executes these lines?
if (!fsg->running) {
sleep_thread(fsg);
continue;
}
Here's how it's supposed to work. Initially fsg_main_thread does sleep
there. But when the host sends a Set-Configuration request,
standard_setup_req calls raise_exception, which wakes up
fsg_main_thread (by calling send_sig_info).
The next time though its big loop, fsg_main_thread calls
handle_exception, which calls do_set_config, which calls
do_set_interface, which sets fsg->running to 1 (near the end of the
do_set_interface routine).
Then when fsg_main_thread goes through its big loop again, it will call
get_next_command.
> When ep1
> receives data, get_next_command() is not called, so start_transfer()
> is not called.
>
> The fsg_main_thread is sleeping in sleep_thread(). How to make it wake
> up? is there anything udc driver has to do to wake up fsg_main_thread?
See above.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html