/*
* 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
*/
/*
*/
#ifndef _LIBSES_PLUGIN_H
#define _LIBSES_PLUGIN_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* These are the primary APIs for plugins to interact with libses.
*/
struct ses_plugin;
typedef enum {
typedef enum ses_page_req {
typedef struct ses_pagedesc {
int spd_pagenum;
ses_node_t *);
int spd_gcoff;
typedef struct ses_plugin_config {
const char *, nvlist_t *);
ses_node_t *, size_t *);
extern void ses_plugin_setspecific(ses_plugin_t *, void *);
extern void *ses_plugin_getspecific(ses_plugin_t *);
/*
* The following are support functions provided by libses.
*/
extern int ses_assert(const char *, const char *, int);
#ifdef DEBUG
#else
#define ASSERT(x)
#endif
sizeof (_buf))
{ \
(_b) = v; \
}
{ \
(_b) = !v; \
}
{ \
uint64_t v = 0; \
(_v) = v; \
}
{ \
uint16_t v = 0; \
SCSI_WRITE16(&(_v), v); \
}
extern void *ses_zalloc(size_t);
extern char *ses_strdup(const char *);
extern void *ses_realloc(void *, size_t);
extern void ses_free(void *);
extern int ses_set_errno(ses_errno_t);
extern int ses_set_nverrno(int, const char *);
extern int ses_error(ses_errno_t, const char *, ...);
extern int ses_nverror(int, const char *, const char *, ...);
extern void ses_panic(const char *, ...) __NORETURN;
extern int nvlist_add_fixed_string(nvlist_t *, const char *,
const char *, size_t);
extern int nvlist_add_fixed_string_trunc(nvlist_t *, const char *,
const char *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* _LIBSES_PLUGIN_H */