Files
@ d6b9b2ac5869
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release/npiv/vmkapi_scsi_vport.h
d6b9b2ac5869
5.6 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 | /* **********************************************************
* Copyright 2012 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
* vmkapi_scsi_vport.h --
*
* Defines the vmkernel specific virtual port API used
* to interact with NPIV VPORT aware native drivers.
*/
#ifndef _VMKAPI_SCSI_VPORT_H
#define _VMKAPI_SCSI_VPORT_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 */
#include "npiv/vmkapi_npiv_wwn.h"
/*
***********************************************************************
* vmk_ScsiVportCreate -- */ /**
*
* \brief Create a virtual port on the physical device indicated.
*
* The driver should create a virtual port representation on the
* physical device passed using the world wide name pair passed
* in wwpn and wwnn. The vmk_ScsiAdapter created to represent the
* vport is passed back in vAdapter.
*
* \note This function is allowed to block in the driver.
*
* \param[in] device Handle to physical device the virtual port
* should be created on.
* \param[in] wwpn Pointer to the world wide port name of the
* virtual port to be created.
* \param[in] wwnn Pointer to the world wide node name of the
* virtual port to be created.
* \param[out] vAdapter Handle to the vmk_ScsiAdapter created on
* the physical device for the vport.
*
* \retval VMK_BAD_PARAM A parameter or the device is not valid.
* \retval VMK_NO_MEMORY Unable to allocate memory for vport handle.
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_ScsiVportCreate)(vmk_Device device,
vmk_VportWwn *wwpn,
vmk_VportWwn *wwnn,
vmk_ScsiAdapter **vAdapter);
/*
***********************************************************************
* vmk_ScsiVportDelete -- */ /**
*
* \brief Delete the virtual port passed from a physical device.
*
* The driver should stop driving this virtual port, and release
* its resources. The vmk_ScsiAdapter vAdapter should be deallocated.
*
* \note The vAdapter passed has already been quiesced at the PSA
* layer and is not used by PSA for IOs.
*
* \note This function is allowed to block in the driver.
*
* \param[in] device Handle to physical device the virtual port was
* created on.
* \param[in] vAdapter Handle to the vmk_ScsiAdapter to be removed
* from the physical device.
*
* \retval VMK_BAD_PARAM A parameter or the device is not valid.
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_ScsiVportDelete)(vmk_Device device,
vmk_ScsiAdapter *vAdapter);
/*
***********************************************************************
* vmk_ScsiVportGetInfo -- */ /**
*
* \brief Return information about virtual ports on the physical device.
*
* Return information about how many virtual ports this physical
* device can support and how many are in use currently.
*
* \note This function is allowed to block in the driver.
*
* \param[in] device Handle to physical device to get the info from.
* \param[out] vports_max Return maximum number of vports allowed.
* \param[out] vports_inuse Return how many of the vports are in use.
*
* \retval VMK_OK Success
*
***********************************************************************
*/
typedef VMK_ReturnStatus (*vmk_ScsiVportGetInfo)(vmk_Device device,
vmk_uint32 *vports_max,
vmk_uint32 *vports_inuse);
/**
* \brief Vport Operations
*/
typedef struct vmk_ScsiVportOps {
/** \brief Create a virtual port */
vmk_ScsiVportCreate createVport;
/** \brief Delete a virtual port */
vmk_ScsiVportDelete deleteVport;
/** \brief Get virtual port information from physical device */
vmk_ScsiVportGetInfo getVportInfo;
} vmk_ScsiVportOps;
/*
***********************************************************************
* vmk_ScsiRegisterVportOps -- */ /**
*
* \brief Register Vport operations for a device.
*
* Register virtual port operations a physical device can perform.
* If VportOps are registered, it is assumed the device can create
* and delete virtual ports and return information about virtual ports.
* If VportOps are not registered, it is assumed the device is not
* NPIV vport capable.
*
* \note This function will not block.
*
* \param[in] device Handle to logical device the VportOps should
* be registered on.
* \param[in] ops VportOps registration data.
*
* \retval VMK_BAD_PARAM Device or ops argument is NULL or device
* is not fully registered yet.
* \retval VMK_NO_MEMORY No memory to register.
* \retval VMK_EXISTS Already registered.
* \retval VMK_OK Successfully registered VportOps.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_ScsiRegisterVportOps(vmk_Device device,
vmk_ScsiVportOps *ops);
#endif /* _VMKAPI_SCSI_VPORT_H */
|