smhbaapi.h revision 9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bb
/*
* ****************************************************************************
*
* Description
* smhbaapi.h - general header file for client
* and library developers
*
* License:
* The contents of this file are subject to the SNIA Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code for SM-HBA API general header file
*
* The Initial Developer of the Original Code is:
* Benjamin F. Kuo, Troika Networks, Inc. (benk@troikanetworks.com)
*
* Contributor(s):
* Tuan Lam, QLogic Corp. (t_lam@qlc.com)
* Dan Willie, Emulex Corp. (Dan.Willie@emulex.com)
* Dixon Hutchinson, Legato Systems, Inc. (dhutchin@legato.com)
* David Dillard, VERITAS Software Corp. (david.dillard@veritas.com)
*
* ****************************************************************************
*
* Adding on SM-HBA related definitions.
*
* - Includes the original HBA API header.
* - SMHBA_* interfaces and structures are defined.
*
* ****************************************************************************
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SMHBAAPI_H_
#define _SMHBAAPI_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <hbaapi.h>
/* Library version string */
#define SMHBA_LIBVERSION 1
/*
* A SCSI function was requested at a time when issuing the requested command
* would cause a SCSI overlapped command condition (see SAM-3)
*/
#define HBA_STATUS_ERROR_TARGET_BUSY 30
/* SM-HBA 6.2 Status Return Values */
/* A call was made to HBA_FreeLibrary when no library was loaded */
#define HBA_STATUS_ERROR_NOT_LOADED 31
/* A call was made to HBA_LoadLibrary when a library was already loaded */
#define HBA_STATUS_ERROR_ALREADY_LOADED 32
/*
* The Address Identifier specified in a call to HBA_SendRNIDV2
* violates access control rules * for that call.
*/
#define HBA_STATUS_ERROR_ILLEGAL_FCID 33
#define HBA_STATUS_ERROR_NOT_ASCSIDEVICE 34
#define HBA_STATUS_ERROR_INVALID_PROTOCOL_TYPE 35
#define HBA_STATUS_ERROR_BAD_EVENT_TYPE 36
/* SM-HBA 6.4.1.1 Port Type */
/* SM-HBA 6.4.1.2 Port State */
/* SM-HBA 6.11.1.3 Port Speed */
/* SM-HBA 6.1 Basic Attributes Types */
/* A byte array representation of a SCSI */
/* LUN (see SAM-4). The first byte of the */
/* LUN shall be in the first byte of the */
/* array, and successive bytes of the SCSI */
/* LUN shall be in successive bytes of the */
/* array. */
typedef unsigned long HBA_SCSILUN;
/* A 64 bit unsigned integer representation */
/* of a SCSI LUN (see SAM-4); */
/* may use OS-specific typedef. */
/* Byte zero of a SCSI LUN shall be stored */
/* in the lowest memory address */
/* of the unsigned 64-bit integer value, */
/* and successive bytes of the SCSI LUN */
/* shall be stored in successively higher memory */
/* addresses of the unsigned 64-bit intege value. */
/* Note that computers often do not store */
/* a byte array in memory in the same order */
/* as they store an integer. */
/* This standard requires storage as a byte array */
/* SM-HBA 6.3.1 Generic Adapter Attribute */
typedef struct SMHBA_AdapterAttributes {
char Manufacturer[64];
char SerialNumber[64];
char Model[256];
char ModelDescription[256];
char HardwareVersion[256];
char DriverVersion[256];
char OptionROMVersion[256];
char FirmwareVersion[256];
char DriverName[256];
char HBASymbolicName[256];
char RedundantOptionROMVersion[256];
char RedundantFirmwareVersion[256];
/* SM-HBA 6.4.6 SMHBA FC Port Attributes */
typedef struct SMHBA_FC_Port {
char PortSymbolicName[256];
/* SM-HBA 6.4.7.1 HBA_SASPortProtocol */
typedef HBA_UINT32 HBA_SASPORTPROTOCOL;
/* SATA Device, Direct Attached or anywhere in the domain. */
#define HBA_SASPORTPROTOCOL_SATA 8
/* SM-HBA 6.4.8 SMHBA SAS Port Attributes */
typedef struct SMHBA_SAS_Port {
/* SM-HBA 6.4.2 Generic Port Attributes */
typedef union SMHBA_Port {
} SMHBA_PORT, *PSMHBA_PORT;
typedef struct SMHBA_PortAttributes {
char OSDeviceName[256];
/* SM-HBA 6.5.1.1 FC Phy Speed */
typedef HBA_UINT32 HBA_FCPHYSPEED;
/* Unknown transceiver incapable of reporting */
#define HBA_FCSPEED_UNKNOWN 0
/*
* The following are redundantly defined in SM-HBA 6.11.1.3 Port Speed.
*/
/*
* The following conflicts with HBA API
* #define HBA_PORTSPEED_NOT_NEGOTIATED (1<<15) Speed not established
*/
/* SM-HBA 6.6.1.2 SM-HBA FC Phy Type */
typedef HBA_UINT8 HBA_FCPHYTYPE;
/* SM-HBA 6.5.2 SM-HBA FC Phy Attributes */
typedef struct SMHBA_FC_Phy {
/* SM-HBA 6.5.4 SAS PHY Attribute Data Declaration */
typedef HBA_UINT32 HBA_SASPHYSPEED;
/* Phy is enabled. But failed speed negotiation. */
#define HBA_SASSTATE_FAILED 0x02
/*
* Phy is enabled. Detected a SATA device and entered the SATA Spinup hold
* state.
*/
#define HBA_SASSTATE_SATASPINUP 0x03
/* The phy is attached to a Port Selector (see SATA-2.6). */
#define HBA_SASSTATE_SATAPORTSEL 0x04
/* SM-HBA 6.5.5 SAS Phy Attribute */
typedef struct SMHBA_SAS_Phy {
/* SM-HBA 6.6.1.1 Protocol Statistics Data Declarations */
/* Statistical counters for FC-4, SSP, STP, SMP protocols */
typedef struct SMHBA_ProtocolStatistics {
/* SM-HBA 6.6.2.1 Port Statistics Data Declarations */
typedef struct SMHBA_PortStatistics {
/* SM-HBA 6.6.2.2 SAS Phy Statistics Data Declaration */
typedef struct SMHBA_SASPhyStatistics {
/* SM-HBA 6.6.2.4 FC Phy Statistics Data Declaration */
/* Statistical counters for FC-0, FC-1, and FC-2 */
typedef struct SMHBA_FCPhyStatistics {
/* SM-HBA 6.6.2.1 Phy Statistics Data Declaration */
typedef union SMHBA_PhyStatistics {
/* SM-HBA 6.7.1.1 SMHBA_BIND_CAPABILITY */
typedef HBA_UINT32 SMHBA_BIND_CAPABILITY;
#define SMHBA_CAN_BIND_TO_WWPN 0x0001
#define SMHBA_CAN_BIND_TO_LUID 0x0002
#define SMHBA_CAN_BIND_ANY_LUNS 0x0400
#define SMHBA_CAN_BIND_AUTOMAP 0x0800
/* SM-HBA 6.7.1.2 SMHBA_BIND_TYPE */
typedef HBA_UINT32 SMHBA_BIND_TYPE;
#define SMHBA_BIND_TO_WWPN 0x0001
#define SMHBA_BIND_TO_LUID 0x0002
/* SM-HBA 6.7.1.3 SMHBA_ScsiId */
typedef struct SMHBA_ScsiId {
char OSDeviceName[256];
/* SM-HBA 6.7.1.4 SMHBA_LUID */
typedef struct SMHBA_LUID {
char buffer[256];
} SMHBA_LUID, *PSMHBA_LUID;
/* SM-HBA 6.7.1.5 SMHBA_PORTLUN */
typedef struct SMHBA_PORTLUN {
/* SM-HBA 6.7.1.6 Composite types */
typedef struct SMHBA_ScsiEntry {
typedef struct SMHBA_TargetMapping {
typedef struct SMHBA_BindingEntry {
typedef struct SMHBA_Binding {
/* SM-HBA 6.9.5 Library Attribute Data Declarations */
typedef struct SMHBA_LibraryAttributes {
char LibPath[256];
char VName[256];
char VVersion[256];
struct {
int tm_mday; /* day of the month - [1 - 31] */
int tm_mon; /* months since January - [0 - 11] */
int tm_year; /* years since 1900 */
} build_date;
/* SM-HBA 6.8.1 Asynchronous Event Data Declarations */
#define HBA_EVENT_PORT_BROADCAST_CHANGE 0x205
#define HBA_EVENT_PORT_BROADCAST_SES 0x208
#define HBA_EVENT_PORT_BROADCAST_D24_0 0x206
#define HBA_EVENT_PORT_BROADCAST_D27_4 0x207
#define HBA_EVENT_PORT_BROADCAST_D01_4 0x209
#define HBA_EVENT_PORT_BROADCAST_D04_7 0x20A
#define HBA_EVENT_PORT_BROADCAST_D16_7 0x20B
#define HBA_EVENT_PORT_BROADCAST_D29_7 0x20C
#define HBA_EVENT_PORT_ALL 0x2FF
/* SM-HBA specific entry points. */
);
);
);
);
);
);
);
);
);
);
);
);
);
void *pReqBuffer,
);
void *pReqBuffer,
void *pRspBuffer,
);
void *pReqBuffer,
void *pRspBuffer,
);
);
);
);
);
);
const SMHBA_BINDING *binding
);
const SMHBA_BINDING *binding
);
);
const HBA_SCSIID *lunit,
);
void *pRspBuffer,
void *pSenseBuffer,
);
void *pRspBuffer,
void *pSenseBuffer,
);
void *pRspBuffer,
void *pSenseBuffer,
);
void (*pCallback) (
void *pData,
void *pUserData,
);
void (*pCallback) (
void *pData,
void *pUserData,
);
void (*pCallback) (
void *pData,
void *pUserData,
);
void (*pCallback) (
void *pData,
void *pUserData,
);
void (*pCallback) (
void *pData,
void *pUserData,
);
void (*pCallback) (
void *pData,
void *pUserData,
);
#ifdef __cplusplus
}
#endif
#endif /* _SMHBAAPI_H_ */