/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CFGA_SBD_H
#define _CFGA_SBD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SBD_DEBUG
void dbg(char *, ...);
#else
#define DBG
#endif
typedef struct {
int flags;
int code;
char *mid;
char *platform;
int skip;
int err;
} ap_opts_t;
/*
* Command options.
*
* Some of the options are provided for testing purpose and
* will not published (e.g. err,code,mid).
*/
#define OPT_UNASSIGN 0
typedef enum {
AP_NONE = 0,
} ap_target_t;
/*
* Attachment point descriptor.
*
* All commands are processed as follows:
*
* . allocate a command descriptor
* . parse the physical ap_id
* . parse the command and its options.
* . sequence if necessary (state change commands)
* . execute
*
*/
typedef struct {
int fd;
int bnum;
int cnum;
int ncm;
int inst;
int norcm;
int statonly;
const char *class;
const char *apid;
char *drv;
char *path;
char *target;
char *minor;
char *cid;
char *cname;
char *options;
char **errstring;
void *ctl;
void *stat;
void *cmstat;
void *rcm;
} apd_t;
/*
* Command definitions.
*
* The command order is significant. The sequenced (-c) commands
* are sorted in execution order. The configure command starts from
* assign and ends with online. The disconnect command starts
* from offline and goes to unassign. Steps in the sequencing may
* be optionally skipped.
*/
#define CMD_ASSIGN 0
/*
* Error messages.
*/
#define ERR_CMD_INVAL 0
#define MSG_ISSUE 0
int ap_confirm(apd_t *);
int ap_state_cmd(cfga_cmd_t, int *);
char *ap_sys_err(apd_t *, char **);
char *ap_cmd_name(int);
char *ap_opt_name(int);
int ap_cm_ncap(apd_t *, int);
char *ap_cm_devpath(apd_t *, int);
void ap_rcm_fini(apd_t *);
int ap_rcm_info(apd_t *, char **);
struct cfga_msg *, struct cfga_confirm *);
int debugging();
#ifdef __cplusplus
}
#endif
#endif /* _CFGA_SBD_H */