PCIRawDevImpl.cpp revision 8796af1bf40deebc04f21fa22333bb761de52e2a
/* $Id$ */
/** @file
* VirtualBox Driver Interface to raw PCI device.
*/
/*
* Copyright (C) 2010-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "Logging.h"
#include "PCIRawDevImpl.h"
#include "PCIDeviceAttachmentImpl.h"
#include "ConsoleImpl.h"
// generated header for events
#include "VBoxEvents.h"
/**
* PCI raw driver instance data.
*/
typedef struct DRVMAINPCIRAWDEV
{
/** Pointer to the real PCI raw object. */
/** Pointer to the driver instance structure. */
/** Our PCI device connector interface. */
//
// constructor / destructor
//
{
}
{
}
/**
* @interface_method_impl{PDMIBASE,pfnQueryInterface}
*/
{
return NULL;
}
/**
* @interface_method_impl{PDMIPCIRAWUP,pfnPciDeviceConstructComplete}
*/
DECLCALLBACK(int) PCIRawDev::drvDeviceConstructComplete(PPDMIPCIRAWCONNECTOR pInterface, const char *pcszName,
int rc)
{
pda.createObject();
if (RT_FAILURE(rc))
fireHostPCIDevicePlugEvent(es, bstrId.raw(), true /* plugged */, RT_SUCCESS(rc) /* success */, pda, msg.raw());
return VINF_SUCCESS;
}
/**
* @interface_method_impl{PDMDRVREG,pfnReset}
*/
{
}
/**
* @interface_method_impl{PDMDRVREG,pfnReset}
*/
{
if (pThis->pPCIRawDev)
}
/**
* @interface_method_impl{PDMDRVREG,pfnConstruct}
*/
DECLCALLBACK(int) PCIRawDev::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
{
/*
* Validate configuration.
*/
("Configuration error: Not possible to attach anything to this driver!\n"),
/*
* IBase.
*/
/*
* IConnector.
*/
/*
* Get the object pointer and update the mpDrv member.
*/
void *pv;
if (RT_FAILURE(rc))
{
return rc;
}
return VINF_SUCCESS;
}
/**
* Main raw PCI driver registration record.
*/
{
/* u32Version */
/* szName */
"MainPciRaw",
/* szRCMod */
"",
/* szR0Mod */
"",
/* pszDescription */
"Main PCI raw driver (Main as in the API).",
/* fFlags */
/* fClass. */
/* cMaxInstances */
~0U,
/* cbInstance */
sizeof(DRVMAINPCIRAWDEV),
/* pfnConstruct */
/* pfnDestruct */
/* pfnRelocate */
NULL,
/* pfnIOCtl */
NULL,
/* pfnPowerOn */
NULL,
/* pfnReset */
/* pfnSuspend */
NULL,
/* pfnResume */
NULL,
/* pfnAttach */
NULL,
/* pfnDetach */
NULL,
/* pfnPowerOff */
NULL,
/* pfnSoftReset */
NULL,
/* u32EndVersion */
};