ibmf_saa_impl.h revision 76c04273c82e93b83f826e73f096a3ece549a8f9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_MGT_IBMF_IBMF_SAA_IMPL_H
#define _SYS_IB_MGT_IBMF_IBMF_SAA_IMPL_H
/*
*/
#ifdef __cplusplus
extern "C" {
#endif
#define SAA_MAX_CLIENTS_PER_PORT 100
#define SAA_MAD_BASE_VERSION 1
#define SAA_MAD_CLASS_VERSION 2
#define IBMF_SAA_RETRANS_RETRIES 2
#define IBMF_SAA_MAX_SUBNET_TIMEOUT 20
#define IBMF_SAA_MAX_RESP_TIME 20
#define IBMF_SAA_MAX_BUSY_RETRY_COUNT 10
#define IBMF_SAA_MAX_WAIT_TIME_IN_SECS 60
#define IBMF_SAA_TRANS_WAIT_TIME_IN_SECS 240
/*
* saa_port_s:
* Linked list of ports that saa is using. Each port is registered to ibmf.
* Multiple saa clients can associate with an saa port
*/
typedef enum saa_port_state_s {
IBMF_SAA_PORT_STATE_INVALID, /* client MUST close */
IBMF_SAA_PORT_STATE_PURGING /* being purged */
typedef struct saa_port_s {
struct saa_port_s *next;
/* registration synchronization: only one client registers to ibmf */
/* state and client reference counts */
/* port identification and ibmf registration info */
/* transaction parameters */
int saa_pt_timeout; /* from portinfo */
/* kstats */
struct kstat *saa_pt_kstatp;
/* sync. for receiving informinfo req packets */
/* node guid and port num, saved for easy ibt_queries */
/* latest hrtime that packet from SA was received */
} saa_port_t;
#define IBMF_SAA_PORT_EVENT_SUB_ALL_ARRIVE \
typedef struct ibmf_saa_kstat_s {
ibmf_saa_kstat_t *kp; \
}
ibmf_saa_kstat_t *kp; \
}
typedef enum _saa_client_state_e {
typedef struct saa_client_data_s {
void *next;
/* set for valid handles */
void *saa_client_sig;
void *saa_client_event_cb_arg;
typedef struct saa_state_s {
} saa_state_t;
/*
* special callback used specifically for handling informinfo responses;
* extra parameter is producer_type
*/
/*
* saa_impl_trans_info_t:
* Convenience structure wich allows ibmf_access_sa to group all the fields
* into one structure as a parameter to the send request function.
* This structure is allocated by ibmf_access_sa() and freed by ibmf_access_sa()
* in the sync case and by the ibmf_msg_transport callback in the async case
*/
typedef struct saa_impl_trans_info_t {
/* used to tell send_request about request mad */
void *si_trans_template;
/* used for async call to tell send_request which callback to use */
void *si_trans_callback_arg;
/*
* used to tell ibmf_access_sa about response if the request was sync.
* If the request was async, the ibmf_msg_transport callback function
* will fill these values directly into the si_trans_callback
*/
int si_trans_status;
void *si_trans_result;
/* fields needed for specific case of handling InformInfo requests */
/*
* producer_type indicates the notice producer type that the
* subscription was for. There is no way to tell which type the
* response packet is for.
*/
/*
* separate callback typedef to provide the producer type to the
* subscription response handler (ibmf_saa_impl_get_informinfo_cb)
*/
/*
* some unsubscribe requests are sequenced, others are unsequenced
* (depending on context that generated unsubscribe request)
*/
/* trans flags saved in case sm lid changes and msg must be resent */
/* counter for retrying requests which return MAD_BUSY status */
/* hrtime that we initiated this transaction */
typedef struct ibmf_saa_event_taskq_args_s {
void *et_callback_arg;
/*
* Public Functions
*/
int ibmf_saa_impl_init();
int ibmf_saa_impl_fini();
void ibmf_saa_impl_purge();
void *args);
void
void
void
void *args);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_MGT_IBMF_IBMF_SAA_IMPL_H */