MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/** @file
|
||||
Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol,
|
||||
Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol,
|
||||
and other common definitions.
|
||||
|
||||
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@@ -224,7 +224,7 @@ UsbBootExecCmd (
|
||||
If the device isn't ready, wait for it. If the device is ready
|
||||
and error occurs, retry the command again until it exceeds the
|
||||
limit of retrial times.
|
||||
|
||||
|
||||
@param UsbMass The device to issue commands to
|
||||
@param Cmd The command to execute
|
||||
@param CmdLen The length of the command
|
||||
@@ -412,7 +412,7 @@ UsbBootInquiry (
|
||||
@retval EFI_SUCCESS The disk geometry is successfully retrieved.
|
||||
@retval EFI_NOT_READY The returned block size is zero.
|
||||
@retval Other READ CAPACITY 16 bytes command execution failed.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UsbBootReadCapacity16 (
|
||||
@@ -442,7 +442,7 @@ UsbBootReadCapacity16 (
|
||||
ZeroMem ((CapacityCmd + 2), 8);
|
||||
|
||||
CapacityCmd[13] = sizeof (CapacityData);
|
||||
|
||||
|
||||
Status = UsbBootExecCmdWithRetry (
|
||||
UsbMass,
|
||||
CapacityCmd,
|
||||
@@ -464,13 +464,13 @@ UsbBootReadCapacity16 (
|
||||
Media->LastBlock = SwapBytes64 (ReadUnaligned64 ((CONST UINT64 *) &(CapacityData.LastLba7)));
|
||||
|
||||
BlockSize = SwapBytes32 (ReadUnaligned32 ((CONST UINT32 *) &(CapacityData.BlockSize3)));
|
||||
|
||||
|
||||
Media->LowestAlignedLba = (CapacityData.LowestAlignLogic2 << 8) |
|
||||
CapacityData.LowestAlignLogic1;
|
||||
Media->LogicalBlocksPerPhysicalBlock = (1 << CapacityData.LogicPerPhysical);
|
||||
if (BlockSize == 0) {
|
||||
//
|
||||
// Get sense data
|
||||
// Get sense data
|
||||
//
|
||||
return UsbBootRequestSense (UsbMass);
|
||||
} else {
|
||||
@@ -494,7 +494,7 @@ UsbBootReadCapacity16 (
|
||||
@retval EFI_SUCCESS The disk geometry is successfully retrieved.
|
||||
@retval EFI_NOT_READY The returned block size is zero.
|
||||
@retval Other READ CAPACITY command execution failed.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UsbBootReadCapacity (
|
||||
@@ -538,7 +538,7 @@ UsbBootReadCapacity (
|
||||
BlockSize = SwapBytes32 (ReadUnaligned32 ((CONST UINT32 *) CapacityData.BlockLen));
|
||||
if (BlockSize == 0) {
|
||||
//
|
||||
// Get sense data
|
||||
// Get sense data
|
||||
//
|
||||
return UsbBootRequestSense (UsbMass);
|
||||
} else {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Definition of the command set of USB Mass Storage Specification
|
||||
for Bootability, Revision 1.0.
|
||||
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -21,7 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
// INQUIRY/REQUEST_SENSE are "No Timeout Commands" as specified
|
||||
// by Multi-Media Commands (MMC) set.
|
||||
// Others are "Group 1 Timeout Commands". That is,
|
||||
// they should be retried if driver is ready.
|
||||
// they should be retried if driver is ready.
|
||||
//
|
||||
#define USB_BOOT_INQUIRY_OPCODE 0x12
|
||||
#define USB_BOOT_REQUEST_SENSE_OPCODE 0x03
|
||||
@@ -82,17 +82,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
// Mass command timeout, refers to specification[USB20-9.2.6.1]
|
||||
//
|
||||
// USB2.0 Spec define the up-limit timeout 5s for all command. USB floppy,
|
||||
// USB CD-Rom and iPod devices are much slower than USB key when reponse
|
||||
// USB2.0 Spec define the up-limit timeout 5s for all command. USB floppy,
|
||||
// USB CD-Rom and iPod devices are much slower than USB key when reponse
|
||||
// most of commands, So we set 5s as timeout here.
|
||||
//
|
||||
//
|
||||
#define USB_BOOT_GENERAL_CMD_TIMEOUT (5 * USB_MASS_1_SECOND)
|
||||
|
||||
//
|
||||
// The required commands are INQUIRY, READ CAPACITY, TEST UNIT READY,
|
||||
// READ10, WRITE10, and REQUEST SENSE. The BLOCK_IO protocol uses LBA
|
||||
// so it isn't necessary to issue MODE SENSE / READ FORMAT CAPACITY
|
||||
// command to retrieve the disk gemotrics.
|
||||
// command to retrieve the disk gemotrics.
|
||||
//
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Implementation of the USB mass storage Bulk-Only Transport protocol,
|
||||
according to USB Mass Storage Class Bulk-Only Transport, Revision 1.0.
|
||||
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -272,7 +272,7 @@ UsbBotDataTransfer (
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) {
|
||||
DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: (%r)\n", Status));
|
||||
DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: (%r)\n", Status));
|
||||
DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: DataIn Stall\n"));
|
||||
UsbClearEndpointStall (UsbBot->UsbIo, Endpoint->EndpointAddress);
|
||||
} else if (USB_IS_ERROR (Result, EFI_USB_ERR_NAK)) {
|
||||
|
@@ -3,7 +3,7 @@
|
||||
based on the "Universal Serial Bus Mass Storage Class Bulk-Only
|
||||
Transport" Revision 1.0, September 31, 1999.
|
||||
|
||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -43,7 +43,7 @@ extern USB_MASS_TRANSPORT mUsbBotTransport;
|
||||
|
||||
//
|
||||
// Usb Bot wait device reset complete, set by experience
|
||||
//
|
||||
//
|
||||
#define USB_BOT_RESET_DEVICE_STALL (100 * USB_MASS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
|
@@ -4,7 +4,7 @@
|
||||
Notice: it is being obsoleted by the standard body in favor of the BOT
|
||||
(Bulk-Only Transport).
|
||||
|
||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -147,7 +147,7 @@ UsbCbiInit (
|
||||
} else {
|
||||
FreePool (UsbCbi);
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
ON_ERROR:
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Defination for the USB mass storage Control/Bulk/Interrupt (CBI) transport,
|
||||
according to USB Mass Storage Class Control/Bulk/Interrupt (CBI) Transport, Revision 1.1.
|
||||
|
||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -27,7 +27,7 @@ extern USB_MASS_TRANSPORT mUsbCbi1Transport;
|
||||
#define USB_CBI_MAX_RETRY 3
|
||||
//
|
||||
// Time to wait for USB CBI reset to complete, set by experience
|
||||
//
|
||||
//
|
||||
#define USB_CBI_RESET_DEVICE_STALL (50 * USB_MASS_1_MILLISECOND)
|
||||
//
|
||||
// USB CBI transport timeout, set by experience
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
This file is used to implement the EFI_DISK_INFO_PROTOCOL interface.
|
||||
|
||||
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -26,7 +26,7 @@ EFI_DISK_INFO_PROTOCOL gUsbDiskInfoProtocolTemplate = {
|
||||
Initialize the installation of DiskInfo protocol.
|
||||
|
||||
This function prepares for the installation of DiskInfo protocol on the child handle.
|
||||
By default, it installs DiskInfo protocol with USB interface GUID.
|
||||
By default, it installs DiskInfo protocol with USB interface GUID.
|
||||
|
||||
@param[in] UsbMass The pointer of USB_MASS_DEVICE.
|
||||
|
||||
@@ -42,7 +42,7 @@ InitializeDiskInfo (
|
||||
|
||||
/**
|
||||
Provides inquiry information for the controller type.
|
||||
|
||||
|
||||
This function is used to get inquiry data. Data format
|
||||
of Identify data is defined by the Interface GUID.
|
||||
|
||||
@@ -51,9 +51,9 @@ InitializeDiskInfo (
|
||||
@param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
|
||||
|
||||
@retval EFI_SUCCESS The command was accepted without any errors.
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading InquiryData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading InquiryData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -85,16 +85,16 @@ UsbDiskInfoInquiry (
|
||||
This function is used to get identify data. Data format
|
||||
of Identify data is defined by the Interface GUID.
|
||||
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
|
||||
instance.
|
||||
@param[in, out] IdentifyData Pointer to a buffer for the identify data.
|
||||
@param[in, out] IdentifyDataSize Pointer to the value for the identify data
|
||||
size.
|
||||
|
||||
@retval EFI_SUCCESS The command was accepted without any errors.
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading IdentifyData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading IdentifyData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -110,8 +110,8 @@ UsbDiskInfoIdentify (
|
||||
|
||||
/**
|
||||
Provides sense data information for the controller type.
|
||||
|
||||
This function is used to get sense data.
|
||||
|
||||
This function is used to get sense data.
|
||||
Data format of Sense data is defined by the Interface GUID.
|
||||
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
|
||||
@@ -141,7 +141,7 @@ UsbDiskInfoSenseData (
|
||||
/**
|
||||
This function is used to get controller information.
|
||||
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
|
||||
@param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
|
||||
@param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Header file for EFI_DISK_INFO_PROTOCOL interface.
|
||||
|
||||
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
Initialize the installation of DiskInfo protocol.
|
||||
|
||||
This function prepares for the installation of DiskInfo protocol on the child handle.
|
||||
By default, it installs DiskInfo protocol with USB interface GUID.
|
||||
By default, it installs DiskInfo protocol with USB interface GUID.
|
||||
|
||||
@param UsbMass The pointer of USB_MASS_DEVICE.
|
||||
|
||||
@@ -32,7 +32,7 @@ InitializeDiskInfo (
|
||||
|
||||
/**
|
||||
Provides inquiry information for the controller type.
|
||||
|
||||
|
||||
This function is used to get inquiry data. Data format
|
||||
of Identify data is defined by the Interface GUID.
|
||||
|
||||
@@ -41,9 +41,9 @@ InitializeDiskInfo (
|
||||
@param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
|
||||
|
||||
@retval EFI_SUCCESS The command was accepted without any errors.
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading InquiryData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading InquiryData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -60,16 +60,16 @@ UsbDiskInfoInquiry (
|
||||
This function is used to get identify data. Data format
|
||||
of Identify data is defined by the Interface GUID.
|
||||
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
|
||||
instance.
|
||||
@param[in, out] IdentifyData Pointer to a buffer for the identify data.
|
||||
@param[in, out] IdentifyDataSize Pointer to the value for the identify data
|
||||
size.
|
||||
|
||||
@retval EFI_SUCCESS The command was accepted without any errors.
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading IdentifyData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
|
||||
@retval EFI_NOT_FOUND Device does not support this data class
|
||||
@retval EFI_DEVICE_ERROR Error reading IdentifyData from device
|
||||
@retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -82,8 +82,8 @@ UsbDiskInfoIdentify (
|
||||
|
||||
/**
|
||||
Provides sense data information for the controller type.
|
||||
|
||||
This function is used to get sense data.
|
||||
|
||||
This function is used to get sense data.
|
||||
Data format of Sense data is defined by the Interface GUID.
|
||||
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
|
||||
@@ -110,7 +110,7 @@ UsbDiskInfoSenseData (
|
||||
/**
|
||||
This function is used to get controller information.
|
||||
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
|
||||
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
|
||||
@param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
|
||||
@param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
|
||||
|
||||
|
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#define USB_MASS_TRANSPORT_COUNT 3
|
||||
//
|
||||
// Array of USB transport interfaces.
|
||||
// Array of USB transport interfaces.
|
||||
//
|
||||
USB_MASS_TRANSPORT *mUsbMassTransport[USB_MASS_TRANSPORT_COUNT] = {
|
||||
&mUsbCbi0Transport,
|
||||
@@ -36,7 +36,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUSBMassDriverBinding = {
|
||||
/**
|
||||
Reset the block device.
|
||||
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.Reset().
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.Reset().
|
||||
It resets the block device hardware.
|
||||
ExtendedVerification is ignored in this implementation.
|
||||
|
||||
@@ -76,7 +76,7 @@ UsbMassReset (
|
||||
/**
|
||||
Reads the requested number of blocks from the device.
|
||||
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks().
|
||||
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.
|
||||
|
||||
@@ -191,7 +191,7 @@ ON_EXIT:
|
||||
/**
|
||||
Writes a specified number of blocks to the device.
|
||||
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks().
|
||||
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.
|
||||
|
||||
@@ -295,7 +295,7 @@ UsbMassWriteBlocks (
|
||||
Status = UsbBootWriteBlocks16 (UsbMass, Lba, TotalBlock, Buffer);
|
||||
} else {
|
||||
Status = UsbBootWriteBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "UsbMassWriteBlocks: UsbBootWriteBlocks (%r) -> Reset\n", Status));
|
||||
@@ -402,7 +402,7 @@ UsbMassInitTransport (
|
||||
EFI_USB_INTERFACE_DESCRIPTOR Interface;
|
||||
UINT8 Index;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiUsbIoProtocolGuid,
|
||||
@@ -415,12 +415,12 @@ UsbMassInitTransport (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
|
||||
Status = EFI_UNSUPPORTED;
|
||||
|
||||
//
|
||||
@@ -443,7 +443,7 @@ UsbMassInitTransport (
|
||||
}
|
||||
|
||||
//
|
||||
// For BOT device, try to get its max LUN.
|
||||
// For BOT device, try to get its max LUN.
|
||||
// If max LUN is 0, then it is a non-lun device.
|
||||
// Otherwise, it is a multi-lun device.
|
||||
//
|
||||
@@ -458,7 +458,7 @@ ON_EXIT:
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
return Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -495,14 +495,14 @@ UsbMassInitMultiLun (
|
||||
ASSERT (MaxLun > 0);
|
||||
ReturnStatus = EFI_NOT_FOUND;
|
||||
|
||||
for (Index = 0; Index <= MaxLun; Index++) {
|
||||
for (Index = 0; Index <= MaxLun; Index++) {
|
||||
|
||||
DEBUG ((EFI_D_INFO, "UsbMassInitMultiLun: Start to initialize No.%d logic unit\n", Index));
|
||||
|
||||
|
||||
UsbIo = NULL;
|
||||
UsbMass = AllocateZeroPool (sizeof (USB_MASS_DEVICE));
|
||||
ASSERT (UsbMass != NULL);
|
||||
|
||||
|
||||
UsbMass->Signature = USB_MASS_SIGNATURE;
|
||||
UsbMass->UsbIo = UsbIo;
|
||||
UsbMass->BlockIo.Media = &UsbMass->BlockIoMedia;
|
||||
@@ -514,7 +514,7 @@ UsbMassInitMultiLun (
|
||||
UsbMass->Transport = Transport;
|
||||
UsbMass->Context = Context;
|
||||
UsbMass->Lun = Index;
|
||||
|
||||
|
||||
//
|
||||
// Initialize the media parameter data for EFI_BLOCK_IO_MEDIA of Block I/O Protocol.
|
||||
//
|
||||
@@ -531,11 +531,11 @@ UsbMassInitMultiLun (
|
||||
LunNode.Header.Type = MESSAGING_DEVICE_PATH;
|
||||
LunNode.Header.SubType = MSG_DEVICE_LOGICAL_UNIT_DP;
|
||||
LunNode.Lun = UsbMass->Lun;
|
||||
|
||||
|
||||
SetDevicePathNodeLength (&LunNode.Header, sizeof (LunNode));
|
||||
|
||||
|
||||
UsbMass->DevicePath = AppendDevicePathNode (DevicePath, &LunNode.Header);
|
||||
|
||||
|
||||
if (UsbMass->DevicePath == NULL) {
|
||||
DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: failed to create device logic unit device path\n"));
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
@@ -558,7 +558,7 @@ UsbMassInitMultiLun (
|
||||
&UsbMass->DiskInfo,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: InstallMultipleProtocolInterfaces (%r)\n", Status));
|
||||
FreePool (UsbMass->DevicePath);
|
||||
@@ -597,7 +597,7 @@ UsbMassInitMultiLun (
|
||||
ReturnStatus = EFI_SUCCESS;
|
||||
DEBUG ((EFI_D_INFO, "UsbMassInitMultiLun: Success to initialize No.%d logic unit\n", Index));
|
||||
}
|
||||
|
||||
|
||||
return ReturnStatus;
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ UsbMassInitNonLun (
|
||||
DEBUG ((EFI_D_ERROR, "UsbMassInitNonLun: OpenUsbIoProtocol By Driver (%r)\n", Status));
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
UsbMass->Signature = USB_MASS_SIGNATURE;
|
||||
UsbMass->Controller = Controller;
|
||||
UsbMass->UsbIo = UsbIo;
|
||||
@@ -654,7 +654,7 @@ UsbMassInitNonLun (
|
||||
UsbMass->OpticalStorage = FALSE;
|
||||
UsbMass->Transport = Transport;
|
||||
UsbMass->Context = Context;
|
||||
|
||||
|
||||
//
|
||||
// Initialize the media parameter data for EFI_BLOCK_IO_MEDIA of Block I/O Protocol.
|
||||
//
|
||||
@@ -663,7 +663,7 @@ UsbMassInitNonLun (
|
||||
DEBUG ((EFI_D_ERROR, "UsbMassInitNonLun: UsbMassInitMedia (%r)\n", Status));
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
InitializeDiskInfo (UsbMass);
|
||||
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
@@ -692,7 +692,7 @@ ON_ERROR:
|
||||
Controller
|
||||
);
|
||||
}
|
||||
return Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
@@ -804,7 +804,7 @@ USBMassDriverBindingStart (
|
||||
VOID *Context;
|
||||
UINT8 MaxLun;
|
||||
EFI_STATUS Status;
|
||||
EFI_USB_IO_PROTOCOL *UsbIo;
|
||||
EFI_USB_IO_PROTOCOL *UsbIo;
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
@@ -824,7 +824,7 @@ USBMassDriverBindingStart (
|
||||
// Initialize data for device that does not support multiple LUNSs.
|
||||
//
|
||||
Status = UsbMassInitNonLun (This, Controller, Transport, Context);
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbMassInitNonLun (%r)\n", Status));
|
||||
}
|
||||
} else {
|
||||
@@ -839,7 +839,7 @@ USBMassDriverBindingStart (
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: OpenDevicePathProtocol By Driver (%r)\n", Status));
|
||||
goto Exit;
|
||||
@@ -853,7 +853,7 @@ USBMassDriverBindingStart (
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: OpenUsbIoProtocol By Driver (%r)\n", Status));
|
||||
gBS->CloseProtocol (
|
||||
@@ -941,7 +941,7 @@ USBMassDriverBindingStop (
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
//
|
||||
// This is a 2nd type handle(multi-lun root), it needs to close devicepath
|
||||
@@ -962,13 +962,13 @@ USBMassDriverBindingStop (
|
||||
DEBUG ((EFI_D_INFO, "Success to stop multi-lun root handle\n"));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// This is a 1st type handle(non-multi-lun), which only needs to uninstall
|
||||
// Block I/O Protocol, close USB I/O Protocol and free mass device.
|
||||
//
|
||||
UsbMass = USB_MASS_DEVICE_FROM_BLOCK_IO (BlockIo);
|
||||
|
||||
|
||||
//
|
||||
// Uninstall Block I/O protocol from the device handle,
|
||||
// then call the transport protocol to stop itself.
|
||||
@@ -984,24 +984,24 @@ USBMassDriverBindingStop (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiUsbIoProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
|
||||
|
||||
UsbMass->Transport->CleanUp (UsbMass->Context);
|
||||
FreePool (UsbMass);
|
||||
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Success to stop non-multi-lun root handle\n"));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// This is a 3rd type handle(multi-lun), which needs uninstall
|
||||
// Block I/O Protocol and Device Path Protocol, close USB I/O Protocol and
|
||||
// Block I/O Protocol and Device Path Protocol, close USB I/O Protocol and
|
||||
// free mass device for all children.
|
||||
//
|
||||
AllChildrenStopped = TRUE;
|
||||
@@ -1030,7 +1030,7 @@ USBMassDriverBindingStop (
|
||||
This->DriverBindingHandle,
|
||||
ChildHandleBuffer[Index]
|
||||
);
|
||||
|
||||
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
ChildHandleBuffer[Index],
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
@@ -1041,14 +1041,14 @@ USBMassDriverBindingStop (
|
||||
&UsbMass->DiskInfo,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Fail to uninstall Block I/O Protocol and Device Path Protocol, so re-open USB I/O Protocol by child.
|
||||
//
|
||||
AllChildrenStopped = FALSE;
|
||||
DEBUG ((EFI_D_ERROR, "Fail to stop No.%d multi-lun child handle when uninstalling blockio and devicepath\n", (UINT32)Index));
|
||||
|
||||
|
||||
gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiUsbIoProtocolGuid,
|
||||
@@ -1071,7 +1071,7 @@ USBMassDriverBindingStop (
|
||||
if (!AllChildrenStopped) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Success to stop all %d multi-lun children handles\n", (UINT32) NumberOfChildren));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Definitions of functions for Driver Binding Protocol and Block I/O Protocol,
|
||||
and other internal definitions.
|
||||
|
||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -107,7 +107,7 @@ USBMassDriverBindingStop (
|
||||
/**
|
||||
Reset the block device.
|
||||
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.Reset().
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.Reset().
|
||||
It resets the block device hardware.
|
||||
ExtendedVerification is ignored in this implementation.
|
||||
|
||||
@@ -129,7 +129,7 @@ UsbMassReset (
|
||||
/**
|
||||
Reads the requested number of blocks from the device.
|
||||
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks().
|
||||
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.
|
||||
|
||||
@@ -163,7 +163,7 @@ UsbMassReadBlocks (
|
||||
/**
|
||||
Writes a specified number of blocks to the device.
|
||||
|
||||
This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks().
|
||||
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.
|
||||
|
||||
|
@@ -13,7 +13,7 @@
|
||||
# 3. USB Mass Storage Class Bulk-Only Transport, Revision 1.0.
|
||||
# 4. UEFI Specification, v2.1
|
||||
#
|
||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -40,7 +40,7 @@
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gUSBMassDriverBinding
|
||||
# DRIVER_BINDING = gUSBMassDriverBinding
|
||||
# COMPONENT_NAME = gUsbMassStorageComponentName
|
||||
# COMPONENT_NAME2 = gUsbMassStorageComponentName2
|
||||
#
|
||||
|
@@ -13,13 +13,13 @@
|
||||
// 3. USB Mass Storage Class Bulk-Only Transport, Revision 1.0.
|
||||
// 4. UEFI Specification, v2.1
|
||||
//
|
||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// which accompanies this distribution. The full text of the license may be found at
|
||||
// http://opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
//
|
||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// UsbMassStorageDxe Localized Strings and Content
|
||||
//
|
||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -13,8 +13,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"USB Mass Storage DXE Driver"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user