TianoCore EDK2 master
Loading...
Searching...
No Matches
LsiScsi.c File Reference

Go to the source code of this file.

Functions

STATIC EFI_STATUS Out8 (IN LSI_SCSI_DEV *Dev, IN UINT32 Addr, IN UINT8 Data)
 
STATIC EFI_STATUS Out32 (IN LSI_SCSI_DEV *Dev, IN UINT32 Addr, IN UINT32 Data)
 
STATIC EFI_STATUS In8 (IN LSI_SCSI_DEV *Dev, IN UINT32 Addr, OUT UINT8 *Data)
 
STATIC EFI_STATUS In32 (IN LSI_SCSI_DEV *Dev, IN UINT32 Addr, OUT UINT32 *Data)
 
STATIC EFI_STATUS LsiScsiReset (IN LSI_SCSI_DEV *Dev)
 
STATIC EFI_STATUS ReportHostAdapterOverrunError (OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS LsiScsiCheckRequest (IN LSI_SCSI_DEV *Dev, IN UINT8 Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS LsiScsiProcessRequest (IN LSI_SCSI_DEV *Dev, IN UINT8 Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
EFI_STATUS EFIAPI LsiScsiPassThru (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet, IN EFI_EVENT Event OPTIONAL)
 
EFI_STATUS EFIAPI LsiScsiGetNextTargetLun (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN OUT UINT8 **TargetPointer, IN OUT UINT64 *Lun)
 
EFI_STATUS EFIAPI LsiScsiBuildDevicePath (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
 
EFI_STATUS EFIAPI LsiScsiGetTargetLun (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT8 **TargetPointer, OUT UINT64 *Lun)
 
EFI_STATUS EFIAPI LsiScsiResetChannel (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This)
 
EFI_STATUS EFIAPI LsiScsiResetTargetLun (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun)
 
EFI_STATUS EFIAPI LsiScsiGetNextTarget (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN OUT UINT8 **TargetPointer)
 
STATIC VOID EFIAPI LsiScsiExitBoot (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI LsiScsiControllerSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI LsiScsiControllerStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI LsiScsiControllerStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI LsiScsiGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
EFI_STATUS EFIAPI LsiScsiGetDeviceName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_HANDLE ChildHandle, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
 
EFI_STATUS EFIAPI LsiScsiEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
 
STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable []
 
STATIC EFI_COMPONENT_NAME_PROTOCOL gComponentName
 
STATIC EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
 

Detailed Description

This driver produces Extended SCSI Pass Thru Protocol instances for LSI 53C895A SCSI devices.

Copyright (C) 2020, SUSE LLC.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file LsiScsi.c.

Function Documentation

◆ In32()

STATIC EFI_STATUS In32 ( IN LSI_SCSI_DEV Dev,
IN UINT32  Addr,
OUT UINT32 *  Data 
)

Definition at line 84 of file LsiScsi.c.

◆ In8()

STATIC EFI_STATUS In8 ( IN LSI_SCSI_DEV Dev,
IN UINT32  Addr,
OUT UINT8 *  Data 
)

Definition at line 66 of file LsiScsi.c.

◆ LsiScsiBuildDevicePath()

EFI_STATUS EFIAPI LsiScsiBuildDevicePath ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN UINT8 *  Target,
IN UINT64  Lun,
IN OUT EFI_DEVICE_PATH_PROTOCOL **  DevicePath 
)

Definition at line 647 of file LsiScsi.c.

◆ LsiScsiCheckRequest()

STATIC EFI_STATUS LsiScsiCheckRequest ( IN LSI_SCSI_DEV Dev,
IN UINT8  Target,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Check the request packet from the Extended SCSI Pass Thru Protocol. The request packet is modified, to be forwarded outwards by LsiScsiPassThru(), if invalid or unsupported parameters are detected.

Parameters
[in]DevThe LSI 53C895A SCSI device the packet targets.
[in]TargetThe SCSI target controlled by the LSI 53C895A SCSI device.
[in]LunThe Logical Unit Number under the SCSI target.
[in,out]PacketThe Extended SCSI Pass Thru Protocol packet.
Return values
EFI_SUCCESSThe Extended SCSI Pass Thru Protocol packet was valid.
Returns
Otherwise, invalid or unsupported parameters were detected. Status codes are meant for direct forwarding by the EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() implementation.

Definition at line 148 of file LsiScsi.c.

◆ LsiScsiControllerStart()

EFI_STATUS EFIAPI LsiScsiControllerStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Definition at line 871 of file LsiScsi.c.

◆ LsiScsiControllerStop()

EFI_STATUS EFIAPI LsiScsiControllerStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Definition at line 1059 of file LsiScsi.c.

◆ LsiScsiControllerSupported()

EFI_STATUS EFIAPI LsiScsiControllerSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Definition at line 818 of file LsiScsi.c.

◆ LsiScsiEntryPoint()

EFI_STATUS EFIAPI LsiScsiEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Definition at line 1213 of file LsiScsi.c.

◆ LsiScsiExitBoot()

STATIC VOID EFIAPI LsiScsiExitBoot ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Definition at line 795 of file LsiScsi.c.

◆ LsiScsiGetDeviceName()

EFI_STATUS EFIAPI LsiScsiGetDeviceName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_HANDLE  ChildHandle,
IN CHAR8 *  Language,
OUT CHAR16 **  ControllerName 
)

Definition at line 1183 of file LsiScsi.c.

◆ LsiScsiGetDriverName()

EFI_STATUS EFIAPI LsiScsiGetDriverName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN CHAR8 *  Language,
OUT CHAR16 **  DriverName 
)

Definition at line 1166 of file LsiScsi.c.

◆ LsiScsiGetNextTarget()

EFI_STATUS EFIAPI LsiScsiGetNextTarget ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN OUT UINT8 **  TargetPointer 
)

Definition at line 747 of file LsiScsi.c.

◆ LsiScsiGetNextTargetLun()

EFI_STATUS EFIAPI LsiScsiGetNextTargetLun ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN OUT UINT8 **  TargetPointer,
IN OUT UINT64 *  Lun 
)

Definition at line 592 of file LsiScsi.c.

◆ LsiScsiGetTargetLun()

EFI_STATUS EFIAPI LsiScsiGetTargetLun ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
OUT UINT8 **  TargetPointer,
OUT UINT64 *  Lun 
)

Definition at line 686 of file LsiScsi.c.

◆ LsiScsiPassThru()

EFI_STATUS EFIAPI LsiScsiPassThru ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN UINT8 *  Target,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet,
IN EFI_EVENT Event  OPTIONAL 
)

Definition at line 570 of file LsiScsi.c.

◆ LsiScsiProcessRequest()

STATIC EFI_STATUS LsiScsiProcessRequest ( IN LSI_SCSI_DEV Dev,
IN UINT8  Target,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Interpret the request packet from the Extended SCSI Pass Thru Protocol and compose the script to submit the command and data to the controller.

Parameters
[in]DevThe LSI 53C895A SCSI device the packet targets.
[in]TargetThe SCSI target controlled by the LSI 53C895A SCSI device.
[in]LunThe Logical Unit Number under the SCSI target.
[in,out]PacketThe Extended SCSI Pass Thru Protocol packet.
Return values
EFI_SUCCESSThe Extended SCSI Pass Thru Protocol packet was valid.
Returns
Otherwise, invalid or unsupported parameters were detected. Status codes are meant for direct forwarding by the EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() implementation.

Definition at line 226 of file LsiScsi.c.

◆ LsiScsiReset()

STATIC EFI_STATUS LsiScsiReset ( IN LSI_SCSI_DEV Dev)

Definition at line 102 of file LsiScsi.c.

◆ LsiScsiResetChannel()

EFI_STATUS EFIAPI LsiScsiResetChannel ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This)

Definition at line 727 of file LsiScsi.c.

◆ LsiScsiResetTargetLun()

EFI_STATUS EFIAPI LsiScsiResetTargetLun ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN UINT8 *  Target,
IN UINT64  Lun 
)

Definition at line 736 of file LsiScsi.c.

◆ Out32()

STATIC EFI_STATUS Out32 ( IN LSI_SCSI_DEV Dev,
IN UINT32  Addr,
IN UINT32  Data 
)

Definition at line 48 of file LsiScsi.c.

◆ Out8()

STATIC EFI_STATUS Out8 ( IN LSI_SCSI_DEV Dev,
IN UINT32  Addr,
IN UINT8  Data 
)

Definition at line 30 of file LsiScsi.c.

◆ ReportHostAdapterOverrunError()

STATIC EFI_STATUS ReportHostAdapterOverrunError ( OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet)

Definition at line 111 of file LsiScsi.c.

Variable Documentation

◆ gComponentName

Initial value:
= {
&LsiScsiGetDriverName,
&LsiScsiGetDeviceName,
"eng"
}

Definition at line 1162 of file LsiScsi.c.

◆ gComponentName2

Initial value:
= {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME)&LsiScsiGetDriverName,
"en"
}
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)

Definition at line 1202 of file LsiScsi.c.

◆ gDriverBinding

Initial value:
= {
&LsiScsiControllerSupported,
&LsiScsiControllerStart,
&LsiScsiControllerStop,
0x10,
NULL,
}
#define NULL
Definition: Base.h:319

Definition at line 1133 of file LsiScsi.c.

◆ mDriverNameTable

STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable[]
Initial value:
= {
{ "eng;en", L"LSI 53C895A SCSI Controller Driver" },
{ NULL, NULL }
}

Definition at line 1156 of file LsiScsi.c.