Files
@ d6b9b2ac5869
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release/scsi/vmkapi_scsi_iodm.h
d6b9b2ac5869
7.1 KiB
text/x-chdr
ESXi-5.5-U2
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 194 195 196 | /* **********************************************************
* Copyright 2012 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
***********************************************************************
* SCSI I/O Device Management(IODM) Interfaces */ /**
*
* \addtogroup SCSI
* @{
*
* \defgroup IODM SCSI I/O Device Management(IODM) interfaces
*
* IODM interfaces allow SCSI drivers to notify VMkernel of any events
* happening on the HBA(Host Bus Adapter).
*
* For example any Fiber Channel driver can use IODM interfaces to
* notify VMkernel of FC link related events, target port state
* change notifications, FC dropped frame instances etc.
*
* These interfaces are to be used only by Native SCSI drivers and
* vmklinux module, but not by vmklinux SCSI drivers.
*
* @{
*
***********************************************************************
*/
#ifndef _VMKAPI_SCSI_IODM_H_
#define _VMKAPI_SCSI_IODM_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 */
/**
* \brief Types of IODM events.
*/
typedef enum {
/** \brief Event ID for an I/O Error.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to the address of the failed 'vmk_ScsiCommand' and
* 'data' parameter set to 0.
*/
VMK_IODM_IOERROR,
/** \brief Event ID for a Fibre Channel(FC) RSCN event.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to NULL and
* 'data' parameter set to the FCID of the port that the FC driver needs to act on.
*/
VMK_IODM_RSCN,
/** \brief Event ID for an FC link up event.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to NULL and
* 'data' parameter set to 0.
*/
VMK_IODM_LINKUP,
/** \brief Event ID for an FC link down event.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to NULL and
* 'data' parameter set to 0.
*/
VMK_IODM_LINKDOWN,
/** \brief Event ID for an FC frame drop event.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to the address of the 'vmk_ScsiCommand' and
* 'data' parameter set to the FC residual data bytes count(FCP_RESID).
*/
VMK_IODM_FRAMEDROP,
/** \brief Event ID for a SCSI LUN reset event.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to NULL and 'data' parameter set to
* the value encoded by (C << 48 | T << 32 | L), where C, T, L
* represent Channel, Target and LUN IDs of the SCSI device respectively.
*/
VMK_IODM_LUNRESET,
/** \brief Event ID for an FCoE Clear Virutal Link(CVL) event.
* \note To notify this event, vmk_IodmEvent() should be called with
* 'dataPtr.ptr' parameter set to NULL and
* 'data' parameter set to the FCID of the vport that received the CVL.
*/
VMK_IODM_FCOE_CVL,
/*
* Whenever a new IODM event is added to the 'vmk_IodmEventType'
* enum, make sure its corresponding string is added to the
* 'VMK_IODM_EVENT_STRINGS' macro below in the same exact order.
*/
VMK_IODM_EVENT_LAST,
} vmk_IodmEventType;
/** \cond nodoc */
#define VMK_IODM_EVENT_STRINGS \
VMK_IODM_EVENT_STR(VMK_IODM_IOERROR, "IO_ERROR") \
VMK_IODM_EVENT_STR(VMK_IODM_RSCN, "RSCN") \
VMK_IODM_EVENT_STR(VMK_IODM_LINKUP, "LINK_UP") \
VMK_IODM_EVENT_STR(VMK_IODM_LINKDOWN, "LINK_DOWN") \
VMK_IODM_EVENT_STR(VMK_IODM_FRAMEDROP, "FRAME_DROP") \
VMK_IODM_EVENT_STR(VMK_IODM_LUNRESET, "LUN_RESET") \
VMK_IODM_EVENT_STR(VMK_IODM_FCOE_CVL, "FCOE_CVL")
/** \endcond */
/*
***********************************************************************
* vmk_IodmEnableEvents -- */ /**
*
* \brief Enable IODM event notification for a SCSI Adapter.
*
* This function enables IODM event collection for a SCSI Adapter.
* SCSI drivers call this function during HBA registration time.
* This function will allocate memory to store a reasonable number of
* IODM events for the SCSI Adapter.
*
* \note This function may block.
*
* \param[in] vmkAdapter SCSI Adapter on which IODM event collection
* is to be enabled.
*
* \retval VMK_OK IODM Event notification is enabled.
* \retval VMK_NO_MEMORY Not enough memory to allocate resources.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IodmEnableEvents(vmk_ScsiAdapter *vmkAdapter);
/*
***********************************************************************
* vmk_IodmDisableEvents -- */ /**
*
* \brief Disable IODM event notification for a SCSI Adapter.
*
* This function disables IODM event collection for a SCSI Adapter.
* SCSI drivers call this function during HBA unregistration time, if
* IODM event collection was enabled for the HBA during registration.
* This function will free up the IODM resources allocated for the
* SCSI Adapter.
*
* \note This function may block.
*
* \param[in] vmkAdapter SCSI Adapter on which IODM is to be disabled.
*
* \retval VMK_OK IODM Event notification is disabled.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IodmDisableEvents(vmk_ScsiAdapter *vmkAdapter);
/*
***********************************************************************
* vmk_IodmEvent -- */ /**
*
* \brief Notify VMkernel of an IODM event of a SCSI Adapter
*
* SCSI drivers call this function to notify VMkernel when
* an IODM event has occured on the HBA device.
*
* \pre IODM event notification should have been enabled.
*
* \see vmk_IodmEnableEvents()
*
* \note This is a non-blocking function.
*
* \note Spin locks can be held while calling into this function.
*
* \note Given an 'eventId', either 'dataPtr' or 'data' or both
* parameters will be used to convey IODM event's payload.
* Refer to 'vmk_IodmEventType' enum for different 'eventId'
* types and their associated 'dataPtr' and 'data' parameters.
*
* \param[in] vmkAdapter SCSI Adapter on which the event occured.
* \param[in] eventId Event type
* \param[in] dataPtr Pointer to payload associated with the event.
* \param[in] data Data associated with the event.
*
* \retval VMK_OK Event successfully added to the pool.
* \retval VMK_NOT_FOUND IODM event notification is not enabled for
* the adapter.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IodmEvent(vmk_ScsiAdapter *vmkAdapter,
vmk_IodmEventType eventId,
vmk_AddrCookie dataPtr,
vmk_uint64 data);
#endif //_VMKAPI_SCSI_IODM_H_
/** @} */
/** @} */
|