File Storage Gadget Driver - a small doubt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear All,

I have gone through the file_storage gadget driver code which exists
in the drivers/usb/gadget folder. I understood the code flow a bit.
However, I did not understand about the following variable.

fsg->next_buffhd_to_fill

The above variable is defined in the main device structure, struct
fsg_dev. As explained in the comments "There is a variable
(fsg->next_buffhd_to_fill) that points to the next buffer head to
use".

As explained in the comments, that was used directly from the fsg main
structure in all the functions like get_next_command, do_read,
do_write, do_verify etc. In all these functions the following
statement was used.

bh = fsg->next_buffhd_to_fill;
     where bh is a struct fsg_buffhd structure type.

My doubt about this variable is, how it will be filled and where it
will be filled? I have used the dummy hcd driver for this.

I have also seen that there is a wake up call to the sleeping thread
from all the completion callback routines like bulk_out_complete,
bulk_in_complete. There is a statement like

struct fsg_buffhd	*bh = req->context;

How can the req->context is equivalent to the struct fsg_buffhd? OR Is
there any API that passes the struct fsg_buffhd pointer to the upper
layers like dummy hcd / usb core?

Sorry, If I have asked very silly questions. Any help would be greatly
appreciated and helps a lot to me.

Thanks in advance.

With Regards,
Madhavi M.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux