#ifndef _SYS_SSM_H
#define _SYS_SSM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <sys/dditypes.h>
#include <sys/mutex.h>
#define SSM_INSTANCE_SHIFT 4
#define SSM_BOARD_MASK 0xff
struct ssm_soft_state {
dev_info_t *dip;
int ssm_nodeid;
dev_info_t *top_node;
int initialized;
kmutex_t ssm_sft_lock;
ddi_iblock_cookie_t ssm_fm_ibc;
int ssm_fm_cap;
};
typedef struct {
int instance;
int wnode;
} ssm_sbdp_info_t;
#define SSM_ATTACH_DEBUG 0x0002
#define SSM_CTLOPS_DEBUG 0x0004
#define SSM_EVENT_DEBUG 0x0008
#define _SSM_IOCTL (('m' << 16) | ('p' << 8))
#define SSM_TEARDOWN_SBD (_SSM_IOCTL | 0x1)
#ifdef DEBUG
#define CMD2EVNT(m) ((m) == SGDR_BD_ABSENT ? SG_EVT_BOARD_ABSENT : \
(m) == SGDR_BD_PRESENT ? SG_EVT_BOARD_PRESENT :\
(m) == SGDR_UNASSIGN ? SG_EVT_UNASSIGN : \
(m) == SGDR_ASSIGN ? SG_EVT_ASSIGN : \
(m) == SGDR_UNAVAILABLE ? SG_EVT_UNAVAILABLE :\
(m) == SGDR_AVAILABLE ? SG_EVT_AVAILABLE : \
(m) == SGDR_POWER_OFF ? SG_EVT_POWER_OFF : \
(m) == SGDR_POWER_ON ? SG_EVT_POWER_ON : \
(m) == SGDR_PASSED_TEST ? SG_EVT_PASSED_TEST :\
(m) == SGDR_FAILED_TEST ? SG_EVT_FAILED_TEST :\
0)
#define EVNT2STR(c) ((c) == SG_EVT_BOARD_ABSENT ? "board_absent" :\
(c) == SG_EVT_BOARD_PRESENT ? "board_present" :\
(c) == SG_EVT_UNASSIGN ? "unassign" : \
(c) == SG_EVT_ASSIGN ? "assign" : \
(c) == SG_EVT_UNAVAILABLE ? "unavailable" : \
(c) == SG_EVT_AVAILABLE ? "available" : \
(c) == SG_EVT_POWER_OFF ? "power_off" : \
(c) == SG_EVT_POWER_ON ? "power_on" : \
(c) == SG_EVT_PASSED_TEST ? "passed_test" : \
(c) == SG_EVT_FAILED_TEST ? "failed_test" : \
NULL)
#endif
#ifdef __cplusplus
}
#endif
#endif