Re: File Storage Gadget Driver - a small doubt

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

 



On Fri, 24 Jul 2009, Madhavi Manchala wrote:

> Dear Alan,
> 
> The below snippet is used to allocate the buffer heads. Currently
> NUM_BUFFERS is defined to 2. I would like to change it 4. Two buffer
> heads per thread. Is this the correct approach?

Look again.  This code doesn't allocate buffer heads; it allocates
usb_request structures.  See the comment and the calls to
alloc_request()?

> 	/* Allocate the requests */
> 	for (i = 0; i < NUM_BUFFERS; ++i) {
> 		struct fsg_buffhd	*bh = &fsg->buffhds[i];
> 
> 		if ((rc = alloc_request(fsg, fsg->bulk_in, &bh->inreq)) != 0)
> 			goto reset;
> 		if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0)
> 			goto reset;
> 		bh->inreq->buf = bh->outreq->buf = bh->buf;
> 		bh->inreq->context = bh->outreq->context = bh;
> 		bh->inreq->complete = bulk_in_complete;
> 		bh->outreq->complete = bulk_out_complete;
> 	}
> 
> Does dummy hcd understand the changes and use the FOUR buffers heads
> instead of TWO buffer heads?

dummy-hcd doesn't use buffer heads at all; it uses only usb_requests.
There's a reason why the structures are named "fsg_buffhd" -- it's 
because they are private to the fsg driver.

Alan Stern

--
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