rawpci.h revision 1fff175c9a0fea173ee52a209224dc6ecbd39572
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * PDM - Pluggable Device Manager, raw PCI Devices. (VMM)
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2010-2011 Oracle Corporation
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * available from http://www.virtualbox.org. This file is free software;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * you can redistribute it and/or modify it under the terms of the GNU
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * General Public License (GPL) as published by the Free Software
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The contents of this file may alternatively be used under the terms
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * of the Common Development and Distribution License Version 1.0
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution, in which case the provisions of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * CDDL are applicable instead of those of the GPL.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * You may elect to license modified versions of this file under the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * terms and conditions of either the GPL or the CDDL or both.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Handle for the raw PCI device.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** Parameters buffer for PCIRAWR0_DO_OPEN_DEVICE call */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef struct
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** Parameters buffer for PCIRAWR0_DO_CLOSE_DEVICE call */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsynctypedef struct
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/** Parameters buffer for PCIRAWR0_DO_GET_REGION_INFO call */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsynctypedef struct
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync/** Parameters buffer for PCIRAWR0_DO_MAP_REGION call. */
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsynctypedef struct
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync/** Parameters buffer for PCIRAWR0_DO_UNMAP_REGION call. */
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsynctypedef struct
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync/** Parameters buffer for PCIRAWR0_DO_PIO_WRITE call. */
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsynctypedef struct
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync/** Parameters buffer for PCIRAWR0_DO_PIO_READ call. */
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsynctypedef struct
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync/** Memory operand. */
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsynctypedef struct
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync/** Parameters buffer for PCIRAWR0_DO_MMIO_WRITE call. */
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsynctypedef struct
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync/** Parameters buffer for PCIRAWR0_DO_MMIO_READ call. */
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsynctypedef struct
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync /* inout (Value.cb is in) */
04bce18d27791abed8346aba0de41c53a2acd81avboxsync/* Parameters buffer for PCIRAWR0_DO_PCICFG_WRITE call. */
04bce18d27791abed8346aba0de41c53a2acd81avboxsynctypedef struct
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync/** Parameters buffer for PCIRAWR0_DO_PCICFG_READ call. */
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsynctypedef struct
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync /* inout (Value.cb is in) */
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync/** Parameters buffer for PCIRAWR0_DO_REGISTER_R0_IRQ_HANDLER call. */
e3e8bde164b5715114ebf596187b5512fa9b75advboxsynctypedef struct
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync/** Parameters buffer for PCIRAWR0_DO_UNREGISTER_R0_IRQ_HANDLER call. */
e3e8bde164b5715114ebf596187b5512fa9b75advboxsynctypedef struct
04bce18d27791abed8346aba0de41c53a2acd81avboxsync * Request buffer use for communication with the driver.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync /** The request header. */
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync /** Alternative to passing the taking the session from the VM handle.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * Either use this member or use the VM handle, don't do both.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync /** Request type. */
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync /** Host device request targetted to. */
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync /** Call parameters. */
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync PCIRAWREQREGISTERR0IRQHANDLER aRegisterR0IrqHandler;
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync PCIRAWREQUNREGISTERR0IRQHANDLER aUnregisterR0IrqHandler;
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * Operations performed by the driver.
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync /* Open device. */
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync /* Close device. */
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync /* Get PCI region info. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /* Map PCI region into VM address space. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /* Unmap PCI region from VM address space. */
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync /* Perform PIO write. */
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync /* Perform PIO read. */
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync /* Perform MMIO write. */
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync /* Perform MMIO read. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /* Perform PCI config write. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /* Perform PCI config read. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /* Register device IRQ R0 handler. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /* Unregister device IRQ R0 handler. */
e0dec59adb362e8486c0622785420ad10e720972vboxsync /** The usual 32-bit type blow up. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** Forward declarations. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * Interrupt service routine callback.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @param pvContext Opaque user data which to the handler.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @param iIrq Interrupt number.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef DECLCALLBACK(void) FNRAWPCIISR(void *pvContext, int32_t iIrq);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This is the port on the device interface, i.e. the driver side which the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * host device is connected to.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * This is only used for the in-kernel PCI device connections.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Structure version number. (RAWPCIDEVPORT_VERSION) */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Retain the object.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * It will normally be called while owning the internal semaphore.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pPort Pointer to this structure.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync DECLR0CALLBACKMEMBER(void, pfnRetain,(PRAWPCIDEVPORT pPort));
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Releases the object.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * This must be called for every pfnRetain call.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pPort Pointer to this structure.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync DECLR0CALLBACKMEMBER(void, pfnRelease,(PRAWPCIDEVPORT pPort));
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Init device.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @param pPort Pointer to this structure.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param fFlags Initialization flags.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync DECLR0CALLBACKMEMBER(int, pfnInit,(PRAWPCIDEVPORT pPort,
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync * Deinit device.
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync * @param pPort Pointer to this structure.
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync * @param fFlags Initialization flags.
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync DECLR0CALLBACKMEMBER(int, pfnDeinit,(PRAWPCIDEVPORT pPort,
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync * Get PCI region info.
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync * @param pPort Pointer to this structure.
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync DECLR0CALLBACKMEMBER(int, pfnGetRegionInfo,(PRAWPCIDEVPORT pPort,
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Map PCI region.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pPort Pointer to this structure.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync DECLR0CALLBACKMEMBER(int, pfnMapRegion,(PRAWPCIDEVPORT pPort,
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Unmap PCI region.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pPort Pointer to this structure.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync DECLR0CALLBACKMEMBER(int, pfnUnmapRegion,(PRAWPCIDEVPORT pPort,
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Read device PCI register.
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync * @param pPort Pointer to this structure.
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync * @param fFlags Initialization flags.
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync DECLR0CALLBACKMEMBER(int, pfnPciCfgRead,(PRAWPCIDEVPORT pPort,
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Write device PCI register.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pPort Pointer to this structure.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param fFlags Initialization flags.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync DECLR0CALLBACKMEMBER(int, pfnPciCfgWrite,(PRAWPCIDEVPORT pPort,
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Request to register interrupt handler.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pPort Pointer to this structure.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pfnHandler Pointer to the handler.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pIrqContext Context passed to the handler.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param piHostIrq Which host IRQ is used.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync DECLR0CALLBACKMEMBER(int, pfnRegisterIrqHandler,(PRAWPCIDEVPORT pPort,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Request to unregister interrupt handler.
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync * @param pPort Pointer to this structure.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param iHostIrq Which host IRQ was used (retured by earlier pfnRegisterIrqHandler).
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync DECLR0CALLBACKMEMBER(int, pfnUnregisterIrqHandler,(PRAWPCIDEVPORT pPort,
typedef struct RAWPCIFACTORY
typedef enum PCIRAWDRIVERFLAGS
* in pci.h.
typedef enum PCIRAWADDRESSSPACE