/*
* 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 _SUN_SAS_H
#define _SUN_SAS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <smhbaapi.h>
#include <vendorsmhbaapi.h>
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <limits.h>
#include <syslog.h>
#include <thread.h>
#include <synch.h>
#include <unistd.h>
#include <stropts.h>
#include <libdevinfo.h>
#include <libsysevent.h>
#ifdef __cplusplus
extern "C" {
#endif
/* The /dev links we expose */
/* To be consistent, when out of memory call this macro routine */
di_nodeid(s) == (DI_PROM_NODEID))
/* manf+model+10(char length of UINTMAX)+6(for 2 -'s, NULL & extra 3bytes */
/* Some timing values */
/* How many times to silently retry, before starting to print warnings */
/* misc */
/* Internal structures that aren't exposed to clients */
struct open_handle {
int adapterIndex;
};
struct sun_sas_hba {
/* The libdevinfo HBA path (lacking /devices) */
/* State tracking */
};
struct ScsiEntryList {
};
struct phy_info {
};
struct sun_sas_port {
/* The libdevinfo HBA path (lacking /devices) */
int cntlNumber;
/* The following are used to track the device map */
int num_devices;
};
typedef struct walkarg {
char *devpath;
} walkarg_t;
extern int loadCount;
extern sysevent_handle_t *gSysEventHandle;
/* External routines */
extern HBA_UINT32 Sun_sasGetNumberOfAdapters();
SMHBA_FC_PHY *);
HBA_UINT32, SMHBA_SAS_PHY *);
void *, HBA_UINT32, void *, HBA_UINT32 *);
SMHBA_BINDING *);
const SMHBA_BINDING *);
const SMHBA_BINDING *);
HBA_WWN);
HBA_UINT32), void *, HBA_CALLBACKHANDLE *);
extern HBA_STATUS Sun_sasRegisterForAdapterPortStatEvents(void (*)(void *,
extern HBA_STATUS Sun_sasRegisterForAdapterPhyStatEvents(void (*)(void *,
void *, HBA_UINT32 *);
extern HBA_UINT32 Sun_sasGetVersion();
extern HBA_STATUS Sun_sasLoadLibrary();
extern HBA_STATUS Sun_sasFreeLibrary();
extern HBA_UINT32 Sun_sasGetNumberOfAdapters();
extern HBA_HANDLE Sun_sasOpenAdapter(char *);
extern void Sun_sasCloseAdapter(HBA_HANDLE);
extern void Sun_sasRefreshInformation(HBA_HANDLE);
extern void Sun_sasRefreshAdapterConfiguration(void);
/* Internal routines */
extern void log(int, const char *, char *, ...);
extern HBA_HANDLE CreateHandle(int);
extern int RetrieveIndex(HBA_HANDLE);
extern struct sun_sas_hba *RetrieveHandle(int);
extern struct sun_sas_hba *ExtractHandle(int);
extern void reportSense(struct scsi_extended_sense *, const char *);
extern void fillDomainPortWWN(struct sun_sas_port *);
extern HBA_STATUS registerSysevent();
#ifdef __cplusplus
}
#endif
#endif /* _SUN_SAS_H */