/*
* 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 _SYS_1394_TARGETS_AV1394_IMPL_H
#define _SYS_1394_TARGETS_AV1394_IMPL_H
/*
* av1394 driver definitions
*/
#include <sys/tnf_probe.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* byte swapping support, stolen from SBP2
*/
#ifdef _LITTLE_ENDIAN
#else
#endif
/*
* double-linked list
*/
typedef struct av1394_list_item_s {
typedef struct av1394_list_s {
/*
* queue
*/
typedef struct av1394_queue_s {
/*
* asynchronous module definitions
*
*
* command structure
*/
typedef struct av1394_fcp_cmd_s {
/*
* per-instance FCP structure
*/
typedef struct av1394_fcp_s {
} av1394_fcp_t;
enum {
};
/*
* configuration ROM
*/
/* offsets in quadlets */
typedef struct av1394_cfgrom_text_leaf_s {
typedef struct av1394_cfgrom_parsed_dir_s {
typedef struct av1394_cfgrom_parse_arg_s {
enum {
};
typedef struct av1394_cfgrom_s {
/*
* async command
*/
typedef struct av1394_async_cmd_s {
/*
* per-instance soft state structure
*/
typedef struct av1394_async_s {
}))
/* we use special message types for the read queue */
enum {
/*
* For efficiency, we only store 1394 request data on the read queue.
* ARQ headers (iec61883_arq_t) are generated when an application
* calls read(2). Because applications may read header separately
* from the data, we need to mark each mblk when its header was read
* but not the data - the following flag is used for this purpose.
*/
};
/*
* device state:
*
* AV1394_DEV_DISCONNECTED
* | | ^
* | | |
* detach reconnect disconnect
* | | |
* v v |
* AV1394_DEV_INIT ----attach---> AV1394_DEV_ONLINE
* (initial state) <---detach--- | ^
* | |
* cpr suspend cpr resume
* | |
* v |
* AV1394_DEV_SUSPENDED
*/
typedef enum {
AV1394_DEV_INIT = 0,
/*
* per-instance soft state structure
*/
typedef struct av1394_inst_s {
}))
/* these are set during attach (single-threaded) and don't change afterwards */
}))
/*
* minor <-> instance mapping
*/
/* misc constants */
enum {
};
/* current interface version */
/* TNF probes */
/* misc */
#define NELEM(a) (sizeof (a) / sizeof (*(a)))
/* double-linked list */
/* queue */
void av1394_destroyq(av1394_queue_t *q);
int av1394_getmaxq(av1394_queue_t *q);
void av1394_flushq(av1394_queue_t *q);
int av1394_qwait_sig(av1394_queue_t *q);
/* FCP */
int av1394_fcp_attach(av1394_inst_t *);
void av1394_fcp_detach(av1394_inst_t *);
int av1394_fcp_open(av1394_inst_t *, int);
int av1394_fcp_close(av1394_inst_t *, int);
/* config ROM */
int av1394_cfgrom_init(av1394_inst_t *);
void av1394_cfgrom_fini(av1394_inst_t *);
void av1394_cfgrom_close(av1394_inst_t *);
int av1394_ioctl_node_get_bus_name(av1394_inst_t *, void *, int);
int av1394_ioctl_node_get_uid(av1394_inst_t *, void *, int);
int av1394_ioctl_node_get_text_leaf(av1394_inst_t *, void *, int);
/* async module */
int av1394_async_attach(av1394_inst_t *);
void av1394_async_detach(av1394_inst_t *);
int av1394_async_cpr_resume(av1394_inst_t *);
void av1394_async_bus_reset(av1394_inst_t *);
void av1394_async_disconnect(av1394_inst_t *);
void av1394_async_reconnect(av1394_inst_t *);
int av1394_async_open(av1394_inst_t *, int);
int av1394_async_close(av1394_inst_t *, int);
int av1394_async_poll(av1394_inst_t *, short, int, short *,
struct pollhead **);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_1394_TARGETS_AV1394_IMPL_H */