Re: USB Gadget driver: Add support for CD-ROM booting

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

 



On Mon, 10 Dec 2012, Golmer Palmer wrote:

> Now, another comment related to the "storage_common.c" file:
> 
> Why the limit of "if (num_sectors >= 256*60*75*4)" in function "fsg_lun_open()". 

The limit is 256*60*75 = 1152000.

> From my point of view (please, correct me if I wrong!), this are 1,152,000 
> sectors. With a 99 minutes (900MB) CD-ROMs, the limit are 445,000 sectors. 

Right.  This limit represents a hypothetical 256-minute CD.

> Nevertheless, with a DVD the  maximum sectors are 4,173,824 (DVD-9 DL). So why 
> this limit? As we can supose that the driver can work with a DVD ISO image, why 
> not increase the limit to DVD specs?

Although the driver can work with a DVD ISO image, it does not emulate 
a DVD.  Only a CD.

> > By the way, that's not the right way to do this.  Here's the proper 
> > patch.
> > 
> > Alan Stern
> > 
> > Index: usb-3.7/drivers/usb/gadget/f_mass_storage.c
> > ===================================================================
> > --- usb-3.7.orig/drivers/usb/gadget/f_mass_storage.c
> > +++ usb-3.7/drivers/usb/gadget/f_mass_storage.c
> > @@ -1995,8 +1995,13 @@ static int do_scsi_command(struct fsg_co
> >  			goto unknown_cmnd;
> >  		common->data_size_from_cmnd =
> >  			get_unaligned_be16(&common->cmnd[7]);
> > +		/*
> > +		 * According to Andreas Kemnade, some BIOSes incorrectly
> > +		 * put nonzero values in the "control" byte of READ TOC
> > +		 * commands.  So let's accept them.
> > +		 */
> >  		reply = check_command(common, 10, DATA_DIR_TO_HOST,
> > -				      (7<<6) | (1<<1), 1,
> > +				      (1<<9) | (7<<6) | (1<<1), 1,
> >  				      "READ TOC");
> >  		if (reply == 0)
> >  			reply = do_read_toc(common, bh);
> > 
> > --
> 
> Thank you, Alan! Please, can you try to push this patch to the main kernel tree?

Not until somebody tests it and confirms that it fixes the problem.

> I'll like to see this corrected in a new release of the Android Kernel.

You'll have to talk to the Android people about that.

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