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

Go to the source code of this file.

Data Structures

struct  MPT_SCSI_DMA_BUFFER
 
struct  MPT_SCSI_DEV
 

Macros

#define MPT_SCSI_BINDING_VERSION   0x10
 
#define MPT_SCSI_DEV_SIGNATURE   SIGNATURE_32 ('M','P','T','S')
 
#define MPT_SCSI_FROM_PASS_THRU(PassThruPtr)    CR (PassThruPtr, MPT_SCSI_DEV, PassThru, MPT_SCSI_DEV_SIGNATURE)
 
#define MPT_SCSI_DMA_ADDR(Dev, MemberName)    (Dev->DmaPhysical + OFFSET_OF (MPT_SCSI_DMA_BUFFER, MemberName))
 
#define MPT_SCSI_DMA_ADDR_HIGH(Dev, MemberName)    ((UINT32)RShiftU64 (MPT_SCSI_DMA_ADDR (Dev, MemberName), 32))
 
#define MPT_SCSI_DMA_ADDR_LOW(Dev, MemberName)    ((UINT32)MPT_SCSI_DMA_ADDR (Dev, MemberName))
 

Functions

STATIC EFI_STATUS Out32 (IN MPT_SCSI_DEV *Dev, IN UINT32 Addr, IN UINT32 Data)
 
STATIC EFI_STATUS In32 (IN MPT_SCSI_DEV *Dev, IN UINT32 Addr, OUT UINT32 *Data)
 
STATIC EFI_STATUS MptDoorbell (IN MPT_SCSI_DEV *Dev, IN UINT8 DoorbellFunc, IN UINT8 DoorbellArg)
 
STATIC EFI_STATUS MptScsiReset (IN MPT_SCSI_DEV *Dev)
 
STATIC EFI_STATUS MptScsiInit (IN MPT_SCSI_DEV *Dev)
 
STATIC EFI_STATUS ReportHostAdapterError (OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS ReportHostAdapterOverrunError (OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS MptScsiPopulateRequest (IN MPT_SCSI_DEV *Dev, IN UINT8 Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS MptScsiSendRequest (IN MPT_SCSI_DEV *Dev, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS MptScsiGetReply (IN MPT_SCSI_DEV *Dev, OUT UINT32 *Reply)
 
STATIC EFI_STATUS MptScsiHandleReply (IN MPT_SCSI_DEV *Dev, IN UINT32 Reply, OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
STATIC EFI_STATUS EFIAPI MptScsiPassThru (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)
 
STATIC BOOLEAN IsTargetInitialized (IN UINT8 *Target)
 
STATIC EFI_STATUS EFIAPI MptScsiGetNextTargetLun (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN OUT UINT8 **Target, IN OUT UINT64 *Lun)
 
STATIC EFI_STATUS EFIAPI MptScsiGetNextTarget (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN OUT UINT8 **Target)
 
STATIC EFI_STATUS EFIAPI MptScsiBuildDevicePath (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
 
STATIC EFI_STATUS EFIAPI MptScsiGetTargetLun (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT8 **Target, OUT UINT64 *Lun)
 
STATIC EFI_STATUS EFIAPI MptScsiResetChannel (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This)
 
STATIC VOID EFIAPI MptScsiExitBoot (IN EFI_EVENT Event, IN VOID *Context)
 
STATIC EFI_STATUS EFIAPI MptScsiResetTargetLun (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun)
 
STATIC EFI_STATUS EFIAPI MptScsiControllerSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
STATIC EFI_STATUS EFIAPI MptScsiControllerStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
STATIC EFI_STATUS EFIAPI MptScsiControllerStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI MptScsiGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
EFI_STATUS EFIAPI MptScsiGetDeviceName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_HANDLE ChildHandle, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
 
EFI_STATUS EFIAPI MptScsiEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC EFI_DRIVER_BINDING_PROTOCOL mMptScsiDriverBinding
 
STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable []
 
STATIC EFI_COMPONENT_NAME_PROTOCOL mComponentName
 
STATIC EFI_COMPONENT_NAME2_PROTOCOL mComponentName2
 

Detailed Description

This driver produces Extended SCSI Pass Thru Protocol instances for LSI Fusion MPT SCSI devices.

Copyright (C) 2020, Oracle and/or its affiliates.

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

Definition in file MptScsi.c.

Macro Definition Documentation

◆ MPT_SCSI_BINDING_VERSION

#define MPT_SCSI_BINDING_VERSION   0x10

Definition at line 30 of file MptScsi.c.

◆ MPT_SCSI_DEV_SIGNATURE

#define MPT_SCSI_DEV_SIGNATURE   SIGNATURE_32 ('M','P','T','S')

Definition at line 53 of file MptScsi.c.

◆ MPT_SCSI_DMA_ADDR

#define MPT_SCSI_DMA_ADDR (   Dev,
  MemberName 
)     (Dev->DmaPhysical + OFFSET_OF (MPT_SCSI_DMA_BUFFER, MemberName))

Definition at line 72 of file MptScsi.c.

◆ MPT_SCSI_DMA_ADDR_HIGH

#define MPT_SCSI_DMA_ADDR_HIGH (   Dev,
  MemberName 
)     ((UINT32)RShiftU64 (MPT_SCSI_DMA_ADDR (Dev, MemberName), 32))

Definition at line 75 of file MptScsi.c.

◆ MPT_SCSI_DMA_ADDR_LOW

#define MPT_SCSI_DMA_ADDR_LOW (   Dev,
  MemberName 
)     ((UINT32)MPT_SCSI_DMA_ADDR (Dev, MemberName))

Definition at line 78 of file MptScsi.c.

◆ MPT_SCSI_FROM_PASS_THRU

#define MPT_SCSI_FROM_PASS_THRU (   PassThruPtr)     CR (PassThruPtr, MPT_SCSI_DEV, PassThru, MPT_SCSI_DEV_SIGNATURE)

Definition at line 69 of file MptScsi.c.

Function Documentation

◆ In32()

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

Definition at line 105 of file MptScsi.c.

◆ IsTargetInitialized()

STATIC BOOLEAN IsTargetInitialized ( IN UINT8 *  Target)

Definition at line 605 of file MptScsi.c.

◆ MptDoorbell()

STATIC EFI_STATUS MptDoorbell ( IN MPT_SCSI_DEV Dev,
IN UINT8  DoorbellFunc,
IN UINT8  DoorbellArg 
)

Definition at line 123 of file MptScsi.c.

◆ MptScsiBuildDevicePath()

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

Definition at line 684 of file MptScsi.c.

◆ MptScsiControllerStart()

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

Definition at line 867 of file MptScsi.c.

◆ MptScsiControllerStop()

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

Definition at line 1070 of file MptScsi.c.

◆ MptScsiControllerSupported()

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

Definition at line 811 of file MptScsi.c.

◆ MptScsiEntryPoint()

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

Definition at line 1211 of file MptScsi.c.

◆ MptScsiExitBoot()

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

Definition at line 780 of file MptScsi.c.

◆ MptScsiGetDeviceName()

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

Definition at line 1180 of file MptScsi.c.

◆ MptScsiGetDriverName()

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

Definition at line 1163 of file MptScsi.c.

◆ MptScsiGetNextTarget()

STATIC EFI_STATUS EFIAPI MptScsiGetNextTarget ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN OUT UINT8 **  Target 
)

Definition at line 656 of file MptScsi.c.

◆ MptScsiGetNextTargetLun()

STATIC EFI_STATUS EFIAPI MptScsiGetNextTargetLun ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This,
IN OUT UINT8 **  Target,
IN OUT UINT64 *  Lun 
)

Definition at line 623 of file MptScsi.c.

◆ MptScsiGetReply()

STATIC EFI_STATUS MptScsiGetReply ( IN MPT_SCSI_DEV Dev,
OUT UINT32 *  Reply 
)

Definition at line 445 of file MptScsi.c.

◆ MptScsiGetTargetLun()

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

Definition at line 726 of file MptScsi.c.

◆ MptScsiHandleReply()

STATIC EFI_STATUS MptScsiHandleReply ( IN MPT_SCSI_DEV Dev,
IN UINT32  Reply,
OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Definition at line 494 of file MptScsi.c.

◆ MptScsiInit()

STATIC EFI_STATUS MptScsiInit ( IN MPT_SCSI_DEV Dev)

Definition at line 173 of file MptScsi.c.

◆ MptScsiPassThru()

STATIC EFI_STATUS EFIAPI MptScsiPassThru ( 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 566 of file MptScsi.c.

◆ MptScsiPopulateRequest()

STATIC EFI_STATUS MptScsiPopulateRequest ( IN MPT_SCSI_DEV Dev,
IN UINT8  Target,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Definition at line 305 of file MptScsi.c.

◆ MptScsiReset()

STATIC EFI_STATUS MptScsiReset ( IN MPT_SCSI_DEV Dev)

Definition at line 138 of file MptScsi.c.

◆ MptScsiResetChannel()

STATIC EFI_STATUS EFIAPI MptScsiResetChannel ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL This)

Definition at line 770 of file MptScsi.c.

◆ MptScsiResetTargetLun()

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

Definition at line 795 of file MptScsi.c.

◆ MptScsiSendRequest()

STATIC EFI_STATUS MptScsiSendRequest ( IN MPT_SCSI_DEV Dev,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Definition at line 415 of file MptScsi.c.

◆ Out32()

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

Definition at line 87 of file MptScsi.c.

◆ ReportHostAdapterError()

STATIC EFI_STATUS ReportHostAdapterError ( OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet)

Definition at line 277 of file MptScsi.c.

◆ ReportHostAdapterOverrunError()

STATIC EFI_STATUS ReportHostAdapterOverrunError ( OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet)

Definition at line 292 of file MptScsi.c.

Variable Documentation

◆ mComponentName

Initial value:
= {
&MptScsiGetDriverName,
&MptScsiGetDeviceName,
"eng"
}

Definition at line 1159 of file MptScsi.c.

◆ mComponentName2

Initial value:
= {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME)&MptScsiGetDriverName,
"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 1199 of file MptScsi.c.

◆ mDriverNameTable

STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable[]
Initial value:
= {
{ "eng;en", L"LSI Fusion MPT SCSI Driver" },
{ NULL, NULL }
}
#define NULL
Definition: Base.h:319

Definition at line 1153 of file MptScsi.c.

◆ mMptScsiDriverBinding

STATIC EFI_DRIVER_BINDING_PROTOCOL mMptScsiDriverBinding
Initial value:
= {
&MptScsiControllerSupported,
&MptScsiControllerStart,
&MptScsiControllerStop,
MPT_SCSI_BINDING_VERSION,
NULL,
NULL,
}

Definition at line 1139 of file MptScsi.c.