av1394_impl.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2002-2003 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
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* av1394 driver definitions
*/
#include <sys/tnf_probe.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* double-linked list
*/
typedef struct av1394_list_item_s {
struct av1394_list_item_s *i_next;
struct av1394_list_item_s *i_prev;
typedef struct av1394_list_s {
int l_cnt; /* number of items */
/*
* queue
*/
typedef struct av1394_queue_s {
int q_size; /* current data size */
int q_max; /* max data size */
/*
* 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 */
#define AV1394_CFGROM_BUS_NAME_OFF 1
#define AV1394_CFGROM_EUI64_HI_OFF 3
#define AV1394_CFGROM_EUI64_LO_OFF 4
typedef struct av1394_cfgrom_text_leaf_s {
typedef struct av1394_cfgrom_parsed_dir_s {
int pd_tl_size; /* total # of array entries */
int pd_tl_next; /* first unused entry index */
typedef struct av1394_cfgrom_parse_arg_s {
int pa_depth; /* parser depth */
enum {
};
typedef struct av1394_cfgrom_s {
/*
* async command
*/
typedef struct av1394_async_cmd_s {
/*
* per-instance soft state structure
*/
typedef struct av1394_async_s {
int a_nopen; /* number of opens */
int a_oflag; /* open flags */
short a_pollevents; /* polled events */
}))
/* 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.
*/
AV1394_M_NOHDR = 0x80
};
/*
* 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 {
int av_instance; /* instance number */
}))
/* these are set during attach (single-threaded) and don't change afterwards */
}))
/*
* minor <-> instance mapping
*/
#define AV1394_DEV_IS_ISOCH(dev) \
#define AV1394_DEV_IS_ASYNC(dev) \
#define AV1394_DEV2INST(dev) \
/* misc constants */
enum {
AV1394_CLEANUP_LEVEL_MAX = 256
};
/* current interface version */
#define AV1394_IEC61883_VER IEC61883_V1_0
/* TNF probes */
#define AV1394_TNF_FCP "1394 av1394 fcp "
#define AV1394_TNF_FCP_STACK "1394 av1394 fcp stacktrace "
#define AV1394_TNF_FCP_ERROR "1394 av1394 fcp error "
#define AV1394_TNF_ASYNC "1394 av1394 async "
#define AV1394_TNF_ASYNC_STACK "1394 av1394 async stacktrace "
#define AV1394_TNF_ASYNC_ERROR "1394 av1394 async error "
#define AV1394_TNF_INST "1394 av1394 inst "
#define AV1394_TNF_INST_STACK "1394 av1394 inst stacktrace "
#define AV1394_TNF_INST_ERROR "1394 av1394 inst error "
/* 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 */