Haiku currently does not have any form of Hyper-V guest support, and this change begins work toward #16664. This change implements initial VMBus bus/device structure and functions. Change-Id: I2d081f55e99da479d9bc5084f1815ade6cc77fe2 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10333 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Jérôme Duval <[email protected]> Reviewed-by: waddlesplash <[email protected]>
64 lines
2.5 KiB
C
64 lines
2.5 KiB
C
/*
|
|
* Copyright 2026 John Davis. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _HYPERV_H_
|
|
#define _HYPERV_H_
|
|
|
|
|
|
#include <device_manager.h>
|
|
#include <KernelExport.h>
|
|
|
|
#include <hyperv_spec.h>
|
|
|
|
#define HYPERV_BUS_NAME "hyperv"
|
|
|
|
// Device attributes for the VMBus device
|
|
#define HYPERV_CHANNEL_ID_ITEM "hyperv/channel"
|
|
#define HYPERV_DEVICE_TYPE_ITEM "hyperv/type"
|
|
#define HYPERV_INSTANCE_ID_ITEM "hyperv/instance"
|
|
|
|
#define HYPERV_PRETTYNAME_VMBUS "Hyper-V Virtual Machine Bus"
|
|
#define HYPERV_PRETTYNAME_VMBUS_DEVICE_FMT "Hyper-V Channel %u"
|
|
#define HYPERV_PRETTYNAME_AVMA "Hyper-V Automatic Virtual Machine Activation"
|
|
#define HYPERV_PRETTYNAME_BALLOON "Hyper-V Dynamic Memory"
|
|
#define HYPERV_PRETTYNAME_DISPLAY "Hyper-V Display"
|
|
#define HYPERV_PRETTYNAME_FIBRECHANNEL "Hyper-V Fibre Channel"
|
|
#define HYPERV_PRETTYNAME_FILECOPY "Hyper-V File Copy"
|
|
#define HYPERV_PRETTYNAME_HEARTBEAT "Hyper-V Heartbeat"
|
|
#define HYPERV_PRETTYNAME_IDE "Hyper-V IDE Accelerator"
|
|
#define HYPERV_PRETTYNAME_INPUT "Hyper-V Input"
|
|
#define HYPERV_PRETTYNAME_KEYBOARD "Hyper-V Keyboard"
|
|
#define HYPERV_PRETTYNAME_KVP "Hyper-V Data Exchange"
|
|
#define HYPERV_PRETTYNAME_NETWORK "Hyper-V Network Adapter"
|
|
#define HYPERV_PRETTYNAME_PCI "Hyper-V PCI Bridge"
|
|
#define HYPERV_PRETTYNAME_RDCONTROL "Hyper-V Remote Desktop Control"
|
|
#define HYPERV_PRETTYNAME_RDMA "Hyper-V RDMA"
|
|
#define HYPERV_PRETTYNAME_RDVIRT "Hyper-V Remote Desktop Virtualization"
|
|
#define HYPERV_PRETTYNAME_SCSI "Hyper-V SCSI Adapter"
|
|
#define HYPERV_PRETTYNAME_SHUTDOWN "Hyper-V Guest Shutdown"
|
|
#define HYPERV_PRETTYNAME_TIMESYNC "Hyper-V Time Synchronization"
|
|
#define HYPERV_PRETTYNAME_VSS "Hyper-V Volume Shadow Copy"
|
|
|
|
|
|
typedef void* hyperv_device;
|
|
typedef void (*hyperv_device_callback)(void* data);
|
|
|
|
|
|
// Interface between the VMBus device driver, and the VMBus device bus manager
|
|
typedef struct hyperv_device_interface {
|
|
driver_module_info info;
|
|
|
|
uint32 (*get_bus_version)(hyperv_device cookie);
|
|
status_t (*open)(hyperv_device cookie, uint32 txLength, uint32 rxLength,
|
|
hyperv_device_callback callback, void* callbackData);
|
|
void (*close)(hyperv_device cookie);
|
|
status_t (*write_packet)(hyperv_device cookie, uint16 type, void* buffer,
|
|
uint32 length, bool responseRequired, uint64 transactionID);
|
|
status_t (*read_packet)(hyperv_device cookie, vmbus_pkt_header* _header,
|
|
uint32* _headerLength, void* _buffer, uint32* _length);
|
|
} hyperv_device_interface;
|
|
|
|
|
|
#endif // _HYPERV_H_
|