]>
Commit | Line | Data |
---|---|---|
b55d6622 LE |
1 | /** @file\r |
2 | Internal macro definitions, type definitions, and function declarations for\r | |
3 | the Virtio Filesystem device driver.\r | |
4 | \r | |
5 | Copyright (C) 2020, Red Hat, Inc.\r | |
6 | \r | |
7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | **/\r | |
9 | \r | |
10 | #ifndef VIRTIO_FS_DXE_H_\r | |
11 | #define VIRTIO_FS_DXE_H_\r | |
12 | \r | |
13 | #include <Base.h> // SIGNATURE_64()\r | |
cd473d41 | 14 | #include <Guid/FileInfo.h> // EFI_FILE_INFO\r |
eaa7115d | 15 | #include <IndustryStandard/VirtioFs.h> // VIRTIO_FS_TAG_BYTES\r |
b55d6622 LE |
16 | #include <Library/DebugLib.h> // CR()\r |
17 | #include <Protocol/SimpleFileSystem.h> // EFI_SIMPLE_FILE_SYSTEM_PROTOCOL\r | |
18 | #include <Protocol/VirtioDevice.h> // VIRTIO_DEVICE_PROTOCOL\r | |
eaa7115d | 19 | #include <Uefi/UefiBaseType.h> // EFI_EVENT\r |
b55d6622 | 20 | \r |
ac0a286f | 21 | #define VIRTIO_FS_SIG SIGNATURE_64 ('V', 'I', 'R', 'T', 'I', 'O', 'F', 'S')\r |
b55d6622 | 22 | \r |
334c13e1 LE |
23 | #define VIRTIO_FS_FILE_SIG \\r |
24 | SIGNATURE_64 ('V', 'I', 'O', 'F', 'S', 'F', 'I', 'L')\r | |
25 | \r | |
9307d7c7 LE |
26 | //\r |
27 | // The following limit applies to two kinds of pathnames.\r | |
28 | //\r | |
29 | // - The length of a POSIX-style, canonical pathname *at rest* never exceeds\r | |
30 | // VIRTIO_FS_MAX_PATHNAME_LENGTH. (Length is defined as the number of CHAR8\r | |
31 | // elements in the canonical pathname, excluding the terminating '\0'.) This\r | |
32 | // is an invariant that is ensured for canonical pathnames created, and that\r | |
33 | // is assumed about canonical pathname inputs (which all originate\r | |
34 | // internally).\r | |
35 | //\r | |
36 | // - If the length of a UEFI-style pathname *argument*, originating directly or\r | |
37 | // indirectly from the EFI_FILE_PROTOCOL caller, exceeds\r | |
38 | // VIRTIO_FS_MAX_PATHNAME_LENGTH, then the argument is rejected. (Length is\r | |
39 | // defined as the number of CHAR16 elements in the UEFI-style pathname,\r | |
40 | // excluding the terminating L'\0'.) This is a restriction that's checked on\r | |
41 | // external UEFI-style pathname inputs.\r | |
42 | //\r | |
43 | // The limit is not expected to be a practical limitation; it's only supposed\r | |
44 | // to prevent attempts at overflowing size calculations. For both kinds of\r | |
45 | // pathnames, separate limits could be used; a common limit is used purely for\r | |
46 | // simplicity.\r | |
47 | //\r | |
ac0a286f | 48 | #define VIRTIO_FS_MAX_PATHNAME_LENGTH ((UINTN)65535)\r |
9307d7c7 | 49 | \r |
b845de89 LE |
50 | //\r |
51 | // Maximum value for VIRTIO_FS_FILE.NumFileInfo.\r | |
52 | //\r | |
ac0a286f | 53 | #define VIRTIO_FS_FILE_MAX_FILE_INFO 256\r |
b845de89 | 54 | \r |
eaa7115d LE |
55 | //\r |
56 | // Filesystem label encoded in UCS-2, transformed from the UTF-8 representation\r | |
57 | // in "VIRTIO_FS_CONFIG.Tag", and NUL-terminated. Only the printable ASCII code\r | |
58 | // points (U+0020 through U+007E) are supported.\r | |
59 | //\r | |
60 | typedef CHAR16 VIRTIO_FS_LABEL[VIRTIO_FS_TAG_BYTES + 1];\r | |
61 | \r | |
b55d6622 LE |
62 | //\r |
63 | // Main context structure, expressing an EFI_SIMPLE_FILE_SYSTEM_PROTOCOL\r | |
64 | // interface on top of the Virtio Filesystem device.\r | |
65 | //\r | |
66 | typedef struct {\r | |
67 | //\r | |
68 | // Parts of this structure are initialized / torn down in various functions\r | |
69 | // at various call depths. The table to the right should make it easier to\r | |
70 | // track them.\r | |
71 | //\r | |
72 | // field init function init depth\r | |
73 | // ----------- ------------------ ----------\r | |
ac0a286f MK |
74 | UINT64 Signature; // DriverBindingStart 0\r |
75 | VIRTIO_DEVICE_PROTOCOL *Virtio; // DriverBindingStart 0\r | |
76 | VIRTIO_FS_LABEL Label; // VirtioFsInit 1\r | |
77 | UINT16 QueueSize; // VirtioFsInit 1\r | |
78 | VRING Ring; // VirtioRingInit 2\r | |
79 | VOID *RingMap; // VirtioRingMap 2\r | |
80 | UINT64 RequestId; // FuseInitSession 1\r | |
81 | UINT32 MaxWrite; // FuseInitSession 1\r | |
82 | EFI_EVENT ExitBoot; // DriverBindingStart 0\r | |
83 | LIST_ENTRY OpenFiles; // DriverBindingStart 0\r | |
84 | EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFs; // DriverBindingStart 0\r | |
b55d6622 LE |
85 | } VIRTIO_FS;\r |
86 | \r | |
87 | #define VIRTIO_FS_FROM_SIMPLE_FS(SimpleFsReference) \\r | |
88 | CR (SimpleFsReference, VIRTIO_FS, SimpleFs, VIRTIO_FS_SIG);\r | |
89 | \r | |
6578cacb LE |
90 | //\r |
91 | // Structure for describing a contiguous buffer, potentially mapped for Virtio\r | |
92 | // transfer.\r | |
93 | //\r | |
94 | typedef struct {\r | |
95 | //\r | |
96 | // The following fields originate from the owner of the buffer.\r | |
97 | //\r | |
ac0a286f MK |
98 | VOID *Buffer;\r |
99 | UINTN Size;\r | |
6578cacb LE |
100 | //\r |
101 | // All of the fields below, until the end of the structure, are\r | |
102 | // zero-initialized when the structure is initially validated.\r | |
103 | //\r | |
104 | // Mapped, MappedAddress and Mapping are updated when the buffer is mapped\r | |
105 | // for VirtioOperationBusMasterRead or VirtioOperationBusMasterWrite. They\r | |
106 | // are again updated when the buffer is unmapped.\r | |
107 | //\r | |
ac0a286f MK |
108 | BOOLEAN Mapped;\r |
109 | EFI_PHYSICAL_ADDRESS MappedAddress;\r | |
110 | VOID *Mapping;\r | |
6578cacb LE |
111 | //\r |
112 | // Transferred is updated after VirtioFlush() returns successfully:\r | |
113 | // - for VirtioOperationBusMasterRead, Transferred is set to Size;\r | |
114 | // - for VirtioOperationBusMasterWrite, Transferred is calculated from the\r | |
115 | // UsedLen output parameter of VirtioFlush().\r | |
116 | //\r | |
ac0a286f | 117 | UINTN Transferred;\r |
6578cacb LE |
118 | } VIRTIO_FS_IO_VECTOR;\r |
119 | \r | |
120 | //\r | |
121 | // Structure for describing a list of IO Vectors.\r | |
122 | //\r | |
123 | typedef struct {\r | |
124 | //\r | |
125 | // The following fields originate from the owner of the buffers.\r | |
126 | //\r | |
ac0a286f MK |
127 | VIRTIO_FS_IO_VECTOR *IoVec;\r |
128 | UINTN NumVec;\r | |
6578cacb LE |
129 | //\r |
130 | // TotalSize is calculated when the scatter-gather list is initially\r | |
131 | // validated.\r | |
132 | //\r | |
ac0a286f | 133 | UINT32 TotalSize;\r |
6578cacb LE |
134 | } VIRTIO_FS_SCATTER_GATHER_LIST;\r |
135 | \r | |
334c13e1 LE |
136 | //\r |
137 | // Private context structure that exposes EFI_FILE_PROTOCOL on top of an open\r | |
138 | // FUSE file reference.\r | |
139 | //\r | |
140 | typedef struct {\r | |
ac0a286f MK |
141 | UINT64 Signature;\r |
142 | EFI_FILE_PROTOCOL SimpleFile;\r | |
143 | BOOLEAN IsDirectory;\r | |
144 | BOOLEAN IsOpenForWriting;\r | |
145 | VIRTIO_FS *OwnerFs;\r | |
146 | LIST_ENTRY OpenFilesEntry;\r | |
147 | CHAR8 *CanonicalPathname;\r | |
148 | UINT64 FilePosition;\r | |
334c13e1 LE |
149 | //\r |
150 | // In the FUSE wire protocol, every request except FUSE_INIT refers to a\r | |
151 | // file, namely by the "VIRTIO_FS_FUSE_REQUEST.NodeId" field; that is, by the\r | |
152 | // inode number of the file. However, some of the FUSE requests that we need\r | |
153 | // for some of the EFI_FILE_PROTOCOL member functions require an open file\r | |
154 | // handle *in addition* to the inode number. For simplicity, whenever a\r | |
155 | // VIRTIO_FS_FILE object is created, primarily defined by its NodeId field,\r | |
156 | // we also *open* the referenced file at once, and save the returned file\r | |
157 | // handle in the FuseHandle field. This way, when an EFI_FILE_PROTOCOL member\r | |
158 | // function must send a FUSE request that needs the file handle *in addition*\r | |
159 | // to the inode number, FuseHandle will be at our disposal at once.\r | |
160 | //\r | |
ac0a286f MK |
161 | UINT64 NodeId;\r |
162 | UINT64 FuseHandle;\r | |
b845de89 LE |
163 | //\r |
164 | // EFI_FILE_INFO objects cached for an in-flight directory read.\r | |
165 | //\r | |
166 | // For reading through a directory stream with tolerable performance, we have\r | |
167 | // to call FUSE_READDIRPLUS each time with such a buffer that can deliver a\r | |
168 | // good number of variable size records (VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE\r | |
169 | // elements). Every time we do that, we turn the whole bunch into an array of\r | |
170 | // EFI_FILE_INFOs immediately. EFI_FILE_PROTOCOL.Read() invocations (on\r | |
171 | // directories) will be served from this EFI_FILE_INFO cache.\r | |
172 | //\r | |
ac0a286f MK |
173 | UINT8 *FileInfoArray;\r |
174 | UINTN SingleFileInfoSize;\r | |
175 | UINTN NumFileInfo;\r | |
176 | UINTN NextFileInfo;\r | |
334c13e1 LE |
177 | } VIRTIO_FS_FILE;\r |
178 | \r | |
179 | #define VIRTIO_FS_FILE_FROM_SIMPLE_FILE(SimpleFileReference) \\r | |
180 | CR (SimpleFileReference, VIRTIO_FS_FILE, SimpleFile, VIRTIO_FS_FILE_SIG);\r | |
181 | \r | |
182 | #define VIRTIO_FS_FILE_FROM_OPEN_FILES_ENTRY(OpenFilesEntryReference) \\r | |
183 | CR (OpenFilesEntryReference, VIRTIO_FS_FILE, OpenFilesEntry, \\r | |
184 | VIRTIO_FS_FILE_SIG);\r | |
185 | \r | |
eaa7115d LE |
186 | //\r |
187 | // Initialization and helper routines for the Virtio Filesystem device.\r | |
188 | //\r | |
189 | \r | |
190 | EFI_STATUS\r | |
191 | VirtioFsInit (\r | |
ac0a286f | 192 | IN OUT VIRTIO_FS *VirtioFs\r |
eaa7115d LE |
193 | );\r |
194 | \r | |
195 | VOID\r | |
196 | VirtioFsUninit (\r | |
ac0a286f | 197 | IN OUT VIRTIO_FS *VirtioFs\r |
eaa7115d LE |
198 | );\r |
199 | \r | |
200 | VOID\r | |
201 | EFIAPI\r | |
202 | VirtioFsExitBoot (\r | |
ac0a286f MK |
203 | IN EFI_EVENT ExitBootEvent,\r |
204 | IN VOID *VirtioFsAsVoid\r | |
eaa7115d LE |
205 | );\r |
206 | \r | |
6578cacb LE |
207 | EFI_STATUS\r |
208 | VirtioFsSgListsValidate (\r | |
ac0a286f MK |
209 | IN VIRTIO_FS *VirtioFs,\r |
210 | IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *RequestSgList,\r | |
211 | IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList OPTIONAL\r | |
6578cacb LE |
212 | );\r |
213 | \r | |
214 | EFI_STATUS\r | |
215 | VirtioFsSgListsSubmit (\r | |
ac0a286f MK |
216 | IN OUT VIRTIO_FS *VirtioFs,\r |
217 | IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *RequestSgList,\r | |
218 | IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList OPTIONAL\r | |
6578cacb LE |
219 | );\r |
220 | \r | |
6a2dc768 LE |
221 | EFI_STATUS\r |
222 | VirtioFsFuseNewRequest (\r | |
223 | IN OUT VIRTIO_FS *VirtioFs,\r | |
ac0a286f | 224 | OUT VIRTIO_FS_FUSE_REQUEST *Request,\r |
6a2dc768 | 225 | IN UINT32 RequestSize,\r |
fa97e372 | 226 | IN VIRTIO_FS_FUSE_OPCODE Opcode,\r |
6a2dc768 LE |
227 | IN UINT64 NodeId\r |
228 | );\r | |
229 | \r | |
230 | EFI_STATUS\r | |
231 | VirtioFsFuseCheckResponse (\r | |
ac0a286f MK |
232 | IN VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList,\r |
233 | IN UINT64 RequestId,\r | |
234 | OUT UINTN *TailBufferFill\r | |
6a2dc768 LE |
235 | );\r |
236 | \r | |
e8a74c9a LE |
237 | EFI_STATUS\r |
238 | VirtioFsErrnoToEfiStatus (\r | |
ac0a286f | 239 | IN INT32 Errno\r |
e8a74c9a LE |
240 | );\r |
241 | \r | |
9307d7c7 LE |
242 | EFI_STATUS\r |
243 | VirtioFsAppendPath (\r | |
244 | IN CHAR8 *LhsPath8,\r | |
245 | IN CHAR16 *RhsPath16,\r | |
ac0a286f MK |
246 | OUT CHAR8 **ResultPath8,\r |
247 | OUT BOOLEAN *RootEscape\r | |
9307d7c7 LE |
248 | );\r |
249 | \r | |
ca61b845 LE |
250 | EFI_STATUS\r |
251 | VirtioFsLookupMostSpecificParentDir (\r | |
ac0a286f MK |
252 | IN OUT VIRTIO_FS *VirtioFs,\r |
253 | IN OUT CHAR8 *Path,\r | |
254 | OUT UINT64 *DirNodeId,\r | |
255 | OUT CHAR8 **LastComponent\r | |
ca61b845 LE |
256 | );\r |
257 | \r | |
44bc7879 LE |
258 | EFI_STATUS\r |
259 | VirtioFsGetBasename (\r | |
260 | IN CHAR8 *Path,\r | |
ac0a286f | 261 | OUT CHAR16 *Basename OPTIONAL,\r |
44bc7879 LE |
262 | IN OUT UINTN *BasenameSize\r |
263 | );\r | |
264 | \r | |
cd473d41 | 265 | EFI_STATUS\r |
c3f76ef8 LE |
266 | VirtioFsComposeRenameDestination (\r |
267 | IN CHAR8 *LhsPath8,\r | |
268 | IN CHAR16 *RhsPath16,\r | |
ac0a286f MK |
269 | OUT CHAR8 **ResultPath8,\r |
270 | OUT BOOLEAN *RootEscape\r | |
c3f76ef8 LE |
271 | );\r |
272 | \r | |
273 | EFI_STATUS\r | |
cd473d41 | 274 | VirtioFsFuseAttrToEfiFileInfo (\r |
ac0a286f MK |
275 | IN VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr,\r |
276 | OUT EFI_FILE_INFO *FileInfo\r | |
cd473d41 LE |
277 | );\r |
278 | \r | |
7a775209 LE |
279 | EFI_STATUS\r |
280 | VirtioFsFuseDirentPlusToEfiFileInfo (\r | |
ac0a286f MK |
281 | IN VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE *FuseDirent,\r |
282 | IN OUT EFI_FILE_INFO *FileInfo\r | |
7a775209 LE |
283 | );\r |
284 | \r | |
6c33d7b2 LE |
285 | VOID\r |
286 | VirtioFsGetFuseSizeUpdate (\r | |
ac0a286f MK |
287 | IN EFI_FILE_INFO *Info,\r |
288 | IN EFI_FILE_INFO *NewInfo,\r | |
289 | OUT BOOLEAN *Update,\r | |
290 | OUT UINT64 *Size\r | |
6c33d7b2 LE |
291 | );\r |
292 | \r | |
3cbd54b9 LE |
293 | EFI_STATUS\r |
294 | VirtioFsGetFuseTimeUpdates (\r | |
ac0a286f MK |
295 | IN EFI_FILE_INFO *Info,\r |
296 | IN EFI_FILE_INFO *NewInfo,\r | |
297 | OUT BOOLEAN *UpdateAtime,\r | |
298 | OUT BOOLEAN *UpdateMtime,\r | |
299 | OUT UINT64 *Atime,\r | |
300 | OUT UINT64 *Mtime\r | |
3cbd54b9 LE |
301 | );\r |
302 | \r | |
13a506d4 LE |
303 | EFI_STATUS\r |
304 | VirtioFsGetFuseModeUpdate (\r | |
ac0a286f MK |
305 | IN EFI_FILE_INFO *Info,\r |
306 | IN EFI_FILE_INFO *NewInfo,\r | |
307 | OUT BOOLEAN *Update,\r | |
308 | OUT UINT32 *Mode\r | |
309 | );\r | |
13a506d4 | 310 | \r |
fa97e372 LE |
311 | //\r |
312 | // Wrapper functions for FUSE commands (primitives).\r | |
313 | //\r | |
314 | \r | |
b6ce961a LE |
315 | EFI_STATUS\r |
316 | VirtioFsFuseLookup (\r | |
ac0a286f MK |
317 | IN OUT VIRTIO_FS *VirtioFs,\r |
318 | IN UINT64 DirNodeId,\r | |
319 | IN CHAR8 *Name,\r | |
320 | OUT UINT64 *NodeId,\r | |
321 | OUT VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr\r | |
b6ce961a LE |
322 | );\r |
323 | \r | |
92a4d30e LE |
324 | EFI_STATUS\r |
325 | VirtioFsFuseForget (\r | |
ac0a286f MK |
326 | IN OUT VIRTIO_FS *VirtioFs,\r |
327 | IN UINT64 NodeId\r | |
92a4d30e LE |
328 | );\r |
329 | \r | |
e3bc9577 LE |
330 | EFI_STATUS\r |
331 | VirtioFsFuseGetAttr (\r | |
ac0a286f MK |
332 | IN OUT VIRTIO_FS *VirtioFs,\r |
333 | IN UINT64 NodeId,\r | |
334 | OUT VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr\r | |
e3bc9577 LE |
335 | );\r |
336 | \r | |
f058cb69 | 337 | EFI_STATUS\r |
647340b0 | 338 | VirtioFsFuseSetAttr (\r |
ac0a286f MK |
339 | IN OUT VIRTIO_FS *VirtioFs,\r |
340 | IN UINT64 NodeId,\r | |
341 | IN UINT64 *Size OPTIONAL,\r | |
342 | IN UINT64 *Atime OPTIONAL,\r | |
343 | IN UINT64 *Mtime OPTIONAL,\r | |
344 | IN UINT32 *Mode OPTIONAL\r | |
647340b0 LE |
345 | );\r |
346 | \r | |
347 | EFI_STATUS\r | |
f058cb69 | 348 | VirtioFsFuseMkDir (\r |
ac0a286f MK |
349 | IN OUT VIRTIO_FS *VirtioFs,\r |
350 | IN UINT64 ParentNodeId,\r | |
351 | IN CHAR8 *Name,\r | |
352 | OUT UINT64 *NodeId\r | |
f058cb69 LE |
353 | );\r |
354 | \r | |
0771671c LE |
355 | EFI_STATUS\r |
356 | VirtioFsFuseRemoveFileOrDir (\r | |
ac0a286f MK |
357 | IN OUT VIRTIO_FS *VirtioFs,\r |
358 | IN UINT64 ParentNodeId,\r | |
359 | IN CHAR8 *Name,\r | |
360 | IN BOOLEAN IsDir\r | |
0771671c LE |
361 | );\r |
362 | \r | |
da82d2e3 LE |
363 | EFI_STATUS\r |
364 | VirtioFsFuseOpen (\r | |
ac0a286f MK |
365 | IN OUT VIRTIO_FS *VirtioFs,\r |
366 | IN UINT64 NodeId,\r | |
367 | IN BOOLEAN ReadWrite,\r | |
368 | OUT UINT64 *FuseHandle\r | |
da82d2e3 LE |
369 | );\r |
370 | \r | |
d98d7e30 LE |
371 | EFI_STATUS\r |
372 | VirtioFsFuseReadFileOrDir (\r | |
ac0a286f MK |
373 | IN OUT VIRTIO_FS *VirtioFs,\r |
374 | IN UINT64 NodeId,\r | |
375 | IN UINT64 FuseHandle,\r | |
376 | IN BOOLEAN IsDir,\r | |
377 | IN UINT64 Offset,\r | |
378 | IN OUT UINT32 *Size,\r | |
379 | OUT VOID *Data\r | |
d98d7e30 LE |
380 | );\r |
381 | \r | |
6f7bc719 LE |
382 | EFI_STATUS\r |
383 | VirtioFsFuseWrite (\r | |
ac0a286f MK |
384 | IN OUT VIRTIO_FS *VirtioFs,\r |
385 | IN UINT64 NodeId,\r | |
386 | IN UINT64 FuseHandle,\r | |
387 | IN UINT64 Offset,\r | |
388 | IN OUT UINT32 *Size,\r | |
389 | IN VOID *Data\r | |
6f7bc719 LE |
390 | );\r |
391 | \r | |
ba118463 LE |
392 | EFI_STATUS\r |
393 | VirtioFsFuseStatFs (\r | |
ac0a286f MK |
394 | IN OUT VIRTIO_FS *VirtioFs,\r |
395 | IN UINT64 NodeId,\r | |
396 | OUT VIRTIO_FS_FUSE_STATFS_RESPONSE *FilesysAttr\r | |
397 | );\r | |
ba118463 | 398 | \r |
72d4f133 LE |
399 | EFI_STATUS\r |
400 | VirtioFsFuseReleaseFileOrDir (\r | |
ac0a286f MK |
401 | IN OUT VIRTIO_FS *VirtioFs,\r |
402 | IN UINT64 NodeId,\r | |
403 | IN UINT64 FuseHandle,\r | |
404 | IN BOOLEAN IsDir\r | |
72d4f133 LE |
405 | );\r |
406 | \r | |
2e151d26 LE |
407 | EFI_STATUS\r |
408 | VirtioFsFuseFsyncFileOrDir (\r | |
ac0a286f MK |
409 | IN OUT VIRTIO_FS *VirtioFs,\r |
410 | IN UINT64 NodeId,\r | |
411 | IN UINT64 FuseHandle,\r | |
412 | IN BOOLEAN IsDir\r | |
2e151d26 LE |
413 | );\r |
414 | \r | |
d0474399 LE |
415 | EFI_STATUS\r |
416 | VirtioFsFuseFlush (\r | |
ac0a286f MK |
417 | IN OUT VIRTIO_FS *VirtioFs,\r |
418 | IN UINT64 NodeId,\r | |
419 | IN UINT64 FuseHandle\r | |
d0474399 LE |
420 | );\r |
421 | \r | |
fa97e372 LE |
422 | EFI_STATUS\r |
423 | VirtioFsFuseInitSession (\r | |
ac0a286f | 424 | IN OUT VIRTIO_FS *VirtioFs\r |
fa97e372 LE |
425 | );\r |
426 | \r | |
b62a0c56 LE |
427 | EFI_STATUS\r |
428 | VirtioFsFuseOpenDir (\r | |
ac0a286f MK |
429 | IN OUT VIRTIO_FS *VirtioFs,\r |
430 | IN UINT64 NodeId,\r | |
431 | OUT UINT64 *FuseHandle\r | |
b62a0c56 LE |
432 | );\r |
433 | \r | |
a70860f4 LE |
434 | EFI_STATUS\r |
435 | VirtioFsFuseOpenOrCreate (\r | |
ac0a286f MK |
436 | IN OUT VIRTIO_FS *VirtioFs,\r |
437 | IN UINT64 ParentNodeId,\r | |
438 | IN CHAR8 *Name,\r | |
439 | OUT UINT64 *NodeId,\r | |
440 | OUT UINT64 *FuseHandle\r | |
a70860f4 LE |
441 | );\r |
442 | \r | |
bea1f51d LE |
443 | EFI_STATUS\r |
444 | VirtioFsFuseRename (\r | |
ac0a286f MK |
445 | IN OUT VIRTIO_FS *VirtioFs,\r |
446 | IN UINT64 OldParentNodeId,\r | |
447 | IN CHAR8 *OldName,\r | |
448 | IN UINT64 NewParentNodeId,\r | |
449 | IN CHAR8 *NewName\r | |
bea1f51d LE |
450 | );\r |
451 | \r | |
b55d6622 LE |
452 | //\r |
453 | // EFI_SIMPLE_FILE_SYSTEM_PROTOCOL member functions for the Virtio Filesystem\r | |
454 | // driver.\r | |
455 | //\r | |
456 | \r | |
457 | EFI_STATUS\r | |
458 | EFIAPI\r | |
459 | VirtioFsOpenVolume (\r | |
ac0a286f MK |
460 | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r |
461 | OUT EFI_FILE_PROTOCOL **Root\r | |
b55d6622 LE |
462 | );\r |
463 | \r | |
334c13e1 LE |
464 | //\r |
465 | // EFI_FILE_PROTOCOL member functions for the Virtio Filesystem driver.\r | |
466 | //\r | |
467 | \r | |
468 | EFI_STATUS\r | |
469 | EFIAPI\r | |
470 | VirtioFsSimpleFileClose (\r | |
ac0a286f | 471 | IN EFI_FILE_PROTOCOL *This\r |
334c13e1 LE |
472 | );\r |
473 | \r | |
474 | EFI_STATUS\r | |
475 | EFIAPI\r | |
476 | VirtioFsSimpleFileDelete (\r | |
ac0a286f | 477 | IN EFI_FILE_PROTOCOL *This\r |
334c13e1 LE |
478 | );\r |
479 | \r | |
480 | EFI_STATUS\r | |
481 | EFIAPI\r | |
482 | VirtioFsSimpleFileFlush (\r | |
ac0a286f | 483 | IN EFI_FILE_PROTOCOL *This\r |
334c13e1 LE |
484 | );\r |
485 | \r | |
486 | EFI_STATUS\r | |
487 | EFIAPI\r | |
488 | VirtioFsSimpleFileGetInfo (\r | |
ac0a286f MK |
489 | IN EFI_FILE_PROTOCOL *This,\r |
490 | IN EFI_GUID *InformationType,\r | |
491 | IN OUT UINTN *BufferSize,\r | |
492 | OUT VOID *Buffer\r | |
334c13e1 LE |
493 | );\r |
494 | \r | |
495 | EFI_STATUS\r | |
496 | EFIAPI\r | |
497 | VirtioFsSimpleFileGetPosition (\r | |
ac0a286f MK |
498 | IN EFI_FILE_PROTOCOL *This,\r |
499 | OUT UINT64 *Position\r | |
334c13e1 LE |
500 | );\r |
501 | \r | |
502 | EFI_STATUS\r | |
503 | EFIAPI\r | |
504 | VirtioFsSimpleFileOpen (\r | |
ac0a286f MK |
505 | IN EFI_FILE_PROTOCOL *This,\r |
506 | OUT EFI_FILE_PROTOCOL **NewHandle,\r | |
507 | IN CHAR16 *FileName,\r | |
508 | IN UINT64 OpenMode,\r | |
509 | IN UINT64 Attributes\r | |
334c13e1 LE |
510 | );\r |
511 | \r | |
512 | EFI_STATUS\r | |
513 | EFIAPI\r | |
514 | VirtioFsSimpleFileRead (\r | |
ac0a286f MK |
515 | IN EFI_FILE_PROTOCOL *This,\r |
516 | IN OUT UINTN *BufferSize,\r | |
517 | OUT VOID *Buffer\r | |
334c13e1 LE |
518 | );\r |
519 | \r | |
520 | EFI_STATUS\r | |
521 | EFIAPI\r | |
522 | VirtioFsSimpleFileSetInfo (\r | |
ac0a286f MK |
523 | IN EFI_FILE_PROTOCOL *This,\r |
524 | IN EFI_GUID *InformationType,\r | |
525 | IN UINTN BufferSize,\r | |
526 | IN VOID *Buffer\r | |
334c13e1 LE |
527 | );\r |
528 | \r | |
529 | EFI_STATUS\r | |
530 | EFIAPI\r | |
531 | VirtioFsSimpleFileSetPosition (\r | |
ac0a286f MK |
532 | IN EFI_FILE_PROTOCOL *This,\r |
533 | IN UINT64 Position\r | |
334c13e1 LE |
534 | );\r |
535 | \r | |
536 | EFI_STATUS\r | |
537 | EFIAPI\r | |
538 | VirtioFsSimpleFileWrite (\r | |
ac0a286f MK |
539 | IN EFI_FILE_PROTOCOL *This,\r |
540 | IN OUT UINTN *BufferSize,\r | |
541 | IN VOID *Buffer\r | |
334c13e1 LE |
542 | );\r |
543 | \r | |
b55d6622 | 544 | #endif // VIRTIO_FS_DXE_H_\r |