Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/core/vmkapi_driver.h
d0a14f973771
5.9 KiB
text/x-chdr
ESXi-5.0-U1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
/***************************************************************************
* Copyright 2010 VMware, Inc. All rights reserved.
***************************************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
***********************************************************************
* Driver */ /**
* \addtogroup Device
* @{
* \defgroup Driver Driver Interfaces
* @{
***********************************************************************
*/
#ifndef _VMKAPI_DRIVER_H_
#define _VMKAPI_DRIVER_H_
/** \cond never */
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
#error This vmkapi file should never be included directly but only via vmkapi.h
#endif
/** \endcond never */
/*
***********************************************************************
* vmk_DriverAttachDevice -- */ /**
*
* \brief Attach a device to a driver.
*
* The driver should start driving this device. If the driver is not
* capable of driving the given device, an appropriate error should be
* returned, and the device must be restored to its original state at
* entry.
*
* \param[in] device Handle to device to be added to the driver.
*
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_DriverAttachDevice)(vmk_Device device);
/*
***********************************************************************
* vmk_DriverDetachDevice -- */ /**
*
* \brief Detach a device from its driver.
*
* The driver should stop driving this device, and release its resources.
*
* \param[in] device Handle to device to be removed from the driver.
*
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_DriverDetachDevice)(vmk_Device device);
/*
***********************************************************************
* vmk_DriverQuiesceDevice -- */ /**
*
* \brief Quiesce a device.
*
* This callback is invoked in preparation for device removal or
* system shutdown. The driver should complete any IO on the device
* and flush any device caches as necessary to put the device in a
* quiescent state.
*
* \param[in] device Handle to device to be quiesced.
*
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_DriverQuiesceDevice)(vmk_Device device);
/*
***********************************************************************
* vmk_DriverScanDevice -- */ /**
*
* \brief Scan a device for new children and register them.
*
* Only bus drivers will typically need to implement this entry.
* This function is called at least once after a device has been
* successfully attached to a driver. It may be called at other
* device hotplug events as appropriate.
*
* \param[in] device Handle to device to scan.
*
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_DriverScanDevice)(vmk_Device device);
/**
* \brief Driver operations.
*/
typedef struct {
/** \brief Attach a device to a driver */
vmk_DriverAttachDevice attachDevice;
/** \brief Scan a device for new child devices */
vmk_DriverScanDevice scanDevice;
/** \brief Detach a device from its driver */
vmk_DriverDetachDevice detachDevice;
/** \brief Quiesce a device for system shutdown */
vmk_DriverQuiesceDevice quiesceDevice;
} vmk_DriverOps;
/**
* \brief Driver registration data.
*/
typedef struct {
/** Module registering this driver */
vmk_ModuleID moduleID;
/** Identifying name for the driver */
vmk_Name name;
/** Driver operations */
vmk_DriverOps *ops;
/** Driver private data */
vmk_AddrCookie privateData;
} vmk_DriverProps;
/*
***********************************************************************
* vmk_DriverRegister -- */ /**
*
* \brief Register a driver with the driver database and get a
* a driver handle back.
*
* \note This function will not block.
*
* \param[in] driverProps Driver registration data
* \param[out] driver New driver handle.
*
* \retval VMK_BAD_PARAM Name or ops argument is NULL.
* \retval VMK_NO_MEMORY Unable to allocate memory for device handle.
* \retval VMK_OK Successfully registered driver.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_DriverRegister(vmk_DriverProps *driverProps,
vmk_Driver *driver);
/*
***********************************************************************
* vmk_DriverUnregister -- */ /**
*
* \brief Unregister a driver from the driver database.
*
* \note This function will not block.
*
* \param[in] driver Driver handle
*
* \retval VMK_OK Successfully unregistered driver.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_DriverUnregister(vmk_Driver driver);
/*
***********************************************************************
* vmk_DriverGetPrivateData -- */ /**
*
* \brief Get private data for driver.
*
* \note This function will not block.
*
* \param[in] driver Driver handle
* \param[out] data Driver data.
*
* \retval VMK_OK Successfully returned driver private data.
* \retval VMK_BAD_PARAM Invalid driver handle.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_DriverGetPrivateData(vmk_Driver driver,
vmk_AddrCookie *data);
#endif /* _VMKAPI_DRIVER_H_ */
/** @} */
/** @} */
|