Intel Extensible Firmware Interface Network Router User Manual


  Open as PDF
of 1084
 
Version 1.10 12/01/02 G-1
Appendix G
Using the EFI SCSI Pass Thru Protocol
This appendix describes how an EFI utility might gain access to the EFI SCSI Pass Thru interfaces.
The basic concept is to use the LocateHandle()
boot service to retrieve the list of handles that
support the EFI_SCSI_PASS_THRU_Protocol
. Each of these handles represents a different
SCSI channel present in the system. Each of these handles can then be used the retrieve the
EFI_SCSI_PASS_THRU_Protocol interface with the HandleProtocol()
boot service.
The EFI_SCSI_PASS_THRU_Protocol interface provides the services required to access any
of the SCSI devices attached to a SCSI channel. The services of the
EFI_SCSI_PASS_THRU_Protocol are then to loop through the Target IDs of all the SCSI
devices on the SCSI channel.
#include “efi.h”
#include “efilib.h”
#include EFI_PROTOCOL_DEFINITION(ScsiPassThru)
EFI_GUID gEfiScsiPassThruProtocolGuid = EFI_SCSI_PASS_THRU_PROTOCOL_GUID;
EFI_STATUS
UtilityEntryPoint(
EFI_HANDLE ImageHandle,
EFI_SYSTEM_TABLE SystemTable
)
{
EFI_STATUS Status;
UINTN NoHandles;
EFI_HANDLE *HandleBuffer;
UINTN Index;
EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThruProtocol;
//
// Initialize EFI Library
//
InitializeLib (ImageHandle, SystemTable);
//
// Get list of handles that support the
// EFI_SCSI_PASS_THRU_PROTOCOL
//
NoHandles = 0;
HandleBuffer = NULL;
Status = LibLocateHandle(
ByProtocol,
&gEfiScsiPassThruProtocolGuid,
NULL,
&NoHandles,
&HandleBuffer
);