Re: [PATCH] USB: g_mass_storage: superfluous and missing packets fixed

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

 



On Tue, 26 Jan 2010, [utf-8] MichaÅ? Nazarewicz wrote:

> >> +		/* Respond with data/status */
> >> +		req->length = 1;
> >> +		req->zero = 1 < w_length;

> > Regardless, setting req->length to 1 is probably wrong if w_length is
> > 0.  And setting req->zero at all is unnecessary.
> 
> That's the thing done in original fsg_setup() (in file storage gadget):
> 
> 	if (rc >= 0 && rc != DELAYED_STATUS) {
> 		rc = min(rc, w_length);
> 		fsg->ep0req->length = rc;

As I said, if w_length is 0 then req->length isn't set to 1.

> 		fsg->ep0req->zero = rc < w_length;

This isn't necessary if you know that the length isn't a multiple of
the maxpacket size.  In the original fsg_setup() that wasn't known, but
here it is.  Setting req->zero isn't _wrong_; it's just unnecessary.

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