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

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

 



Alan Stern <stern@...> writes:

> 
> On Mon, 10 Dec 2012, Michal Nazarewicz wrote:
> 
> > On Mon, Dec 10 2012, Golmer Palmer <onrollo-9944@...> wrote:
> > > This message is for request to support CD-ROM boot support in the USB 
Gadget 
> > > driver.
> > >
> > > Specifically, I ask for improve "g_mass_storage" driver with:
> > >
> > > * 2048 byte/sector support in CD mode.
> > 
> > Unless I'm missing something, g_mass_storage is using 2048 sector size
> > for CD-ROMs.  See initialisation of blksize in fsg_lun_open() in
> > storage_common.c.

Yeah! Now I can see this on last Linux Kernel source. My problem is with 
Android. No one has updated the file "storage_common.c" with this code related 
to block size initialization. I hope to view it on next releases.

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()". 
>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. 
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?

> > 
> > > * workaround for READ TOC command with incorrect length.
> > 
> 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?
I'll like to see this corrected in a new release of the Android Kernel.

Many thanks to the good guys around here!


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