TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbBotPeim.h
Go to the documentation of this file.
1
10#ifndef _PEI_USB_BOT_PEIM_H_
11#define _PEI_USB_BOT_PEIM_H_
12
13#include <PiPei.h>
14
15#include <Ppi/UsbIo.h>
17#include <Ppi/BlockIo.h>
18#include <Ppi/BlockIo2.h>
19
20#include <Library/DebugLib.h>
21
24
25#define PEI_FAT_MAX_USB_IO_PPI 127
26
47EFIAPI
49 IN EFI_PEI_SERVICES **PeiServices,
51 OUT UINTN *NumberBlockDevices
52 );
53
82EFIAPI
84 IN EFI_PEI_SERVICES **PeiServices,
86 IN UINTN DeviceIndex,
88 );
89
125EFIAPI
127 IN EFI_PEI_SERVICES **PeiServices,
129 IN UINTN DeviceIndex,
130 IN EFI_PEI_LBA StartLBA,
131 IN UINTN BufferSize,
132 OUT VOID *Buffer
133 );
134
155EFIAPI
157 IN EFI_PEI_SERVICES **PeiServices,
159 OUT UINTN *NumberBlockDevices
160 );
161
190EFIAPI
192 IN EFI_PEI_SERVICES **PeiServices,
194 IN UINTN DeviceIndex,
196 );
197
233EFIAPI
235 IN EFI_PEI_SERVICES **PeiServices,
237 IN UINTN DeviceIndex,
238 IN EFI_PEI_LBA StartLBA,
239 IN UINTN BufferSize,
240 OUT VOID *Buffer
241 );
242
257EFIAPI
259 IN EFI_PEI_SERVICES **PeiServices,
260 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
261 IN VOID *InvokePpi
262 );
263
277 IN EFI_PEI_SERVICES **PeiServices,
278 IN PEI_USB_IO_PPI *UsbIoPpi
279 );
280
281#define USBCDROM 1 // let the device type value equal to USBCDROM, which is defined by PI spec.
282 // Therefore the CdExpressPei module can do recovery on UsbCdrom.
283#define USBFLOPPY 2 // for those that use ReadCapacity(0x25) command to retrieve media capacity
284#define USBFLOPPY2 3 // for those that use ReadFormatCapacity(0x23) command to retrieve media capacity
285
286//
287// Bot device structure
288//
289#define PEI_BOT_DEVICE_SIGNATURE SIGNATURE_32 ('U', 'B', 'O', 'T')
290typedef struct {
291 UINTN Signature;
294 EFI_PEI_PPI_DESCRIPTOR BlkIoPpiList;
295 EFI_PEI_PPI_DESCRIPTOR BlkIo2PpiList;
298 PEI_USB_IO_PPI *UsbIoPpi;
299 EFI_USB_INTERFACE_DESCRIPTOR *BotInterface;
300 EFI_USB_ENDPOINT_DESCRIPTOR *BulkInEndpoint;
301 EFI_USB_ENDPOINT_DESCRIPTOR *BulkOutEndpoint;
303 UINTN DeviceType;
304 ATAPI_REQUEST_SENSE_DATA *SensePtr;
306
307#define PEI_BOT_DEVICE_FROM_THIS(a) CR (a, PEI_BOT_DEVICE, BlkIoPpi, PEI_BOT_DEVICE_SIGNATURE)
308#define PEI_BOT_DEVICE2_FROM_THIS(a) CR (a, PEI_BOT_DEVICE, BlkIo2Ppi, PEI_BOT_DEVICE_SIGNATURE)
309
329 IN EFI_PEI_SERVICES **PeiServices,
330 IN PEI_BOT_DEVICE *PeiBotDev,
331 IN VOID *Command,
332 IN UINT8 CommandSize,
333 IN VOID *DataBuffer,
334 IN UINT32 BufferLength,
335 IN EFI_USB_DATA_DIRECTION Direction,
336 IN UINT16 TimeOutInMilliSeconds
337 );
338
339#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 EFI_PEI_LBA
Definition: BlockIo.h:41
EFI_USB_DATA_DIRECTION
Definition: UsbIo.h:44
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
@ AllocateAddress
Definition: UefiSpec.h:42
EFI_STATUS EFIAPI BotGetMediaInfo2(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI *This, IN UINTN DeviceIndex, OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo)
Definition: UsbBotPeim.c:625
EFI_STATUS EFIAPI BotReadBlocks2(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI *This, IN UINTN DeviceIndex, IN EFI_PEI_LBA StartLBA, IN UINTN BufferSize, OUT VOID *Buffer)
Definition: UsbBotPeim.c:693
EFI_STATUS EFIAPI NotifyOnUsbIoPpi(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, IN VOID *InvokePpi)
Definition: UsbBotPeim.c:129
EFI_STATUS EFIAPI BotGetNumberOfBlockDevices(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *This, OUT UINTN *NumberBlockDevices)
Definition: UsbBotPeim.c:306
EFI_STATUS EFIAPI BotGetMediaInfo(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *This, IN UINTN DeviceIndex, OUT EFI_PEI_BLOCK_IO_MEDIA *MediaInfo)
Definition: UsbBotPeim.c:348
EFI_STATUS EFIAPI BotGetNumberOfBlockDevices2(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI *This, OUT UINTN *NumberBlockDevices)
Definition: UsbBotPeim.c:583
EFI_STATUS InitUsbBot(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi)
Definition: UsbBotPeim.c:156
EFI_STATUS EFIAPI BotReadBlocks(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *This, IN UINTN DeviceIndex, IN EFI_PEI_LBA StartLBA, IN UINTN BufferSize, OUT VOID *Buffer)
Definition: UsbBotPeim.c:422
EFI_STATUS PeiAtapiCommand(IN EFI_PEI_SERVICES **PeiServices, IN PEI_BOT_DEVICE *PeiBotDev, IN VOID *Command, IN UINT8 CommandSize, IN VOID *DataBuffer, IN UINT32 BufferLength, IN EFI_USB_DATA_DIRECTION Direction, IN UINT16 TimeOutInMilliSeconds)
Definition: BotPeim.c:321