
//***************************************************************************
//
//  hbaapi.mof
//
//  Module: WDM classes to expose HBA api data from drivers
//
//  Purpose: Contains WDM classes that specify the HBA data to be exposed
//           via the HBA api set.
//
//  NOTE: This file contains information that is based upon an earlier
//        revision of the HBAAPI 2.18 specification.
//
//  NOTE: This is currently under revision to SM-HBA Dec 2005
//
//  Copyright (c) 2001 Microsoft Corporation
//
//***************************************************************************

#pragma autorecover
#pragma classflags(64)
#pragma namespace("\\\\.\\Root\\wmi")

[cpp_quote("\n//***************************************************************************\n//\n// This class allows System Center Virtual Machine Manager to create virtual\n// ports for quickly migrating the VHD files associated with a VM from one\n// host to another.\n//\n//***************************************************************************\n\n"),WMI,Dynamic,Provider("WmiProv"),Locale("MS\\0x409"),guid("{8d49ef4c-c172-45d8-a303-c5fbc5601f37}")] 
class MSFC_FibrePortNPIVMethods
{
  [key,read] string InstanceName;
  [read] boolean Active;
  [WmiMethodId(1),Implemented] void CreateVirtualPort([OUT,ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_MAX_VPORT_COUNT", "NPIV_WWPN_IN_USE", "NPIV_WWPN_INVALID_FORMAT", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND"}] uint32 Status,[IN,MAX(8)] uint8 WWPN[],[IN,MAX(8)] uint8 WWNN[],[IN,MAX(16)] uint8 Tag[],[IN,MAX(64)] uint16 VirtualName[]);
  [WmiMethodId(2),Implemented] void RemoveVirtualPort([out,ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_MAX_VPORT_COUNT", "NPIV_WWPN_IN_USE", "NPIV_WWPN_INVALID_FORMAT", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND"}] uint32 Status,[in,MAX(8)] uint8 WWPN[]);
};

[cpp_quote("\n//***************************************************************************\n//\n// This class defines the parameters used to set up DH-CHAP.\n//\n//***************************************************************************\n\n"),WMI,Locale("MS\\0x409"),guid("{8c6bc95b-e363-418d-b86b-686f49c26608}")] 
class MSFC_DH_Chap_Parameters
{
  [WmiDataId(1)] uint32 SharedSecretLength;
  [WmiDataId(2),ValueMap{"1", "2"},Values{"Printable ASCII", "Binary"}] uint8 SecretEncoding;
  [WmiDataId(3),WmiSizeIs("SharedSecretLength")] uint8 SharedSecret[];
};

[cpp_quote("\n//***************************************************************************\n//\n// This class advertizes the ability to use DH-CHAP with physical or virtual\n// ports.  If these values are false, Hyper-V will not attempt to use DH-CHAP.\n//\n//***************************************************************************\n\n"),WMI,Dynamic,Provider("WmiProv"),Locale("MS\\0x409"),guid("{57d6ff16-db8a-4205-bdc0-b690e9a2f862}")] 
class MSFC_NPIVCapabilities
{
  [key,read] string InstanceName;
  [read] boolean Active;
  [WmiDataId(1)] boolean DhChapAvailableOnPhysicalPort;
  [WmiDataId(2)] boolean DhChapAvailableOnVirtualPorts;
  [WmiDataId(3)] uint16 MaxVirtualPortCount;
};

[cpp_quote("\n//***************************************************************************\n//\n// This class defines methods which allow Hyper-V to create, delete and\n// manipulate virtual ports for use on behalf of virtual machines.\n//\n//***************************************************************************\n\n"),WMI,Dynamic,Provider("WmiProv"),Locale("MS\\0x409"),guid("{4135419a-2ebe-472b-a8c8-8416ca2ae1d8}")] 
class MSFC_FibrePortNPIVMethodsEx
{
  [key,read] string InstanceName;
  [read] boolean Active;
  [WmiMethodId(1),Implemented] void SetChapForPhysicalPort([OUT,ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0xA", "0xB", "0xC", "0xD", "0xE"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_AUTHENTICATION_MECHANISM_NOT_USABLE", "NPIV_HASH_FUNCTION_NOT_USABLE", "NPIV_AUTHENTICATION_TRANSACTION_ALREADY_STARTED", "NPIV_AUTHENTICATION_FAILED", "NPIV_UNSUPPORTED_PROTOCOL_VERSION"}] uint32 Status,[IN] MSFC_DH_Chap_Parameters CHAP);
  [WmiMethodId(2),Implemented] void RemoveChapForPhysicalPort([OUT,ValueMap{"0", "1"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR"}] uint32 Status);
  [WmiMethodId(3),Implemented] void CreateVirtualPortEx([OUT,ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9", "0XD"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_MAX_VPORT_COUNT", "NPIV_WWPN_IN_USE", "NPIV_WWPN_INVALID_FORMAT", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND", "NPIV_AUTHENTICATION_FAILED"}] uint32 Status,[IN,MAX(8)] uint8 WWPN[],[IN,MAX(8)] uint8 WWNN[],[IN,MAX(16)] uint8 Tag[],[IN,MAX(64)] uint16 VirtualName[]);
  [WmiMethodId(4),Implemented] void CreateVirtualPortExUsingDHCHAP([OUT,ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9", "0xA", "0xB", "0xC", "0xD", "0xE"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_MAX_VPORT_COUNT", "NPIV_WWPN_IN_USE", "NPIV_WWPN_INVALID_FORMAT", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND", "NPIV_AUTHENTICATION_MECHANISM_NOT_USABLE", "NPIV_HASH_FUNCTION_NOT_USABLE", "NPIV_AUTHENTICATION_TRANSACTION_ALREADY_STARTED", "NPIV_AUTHENTICATION_FAILED", "NPIV_UNSUPPORTED_PROTOCOL_VERSION"}] uint32 Status,[IN,MAX(8)] uint8 WWPN[],[IN,MAX(8)] uint8 WWNN[],[IN,MAX(16)] uint8 Tag[],[IN,MAX(64)] uint16 VirtualName[],[IN] MSFC_DH_Chap_Parameters CHAP);
  [WmiMethodId(5),Implemented] void RemoveVirtualPortEx([OUT,ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_MAX_VPORT_COUNT", "NPIV_WWPN_IN_USE", "NPIV_WWPN_INVALID_FORMAT", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND"}] uint32 Status,[IN,MAX(8)] uint8 WWPN[]);
  [WmiMethodId(6),Implemented] void RescanVirtualPort([OUT,ValueMap{"0x0", "0x1", "0x8", "0x9"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND"}] uint32 Status,[IN,MAX(8)] uint8 WWPN[]);
};

[WMI,Locale("MS\\0x409"),guid("{3574bc0b-6f5f-4baf-af67-c48cc79fe957}")] 
class MSFC_VirtualFibrePortAttributes
{
  [WmiDataId(1),ValueMap{"0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9"},Values{"NPIV_SUCCESS", "NPIV_UNKNOWN_ERROR", "NPIV_NOT_SUPPORTED_HOST", "NPIV_NOT_SUPPORTED_FABRIC", "NPIV_OUT_OF_RESOURCES", "NPIV_MAX_VPORT_COUNT", "NPIV_WWPN_IN_USE", "NPIV_WWPN_INVALID_FORMAT", "NPIV_LINK_DOWN", "NPIV_WWPN_NOT_FOUND"}] uint32 Status;
  [WmiDataId(2)] uint32 FCId;
  [WmiDataId(3),MAX(64)] uint16 VirtualName[];
  [WmiDataId(4),MAX(16)] uint8 Tag[];
  [WmiDataId(5),MAX(8)] uint8 WWPN[];
  [WmiDataId(6),MAX(8)] uint8 WWNN[];
  [WmiDataId(7),MAX(8)] uint8 FabricWWN[];
};

[WMI,Dynamic,Provider("WmiProv"),Locale("MS\\0x409"),guid("{66902796-54f4-4e24-ad91-0ab3b1ad65af}")] 
class MSFC_FibrePortNPIVAttributes
{
  [key,read] string InstanceName;
  [read] boolean Active;
  [WmiDataId(1),MAX(8)] uint8 WWPN[];
  [WmiDataId(2),MAX(8)] uint8 WWNN[];
  [WmiDataId(3),read] uint32 NumberVirtualPorts;
  [WmiDataId(4),read,WmiSizeIs("NumberVirtualPorts")] MSFC_VirtualFibrePortAttributes VirtualPorts[];
};

[WMI,Dynamic,Provider("WmiProv"),Locale("MS\\0x409"),guid("{21763208-feb5-49bc-a4e6-f56fdd8ccbd4}")] 
class MSFC_NPIVLUNMappingInformation
{
  [key,read] string InstanceName;
  [read] boolean Active;
  [WmiDataId(1),MAX(8)] uint8 WWPNVirtualPort[];
  [WmiDataId(2),MAX(8)] uint8 WWPNPhysicalPort[];
  [WmiDataId(3),read] uint8 OSBus;
  [WmiDataId(4),read] uint8 OSTarget;
  [WmiDataId(5),read] uint8 OSLUN;
};

[cpp_quote("\n//***************************************************************************\n//\n// This class allows Hyper-V to identify the virtual port associated with a\n// specific LUN.\n//\n//***************************************************************************\n\n"),WMI,Dynamic,Provider("WmiProv"),Locale("MS\\0x409"),guid("{684c1fef-3c76-4147-b214-e9aa061a7564}")] 
class MSFC_NPIVLUNMappingInformationEx
{
  [key,read] string InstanceName;
  [read] boolean Active;
  [WmiDataId(1),MAX(8)] uint8 WWPNVirtualPort[];
  [WmiDataId(2),MAX(8)] uint8 WWPNPhysicalPort[];
  [WmiDataId(3),read] uint8 PortNumber;
  [WmiDataId(4),read] uint8 OSBus;
  [WmiDataId(5),read] uint8 OSTarget;
  [WmiDataId(6),read] uint8 OSLUN;
};
#pragma autorecover
#pragma classflags(64)
#pragma namespace("\\\\.\\Root\\wmi")
instance of __namespace{ name="ms_409";};
#pragma namespace("\\\\.\\Root\\wmi\\ms_409")

[Description("NPIV operations that can be performed on a physical adapter") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_FibrePortNPIVMethods
{
  [Description("Create a virtual port with a specific WWPN.") : Amended] void CreateVirtualPort([OUT,Description("Return code") : Amended] uint32 Status,[IN,Description("The world wide port name of the virtual port to create") : Amended] uint8 WWPN[],[IN,Description("The world wide node name to associate with the created virtual port") : Amended] uint8 WWNN[],[IN,Description("An opaque tag passed in by the app. 128 bit so that a guid can be stored in it.") : Amended] uint8 Tag[],[IN,Description("Port symbolic name") : Amended] uint16 VirtualName[]);
  [Description("Remove a virtual port ") : Amended] void RemoveVirtualPort([out,Description("Return code") : Amended] uint32 Status,[in,Description("The world wide port name of the virtual port") : Amended] uint8 WWPN[]);
};

[Description("Embedded class that describes DH-CHAP parameters.") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_DH_Chap_Parameters
{
  [Description("Length in bytes of the shared secret.") : Amended] uint32 SharedSecretLength;
  [Description("Shared Secret Encoding") : Amended] uint8 SecretEncoding;
  [Description("Shared secret to be used at the basis of a DH-CHAP challenge.") : Amended] uint8 SharedSecret[];
};

[Description("NPIV capabilities") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_NPIVCapabilities
{
  [Description("DH-CHAP available for physical port") : Amended] boolean DhChapAvailableOnPhysicalPort;
  [Description("DH-CHAP available for virtual ports") : Amended] boolean DhChapAvailableOnVirtualPorts;
  [Description("Number of virtual ports that can be created on this physical FC port") : Amended] uint16 MaxVirtualPortCount;
};

[Description("NPIV operations that can be performed on a physical adapter which enable Fibre Channel in a Guest Virtual Machine") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_FibrePortNPIVMethodsEx
{
  [Description("Enable DH-CHAP for the Physical Port of a Fibre Channel HBA, allowing for unidirectional authentication of the physical port by the Fibre Channel fabric.") : Amended] void SetChapForPhysicalPort([OUT,Description("Return code") : Amended] uint32 Status,[IN,Description("Parameters necessary to respond to a DH-CHAP challenge.") : Amended] MSFC_DH_Chap_Parameters CHAP);
  [Description("Disable DH-CHAP for the Physical Port of a Fibre Channel HBA.") : Amended] void RemoveChapForPhysicalPort([OUT,Description("Return code") : Amended] uint32 Status);
  [Description("Create a virtual port on behalf of a Guest Virtual Machine with a specific WWPN with no authentication mechanism.") : Amended] void CreateVirtualPortEx([OUT,Description("Return code") : Amended] uint32 Status,[IN,Description("The world wide port name of the virtual port to create") : Amended] uint8 WWPN[],[IN,Description("The world wide node name to associate with the created virtual port") : Amended] uint8 WWNN[],[IN,Description("An opaque tag passed in by the app. 128 bit so that a guid can be stored in it.") : Amended] uint8 Tag[],[IN,Description("Port symbolic name") : Amended] uint16 VirtualName[]);
  [Description("Create a virtual port on behalf of a Guest Virtual Machine with a specific WWPN using DH-CHAP for unidirectional authentication of the N_Port by the FibreChannel fabric.") : Amended] void CreateVirtualPortExUsingDHCHAP([OUT,Description("Return code") : Amended] uint32 Status,[IN,Description("The world wide port name of the virtual port to create") : Amended] uint8 WWPN[],[IN,Description("The world wide node name to associate with the created virtual port") : Amended] uint8 WWNN[],[IN,Description("An opaque tag passed in by the app. 128 bit so that a guid can be stored in it.") : Amended] uint8 Tag[],[IN,Description("Port symbolic name") : Amended] uint16 VirtualName[],[IN,Description("Parameters necessary to respond to a DH-CHAP challenge.") : Amended] MSFC_DH_Chap_Parameters CHAP);
  [Description("Remove a virtual port ") : Amended] void RemoveVirtualPortEx([OUT,Description("Return code") : Amended] uint32 Status,[IN,Description("The world wide port name of the virtual port") : Amended] uint8 WWPN[]);
  [Description("Rescan virtual port, including all logical buses associated with that port. Miniport is expected to notify Storport for targeted bus rescan") : Amended] void RescanVirtualPort([OUT,Description("Return Code") : Amended] uint32 Status,[IN,Description("The world wide port name of the virtual port") : Amended] uint8 WWPN[]);
};

[Description("Embedded class that describes the  properties of a virtual port.") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_VirtualFibrePortAttributes
{
  [Description("Status of the virtual port") : Amended] uint32 Status;
  [Description("FC Id") : Amended] uint32 FCId;
  [Description("Port symbolic name") : Amended] uint16 VirtualName[];
  [Description("An opaque tag passed in by the app. 128 bit so that a guid can be stored in it.") : Amended] uint8 Tag[];
  [Description("The world wide port name of the virtual port") : Amended] uint8 WWPN[];
  [Description("The world wide node name of the virtual port") : Amended] uint8 WWNN[];
  [Description("The world wide node name of fabric") : Amended] uint8 FabricWWN[];
};

[Description("Retrieve the virtual ports created on a physical port.") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_FibrePortNPIVAttributes
{
  [Description("The world wide port name of the physical port") : Amended] uint8 WWPN[];
  [Description("The world wide node name of the physical port") : Amended] uint8 WWNN[];
  [Description("Number of virtual ports on this adapter.") : Amended] uint32 NumberVirtualPorts;
  [Description("Array of virtual ports.") : Amended] MSFC_VirtualFibrePortAttributes VirtualPorts[];
};

[Description("LUN to virtual port mapping.") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_NPIVLUNMappingInformation
{
  [Description("The world wide port name of the virtual port") : Amended] uint8 WWPNVirtualPort[];
  [Description("The world wide port name of the physical port") : Amended] uint8 WWPNPhysicalPort[];
};

[Description("Extended LUN to virtual port mapping.") : Amended,AMENDMENT, LOCALE("ms_409")] 
class MSFC_NPIVLUNMappingInformationEx
{
  [Description("The world wide port name of the virtual port") : Amended] uint8 WWPNVirtualPort[];
  [Description("The world wide port name of the physical port") : Amended] uint8 WWPNPhysicalPort[];
  [Description("The SCSI Port ID associated with this LUN, matching the SCSI_ADDRESS") : Amended] uint8 PortNumber;
  [Description("The SCSI Path ID associated with this LUN, matching the SCSI_ADDRESS") : Amended] uint8 OSBus;
  [Description("The SCSI Target ID associated with this LUN, matching the SCSI_ADDRESS") : Amended] uint8 OSTarget;
  [Description("The SCSI LUN, matching the SCSI_ADDRESS") : Amended] uint8 OSLUN;
};
