TianoCore EDK2 master
|
Go to the source code of this file.
Macros | |
#define | USB_MASS_SIGNATURE SIGNATURE_32 ('U', 's', 'b', 'M') |
#define | USB_MASS_DEVICE_FROM_BLOCK_IO(a) CR (a, USB_MASS_DEVICE, BlockIo, USB_MASS_SIGNATURE) |
#define | USB_MASS_DEVICE_FROM_DISK_INFO(a) CR (a, USB_MASS_DEVICE, DiskInfo, USB_MASS_SIGNATURE) |
Variables | |
EFI_COMPONENT_NAME_PROTOCOL | gUsbMassStorageComponentName |
EFI_COMPONENT_NAME2_PROTOCOL | gUsbMassStorageComponentName2 |
Definitions of functions for Driver Binding Protocol and Block I/O Protocol, and other internal definitions.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbMassImpl.h.
#define USB_MASS_DEVICE_FROM_BLOCK_IO | ( | a | ) | CR (a, USB_MASS_DEVICE, BlockIo, USB_MASS_SIGNATURE) |
Definition at line 15 of file UsbMassImpl.h.
#define USB_MASS_DEVICE_FROM_DISK_INFO | ( | a | ) | CR (a, USB_MASS_DEVICE, DiskInfo, USB_MASS_SIGNATURE) |
Definition at line 18 of file UsbMassImpl.h.
#define USB_MASS_SIGNATURE SIGNATURE_32 ('U', 's', 'b', 'M') |
Definition at line 13 of file UsbMassImpl.h.
EFI_STATUS EFIAPI USBMassDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Starts the USB mass storage device with this driver.
This function consumes USB I/O Protocol, initializes USB mass storage device, installs Block I/O Protocol, and submits Asynchronous Interrupt Transfer to manage the USB mass storage device.
This | The USB mass storage driver binding protocol. |
Controller | The USB mass storage device to start on |
RemainingDevicePath | The remaining device path. |
EFI_SUCCESS | This driver supports this device. |
EFI_UNSUPPORTED | This driver does not support this device. |
EFI_DEVICE_ERROR | This driver cannot be started due to device Error. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_ALREADY_STARTED | This driver has been started. |
Definition at line 791 of file UsbMassImpl.c.
EFI_STATUS EFIAPI USBMassDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop controlling the device.
This | The USB mass storage driver binding |
Controller | The device controller controlled by the driver. |
NumberOfChildren | The number of children of this device |
ChildHandleBuffer | The buffer of children handle. |
EFI_SUCCESS | The driver stopped from controlling the device. |
EFI_DEVICE_ERROR | The device could not be stopped due to a device error. |
EFI_UNSUPPORTED | Block I/O Protocol is not installed on Controller. |
Others | Failed to stop the driver |
Definition at line 907 of file UsbMassImpl.c.
EFI_STATUS EFIAPI USBMassDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Check whether the controller is a supported USB mass storage.
This | The USB mass storage driver binding protocol. |
Controller | The controller handle to check. |
RemainingDevicePath | The remaining device path. |
EFI_SUCCESS | The driver supports this controller. |
other | This device isn't supported. |
Definition at line 707 of file UsbMassImpl.c.
EFI_STATUS EFIAPI UsbMassFlushBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This | ) |
Flushes all modified data to a physical block device.
This function implements EFI_BLOCK_IO_PROTOCOL.FlushBlocks(). USB mass storage device doesn't support write cache, so return EFI_SUCCESS directly.
This | Indicates a pointer to the calling context. |
EFI_SUCCESS | All outstanding data were written correctly to the device. |
EFI_DEVICE_ERROR | The device reported an error while attempting to write data. |
EFI_NO_MEDIA | There is no media in the device. |
Definition at line 319 of file UsbMassImpl.c.
EFI_STATUS EFIAPI UsbMassReadBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Reads the requested number of blocks from the device.
This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks(). It reads the requested number of blocks from the device. All the blocks are read, or an error is returned.
This | Indicates a pointer to the calling context. |
MediaId | The media ID that the read request is for. |
Lba | The starting logical block address to read from on the device. |
BufferSize | The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device. |
Buffer | A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer. |
EFI_SUCCESS | The data was read correctly from the device. |
EFI_DEVICE_ERROR | The device reported an error while attempting to perform the read operation. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_BAD_BUFFER_SIZE | The BufferSize parameter is not a multiple of the intrinsic block size of the device. |
EFI_INVALID_PARAMETER | The read request contains LBAs that are not valid, or the buffer is not on proper alignment. |
Definition at line 96 of file UsbMassImpl.c.
EFI_STATUS EFIAPI UsbMassReset | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the block device.
This function implements EFI_BLOCK_IO_PROTOCOL.Reset(). It resets the block device hardware. ExtendedVerification is ignored in this implementation.
This | Indicates a pointer to the calling context. |
ExtendedVerification | Indicates that the driver may perform a more exhaustive verification operation of the device during reset. |
EFI_SUCCESS | The block device was reset. |
EFI_DEVICE_ERROR | The block device is not functioning correctly and could not be reset. |
Definition at line 47 of file UsbMassImpl.c.
EFI_STATUS EFIAPI UsbMassStorageGetControllerName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_HANDLE ChildHandle | OPTIONAL, | ||
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | ControllerName | ||
) |
Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.
This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
This | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
ControllerHandle | The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned. |
ChildHandle | The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller. |
Language | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
ControllerName | A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This. |
EFI_SUCCESS | The Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName. |
EFI_INVALID_PARAMETER | ControllerHandle is NULL. |
EFI_INVALID_PARAMETER | ChildHandle is not NULL and it is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | ControllerName is NULL. |
EFI_UNSUPPORTED | The driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 146 of file ComponentName.c.
EFI_STATUS EFIAPI UsbMassStorageGetDriverName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | DriverName | ||
) |
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
This | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
Language | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
DriverName | A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language. |
EFI_SUCCESS | The Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | DriverName is NULL. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 71 of file ComponentName.c.
EFI_STATUS EFIAPI UsbMassWriteBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Writes a specified number of blocks to the device.
This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks(). It writes a specified number of blocks to the device. All blocks are written, or an error is returned.
This | Indicates a pointer to the calling context. |
MediaId | The media ID that the write request is for. |
Lba | The starting logical block address to be written. |
BufferSize | The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device. |
Buffer | Pointer to the source buffer for the data. |
EFI_SUCCESS | The data were written correctly to the device. |
EFI_WRITE_PROTECTED | The device cannot be written to. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_DEVICE_ERROR | The device reported an error while attempting to perform the write operation. |
EFI_BAD_BUFFER_SIZE | The BufferSize parameter is not a multiple of the intrinsic block size of the device. |
EFI_INVALID_PARAMETER | The write request contains LBAs that are not valid, or the buffer is not on proper alignment. |
Definition at line 211 of file UsbMassImpl.c.
|
extern |
Definition at line 14 of file ComponentName.c.
|
extern |
Definition at line 23 of file ComponentName.c.