1 /*++
2 
3 Copyright (c) 1999 - 2002, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution.  The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8 
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 
12 
13 Module Name:
14 
15   BlockIo.h
16 
17 Abstract:
18 
19   BlockIo PPI as defined in EFI 2.0
20 
21   Used to access block-oriented storage devices
22 
23 --*/
24 
25 #ifndef _PEI_BLOCK_IO_H_
26 #define _PEI_BLOCK_IO_H_
27 
28 #define PEI_BLOCK_IO_PPI_GUID \
29   { \
30     0x695d8aa1, 0x42ee, 0x4c46, {0x80, 0x5c, 0x6e, 0xa6, 0xbc, 0xe7, 0x99, 0xe3} \
31   }
32 
33 EFI_FORWARD_DECLARATION (PEI_RECOVERY_BLOCK_IO_INTERFACE);
34 
35 typedef UINT64  PEI_LBA;
36 
37 typedef enum {
38   LegacyFloppy  = 0,
39   IdeCDROM      = 1,
40   IdeLS120      = 2,
41   UsbMassStorage= 3,
42   MaxDeviceType
43 } PEI_BLOCK_DEVICE_TYPE;
44 
45 typedef struct {
46   PEI_BLOCK_DEVICE_TYPE DeviceType;
47   BOOLEAN               MediaPresent;
48   UINTN                 LastBlock;
49   UINTN                 BlockSize;
50 } PEI_BLOCK_IO_MEDIA;
51 
52 typedef
53 EFI_STATUS
54 (EFIAPI *PEI_GET_NUMBER_BLOCK_DEVICES) (
55   IN  EFI_PEI_SERVICES                         **PeiServices,
56   IN PEI_RECOVERY_BLOCK_IO_INTERFACE           * This,
57   OUT UINTN                                    *NumberBlockDevices
58   );
59 
60 typedef
61 EFI_STATUS
62 (EFIAPI *PEI_GET_DEVICE_MEDIA_INFORMATION) (
63   IN  EFI_PEI_SERVICES                         **PeiServices,
64   IN PEI_RECOVERY_BLOCK_IO_INTERFACE           * This,
65   IN UINTN                                     DeviceIndex,
66   OUT PEI_BLOCK_IO_MEDIA                       * MediaInfo
67   );
68 
69 typedef
70 EFI_STATUS
71 (EFIAPI *PEI_READ_BLOCKS) (
72   IN  EFI_PEI_SERVICES                         **PeiServices,
73   IN PEI_RECOVERY_BLOCK_IO_INTERFACE           * This,
74   IN UINTN                                     DeviceIndex,
75   IN PEI_LBA                                   StartLBA,
76   IN UINTN                                     BufferSize,
77   OUT VOID                                     *Buffer
78   );
79 
80 struct _PEI_RECOVERY_BLOCK_IO_INTERFACE {
81   PEI_GET_NUMBER_BLOCK_DEVICES      GetNumberOfBlockDevices;
82   PEI_GET_DEVICE_MEDIA_INFORMATION  GetBlockDeviceMediaInfo;
83   PEI_READ_BLOCKS                   ReadBlocks;
84 };
85 
86 extern EFI_GUID gPeiBlockIoPpiGuid;
87 
88 #endif
89