OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_OPEN

Add the VirtioFsFuseOpen() function, for sending the FUSE_OPEN command to
the Virtio Filesystem device.

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3097
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20201216211125.19496-19-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
This commit is contained in:
Laszlo Ersek
2020-12-16 22:10:55 +01:00
committed by mergify[bot]
parent 7e8c83f7d4
commit da82d2e3a0
4 changed files with 156 additions and 14 deletions

View File

@@ -81,11 +81,18 @@ typedef struct {
//
#define VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID 1
//
// Flags for VirtioFsFuseOpOpen.
//
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY 0
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR 2
//
// FUSE operation codes.
//
typedef enum {
VirtioFsFuseOpForget = 2,
VirtioFsFuseOpOpen = 14,
VirtioFsFuseOpRelease = 18,
VirtioFsFuseOpFsync = 20,
VirtioFsFuseOpFlush = 25,
@@ -123,6 +130,20 @@ typedef struct {
UINT64 NumberOfLookups;
} VIRTIO_FS_FUSE_FORGET_REQUEST;
//
// Headers for VirtioFsFuseOpOpen and VirtioFsFuseOpOpenDir.
//
typedef struct {
UINT32 Flags;
UINT32 Unused;
} VIRTIO_FS_FUSE_OPEN_REQUEST;
typedef struct {
UINT64 FileHandle;
UINT32 OpenFlags;
UINT32 Padding;
} VIRTIO_FS_FUSE_OPEN_RESPONSE;
//
// Header for VirtioFsFuseOpRelease and VirtioFsFuseOpReleaseDir.
//
@@ -175,20 +196,6 @@ typedef struct {
UINT16 MapAlignment;
UINT32 Unused[8];
} VIRTIO_FS_FUSE_INIT_RESPONSE;
//
// Headers for VirtioFsFuseOpOpenDir.
//
typedef struct {
UINT32 Flags;
UINT32 Unused;
} VIRTIO_FS_FUSE_OPEN_REQUEST;
typedef struct {
UINT64 FileHandle;
UINT32 OpenFlags;
UINT32 Padding;
} VIRTIO_FS_FUSE_OPEN_RESPONSE;
#pragma pack ()
#endif // VIRTIO_FS_H_