TianoCore EDK2 master
|
#include "ScsiBus.h"
Go to the source code of this file.
Variables | |
EFI_DRIVER_BINDING_PROTOCOL | gSCSIBusDriverBinding |
VOID * | mWorkingBuffer |
SCSI Bus driver that layers on every SCSI Pass Thru and Extended SCSI Pass Thru protocol in the system.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Copyright (c) 1985 - 2022, American Megatrends International LLC.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ScsiBus.c.
VOID * AllocateAlignedBuffer | ( | IN SCSI_IO_DEV * | ScsiIoDevice, |
IN UINTN | BufferSize | ||
) |
Allocates an aligned buffer for SCSI device.
This function allocates an aligned buffer for the SCSI device to perform SCSI pass through operations. The alignment requirement is from SCSI pass through interface.
ScsiIoDevice | The SCSI child device involved for the operation. |
BufferSize | The request buffer size. |
EFI_STATUS DiscoverScsiDevice | ( | IN OUT SCSI_IO_DEV * | ScsiIoDevice | ) |
Discovery SCSI Device
ScsiIoDevice | The pointer of SCSI_IO_DEV |
EFI_SUCCESS | Find SCSI Device and verify it. |
EFI_NOT_FOUND | Unable to find SCSI Device. |
EFI_OUT_OF_RESOURCES | Fail to allocate memory resources. |
EFI_STATUS EFIAPI InitializeScsiBus | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The user Entry Point for module ScsiBus. The user code starts with this function.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
other | Some error occurs when executing this entry point. |
EFI_STATUS EFIAPI PassThruToScsiioPacket | ( | IN EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET * | ScsiPacket, |
OUT EFI_SCSI_IO_SCSI_REQUEST_PACKET * | Packet | ||
) |
Convert EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET packet to EFI_SCSI_IO_SCSI_REQUEST_PACKET packet.
ScsiPacket | The pointer of EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET |
Packet | The pointer of EFI_SCSI_IO_SCSI_REQUEST_PACKET |
EFI_STATUS EFIAPI SCSIBusDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Start this driver on ControllerHandle.
This service is called by the EFI boot service ConnectController(). In order to make drivers as small as possible, there are a few calling restrictions for this service. ConnectController() must follow these calling restrictions. If any other agent wishes to call Start() it must also follow these calling restrictions.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to bind driver to |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver is added to ControllerHandle |
EFI_ALREADY_STARTED | This driver is already running on ControllerHandle |
other | This driver does not support this device |
EFI_STATUS EFIAPI SCSIBusDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop this driver on ControllerHandle.
This service is called by the EFI boot service DisconnectController(). In order to make drivers as small as possible, there are a few calling restrictions for this service. DisconnectController() must follow these calling restrictions. If any other agent wishes to call Stop() it must also follow these calling restrictions.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to stop driver on |
NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed ControllerHandle |
other | This driver was not removed from this device |
EFI_STATUS EFIAPI SCSIBusDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Test to see if this driver supports ControllerHandle.
This service is called by the EFI boot service ConnectController(). In order to make drivers as small as possible, there are a few calling restrictions for this service. ConnectController() must follow these calling restrictions. If any other agent wishes to call Supported() it must also follow these calling restrictions.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to test |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver supports this device |
EFI_ALREADY_STARTED | This driver is already running on this device |
other | This driver does not support this device |
EFI_STATUS EFIAPI ScsiExecuteSCSICommand | ( | IN EFI_SCSI_IO_PROTOCOL * | This, |
IN OUT EFI_SCSI_IO_SCSI_REQUEST_PACKET * | Packet, | ||
IN EFI_EVENT Event | OPTIONAL | ||
) |
Sends a SCSI Request Packet to the SCSI Controller for execution.
This | Protocol instance pointer. |
CommandPacket | The SCSI request packet to send to the SCSI Controller specified by the device handle. |
Event | If the SCSI bus where the SCSI device is attached does not support non-blocking I/O, then Event is ignored, and blocking I/O is performed. If Event is NULL, then blocking I/O is performed. If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed, and Event will be signaled when the SCSI Request Packet completes. |
EFI_SUCCESS | The SCSI Request Packet was sent by the host successfully, and TransferLength bytes were transferred to/from DataBuffer.See HostAdapterStatus, TargetStatus, SenseDataLength, and SenseData in that order for additional status information. |
EFI_BAD_BUFFER_SIZE | The SCSI Request Packet was executed, but the entire DataBuffer could not be transferred. The actual number of bytes transferred is returned in TransferLength. See HostAdapterStatus, TargetStatus, SenseDataLength, and SenseData in that order for additional status information. |
EFI_NOT_READY | The SCSI Request Packet could not be sent because there are too many SCSI Command Packets already queued.The caller may retry again later. |
EFI_DEVICE_ERROR | A device error occurred while attempting to send the SCSI Request Packet. See HostAdapterStatus, TargetStatus, SenseDataLength, and SenseData in that order for additional status information. |
EFI_INVALID_PARAMETER | The contents of CommandPacket are invalid. The SCSI Request Packet was not sent, so no additional status information is available. |
EFI_UNSUPPORTED | The command described by the SCSI Request Packet is not supported by the SCSI initiator(i.e., SCSI Host Controller). The SCSI Request Packet was not sent, so no additional status information is available. |
EFI_TIMEOUT | A timeout occurred while waiting for the SCSI Request Packet to execute. See HostAdapterStatus, TargetStatus, SenseDataLength, and SenseData in that order for additional status information. |
EFI_STATUS EFIAPI ScsiGetDeviceLocation | ( | IN EFI_SCSI_IO_PROTOCOL * | This, |
IN OUT UINT8 ** | Target, | ||
OUT UINT64 * | Lun | ||
) |
Retrieves the device location in the SCSI channel.
This | Protocol instance pointer. |
Target | A pointer to the Target ID of a SCSI device on the SCSI channel. |
Lun | A pointer to the LUN of the SCSI device on the SCSI channel. |
EFI_SUCCESS | Retrieves the device location successfully. |
EFI_INVALID_PARAMETER | The Target or Lun is NULL. |
EFI_STATUS EFIAPI ScsiGetDeviceType | ( | IN EFI_SCSI_IO_PROTOCOL * | This, |
OUT UINT8 * | DeviceType | ||
) |
Retrieves the device type information of the SCSI Controller.
This | Protocol instance pointer. |
DeviceType | A pointer to the device type information retrieved from the SCSI Controller. |
EFI_SUCCESS | Retrieves the device type information successfully. |
EFI_INVALID_PARAMETER | The DeviceType is NULL. |
EFI_STATUS EFIAPI ScsiioToPassThruPacket | ( | IN EFI_SCSI_IO_SCSI_REQUEST_PACKET * | Packet, |
OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET * | CommandPacket | ||
) |
Convert EFI_SCSI_IO_SCSI_REQUEST_PACKET packet to EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET packet.
Packet | The pointer of EFI_SCSI_IO_SCSI_REQUEST_PACKET |
CommandPacket | The pointer of EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET |
EFI_STATUS EFIAPI ScsiResetBus | ( | IN EFI_SCSI_IO_PROTOCOL * | This | ) |
Resets the SCSI Bus that the SCSI Controller is attached to.
This | Protocol instance pointer. |
EFI_SUCCESS | The SCSI bus is reset successfully. |
EFI_DEVICE_ERROR | Errors encountered when resetting the SCSI bus. |
EFI_UNSUPPORTED | The bus reset operation is not supported by the SCSI Host Controller. |
EFI_TIMEOUT | A timeout occurred while attempting to reset the SCSI bus. |
EFI_STATUS EFIAPI ScsiResetDevice | ( | IN EFI_SCSI_IO_PROTOCOL * | This | ) |
Resets the SCSI Controller that the device handle specifies.
This | Protocol instance pointer. |
EFI_SUCCESS | Reset the SCSI controller successfully. |
EFI_DEVICE_ERROR | Errors are encountered when resetting the SCSI Controller. |
EFI_UNSUPPORTED | The SCSI bus does not support a device reset operation. |
EFI_TIMEOUT | A timeout occurred while attempting to reset the SCSI Controller. |
EFI_STATUS EFIAPI ScsiScanCreateDevice | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN SCSI_TARGET_ID * | TargetId, | ||
IN UINT64 | Lun, | ||
IN OUT SCSI_BUS_DEVICE * | ScsiBusDev | ||
) |
Scan SCSI Bus to discover the device, and attach ScsiIoProtocol to it.
This | Protocol instance pointer |
Controller | Controller handle |
TargetId | Target to be scanned |
Lun | The Lun of the SCSI device on the SCSI channel. |
ScsiBusDev | The pointer of SCSI_BUS_DEVICE |
EFI_SUCCESS | Successfully to discover the device and attach ScsiIoProtocol to it. |
EFI_NOT_FOUND | Fail to discover the device. |
EFI_OUT_OF_RESOURCES | Fail to allocate memory resources. |
EFI_DRIVER_BINDING_PROTOCOL gSCSIBusDriverBinding |