/*
* 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_IBDM_IBDM_IMPL_H
#define _SYS_IB_MGT_IBDM_IBDM_IMPL_H
/*
*
* This file contains definitions of the data structures, macros etc
* related to the IBDM module.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* values for "cb_req_type" */
typedef struct ibdm_taskq_args_s {
void *tq_args;
typedef struct ibdm_gid_s {
} ibdm_gid_t;
/*
* Identifiers to distinguish a Cisco FC GW from others.
* Used to filter a setclassportinfo request.
*/
/*
* the bit-shift value for OUI in GUID
* A 64 bit globally unique identifier (GUID) composed of a 24 bit company id
* and an 48 bit extension identifier, and this value is used to extract
* the company id from the GUID.
*/
/*
* The state diagram for the gl_state
*
* (in case of Cisco FC GW)
* IBDM_GID_PROBE_NOT_DONE ---------- 40 -> IBDM_SET_CLASSPORTINFO
* ----. |
* | | | (others) |
* | | 1 |
* | | | 1
* | | `-------------. |
* | | v v
* | | IBDM_GET_CLASSPORTINFO
* | |
* | | |
* | 2 3
* | | |
* | v v
* | IBDM_GID_PROBING_FAILED IBDM_GET_IOUNITINFO
* | |
* 6 4
* | |
* v v
* IBDM_GID_PROBING_SKIPPLED IBDM_GET_IOC_DETAILS
* |
* 5
* |
* v
* IBDM_GID_PROBE_COMPLETE
*
* Initial state : IBDM_GID_PROBE_NOT_DONE
* 40 = Port sends setClassPortInfo to activate Cisco FC GW
* 1 = Port supports DM MAD's and a request to ClassportInfo is sent
* 3 = Received ClassPortInfo and sent IOUnitInfo
* 4 = Recevied IOUunitInfo and sent IOC profile, diagcodes, and
* service entries requests
* 5 = Received all the IOC information
* 2 = Failed to probe the GID
* Port does not support DM MAD's
* Port did not respond property
* 6 = A different GID for the same port, skip the probe
*
* Reprobe state transition :
*
* IBDM_GID_PROBE_COMPLETE
* |
* 7
* |
* v
* IBDM_GET_IOC_DETAILS
* |
* 8
* |
* v
* IBDM_GID_PROBE_COMPLETE
*
* 7 = Reprobe request for one or more IOCs initiated.
* 8 = Reprobe done(IOC COntroller Profile & Service entries)
*/
typedef struct ibdm_dp_gidinfo_s {
int gl_pending_cmds;
int gl_num_iocs;
int gl_disconnected;
/*
* The transaction ID for the GID contains of two parts :
* 1. Upper 32 bits which is unique for each GID.
* 2. Lower 32 bits which is unique for each MAD.
* The assumptions are :
* 1. At most 2 power 32 DM capable GIDs on the IB fabric
* 2. IBDM sends maximum of 2 power 32 MADs to the same DM GID
* The limits are sufficient for practical configurations.
*/
typedef struct ibdm_s {
/* Protects IBDM's critical data */
int ibdm_state;
/*
* These are callback routines registered by the IB nexus driver.
* These callbacks are used to inform the IB nexus driver about
*/
/* Flag indicating - prev_iou during sweep */
int ibdm_prev_iou;
} ibdm_t;
/* valid values for ibdm_state */
/*
* Device Management MAD packet format
* +--------+------------+------------+------------+------------+
* | offset | byte 0 | byte 1 | byte 2 | byte 3 |
* +--------+------------+------------+------------+------------+ --
* | 0 | | ^
* +--------+ | sizeof(
* | ... | Common MAD Header | ib_mad_hdr_t)
* +--------+ | | (A)
* | 20 | | v
* +--------+------------+------------+------------+------------+ --
* | 24 | | ^
* +--------+ | |
* | ... | RMPP Header | |
* +--------+ | |
* | 32 | | |
* +--------+------------+------------+------------+------------+ |
* | 36 | | |
* +--------+ Access_Key |
* | 40 | | IBDM_DM_MAD_
* +--------+------------+------------+------------+------------+ HDR_SZ
* | 44 | KeyType | reserved | (B)
* +--------+------------+------------+------------+------------+ |
* | 48 | | |
* +--------+ | |
* | 52 | Reserved | |
* +--------+ | |
* | 56 | | |
* +--------+------------+------------+------------+------------+ |
* | 60 | Change_ID | ComponentMask | v
* +--------+------------+------------+------------+------------+ --
* | 64 | | ^
* +--------+ | IBDM_MAD_SIZE
* | ... | Device Management Data | - (A) - (B)
* +--------+ | |
* | 252 | | v
* +--------+------------+------------+------------+------------+ --
*/
#define IBDM_DISABLE_TASKQ_HANLDING 0
typedef struct ibdm_saa_event_arg_s {
void *callback_arg;
(((pkey) == IB_PKEY_INVALID_FULL) || \
((pkey) == IB_PKEY_INVALID_LIMITED))
#ifdef DEBUG
void ibdm_dump_mad_hdr(ib_mad_hdr_t *);
void ibdm_dump_ibmf_msg(ibmf_msg_t *, int);
void ibdm_dump_path_info(sa_path_record_t *);
void ibdm_dump_iounitinfo(ib_dm_io_unitinfo_t *);
void ibdm_dump_service_entries(ib_dm_srv_t *);
void ibdm_dump_sweep_fabric_timestamp(int);
#else
#define ibdm_dump_mad_hdr(a)
#define ibdm_dump_ibmf_msg(a, b)
#define ibdm_dump_path_info(a)
#define ibdm_dump_classportinfo(a)
#define ibdm_dump_iounitinfo(a)
#define ibdm_dump_ioc_profile(a)
#define ibdm_dump_service_entries(a)
#define ibdm_dump_sweep_fabric_timestamp(a)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_MGT_IBDM_IBDM_IMPL_H */