[if gte mso 9]>

Re: [edk2] How to access/Read/Eject USB CD/DVD drive

Subject: Re: [edk2] How to access/Read/Eject USB CD/DVD drive

From: "Suraj Joshi" <suraj.joshi@zensar.in>

To: <edk2-devel@lists.sourceforge.net>

Date: 2011-12-01 03:41:38

Hi Sergey,

 

I tried to build following snippet but got build errors, undeclared identifier

 

I got handle of USB CD-ROM device.

 

       EFI_STATUS                 Status;

       USB_MASS_DEVICE            *UsbMass = NULL;

       USB_MASS_TRANSPORT  *Transport;

 

       UsbMass = USB_MASS_DEVICE_FROM_BLOCK_IO (PassThruProtocol);

      

       if (!UsbMass)

       {

              Print(L"no UsbMass\n");

              Status = EFI_NOT_FOUND;

              goto ON_EXIT;

       }

       Status    = UsbMass->Transport->ExecCommand (

                                                              UsbMass->Context,

                                                              &Cdb,

                                                              sizeof(Cdb),

                                                              EfiUsbDataOut,

                                                              NULL, 0,

                                                              UsbMass->Lun,

                                                              Timeout,

                                                              &CmdResult

                                                              );

 

 

But I got error - USB_MASS_DEVICE is undeclared

I declare Sample\Bus\Usb\UsbMassStorage\Dxe\UsbMassStorage.inf in my .dsc file. Still error occurs.

Please help me.

 

Thanks in adv.

 

BR

Suraj Joshi

 

 

 

From: Sergey Isakov [mailto:isakov-sl@bk.ru]
Sent: Wednesday, November 30, 2011 2:03 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to access/Read/Eject USB CD/DVD drive

 

Hi Feng,

 

Thank you for the confirmation a way. I didn't debug carefully yet, I am busy with another issues.

May be return to testing later. Quick look at UsbMassStorage shows that it written an old way.

 

Regards

Sergey

 

On 30.11.2011, at 12:15, Tian, Feng wrote:



Hi, Sergey

 

Yes, like this way.

 

Do you root cause why it doesn’t work? Are you sure all the parameters passed in are correct?

 

Thanks

Feng

 

From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Wednesday, November 30, 2011 15:43
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to access/Read/Eject USB CD/DVD drive

 

Hi, Feng

 

Is it the same as I did?

-------

                                                Status    = UsbMass->Transport->ExecCommand (

                                                                                                                                                                                                UsbMass->Context,

                                                                                                                                                                                                &Cdb,

                                                                                                                                                                                                sizeof(Cdb),

                                                                                                                                                                                                EfiUsbDataOut,

                                                                                                                                                                                                NULL, 0,

                                                                                                                                                                                                UsbMass->Lun,

                                                                                                                                                                                                Timeout,

                                                                                                                                                                                                &CmdResult

                                                                                                                                                                                                );

--------

This way is not working.

 

Sergey

 

On 30.11.2011, at 11:23, Tian, Feng wrote:




And a simplest way is to produce EFI_SCSI_IO_PROTOCOL at UsbMassStorage.

It means a usb device handle will be installed two protocol interfaces: 1) UsbIoProtocol 2)ScsiIoProtocol.

 

EFI_SCSI_IO_PROTOCOL.ExecuteScsiCommand (

  IN      EFI_SCSI_IO_PROTOCOL                 *This,

  IN OUT  EFI_SCSI_IO_SCSI_REQUEST_PACKET      *Packet,

  IN      EFI_EVENT                            Event  OPTIONAL

  )

{

  …

  Status = UsbBootExecCmd (Packet->Cdb, Packet->CdbLength);

  …

}

 

Thanks

Feng

 

From: Tian, Feng [mailto:feng.tian@intel.com] 
Sent: Wednesday, November 30, 2011 15:11
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to access/Read/Eject USB CD/DVD drive

 

Hi, Joshi and Isakov

 

UsbMassStorage driver was originally designed to provide read/write ability for usb mass storage device. So it just produces EFI_BLOCK_IO_PROTOCOL.

 

Now you need modify UsbMassStorage driver to produce EFI_EXT_SCSI_PASS_THRU_PROTOCOL. Then your app can send ejecting ATAPI cmd to the USB cdrom.

 

Thanks

Feng

 

From: Suraj Joshi [mailto:suraj.joshi@zensar.in] 
Sent: Wednesday, November 30, 2011 14:14
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to access/Read/Eject USB CD/DVD drive

 

Hi Sergey,

 

You mean to say I can use same protocol i.e. EFI_EXT_SCSI_PASS_THRU_PROTOCOL for ejecting CD from USB CD-ROM.

 

Please confirm my understanding.

 

 

Regards,

Suraj Joshi

-------------------------------------------------------------------------------------------------------------------------------

Fujitsu TMP , Zensar Technologies

IT Tower, Level 3, Location - 301/07,

Kharadi Knowledge park, Plot#3,MIDC,

Kharadi, Off Nagar Road, Pune – 411014

Landline :  +91-20-66453336        | +91-9421113201

Email     : suraj.joshi@zensar.in     | website:  www.zensar.com

 

 

 

<image001.jpg>

 

 

 

 

 

 

 

 

 

 

 

 

From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Wednesday, November 30, 2011 11:28 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to access/Read/Eject USB CD/DVD drive

 

Hi Suraj,

 

You are in the same boat as me.

USB attached CDROM is physically the same SATA CDROM and might be ejected by the same command. The only problem is to transfer the packet from UsbIo protocol to CDROM device. But UsbMassStorage.... :(

 

Regards,

Sergey

 

On 30.11.2011, at 7:40, Suraj Joshi wrote:

 

Hello experts,

 

I am developing an application for reading block of data from USB CD/DVD drives, also ejecting the same drive using EFI_USB_IO_PROTOCOL.

 

I already succeeded in reading block of data/eject from built in CD/DVD drives using EFI_EXT_SCSI_PASS_THRU_PROTOCOL.

 

Please let me know if any other protocol is used for reading / eject CD/DVD from USB attached ROM.

 

 

Thanks in adv.

 

 

BR

Suraj Joshi

 

 

 

 

 

 

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

 

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

 

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel