Re: File Storage Gadget Driver - a small doubt

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

 



On Thu, Jul 23, 2009 at 9:05 PM, Alan Stern<stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, 23 Jul 2009, Madhavi Manchala wrote:
>
>> 2)    I would like to wake up thread-2 from main thread when ever there
>> is a next command to process (at this time thread-1 is busy processing
>> first command). I guess, to handle like this, I need to create
>> different buffer heads for each thread. Am I correct?
>
> Well, you will certainly want to have more than two buffer heads.  Two
> per thread ought to be enough.

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?

	/* 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?

Pleas let me know if there are any concerns.

Thanks and Regards,
Srinivas  G
--
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