[PATCH 3/6] fms: Add TOC/PMA/ATIP DVD-ROM capabilities

i.kononenko i.kononenko at yadro.com
Mon Jun 28 04:45:07 AEST 2021



On 27.06.2021 17:29, Alan Stern wrote:
> On Sun, Jun 27, 2021 at 12:18:16AM +0300, Igor Kononenko wrote:
>> The DVD-ROM required the SCSI 6.25 READ TOC/PMA/ATIP Command formats:
>>  * Response Format 0000b: Formatted TOC
>>  * Response Format 0001b: Multi-session Information
>> (MMC-6 Specification).
>>
>> This patch adds an implementation of that described above formats.
> 
> I will sum up the last four patches of this series by saying that they
> add features for emulating DVD-ROM and BD devices.  Doing so increases
> the size of the f_mass_storage driver by a considerable amount and
> also adds a large amount of new material to Jens Axboe's
> include/uapi/linux/cdrom.h.

The `include/uapi/linux/cdrom.h` already includes the definition of the
MMC-(2/3) SCSI data structures, and I believe this uses in many cdrom-api
consumers. The current patchset extends this declaration with additional
structures set and clarifies each. Besides, the described above 
SCSI structures are used to implement a mass_storage SCSI-command handler 
to make implementation clearer and avoid the use of magic constants.

> 
> Is any of this really needed?  What usage scenarios require
> f_mass_storage to emulate a DVD-ROM that couldn't use f_tcm instead?

I can't see any impediments to supplement the already existing 
implementation of MMC-(2/3) specification of multimedia devices to 
represent the DVD/BD features. If the kernel presents the CD-ROM SCSI 
commands, why the mass_storage:usb-gadget-function still doesn't include
that for DVD/BD?

Many modern embedded systems (e.g., BMC, OpenBMC) implements their 
required features, e.g., Virtual Media Device, which is based on the 
usb:gadget:mass-storage. 
The purpose of that features is extensive, and their use the mass-storage
not only as a cdrom-device.

The required features of such systems might expect image back-end files
that size is significant than 2.1Gb, but such medium is not the CD-ROM 
device. USB-gadget consumers can incorrectly interpret such device by 
loading the wrong driver. I believe that should be the DVD-medium device,
at least. 

Additionally, please note the current patch also fixes the incorrect 
implementation of retrieving TOC/PMA/ATIP data, which is required for the 
CD-ROM. One system might correct works with retrieving first with the 
last session together, but for some systems, e.g., OS ESXi, OS Windows, 
should retrieving first and last border sessions in separate SCSI-request. 

> 
> Alan Stern
> 

-- 
Best regards,

Igor Kononenko


More information about the openbmc mailing list