xref: /onnv-gate/usr/src/uts/common/sys/ib/mgt/ib_dm_attr.h (revision 1093:4dc7aec69dc9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*1093Shiremath  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _SYS_IB_MGT_IB_DM_ATTR_H
280Sstevel@tonic-gate #define	_SYS_IB_MGT_IB_DM_ATTR_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate /*
330Sstevel@tonic-gate  * ib_dm_attr.h
340Sstevel@tonic-gate  *
350Sstevel@tonic-gate  * This file contains definitions for Device Management data structures
360Sstevel@tonic-gate  * defined in the IB specification (Section 16.3).
370Sstevel@tonic-gate  */
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #ifdef __cplusplus
400Sstevel@tonic-gate extern "C" {
410Sstevel@tonic-gate #endif
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /* Device management Methods */
440Sstevel@tonic-gate #define	IB_DM_DEVMGT_METHOD_GET			0x01
450Sstevel@tonic-gate #define	IB_DM_DEVMGT_METHOD_SET			0x02
460Sstevel@tonic-gate #define	IB_DM_DEVMGT_METHOD_GET_RESP		0x81
470Sstevel@tonic-gate #define	IB_DM_DEVMGT_METHOD_TRAP		0x05
480Sstevel@tonic-gate #define	IB_DM_DEVMGT_METHOD_TRAP_REPRESS	0x07
490Sstevel@tonic-gate 
500Sstevel@tonic-gate /* Device Class version */
510Sstevel@tonic-gate #define	IB_DM_CLASS_VERSION_1			0x1
520Sstevel@tonic-gate 
530Sstevel@tonic-gate /* Device Management Status field */
540Sstevel@tonic-gate #define	IB_DM_DEVMGT_MAD_STAT_NORESP		0x0100
550Sstevel@tonic-gate #define	IB_DM_DEVMGT_MAD_STAT_NOSVC_ENTRIES	0x0200
560Sstevel@tonic-gate #define	IB_DM_DEVMGT_MAD_STAT_GEN_FAILURE	0x8000
570Sstevel@tonic-gate 
580Sstevel@tonic-gate /* Device Management attributes */
590Sstevel@tonic-gate #define	IB_DM_ATTR_CLASSPORTINFO		0x1
600Sstevel@tonic-gate #define	IB_DM_ATTR_NOTICE			0x2
610Sstevel@tonic-gate #define	IB_DM_ATTR_IO_UNITINFO			0x10
620Sstevel@tonic-gate #define	IB_DM_ATTR_IOC_CTRL_PROFILE		0x11
630Sstevel@tonic-gate #define	IB_DM_ATTR_SERVICE_ENTRIES		0x12
640Sstevel@tonic-gate #define	IB_DM_ATTR_DIAG_TIMEOUT			0x20
650Sstevel@tonic-gate #define	IB_DM_ATTR_PREPARE_TO_TEST		0x21
660Sstevel@tonic-gate #define	IB_DM_ATTR_TEST_DEV_ONCE		0x22
670Sstevel@tonic-gate #define	IB_DM_ATTR_TEST_DEV_LOOP		0x23
680Sstevel@tonic-gate #define	IB_DM_ATTR_DIAG_CODE			0x24
690Sstevel@tonic-gate 
700Sstevel@tonic-gate /* IOUnitInfo DM attribute (Section 16.3.3.3 in vol1a) definition */
710Sstevel@tonic-gate #define	IB_DM_MAX_IOCS_IN_IOU			256
720Sstevel@tonic-gate 
730Sstevel@tonic-gate typedef struct ib_dm_io_unitinfo_s {
740Sstevel@tonic-gate 	/* Incremented, with rollover, by any change in the controller list */
750Sstevel@tonic-gate 	uint16_t	iou_changeid;
760Sstevel@tonic-gate 	uint8_t		iou_num_ctrl_slots;	/* # controllers in the IOU */
770Sstevel@tonic-gate 
780Sstevel@tonic-gate 	/*
790Sstevel@tonic-gate 	 * Bit 0 : Option ROM present
800Sstevel@tonic-gate 	 * Bit 1 : Diag Device ID
810Sstevel@tonic-gate 	 */
820Sstevel@tonic-gate 	uint8_t		iou_flag;
830Sstevel@tonic-gate 
840Sstevel@tonic-gate 	/*
850Sstevel@tonic-gate 	 *  List of nibbles representing a slot in the IOU
860Sstevel@tonic-gate 	 *  Contains iou_num_ctrl_slots valid entries
870Sstevel@tonic-gate 	 *  0x0 = IOC not installed
880Sstevel@tonic-gate 	 *  0x1 = IOC present
890Sstevel@tonic-gate 	 *  0xf = Slot does not exist
900Sstevel@tonic-gate 	 *  Note: Bits 7-4 of the first byte represent slot 1 and
910Sstevel@tonic-gate 	 *	bits 3-0 of first byte represents slot 2, bits 7-4 of
920Sstevel@tonic-gate 	 *	second byte represents slot 3, and so on
930Sstevel@tonic-gate 	 */
940Sstevel@tonic-gate 	uint8_t	iou_ctrl_list[128];
950Sstevel@tonic-gate } ib_dm_io_unitinfo_t;
960Sstevel@tonic-gate 
970Sstevel@tonic-gate /* values for iou_flag */
980Sstevel@tonic-gate #define	IB_DM_IOU_OPTIONROM_ABSENT	0x0
990Sstevel@tonic-gate #define	IB_DM_IOU_OPTIONROM_PRESENT	0x1
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate /* masks for iou_flag */
1020Sstevel@tonic-gate #define	IB_DM_IOU_OPTIONROM_MASK	0x1
1030Sstevel@tonic-gate #define	IB_DM_IOU_DEVICEID_MASK		0x2
1040Sstevel@tonic-gate 
1050Sstevel@tonic-gate #define	IB_DM_IOC_ID_STRING_LEN		64	/* see ioc_id_string later */
106*1093Shiremath #define	IB_DM_VENDORID_MASK		0xFFFFFF00
107*1093Shiremath #define	IB_DM_VENDORID_SHIFT		8
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate typedef struct ib_dm_ioc_ctrl_profile_s {
1100Sstevel@tonic-gate 	ib_guid_t	ioc_guid;		/* GUID of the IOC */
1110Sstevel@tonic-gate 	uint32_t	ioc_vendorid;		/* Vendor ID of the IOC */
1120Sstevel@tonic-gate 	uint32_t	ioc_deviceid;		/* Device ID/Product ID */
1130Sstevel@tonic-gate 	uint16_t	ioc_device_ver;		/* Device Version */
1140Sstevel@tonic-gate 	uint16_t	ioc_rsvd1;		/* RESERVED */
1150Sstevel@tonic-gate 	uint32_t	ioc_subsys_vendorid;	/* Subsystem vendor ID */
1160Sstevel@tonic-gate 	uint32_t	ioc_subsys_id;		/* Subsystem ID */
1170Sstevel@tonic-gate 	uint16_t	ioc_io_class;		/* I/O Class */
1180Sstevel@tonic-gate 	uint16_t	ioc_io_subclass;	/* I/O Sub Class */
1190Sstevel@tonic-gate 	uint16_t	ioc_protocol;		/* Type of protocol */
1200Sstevel@tonic-gate 	uint16_t	ioc_protocol_ver;	/* Protocol version */
1210Sstevel@tonic-gate 	uint16_t	ioc_rsvd2;		/* RESERVED */
1220Sstevel@tonic-gate 	uint16_t	ioc_rsvd3;		/* RESERVED */
1230Sstevel@tonic-gate 	uint16_t	ioc_send_msg_qdepth;	/* Send message Q depth */
1240Sstevel@tonic-gate 	uint8_t		ioc_rsvd4;		/* RESERVED */
1250Sstevel@tonic-gate 	uint8_t		ioc_rdma_read_qdepth;	/* RDMA read Q depth */
1260Sstevel@tonic-gate 	uint32_t	ioc_send_msg_sz;	/* Send message Size */
1270Sstevel@tonic-gate 	uint32_t	ioc_rdma_xfer_sz;	/* RDMA transfer size */
1280Sstevel@tonic-gate 	uint8_t		ioc_ctrl_opcap_mask;	/* Ctrl operations */
1290Sstevel@tonic-gate 						/* capability mask */
1300Sstevel@tonic-gate 	uint8_t		ioc_rsvd5;		/* RESERVED */
1310Sstevel@tonic-gate 	uint8_t		ioc_service_entries;	/* Number of service entries */
1320Sstevel@tonic-gate 	uint8_t		ioc_rsvd6[9];		/* RESERVED */
1330Sstevel@tonic-gate 	uint8_t		ioc_id_string[IB_DM_IOC_ID_STRING_LEN];
1340Sstevel@tonic-gate 						/* ID string, UTF-8 format */
1350Sstevel@tonic-gate } ib_dm_ioc_ctrl_profile_t;
1360Sstevel@tonic-gate 
1370Sstevel@tonic-gate /* I/O class definitions as defined in the I/O annex A0 Table 4 */
1380Sstevel@tonic-gate #define	IB_DM_IO_CLASS_VENDOR_SPECIFIC		0xFFFF
1390Sstevel@tonic-gate #define	IB_DM_IO_CLASS_NONE			0x00FF
1400Sstevel@tonic-gate #define	IB_DM_IO_CLASS_STORAGE			0x10FF
1410Sstevel@tonic-gate #define	IB_DM_IO_CLASS_NETWORK			0x20FF
1420Sstevel@tonic-gate #define	IB_DM_IO_CLASS_VEDIO_MULTIMEDIA		0x40FF
1430Sstevel@tonic-gate #define	IB_DM_IO_CLASS_UNKNOWN_OR_MULTIPLE	0xF0FF
1440Sstevel@tonic-gate #define	IB_DM_IO_SUBCLASS_VENDOR_SPECIFIC	0xFFFF
1450Sstevel@tonic-gate 
1460Sstevel@tonic-gate /* Controller Capability Mask values */
1470Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_ST			0x0
1480Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_SF			0x1
1490Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_RT			0x2
1500Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_RF			0x3
1510Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_WT			0x4
1520Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_WF			0x5
1530Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_AT			0x6
1540Sstevel@tonic-gate #define	IB_DM_CTRL_CAP_MASK_AF			0x7
1550Sstevel@tonic-gate 
1560Sstevel@tonic-gate /* Controller Service Capability Mask */
1570Sstevel@tonic-gate #define	IB_DM_CTRL_SRVC_MASK_CS			0x0
1580Sstevel@tonic-gate #define	IB_DM_CTRL_SRVC_MASK_SBWP		0x1
1590Sstevel@tonic-gate #define	IB_DM_CTRL_SRVC_MASK_NBWP		0x2
1600Sstevel@tonic-gate 
1610Sstevel@tonic-gate /* Definition for service entry table 219, 16.3.3.5 */
1620Sstevel@tonic-gate #define	IB_DM_MAX_SVC_ENTS_PER_REQ		4
1630Sstevel@tonic-gate #define	IB_DM_MAX_SVC_NAME_LEN			40
1640Sstevel@tonic-gate #define	IB_DM_MAX_SVC_ENTRIES			0x100
1650Sstevel@tonic-gate 
1660Sstevel@tonic-gate typedef struct ib_dm_srv_s {
1670Sstevel@tonic-gate 	/* Service name string in UTF-8 format */
1680Sstevel@tonic-gate 	uint8_t		srv_name[IB_DM_MAX_SVC_NAME_LEN];
1690Sstevel@tonic-gate 	ib_svc_id_t	srv_id;			/* Service Identifier   */
1700Sstevel@tonic-gate } ib_dm_srv_t;
1710Sstevel@tonic-gate 
1720Sstevel@tonic-gate #ifdef __cplusplus
1730Sstevel@tonic-gate }
1740Sstevel@tonic-gate #endif
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate #endif	/* _SYS_IB_MGT_IB_DM_ATTR_H */
177