MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SdMmcPassThru.h File Reference

Data Structures

struct  _EFI_SD_MMC_COMMAND_BLOCK
 
struct  _EFI_SD_MMC_STATUS_BLOCK
 
struct  _EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
 
struct  _EFI_SD_MMC_PASS_THRU_PROTOCOL
 

Macros

#define EFI_SD_MMC_PASS_THRU_PROTOCOL_GUID
 

Typedefs

typedef struct
_EFI_SD_MMC_PASS_THRU_PROTOCOL 
EFI_SD_MMC_PASS_THRU_PROTOCOL
 
typedef struct
_EFI_SD_MMC_COMMAND_BLOCK 
EFI_SD_MMC_COMMAND_BLOCK
 
typedef struct
_EFI_SD_MMC_STATUS_BLOCK 
EFI_SD_MMC_STATUS_BLOCK
 
typedef struct
_EFI_SD_MMC_PASS_THRU_COMMAND_PACKET 
EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
 
typedef IN UINT8 Slot
 
typedef IN UINT8 IN OUT
EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
Packet
 
typedef IN UINT8 IN OUT
EFI_SD_MMC_PASS_THRU_COMMAND_PACKET
IN EFI_EVENT 
Event
 
typedef IN UINT8 OUT
EFI_DEVICE_PATH_PROTOCOL ** 
DevicePath
 

Enumerations

enum  EFI_SD_MMC_COMMAND_TYPE { SdMmcCommandTypeBc, SdMmcCommandTypeBcr, SdMmcCommandTypeAc, SdMmcCommandTypeAdtc }
 
enum  EFI_SD_MMC_RESPONSE_TYPE {
  SdMmcResponseTypeR1, SdMmcResponseTypeR1b, SdMmcResponseTypeR2, SdMmcResponseTypeR3,
  SdMmcResponseTypeR4, SdMmcResponseTypeR5, SdMmcResponseTypeR5b, SdMmcResponseTypeR6,
  SdMmcResponseTypeR7
}
 

Functions

typedef EFI_STATUS (EFIAPI *EFI_SD_MMC_PASS_THRU_PASSTHRU)(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This
 

Variables

EFI_GUID gEfiSdMmcPassThruProtocolGuid
 

Detailed Description

The EFI_SD_MMC_PASS_THRU_PROTOCOL provides the ability to send SD/MMC Commands to any SD/MMC device attached to the SD compatible pci host controller.

Copyright (c) 2015, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define EFI_SD_MMC_PASS_THRU_PROTOCOL_GUID
Value:
{ \
0x716ef0d9, 0xff83, 0x4f69, {0x81, 0xe9, 0x51, 0x8b, 0xd3, 0x9a, 0x8e, 0x70 } \
}

Typedef Documentation

typedef IN UINT8 Slot

Enumeration Type Documentation

Enumerator
SdMmcCommandTypeBc 
SdMmcCommandTypeBcr 
SdMmcCommandTypeAc 
SdMmcCommandTypeAdtc 
Enumerator
SdMmcResponseTypeR1 
SdMmcResponseTypeR1b 
SdMmcResponseTypeR2 
SdMmcResponseTypeR3 
SdMmcResponseTypeR4 
SdMmcResponseTypeR5 
SdMmcResponseTypeR5b 
SdMmcResponseTypeR6 
SdMmcResponseTypeR7 

Function Documentation

typedef EFI_STATUS ( EFIAPI EFI_SD_MMC_PASS_THRU_RESET_DEVICE)

Sends SD command to an SD card that is attached to the SD controller.

The PassThru() function sends the SD command specified by Packet to the SD card specified by Slot.

If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.

If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.

If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER is returned.

If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL, EFI_INVALID_PARAMETER is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in,out]PacketA pointer to the SD command data structure.
[in]EventIf Event is NULL, blocking I/O is performed. If Event is not NULL, then nonblocking I/O is performed, and Event will be signaled when the Packet completes.
Return values
EFI_SUCCESSThe SD Command Packet was sent by the host.
EFI_DEVICE_ERRORA device error occurred while attempting to send the SD command Packet.
EFI_INVALID_PARAMETERPacket, Slot, or the contents of the Packet is invalid.
EFI_INVALID_PARAMETERPacket defines a data command but both InDataBuffer and OutDataBuffer are NULL.
EFI_NO_MEDIASD Device not present in the Slot.
EFI_UNSUPPORTEDThe command described by the SD Command Packet is not supported by the host controller.
EFI_BAD_BUFFER_SIZEThe InTransferLength or OutTransferLength exceeds the limit supported by SD card ( i.e. if the number of bytes exceed the Last LBA).

Used to retrieve next slot numbers supported by the SD controller. The function returns information about all available slots (populated or not-populated).

The GetNextSlot() function retrieves the next slot number on an SD controller. If on input Slot is 0xFF, then the slot number of the first slot on the SD controller is returned.

If Slot is a slot number that was returned on a previous call to GetNextSlot(), then the slot number of the next slot on the SD controller is returned.

If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(), EFI_INVALID_PARAMETER is returned.

If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
[in,out]SlotOn input, a pointer to a slot number on the SD controller. On output, a pointer to the next slot number on the SD controller. An input value of 0xFF retrieves the first slot number on the SD controller.
Return values
EFI_SUCCESSThe next slot number on the SD controller was returned in Slot.
EFI_NOT_FOUNDThere are no more slots on this SD controller.
EFI_INVALID_PARAMETERSlot is not 0xFF and Slot was not returned on a previous call to GetNextSlot().

Used to allocate and build a device path node for an SD card on the SD controller.

The BuildDevicePath() function allocates and builds a single device node for the SD card specified by Slot.

If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND is returned.

If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.

If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.

Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
[in]SlotSpecifies the slot number of the SD card for which a device path node is to be allocated and built.
[out]DevicePathA pointer to a single device path node that describes the SD card specified by Slot. This function is responsible for allocating the buffer DevicePath with the boot service AllocatePool(). It is the caller's responsibility to free DevicePath when the caller is finished with DevicePath.
Return values
EFI_SUCCESSThe device path node that describes the SD card specified by Slot was allocated and returned in DevicePath.
EFI_NOT_FOUNDThe SD card specified by Slot does not exist on the SD controller.
EFI_INVALID_PARAMETERDevicePath is NULL.
EFI_OUT_OF_RESOURCESThere are not enough resources to allocate DevicePath.

This function retrieves an SD card slot number based on the input device path.

The GetSlotNumber() function retrieves slot number for the SD card specified by the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.

If DevicePath is not a device path node type that the SD Pass Thru driver supports, EFI_UNSUPPORTED is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]DevicePathA pointer to the device path node that describes a SD card on the SD controller.
[out]SlotOn return, points to the slot number of an SD card on the SD controller.
Return values
EFI_SUCCESSSD card slot number is returned in Slot.
EFI_INVALID_PARAMETERSlot or DevicePath is NULL.
EFI_UNSUPPORTEDDevicePath is not a device path node type that the SD Pass Thru driver supports.

Resets an SD card that is connected to the SD controller.

The ResetDevice() function resets the SD card specified by Slot.

If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is returned.

If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER is returned.

If the device reset operation is completed, EFI_SUCCESS is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotSpecifies the slot number of the SD card to be reset.
Return values
EFI_SUCCESSThe SD card specified by Slot was reset.
EFI_UNSUPPORTEDThe SD controller does not support a device reset operation.
EFI_INVALID_PARAMETERSlot number is invalid.
EFI_NO_MEDIASD Device not present in the Slot.
EFI_DEVICE_ERRORThe reset command failed due to a device error

Variable Documentation

EFI_GUID gEfiSdMmcPassThruProtocolGuid