X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbMassStorageDxe%2FUsbMassBot.h;fp=MdeModulePkg%2FBus%2FUsb%2FUsbMassStorageDxe%2FUsbMassBot.h;h=cf8e9a3bdd709eabcf531ec07ae5e1e476379c30;hp=3ef8f240a2c1547343ec6b37a0aa062f0441c9ec;hb=1436aea4d5707e672672a11bda72be2c63c936c3;hpb=7c7184e201a90a1d2376e615e55e3f4074731468 diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.h b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.h index 3ef8f240a2..cf8e9a3bdd 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.h +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.h @@ -11,29 +11,29 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef _EFI_USBMASS_BOT_H_ #define _EFI_USBMASS_BOT_H_ -extern USB_MASS_TRANSPORT mUsbBotTransport; +extern USB_MASS_TRANSPORT mUsbBotTransport; // // Usb Bulk-Only class specific request // -#define USB_BOT_RESET_REQUEST 0xFF ///< Bulk-Only Mass Storage Reset -#define USB_BOT_GETLUN_REQUEST 0xFE ///< Get Max Lun -#define USB_BOT_CBW_SIGNATURE 0x43425355 ///< dCBWSignature, tag the packet as CBW -#define USB_BOT_CSW_SIGNATURE 0x53425355 ///< dCSWSignature, tag the packet as CSW -#define USB_BOT_MAX_LUN 0x0F ///< Lun number is from 0 to 15 -#define USB_BOT_MAX_CMDLEN 16 ///< Maximum number of command from command set +#define USB_BOT_RESET_REQUEST 0xFF ///< Bulk-Only Mass Storage Reset +#define USB_BOT_GETLUN_REQUEST 0xFE ///< Get Max Lun +#define USB_BOT_CBW_SIGNATURE 0x43425355 ///< dCBWSignature, tag the packet as CBW +#define USB_BOT_CSW_SIGNATURE 0x53425355 ///< dCSWSignature, tag the packet as CSW +#define USB_BOT_MAX_LUN 0x0F ///< Lun number is from 0 to 15 +#define USB_BOT_MAX_CMDLEN 16 ///< Maximum number of command from command set // // Usb BOT command block status values // -#define USB_BOT_COMMAND_OK 0x00 ///< Command passed, good status -#define USB_BOT_COMMAND_FAILED 0x01 ///< Command failed -#define USB_BOT_COMMAND_ERROR 0x02 ///< Phase error, need to reset the device +#define USB_BOT_COMMAND_OK 0x00 ///< Command passed, good status +#define USB_BOT_COMMAND_FAILED 0x01 ///< Command failed +#define USB_BOT_COMMAND_ERROR 0x02 ///< Phase error, need to reset the device // // Usb Bot retry to get CSW, refers to specification[BOT10-5.3, it says 2 times] // -#define USB_BOT_RECV_CSW_RETRY 3 +#define USB_BOT_RECV_CSW_RETRY 3 // // Usb Bot wait device reset complete, set by experience @@ -43,32 +43,32 @@ extern USB_MASS_TRANSPORT mUsbBotTransport; // // Usb Bot transport timeout, set by experience // -#define USB_BOT_SEND_CBW_TIMEOUT (3 * USB_MASS_1_SECOND) -#define USB_BOT_RECV_CSW_TIMEOUT (3 * USB_MASS_1_SECOND) -#define USB_BOT_RESET_DEVICE_TIMEOUT (3 * USB_MASS_1_SECOND) +#define USB_BOT_SEND_CBW_TIMEOUT (3 * USB_MASS_1_SECOND) +#define USB_BOT_RECV_CSW_TIMEOUT (3 * USB_MASS_1_SECOND) +#define USB_BOT_RESET_DEVICE_TIMEOUT (3 * USB_MASS_1_SECOND) #pragma pack(1) /// /// The CBW (Command Block Wrapper) structures used by the USB BOT protocol. /// typedef struct { - UINT32 Signature; - UINT32 Tag; - UINT32 DataLen; ///< Length of data between CBW and CSW - UINT8 Flag; ///< Bit 7, 0 ~ Data-Out, 1 ~ Data-In - UINT8 Lun; ///< Lun number. Bits 0~3 are used - UINT8 CmdLen; ///< Length of the command. Bits 0~4 are used - UINT8 CmdBlock[USB_BOT_MAX_CMDLEN]; + UINT32 Signature; + UINT32 Tag; + UINT32 DataLen; ///< Length of data between CBW and CSW + UINT8 Flag; ///< Bit 7, 0 ~ Data-Out, 1 ~ Data-In + UINT8 Lun; ///< Lun number. Bits 0~3 are used + UINT8 CmdLen; ///< Length of the command. Bits 0~4 are used + UINT8 CmdBlock[USB_BOT_MAX_CMDLEN]; } USB_BOT_CBW; /// /// The and CSW (Command Status Wrapper) structures used by the USB BOT protocol. /// typedef struct { - UINT32 Signature; - UINT32 Tag; - UINT32 DataResidue; - UINT8 CmdStatus; + UINT32 Signature; + UINT32 Tag; + UINT32 DataResidue; + UINT8 CmdStatus; } USB_BOT_CSW; #pragma pack() @@ -76,11 +76,11 @@ typedef struct { // // Put Interface at the first field to make it easy to distinguish BOT/CBI Protocol instance // - EFI_USB_INTERFACE_DESCRIPTOR Interface; - EFI_USB_ENDPOINT_DESCRIPTOR *BulkInEndpoint; - EFI_USB_ENDPOINT_DESCRIPTOR *BulkOutEndpoint; - UINT32 CbwTag; - EFI_USB_IO_PROTOCOL *UsbIo; + EFI_USB_INTERFACE_DESCRIPTOR Interface; + EFI_USB_ENDPOINT_DESCRIPTOR *BulkInEndpoint; + EFI_USB_ENDPOINT_DESCRIPTOR *BulkOutEndpoint; + UINT32 CbwTag; + EFI_USB_IO_PROTOCOL *UsbIo; } USB_BOT_PROTOCOL; /** @@ -100,8 +100,8 @@ typedef struct { **/ EFI_STATUS UsbBotInit ( - IN EFI_USB_IO_PROTOCOL *UsbIo, - OUT VOID **Context OPTIONAL + IN EFI_USB_IO_PROTOCOL *UsbIo, + OUT VOID **Context OPTIONAL ); /** @@ -150,8 +150,8 @@ UsbBotExecCommand ( **/ EFI_STATUS UsbBotResetDevice ( - IN VOID *Context, - IN BOOLEAN ExtendedVerification + IN VOID *Context, + IN BOOLEAN ExtendedVerification ); /** @@ -167,8 +167,8 @@ UsbBotResetDevice ( **/ EFI_STATUS UsbBotGetMaxLun ( - IN VOID *Context, - OUT UINT8 *MaxLun + IN VOID *Context, + OUT UINT8 *MaxLun ); /** @@ -181,7 +181,7 @@ UsbBotGetMaxLun ( **/ EFI_STATUS UsbBotCleanUp ( - IN VOID *Context + IN VOID *Context ); #endif