Blame IbAccess/Common/Inc/ib_sd_priv.h

Packit 857059
/* BEGIN_ICS_COPYRIGHT3 ****************************************
Packit 857059
Packit 857059
Copyright (c) 2015-2017, Intel Corporation
Packit 857059
Packit 857059
Redistribution and use in source and binary forms, with or without
Packit 857059
modification, are permitted provided that the following conditions are met:
Packit 857059
Packit 857059
    * Redistributions of source code must retain the above copyright notice,
Packit 857059
      this list of conditions and the following disclaimer.
Packit 857059
    * Redistributions in binary form must reproduce the above copyright
Packit 857059
      notice, this list of conditions and the following disclaimer in the
Packit 857059
      documentation and/or other materials provided with the distribution.
Packit 857059
    * Neither the name of Intel Corporation nor the names of its contributors
Packit 857059
      may be used to endorse or promote products derived from this software
Packit 857059
      without specific prior written permission.
Packit 857059
Packit 857059
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit 857059
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 857059
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 857059
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit 857059
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 857059
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit 857059
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit 857059
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit 857059
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 857059
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 857059
Packit 857059
** END_ICS_COPYRIGHT3   ****************************************/
Packit 857059
Packit 857059
/* [ICS VERSION STRING: unknown] */
Packit 857059
Packit 857059
#ifndef _IBA_IB_SD_PRIV_H_
Packit 857059
#define _IBA_IB_SD_PRIV_H_
Packit 857059
Packit 857059
/* IB Subnet Data Interface
Packit 857059
 * The subnet data interface provides a simplied interface to the SM/SA and
Packit 857059
 * automates queries, sets and deletes for commonly required information
Packit 857059
 * from the SM/SA.
Packit 857059
 *
Packit 857059
 * The subnet data interface automatically handles the following:
Packit 857059
 * - retries (client configurable)
Packit 857059
 * - timeouts (client configurable)
Packit 857059
 * - RMPP response coallessing and inter-record padding
Packit 857059
 * - extraction of selected fields from a query to provide a concise response
Packit 857059
 * 		to client
Packit 857059
 * - multi-tiered queries (get paths to a node, etc)
Packit 857059
 *
Packit 857059
 * New drivers/applications should use the iba_* functions.
Packit 857059
 * They can now be called directly.
Packit 857059
 */
Packit 857059
Packit 857059
#include <iba/ib_sd.h>
Packit 857059
Packit 857059
#ifdef __cplusplus
Packit 857059
extern "C" {
Packit 857059
#endif
Packit 857059
Packit 857059
typedef struct _SMINFO_RECORD_RESULTS  {
Packit 857059
    uint32              NumSMInfoRecords;	/* Number of SmInfoRecords returned */
Packit 857059
    IB_SMINFO_RECORD  	SMInfoRecords[1];   	/* list of SMInfo records returned */
Packit 857059
} SMINFO_RECORD_RESULTS, *PSMINFO_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _LINK_RECORD_RESULTS  {
Packit 857059
    uint32              NumLinkRecords;		/* Number of SmInfoRecords returned */
Packit 857059
    IB_LINK_RECORD    	LinkRecords[1];		/* list of SMInfo records returned */
Packit 857059
} LINK_RECORD_RESULTS, *PLINK_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _TRACE_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumTraceRecords;   /* Number of TraceRecords returned */
Packit 857059
	IB_TRACE_RECORD 	TraceRecords[1];   /* list of trace records returned */
Packit 857059
} TRACE_RECORD_RESULTS, *PTRACE_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _SWITCHINFO_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumSwitchInfoRecords;   /* Number of SwitchInfoRecords returned */
Packit 857059
	IB_SWITCHINFO_RECORD 	SwitchInfoRecords[1];   /* list of Switch Info records returned */
Packit 857059
} SWITCHINFO_RECORD_RESULTS, *PSWITCHINFO_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _LINEAR_FDB_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumLinearFDBRecords;   /* Number of LinearFDBRecords returned */
Packit 857059
	IB_LINEAR_FDB_RECORD 	LinearFDBRecords[1];   /* list of Linear FDB records returned */
Packit 857059
} LINEAR_FDB_RECORD_RESULTS, *PLINEAR_FDB_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _RANDOM_FDB_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumRandomFDBRecords;   /* Number of RandomFDBRecords returned */
Packit 857059
	IB_RANDOM_FDB_RECORD 	RandomFDBRecords[1];   /* list of Random FDB records returned */
Packit 857059
} RANDOM_FDB_RECORD_RESULTS, *PRANDOM_FDB_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _MCAST_FDB_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumMCastFDBRecords;   /* Number of MCastFDBRecords returned */
Packit 857059
	IB_MCAST_FDB_RECORD 	MCastFDBRecords[1];   /* list of multicast FDB records returned */
Packit 857059
} MCAST_FDB_RECORD_RESULTS, *PMCAST_FDB_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _VLARBTABLE_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumVLArbTableRecords;   /* Number of VLArbTableRecords returned */
Packit 857059
	IB_VLARBTABLE_RECORD 	VLArbTableRecords[1];   /* list of VL Arbitration table records returned */
Packit 857059
} VLARBTABLE_RECORD_RESULTS, *PVLARBTABLE_RECORD_RESULTS;
Packit 857059
Packit 857059
typedef struct _PKEYTABLE_RECORD_RESULTS  {
Packit 857059
    uint32 			    NumPKeyTableRecords;   /* Number of PKeyTableRecords returned */
Packit 857059
	IB_P_KEY_TABLE_RECORD 	PKeyTableRecords[1];   /* list of P-Key table records returned */
Packit 857059
} PKEYTABLE_RECORD_RESULTS, *PPKEYTABLE_RECORD_RESULTS;
Packit 857059
Packit 857059
/* ===========================================================================
Packit 857059
 * kernel mode function interface
Packit 857059
 */
Packit 857059
#if defined(VXWORKS)
Packit 857059
Packit 857059
/* return a list of the PortGuids for presently active ports
Packit 857059
 * caller must MemoryDeallocate(*ppLocalPortGuidsList) when done using it
Packit 857059
 * this does not preempt
Packit 857059
 * if no ports are found, can return FSUCCESS but with both outputs set to 0
Packit 857059
 * data pointed to only used during duration of call
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_GET_LOCAL_PORT_GUIDS)(
Packit 857059
		 IN OUT uint64						**ppLocalPortGuidsList,
Packit 857059
   IN OUT uint32						*LocalPortGuidsCount
Packit 857059
								  );
Packit 857059
IBA_API SDK_GET_LOCAL_PORT_GUIDS iba_sd_get_local_port_guids_alloc;
Packit 857059
Packit 857059
/* return a list of the PortGuids and SubnetPrefixes for presently active ports
Packit 857059
 * caller must MemoryDeallocate(*ppLocalPortGuidsList) and
Packit 857059
 * MemoryDeallocate(*ppLocalPortSubnetPrefixList) when done using it
Packit 857059
 * this does not preempt
Packit 857059
 * if no ports are found, can return FSUCCESS but with both outputs set to 0
Packit 857059
 * data pointed to only used during duration of call
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_GET_LOCAL_PORT_GUIDS2)(
Packit 857059
		 IN OUT uint64						**ppLocalPortGuidsList,
Packit 857059
   IN OUT uint64						**ppLocalPortSubnetPrefixList,
Packit 857059
   IN OUT uint32						*LocalPortGuidsCount
Packit 857059
								   );
Packit 857059
IBA_API SDK_GET_LOCAL_PORT_GUIDS2 iba_sd_get_local_port_guids_alloc2;
Packit 857059
Packit 857059
/* Callback made in kernel mode when a Query[Port]FabricInformation completes
Packit 857059
 * this callback occurs in a thread context, however it should not preempt
Packit 857059
 * for long durations
Packit 857059
 * data pointed to only valid during duration of call
Packit 857059
 */
Packit 857059
typedef 
Packit 857059
		void (SDK_QUERY_CALLBACK)(
Packit 857059
			  IN void					*Context,		/* as supplied in Query */
Packit 857059
	 IN PQUERY				pInputQuery,	/* input request */
Packit 857059
  IN PQUERY_RESULT_VALUES pQueryResults	/* results returned from Manager */
Packit 857059
								 );
Packit 857059
typedef SDK_QUERY_CALLBACK *PQUERY_CALLBACK;/* depricated */
Packit 857059
Packit 857059
/* perform a query of a manager (SA, etc)
Packit 857059
 * using 1st active port
Packit 857059
 * if pQueryControlParameters is NULL, values established for client session
Packit 857059
 * will be used
Packit 857059
 * this function does not preempt.  When the operation completes a callback
Packit 857059
 * will occur with the result data.
Packit 857059
 * data pointed to only used during duration of call
Packit 857059
 */
Packit 857059
typedef  FSTATUS
Packit 857059
		(SDK_QUERY_FABRIC_INFO)(
Packit 857059
		 IN CLIENT_HANDLE				ClientHandle,
Packit 857059
   IN PQUERY						pQuery,		/* query to make */
Packit 857059
   IN SDK_QUERY_CALLBACK			*Callback,	/* called on completion */
Packit 857059
   IN COMMAND_CONTROL_PARAMETERS	*pQueryControlParameters OPTIONAL,
Packit 857059
   IN void							*Context OPTIONAL/* context for callback */
Packit 857059
							   );
Packit 857059
IBA_API SDK_QUERY_FABRIC_INFO iba_sd_query_fabric_info;
Packit 857059
Packit 857059
/* Same as QueryFabricInformation, except issued against a specific port */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_QUERY_PORT_FABRIC_INFO)(
Packit 857059
		 IN CLIENT_HANDLE				ClientHandle,
Packit 857059
   IN EUI64						PortGuid,
Packit 857059
   IN PQUERY						pQuery,
Packit 857059
   IN SDK_QUERY_CALLBACK			*Callback,
Packit 857059
   IN COMMAND_CONTROL_PARAMETERS	*pQueryControlParameters OPTIONAL,
Packit 857059
   IN void							*Context OPTIONAL
Packit 857059
									);
Packit 857059
IBA_API SDK_QUERY_PORT_FABRIC_INFO iba_sd_query_port_fabric_info;
Packit 857059
Packit 857059
/* Callback made in kernel mode when a [Port]FabricOperation completes
Packit 857059
 * this callback occurs in a thread context, however it should not preempt
Packit 857059
 * for long durations
Packit 857059
 * data pointed to only valid during duration of call
Packit 857059
 */
Packit 857059
typedef 
Packit 857059
		void (SDK_FABRIC_OPERATION_CALLBACK)(
Packit 857059
			  IN void* 					Context,/* as supplied in FabricOperation */
Packit 857059
	 IN FABRIC_OPERATION_DATA*	pFabOp,	/* contains response value */
Packit 857059
  IN FSTATUS 					Status,	/* overall result of query */
Packit 857059
  IN uint32					MadStatus	/* for FSUCCESS or FERROR Status: */
Packit 857059
		  /* manager's Mad Status code from resp */
Packit 857059
											);
Packit 857059
typedef SDK_FABRIC_OPERATION_CALLBACK *PFABRIC_OPERATION_CALLBACK;/* depricated */
Packit 857059
Packit 857059
/* perform a fabric operation (eg. set/delete, etc) against a manager
Packit 857059
 * using 1st active port
Packit 857059
 * if pCmdControlParameters is NULL, values established for client session
Packit 857059
 * will be used
Packit 857059
 * this function does not preempt.  When the operation completes a callback
Packit 857059
 * will occur with the result data.
Packit 857059
 * data pointed to only used during duration of call
Packit 857059
 */
Packit 857059
typedef  FSTATUS
Packit 857059
		(SDK_FABRIC_OPERATION)(
Packit 857059
		 IN CLIENT_HANDLE 				ClientHandle,
Packit 857059
   IN FABRIC_OPERATION_DATA* 		pFabOp,	/* operation to perform */
Packit 857059
   IN SDK_FABRIC_OPERATION_CALLBACK 	*Callback,
Packit 857059
   IN COMMAND_CONTROL_PARAMETERS* 	pCmdControlParameters OPTIONAL,
Packit 857059
   IN void*						Context OPTIONAL
Packit 857059
							  );
Packit 857059
IBA_API SDK_FABRIC_OPERATION iba_sd_fabric_operation;
Packit 857059
Packit 857059
/* Same as FabricOperation, except issued against a specific port */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_PORT_FABRIC_OPERATION)(
Packit 857059
		 IN CLIENT_HANDLE 				ClientHandle,
Packit 857059
   IN EUI64 						PortGuid,
Packit 857059
   IN FABRIC_OPERATION_DATA*		pFabOp,	/* operation to perform */
Packit 857059
   IN SDK_FABRIC_OPERATION_CALLBACK	*Callback,
Packit 857059
   IN COMMAND_CONTROL_PARAMETERS* 	pCmdControlParameters OPTIONAL,
Packit 857059
   IN void* 						Context OPTIONAL
Packit 857059
								   );
Packit 857059
IBA_API SDK_PORT_FABRIC_OPERATION iba_sd_port_fabric_operation;
Packit 857059
Packit 857059
/* subscribe for an SA Trap/Notice
Packit 857059
 * client will receive a callback when the given Trap/Notice is received
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_TRAP_NOTICE_SUBSCRIBE)(
Packit 857059
		 IN CLIENT_HANDLE ClientHandle,
Packit 857059
   IN uint16 TrapNumber,
Packit 857059
   IN EUI64 PortGuid,
Packit 857059
   IN void *pContext,
Packit 857059
   IN SD_REPORT_NOTICE_CALLBACK *pReportNoticeCallback
Packit 857059
								   );
Packit 857059
IBA_API SDK_TRAP_NOTICE_SUBSCRIBE iba_sd_trap_notice_subscribe;
Packit 857059
Packit 857059
/* unsubscribe for an SA Trap/Notice
Packit 857059
 * this does not preempt
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_TRAP_NOTICE_UNSUBSCRIBE)(
Packit 857059
		 IN CLIENT_HANDLE ClientHandle,
Packit 857059
   IN uint16 TrapNumber,
Packit 857059
   IN EUI64 PortGuid
Packit 857059
									 );
Packit 857059
IBA_API SDK_TRAP_NOTICE_UNSUBSCRIBE iba_sd_trap_notice_unsubscribe;
Packit 857059
Packit 857059
/* have any of the client's traps been successfully subscribed for
Packit 857059
 * this does not preempt
Packit 857059
 */
Packit 857059
typedef boolean
Packit 857059
		(SDK_PORT_TRAPS_SUBSCRIBED)(
Packit 857059
		 IN EUI64 PortGuid
Packit 857059
								   );
Packit 857059
IBA_API SDK_PORT_TRAPS_SUBSCRIBED iba_sd_port_traps_subscribed;
Packit 857059
Packit 857059
/* Request join/create of a multicast group
Packit 857059
 *
Packit 857059
 * This version of the call uses the MGID as the group identifier
Packit 857059
 *
Packit 857059
 * SdClientHandle - handle from iba_sd_register
Packit 857059
 * McFlags - MC_FLAGS_* to control when get callbacks
Packit 857059
 * ComponentMask - indicate fields in pMcMemberRecord which are set
Packit 857059
 * pContext - user defined context pointer supplied to callback
Packit 857059
 * pMulticastCallback - callback function invoked when join state changes
Packit 857059
 *
Packit 857059
 * Since joins are per HCA port, this call handles multiple applications
Packit 857059
 * joining the same MC group and will only issue joins to the SM on the
Packit 857059
 * 1st application joining.  Similarly iba_sd_leave_mcgroup will only issue
Packit 857059
 * the leave to the SM on last application leaving.
Packit 857059
 *
Packit 857059
 * Internally this call maintains the joined state and will rejoin when
Packit 857059
 * fabric events warrent, such as SM restart, port down and up, etc.
Packit 857059
 *
Packit 857059
 * this does not preempt
Packit 857059
 * data pointed to only used during duration of call
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_JOIN_MULTICAST_GROUP)(
Packit 857059
		 IN CLIENT_HANDLE SdClientHandle,
Packit 857059
   IN uint16 McFlags,
Packit 857059
   IN uint64 ComponentMask, 
Packit 857059
   IN IB_MCMEMBER_RECORD *pMcMemberRecord,
Packit 857059
   IN void *pContext,
Packit 857059
   IN SD_MULTICAST_CALLBACK *pMulticastCallback
Packit 857059
								  );
Packit 857059
IBA_API SDK_JOIN_MULTICAST_GROUP iba_sd_join_mcgroup;
Packit 857059
Packit 857059
/* Request join/create of a multicast group
Packit 857059
 *
Packit 857059
 * This version of the call uses the RID as the group identifier
Packit 857059
 *
Packit 857059
 * SdClientHandle - handle from iba_sd_register
Packit 857059
 * McFlags - MC_FLAGS_* to control when get callbacks
Packit 857059
 * ComponentMask - indicate fields in pMcMemberRecord which are set
Packit 857059
 * pContext - user defined context pointer supplied to callback
Packit 857059
 * pMulticastCallback - callback function invoked when join state changes
Packit 857059
 *
Packit 857059
 * Since joins are per HCA port, this call handles multiple applications
Packit 857059
 * joining the same MC group and will only issue joins to the SM on the
Packit 857059
 * 1st application joining.  Similarly iba_sd_leave_mcgroup2 will only issue
Packit 857059
 * the leave to the SM on last application leaving.
Packit 857059
 *
Packit 857059
 * Internally this call maintains the joined state and will rejoin when
Packit 857059
 * fabric events warrent, such as SM restart, port down and up, etc.
Packit 857059
 *
Packit 857059
 * this does not preempt
Packit 857059
 * data pointed to only used during duration of call
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_JOIN_MULTICAST_GROUP2)(
Packit 857059
		 IN CLIENT_HANDLE SdClientHandle,
Packit 857059
   IN uint16 McFlags,
Packit 857059
   IN uint64 ComponentMask, 
Packit 857059
   IN IB_MCMEMBER_RECORD *pMcMemberRecord,
Packit 857059
   IN EUI64 EgressPortGUID,
Packit 857059
   IN void *pContext,
Packit 857059
   IN SD_MULTICAST_CALLBACK *pMulticastCallback
Packit 857059
								   );
Packit 857059
IBA_API SDK_JOIN_MULTICAST_GROUP2 iba_sd_join_mcgroup2;
Packit 857059
Packit 857059
/* Request leave of a multicast group which was previously joined via
Packit 857059
 * iba_sd_join_mcgroup
Packit 857059
 *
Packit 857059
 * Once this returns, no more callbacks will be issued for the given join.
Packit 857059
 * This call does not trigger a callback.
Packit 857059
 *
Packit 857059
 * This will only issue the leave to the SM on last application leaving the
Packit 857059
 * group.
Packit 857059
 *
Packit 857059
 * this does not preempt
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_LEAVE_MULTICAST_GROUP)(
Packit 857059
		 IN CLIENT_HANDLE SdClientHandle,
Packit 857059
   IN IB_GID *pMGID
Packit 857059
								   );
Packit 857059
IBA_API SDK_LEAVE_MULTICAST_GROUP iba_sd_leave_mcgroup;
Packit 857059
Packit 857059
/* Request leave of a multicast group which was previously joined via
Packit 857059
 * iba_sd_join_mcgroup2
Packit 857059
 *
Packit 857059
 * Once this returns, no more callbacks will be issued for the given join.
Packit 857059
 * This call does not trigger a callback.
Packit 857059
 *
Packit 857059
 * This will only issue the leave to the SM on last application leaving the
Packit 857059
 * group.
Packit 857059
 *
Packit 857059
 * this does not preempt
Packit 857059
 */
Packit 857059
typedef FSTATUS
Packit 857059
		(SDK_LEAVE_MULTICAST_GROUP2)(
Packit 857059
		 IN CLIENT_HANDLE SdClientHandle,
Packit 857059
   IN IB_GID *pMGID,
Packit 857059
   IN IB_GID *pPortGID,
Packit 857059
   IN EUI64  EgressPortGUID
Packit 857059
									);
Packit 857059
IBA_API SDK_LEAVE_MULTICAST_GROUP2 iba_sd_leave_mcgroup2;
Packit 857059
Packit 857059
#endif /* defined(VXWORKS) */
Packit 857059
Packit 857059
#ifdef __cplusplus
Packit 857059
};
Packit 857059
#endif
Packit 857059
Packit 857059
#endif  /* _IBA_IB_SD_PRIV_H_ */