[if gte mso 9]>
Subject: Re: [edk2] Protocol for ejecting CD/DVD from disc drive Programmatically
From: "Tian, Feng" <email@example.com>
To: "firstname.lastname@example.org" <email@example.com>
Date: 2011-11-09 06:15:03
1) Locate ScsiIo Protocol;
2) Get Device Type by ScsiIo interface;
If (DeviceType == CDROM) then
Construct and Send Eject cmd;
Please refer to ScsiReadCapacityCommand() in UefiScsiLib.c. It shows how to construct and send ATAPI cmds to lower level driver.
I found Load Unload ATAPI commands which can be used for ejecting.
Please provide me sample pseudo code of implementation of these commands using EFI_EXT_SCSI_PASS_THRU_PROTOCOL.
Thanks & Regards,
The EXT_SCSI_PASS_THRU_PROTOCOL is produced by AtaAtapiPassThru driver in MdeModulePkg\Bus\Ata.
There is no such eject code, but you can refer to UefiScsiLib in MdePkg\Library to find out how to construct EFI_SCSI_IO_SCSI_REQUEST_PACKET to execute ATAPI cmds.
Note: ScsiIo protocol is produced by ScsiBus driver in MdeModulePkg upon EXT_SCSI_PASS_THRU_PROTOCOL.
Thanks for your reply!
Do you have sample code which contains implementation of EXT_SCSI_PASS_THRU_PROTOCOL to eject drive.
Please let me know in which directory of UDK2010 example of EXT_SCSI_PASS_THRU_PROTOCOL is given.
Thanks in adv.
If I recall correctly, EDK1.6 was using IdeBus driver which just produces BlockIo protocol. And this protocol doesn’t support send ATAPI cmds to ATAPI devices.
But UDK2010 now updates its ATA stack implementation. It supports EXT_SCSI_PASS_THRU_PROTOCOL by which user can send eject cmd to the ATAPI devices.
I am developing application for eject CD/DVD from CD/DVD ROM. I have taken EDK 1.6 source code as base version.
Are there any apis exist in EFI for eject drive like in windows MCI protocol which did the same taks.
Thanks in adv.