[hyperv] Add support for VMBus devices

Add support for an abstraction of a VMBus device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2014-12-11 17:23:45 +00:00
parent d77a546fb4
commit d1894970db
7 changed files with 1905 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/cpuid.h>
#include <ipxe/msr.h>
#include <ipxe/hyperv.h>
#include <ipxe/vmbus.h>
#include "hyperv.h"
/** Maximum time to wait for a message response
@@ -506,9 +507,15 @@ static int hv_probe ( struct root_device *rootdev ) {
if ( ( rc = hv_map_synic ( hv ) ) != 0 )
goto err_map_synic;
/* Probe Hyper-V devices */
if ( ( rc = vmbus_probe ( hv, &rootdev->dev ) ) != 0 )
goto err_vmbus_probe;
rootdev_set_drvdata ( rootdev, hv );
return 0;
vmbus_remove ( hv, &rootdev->dev );
err_vmbus_probe:
hv_unmap_synic ( hv );
err_map_synic:
hv_unmap_hypercall ( hv );
@@ -532,6 +539,7 @@ static int hv_probe ( struct root_device *rootdev ) {
static void hv_remove ( struct root_device *rootdev ) {
struct hv_hypervisor *hv = rootdev_get_drvdata ( rootdev );
vmbus_remove ( hv, &rootdev->dev );
hv_unmap_synic ( hv );
hv_unmap_hypercall ( hv );
hv_free_message ( hv );