xref: /onnv-gate/usr/src/uts/common/sys/1394/targets/av1394/av1394_impl.h (revision 9117:47690dda53ee)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*9117SAlan.Perry@Sun.COM  * Common Development and Distribution License (the "License").
6*9117SAlan.Perry@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*9117SAlan.Perry@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef _SYS_1394_TARGETS_AV1394_IMPL_H
270Sstevel@tonic-gate #define	_SYS_1394_TARGETS_AV1394_IMPL_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * av1394 driver definitions
310Sstevel@tonic-gate  */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/note.h>
340Sstevel@tonic-gate #include <sys/ddi.h>
350Sstevel@tonic-gate #include <sys/sunddi.h>
360Sstevel@tonic-gate #include <sys/strsun.h>
370Sstevel@tonic-gate #include <sys/mkdev.h>
380Sstevel@tonic-gate #include <sys/tnf_probe.h>
390Sstevel@tonic-gate #include <sys/av/iec61883.h>
400Sstevel@tonic-gate #include <sys/1394/t1394.h>
410Sstevel@tonic-gate #include <sys/1394/targets/av1394/av1394_isoch.h>
420Sstevel@tonic-gate 
430Sstevel@tonic-gate #ifdef __cplusplus
440Sstevel@tonic-gate extern "C" {
450Sstevel@tonic-gate #endif
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /*
48*9117SAlan.Perry@Sun.COM  * byte swapping support, stolen from SBP2
49*9117SAlan.Perry@Sun.COM  */
50*9117SAlan.Perry@Sun.COM #ifdef _LITTLE_ENDIAN
51*9117SAlan.Perry@Sun.COM #define	AV_SWAP16(data) \
52*9117SAlan.Perry@Sun.COM 	((((data) & 0xff) << 8) | ((data) >> 8))
53*9117SAlan.Perry@Sun.COM 
54*9117SAlan.Perry@Sun.COM #define	AV_SWAP32(data) \
55*9117SAlan.Perry@Sun.COM 	(((uint32_t)AV_SWAP16((uint16_t)((data) & 0xffff)) << 16) |   \
56*9117SAlan.Perry@Sun.COM 	(uint32_t)AV_SWAP16((uint16_t)((data) >> 16)))
57*9117SAlan.Perry@Sun.COM #else
58*9117SAlan.Perry@Sun.COM #define	AV_SWAP16(data)	(data)
59*9117SAlan.Perry@Sun.COM #define	AV_SWAP32(data)	(data)
60*9117SAlan.Perry@Sun.COM #endif
61*9117SAlan.Perry@Sun.COM 
62*9117SAlan.Perry@Sun.COM 
63*9117SAlan.Perry@Sun.COM /*
640Sstevel@tonic-gate  * double-linked list
650Sstevel@tonic-gate  */
660Sstevel@tonic-gate typedef struct av1394_list_item_s {
670Sstevel@tonic-gate 	struct av1394_list_item_s	*i_next;
680Sstevel@tonic-gate 	struct av1394_list_item_s	*i_prev;
690Sstevel@tonic-gate } av1394_list_item_t;
700Sstevel@tonic-gate 
710Sstevel@tonic-gate typedef struct av1394_list_s {
720Sstevel@tonic-gate 	av1394_list_item_t	*l_head;	/* first item */
730Sstevel@tonic-gate 	av1394_list_item_t	*l_tail;	/* last item */
740Sstevel@tonic-gate 	int			l_cnt;		/* number of items */
750Sstevel@tonic-gate } av1394_list_t;
760Sstevel@tonic-gate 
770Sstevel@tonic-gate 
780Sstevel@tonic-gate /*
790Sstevel@tonic-gate  * queue
800Sstevel@tonic-gate  */
810Sstevel@tonic-gate typedef struct av1394_queue_s {
820Sstevel@tonic-gate 	kmutex_t	q_mutex;	/* mutex */
830Sstevel@tonic-gate 	av1394_list_t	q_list;		/* list of mblk's */
840Sstevel@tonic-gate 	int		q_size;		/* current data size */
850Sstevel@tonic-gate 	int		q_max;		/* max data size */
860Sstevel@tonic-gate 	kcondvar_t	q_cv;		/* data cv */
870Sstevel@tonic-gate } av1394_queue_t;
880Sstevel@tonic-gate 
890Sstevel@tonic-gate _NOTE(MUTEX_PROTECTS_DATA(av1394_queue_s::q_mutex, av1394_queue_s))
900Sstevel@tonic-gate 
910Sstevel@tonic-gate #define	AV1394_ENTERQ(q)	mutex_enter(&(q)->q_mutex)
920Sstevel@tonic-gate #define	AV1394_LEAVEQ(q)	mutex_exit(&(q)->q_mutex)
930Sstevel@tonic-gate 
940Sstevel@tonic-gate 
950Sstevel@tonic-gate /*
960Sstevel@tonic-gate  * asynchronous module definitions
970Sstevel@tonic-gate  *
980Sstevel@tonic-gate  *
990Sstevel@tonic-gate  * command structure
1000Sstevel@tonic-gate  */
1010Sstevel@tonic-gate typedef struct av1394_fcp_cmd_s {
1020Sstevel@tonic-gate 	cmd1394_cmd_t	*fc_cmd;	/* 1394 command */
1030Sstevel@tonic-gate 	boolean_t	fc_busy;	/* command is in use */
1040Sstevel@tonic-gate 	kcondvar_t	fc_busy_cv;	/* busy cv */
1050Sstevel@tonic-gate 	boolean_t	fc_xmit;	/* transmit in progress */
1060Sstevel@tonic-gate 	kcondvar_t	fc_xmit_cv;	/* transmit completion cv */
1070Sstevel@tonic-gate } av1394_fcp_cmd_t;
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate /*
1100Sstevel@tonic-gate  * per-instance FCP structure
1110Sstevel@tonic-gate  */
1120Sstevel@tonic-gate typedef struct av1394_fcp_s {
1130Sstevel@tonic-gate 	av1394_fcp_cmd_t	fcp_cmd;	/* outgoing FCP command */
1140Sstevel@tonic-gate 	av1394_fcp_cmd_t	fcp_resp;	/* outgoing FCP response */
1150Sstevel@tonic-gate } av1394_fcp_t;
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate enum {
1180Sstevel@tonic-gate 	AV1394_FCP_ARQ_LEN_MAX	 = 0x200	/* maximum FCP ARQ length */
1190Sstevel@tonic-gate };
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate 
1220Sstevel@tonic-gate /*
1230Sstevel@tonic-gate  * configuration ROM
1240Sstevel@tonic-gate  */
1250Sstevel@tonic-gate #define	AV1394_CFGROM_INFO_LEN_ADDR	(IEEE1394_CONFIG_ROM_ADDR + 0x00)
1260Sstevel@tonic-gate #define	AV1394_CFGROM_BUS_NAME_ADDR	(IEEE1394_CONFIG_ROM_ADDR + 0x04)
1270Sstevel@tonic-gate #define	AV1394_CFGROM_EUI64_HI_ADDR	(IEEE1394_CONFIG_ROM_ADDR + 0x0c)
1280Sstevel@tonic-gate #define	AV1394_CFGROM_EUI64_LO_ADDR	(IEEE1394_CONFIG_ROM_ADDR + 0x10)
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate /* offsets in quadlets */
1310Sstevel@tonic-gate #define	AV1394_CFGROM_BUS_NAME_OFF	1
1320Sstevel@tonic-gate #define	AV1394_CFGROM_EUI64_HI_OFF	3
1330Sstevel@tonic-gate #define	AV1394_CFGROM_EUI64_LO_OFF	4
1340Sstevel@tonic-gate 
1350Sstevel@tonic-gate typedef struct av1394_cfgrom_text_leaf_s {
1360Sstevel@tonic-gate 	uint64_t	tl_addr;	/* leaf entry address */
1370Sstevel@tonic-gate 	uint32_t	tl_desc_entry;	/* entry described by this leaf */
1380Sstevel@tonic-gate } av1394_cfgrom_text_leaf_t;
1390Sstevel@tonic-gate 
1400Sstevel@tonic-gate typedef struct av1394_cfgrom_parsed_dir_s {
1410Sstevel@tonic-gate 	av1394_cfgrom_text_leaf_t *pd_tl;	/* text leaf array */
1420Sstevel@tonic-gate 	int			pd_tl_size;	/* total # of array entries */
1430Sstevel@tonic-gate 	int			pd_tl_next;	/* first unused entry index */
1440Sstevel@tonic-gate } av1394_cfgrom_parsed_dir_t;
1450Sstevel@tonic-gate 
1460Sstevel@tonic-gate typedef struct av1394_cfgrom_parse_arg_s {
1470Sstevel@tonic-gate 	int			pa_depth;	/* parser depth */
1480Sstevel@tonic-gate 	uint32_t		pa_desc_entry;	/* described entry */
1490Sstevel@tonic-gate 	uint8_t			pa_parent_k;	/* parent entry's key value */
1500Sstevel@tonic-gate 	uint64_t		pa_addr;	/* directory address */
1510Sstevel@tonic-gate 	uint16_t		pa_len;		/* directory length */
1520Sstevel@tonic-gate 	av1394_cfgrom_parsed_dir_t *pa_dir;	/* current directory */
1530Sstevel@tonic-gate } av1394_cfgrom_parse_arg_t;
1540Sstevel@tonic-gate 
1550Sstevel@tonic-gate enum {
1560Sstevel@tonic-gate 	AV1394_CFGROM_PARSE_MAX_DEPTH	= 5	/* maximum parse depth */
1570Sstevel@tonic-gate };
1580Sstevel@tonic-gate 
1590Sstevel@tonic-gate typedef struct av1394_cfgrom_s {
1600Sstevel@tonic-gate 	krwlock_t		cr_rwlock;	/* structure lock */
1610Sstevel@tonic-gate 	boolean_t		cr_parsed;	/* node ConfigROM was parsed */
1620Sstevel@tonic-gate 	av1394_cfgrom_parsed_dir_t cr_root_dir;	/* root directory */
1630Sstevel@tonic-gate 	av1394_cfgrom_parsed_dir_t cr_unit_dir;	/* unit directory */
1640Sstevel@tonic-gate } av1394_cfgrom_t;
1650Sstevel@tonic-gate 
1660Sstevel@tonic-gate 
1670Sstevel@tonic-gate /*
1680Sstevel@tonic-gate  * async command
1690Sstevel@tonic-gate  */
1700Sstevel@tonic-gate typedef struct av1394_async_cmd_s {
1710Sstevel@tonic-gate 	kmutex_t	ac_mutex;
1720Sstevel@tonic-gate 	boolean_t	ac_busy;
1730Sstevel@tonic-gate 	kcondvar_t	ac_cv;
1740Sstevel@tonic-gate 	cmd1394_cmd_t	*ac_cmd;
1750Sstevel@tonic-gate } av1394_async_cmd_t;
1760Sstevel@tonic-gate 
1770Sstevel@tonic-gate /*
1780Sstevel@tonic-gate  * per-instance soft state structure
1790Sstevel@tonic-gate  */
1800Sstevel@tonic-gate typedef struct av1394_async_s {
1810Sstevel@tonic-gate 	kmutex_t		a_mutex;	/* structure mutex */
1820Sstevel@tonic-gate 	int			a_nopen;	/* number of opens */
1830Sstevel@tonic-gate 	int			a_oflag;	/* open flags */
1840Sstevel@tonic-gate 	t1394_targetinfo_t	a_targetinfo;	/* target info */
1850Sstevel@tonic-gate 	uint_t			a_bus_generation; /* bus generation */
1860Sstevel@tonic-gate 	av1394_fcp_t		a_fcp;		/* FCP module */
1870Sstevel@tonic-gate 	av1394_cfgrom_t		a_cfgrom;	/* config ROM module */
1880Sstevel@tonic-gate 	av1394_queue_t		a_rq;		/* read queue */
1890Sstevel@tonic-gate 	struct pollhead		a_pollhead;	/* poll(2) support */
1900Sstevel@tonic-gate 	short			a_pollevents;	/* polled events */
1910Sstevel@tonic-gate } av1394_async_t;
1920Sstevel@tonic-gate 
1930Sstevel@tonic-gate _NOTE(MUTEX_PROTECTS_DATA(av1394_async_s::a_mutex, av1394_async_s))
1940Sstevel@tonic-gate _NOTE(DATA_READABLE_WITHOUT_LOCK(av1394_async_s::{
1950Sstevel@tonic-gate 	a_oflag
1960Sstevel@tonic-gate }))
1970Sstevel@tonic-gate 
1980Sstevel@tonic-gate 
1990Sstevel@tonic-gate /* we use special message types for the read queue */
2000Sstevel@tonic-gate enum {
2010Sstevel@tonic-gate 	AV1394_M_FCP_RESP	= 0x01,	/* FCP response */
2020Sstevel@tonic-gate 	AV1394_M_FCP_CMD	= 0x02,	/* FCP command */
2030Sstevel@tonic-gate 	AV1394_M_BUS_RESET	= 0x03,	/* bus reset event */
2040Sstevel@tonic-gate 	/*
2050Sstevel@tonic-gate 	 * For efficiency, we only store 1394 request data on the read queue.
2060Sstevel@tonic-gate 	 * ARQ headers (iec61883_arq_t) are generated when an application
2070Sstevel@tonic-gate 	 * calls read(2). Because applications may read header separately
2080Sstevel@tonic-gate 	 * from the data, we need to mark each mblk when its header was read
2090Sstevel@tonic-gate 	 * but not the data - the following flag is used for this purpose.
2100Sstevel@tonic-gate 	 */
2110Sstevel@tonic-gate 	AV1394_M_NOHDR		= 0x80
2120Sstevel@tonic-gate };
2130Sstevel@tonic-gate 
2140Sstevel@tonic-gate #define	AV1394_DBTYPE(bp)	(DB_TYPE(bp) & ~AV1394_M_NOHDR)
2150Sstevel@tonic-gate #define	AV1394_MARK_NOHDR(bp)	(DB_TYPE(bp) |= AV1394_M_NOHDR)
2160Sstevel@tonic-gate #define	AV1394_IS_NOHDR(bp)	(DB_TYPE(bp) & AV1394_M_NOHDR)
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate 
2190Sstevel@tonic-gate /*
2200Sstevel@tonic-gate  * device state:
2210Sstevel@tonic-gate  *
2220Sstevel@tonic-gate  *                     AV1394_DEV_DISCONNECTED
2230Sstevel@tonic-gate  *                     |                |   ^
2240Sstevel@tonic-gate  *                     |                |   |
2250Sstevel@tonic-gate  *                  detach       reconnect disconnect
2260Sstevel@tonic-gate  *                     |                |   |
2270Sstevel@tonic-gate  *                     v                v   |
2280Sstevel@tonic-gate  *       AV1394_DEV_INIT ----attach---> AV1394_DEV_ONLINE
2290Sstevel@tonic-gate  *      (initial state)  <---detach---  |   ^
2300Sstevel@tonic-gate  *                                      |   |
2310Sstevel@tonic-gate  *                             cpr suspend cpr resume
2320Sstevel@tonic-gate  *                                      |   |
2330Sstevel@tonic-gate  *                                      v   |
2340Sstevel@tonic-gate  *                        AV1394_DEV_SUSPENDED
2350Sstevel@tonic-gate  */
2360Sstevel@tonic-gate typedef enum {
2370Sstevel@tonic-gate 	AV1394_DEV_INIT		= 0,
2380Sstevel@tonic-gate 	AV1394_DEV_ONLINE,
2390Sstevel@tonic-gate 	AV1394_DEV_SUSPENDED,
2400Sstevel@tonic-gate 	AV1394_DEV_DISCONNECTED
2410Sstevel@tonic-gate } av1394_dev_state_t;
2420Sstevel@tonic-gate 
2430Sstevel@tonic-gate /*
2440Sstevel@tonic-gate  * per-instance soft state structure
2450Sstevel@tonic-gate  */
2460Sstevel@tonic-gate typedef struct av1394_inst_s {
2470Sstevel@tonic-gate 	kmutex_t		av_mutex;	/* structure mutex */
2480Sstevel@tonic-gate 	dev_info_t		*av_dip;	/* device information */
2490Sstevel@tonic-gate 	int			av_instance;	/* instance number */
2500Sstevel@tonic-gate 	av1394_dev_state_t	av_dev_state;	/* device state */
2510Sstevel@tonic-gate 	av1394_dev_state_t	av_prev_dev_state; /* previous device state */
2520Sstevel@tonic-gate 	t1394_attachinfo_t	av_attachinfo;	/* 1394 attach info */
2530Sstevel@tonic-gate 	t1394_handle_t		av_t1394_hdl;	/* 1394 handle */
2540Sstevel@tonic-gate 	av1394_async_t		av_a;		/* asynchronous module */
2550Sstevel@tonic-gate 	av1394_isoch_t		av_i;		/* isochronous module */
2560Sstevel@tonic-gate 	ddi_callback_id_t	av_reset_cb;	/* reset event cb id */
2570Sstevel@tonic-gate 	ddi_callback_id_t	av_remove_cb; 	/* remove event cb id */
2580Sstevel@tonic-gate 	ddi_callback_id_t	av_insert_cb;	/* insert event cb id */
2590Sstevel@tonic-gate } av1394_inst_t;
2600Sstevel@tonic-gate 
2610Sstevel@tonic-gate _NOTE(MUTEX_PROTECTS_DATA(av1394_inst_s::av_mutex, av1394_inst_s::{
2620Sstevel@tonic-gate 	av_dip
2630Sstevel@tonic-gate 	av_instance
2640Sstevel@tonic-gate 	av_attachinfo
2650Sstevel@tonic-gate 	av_t1394_hdl
2660Sstevel@tonic-gate }))
2670Sstevel@tonic-gate /* these are set during attach (single-threaded) and don't change afterwards */
2680Sstevel@tonic-gate _NOTE(DATA_READABLE_WITHOUT_LOCK(av1394_inst_s::{
2690Sstevel@tonic-gate 	av_dip
2700Sstevel@tonic-gate 	av_instance
2710Sstevel@tonic-gate 	av_attachinfo
2720Sstevel@tonic-gate 	av_t1394_hdl
2730Sstevel@tonic-gate }))
2740Sstevel@tonic-gate 
2750Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("one per call", msgb datab cmd1394_cmd
2760Sstevel@tonic-gate 	iec61883_arq_t iec61883_isoch_init_t iec61883_plug_init_t))
2770Sstevel@tonic-gate 
2780Sstevel@tonic-gate /*
2790Sstevel@tonic-gate  * minor <-> instance mapping
2800Sstevel@tonic-gate  */
2810Sstevel@tonic-gate #define	AV1394_MINOR_TYPE_MASK		(1 << (NBITSMINOR32 - 1))
2820Sstevel@tonic-gate #define	AV1394_ISOCH_INST2MINOR(inst)	(inst)
2830Sstevel@tonic-gate #define	AV1394_ASYNC_INST2MINOR(inst)	((inst) | AV1394_MINOR_TYPE_MASK)
2840Sstevel@tonic-gate #define	AV1394_DEV_IS_ISOCH(dev)	\
2850Sstevel@tonic-gate 		((getminor(dev) & AV1394_MINOR_TYPE_MASK) == 0)
2860Sstevel@tonic-gate #define	AV1394_DEV_IS_ASYNC(dev)	\
2870Sstevel@tonic-gate 		((getminor(dev) & AV1394_MINOR_TYPE_MASK) != 0)
2880Sstevel@tonic-gate #define	AV1394_DEV2INST(dev)		\
2890Sstevel@tonic-gate 		((getminor(dev)) & ~AV1394_MINOR_TYPE_MASK)
2900Sstevel@tonic-gate 
2910Sstevel@tonic-gate /* misc constants */
2920Sstevel@tonic-gate enum {
2930Sstevel@tonic-gate 	AV1394_CLEANUP_LEVEL_MAX	= 256
2940Sstevel@tonic-gate };
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate /* current interface version */
2970Sstevel@tonic-gate #define	AV1394_IEC61883_VER		IEC61883_V1_0
2980Sstevel@tonic-gate 
2990Sstevel@tonic-gate /* TNF probes */
3000Sstevel@tonic-gate #define	AV1394_TNF_FCP			"1394 av1394 fcp "
3010Sstevel@tonic-gate #define	AV1394_TNF_FCP_STACK		"1394 av1394 fcp stacktrace "
3020Sstevel@tonic-gate #define	AV1394_TNF_FCP_ERROR		"1394 av1394 fcp error "
3030Sstevel@tonic-gate #define	AV1394_TNF_ASYNC		"1394 av1394 async "
3040Sstevel@tonic-gate #define	AV1394_TNF_ASYNC_STACK		"1394 av1394 async stacktrace "
3050Sstevel@tonic-gate #define	AV1394_TNF_ASYNC_ERROR		"1394 av1394 async error "
3060Sstevel@tonic-gate #define	AV1394_TNF_INST			"1394 av1394 inst "
3070Sstevel@tonic-gate #define	AV1394_TNF_INST_STACK		"1394 av1394 inst stacktrace "
3080Sstevel@tonic-gate #define	AV1394_TNF_INST_ERROR		"1394 av1394 inst error "
3090Sstevel@tonic-gate 
3100Sstevel@tonic-gate /* misc */
3110Sstevel@tonic-gate #define	NELEM(a)	(sizeof (a) / sizeof (*(a)))
3120Sstevel@tonic-gate 
3130Sstevel@tonic-gate 
3140Sstevel@tonic-gate /* double-linked list */
3150Sstevel@tonic-gate void	av1394_list_init(av1394_list_t *lp);
3160Sstevel@tonic-gate void	*av1394_list_head(av1394_list_t *lp);
3170Sstevel@tonic-gate void	av1394_list_put_tail(av1394_list_t *lp, void *item);
3180Sstevel@tonic-gate void	av1394_list_put_head(av1394_list_t *lp, void *item);
3190Sstevel@tonic-gate void	*av1394_list_get_head(av1394_list_t *lp);
3200Sstevel@tonic-gate 
3210Sstevel@tonic-gate /* queue */
3220Sstevel@tonic-gate void	av1394_initq(av1394_queue_t *q, ddi_iblock_cookie_t ibc, int max);
3230Sstevel@tonic-gate void	av1394_destroyq(av1394_queue_t *q);
3240Sstevel@tonic-gate void	av1394_setmaxq(av1394_queue_t *q, int max);
3250Sstevel@tonic-gate int	av1394_getmaxq(av1394_queue_t *q);
3260Sstevel@tonic-gate void	av1394_flushq(av1394_queue_t *q);
3270Sstevel@tonic-gate int	av1394_putq(av1394_queue_t *q, mblk_t *bp);
3280Sstevel@tonic-gate int	av1394_putbq(av1394_queue_t *q, mblk_t *bp);
3290Sstevel@tonic-gate mblk_t	*av1394_getq(av1394_queue_t *q);
3300Sstevel@tonic-gate mblk_t	*av1394_peekq(av1394_queue_t *q);
3310Sstevel@tonic-gate mblk_t	*av1394_peekq_locked(av1394_queue_t *q);
3320Sstevel@tonic-gate int	av1394_qwait_sig(av1394_queue_t *q);
3330Sstevel@tonic-gate 
3340Sstevel@tonic-gate /* FCP */
3350Sstevel@tonic-gate int	av1394_fcp_attach(av1394_inst_t *);
3360Sstevel@tonic-gate void	av1394_fcp_detach(av1394_inst_t *);
3370Sstevel@tonic-gate int	av1394_fcp_open(av1394_inst_t *, int);
3380Sstevel@tonic-gate int	av1394_fcp_close(av1394_inst_t *, int);
3390Sstevel@tonic-gate int	av1394_fcp_write(av1394_inst_t *, iec61883_arq_t *, struct uio *);
3400Sstevel@tonic-gate 
3410Sstevel@tonic-gate /* config ROM */
3420Sstevel@tonic-gate int	av1394_cfgrom_init(av1394_inst_t *);
3430Sstevel@tonic-gate void	av1394_cfgrom_fini(av1394_inst_t *);
3440Sstevel@tonic-gate void	av1394_cfgrom_close(av1394_inst_t *);
3450Sstevel@tonic-gate int	av1394_ioctl_node_get_bus_name(av1394_inst_t *, void *, int);
3460Sstevel@tonic-gate int	av1394_ioctl_node_get_uid(av1394_inst_t *, void *, int);
3470Sstevel@tonic-gate int	av1394_ioctl_node_get_text_leaf(av1394_inst_t *, void *, int);
3480Sstevel@tonic-gate 
3490Sstevel@tonic-gate /* async module */
3500Sstevel@tonic-gate int	av1394_async_attach(av1394_inst_t *);
3510Sstevel@tonic-gate void	av1394_async_detach(av1394_inst_t *);
3520Sstevel@tonic-gate int	av1394_async_cpr_suspend(av1394_inst_t *);
3530Sstevel@tonic-gate int	av1394_async_cpr_resume(av1394_inst_t *);
3540Sstevel@tonic-gate void	av1394_async_bus_reset(av1394_inst_t *);
3550Sstevel@tonic-gate void	av1394_async_disconnect(av1394_inst_t *);
3560Sstevel@tonic-gate void	av1394_async_reconnect(av1394_inst_t *);
3570Sstevel@tonic-gate int	av1394_async_open(av1394_inst_t *, int);
3580Sstevel@tonic-gate int	av1394_async_close(av1394_inst_t *, int);
3590Sstevel@tonic-gate int	av1394_async_read(av1394_inst_t *, struct uio *);
3600Sstevel@tonic-gate int	av1394_async_write(av1394_inst_t *, struct uio *);
3610Sstevel@tonic-gate int	av1394_async_ioctl(av1394_inst_t *, int, intptr_t, int, int *);
3620Sstevel@tonic-gate int	av1394_async_poll(av1394_inst_t *, short, int, short *,
3630Sstevel@tonic-gate 		struct pollhead **);
3640Sstevel@tonic-gate void	av1394_async_putq_rq(av1394_inst_t *, mblk_t *);
3650Sstevel@tonic-gate 
3660Sstevel@tonic-gate #ifdef __cplusplus
3670Sstevel@tonic-gate }
3680Sstevel@tonic-gate #endif
3690Sstevel@tonic-gate 
3700Sstevel@tonic-gate #endif /* _SYS_1394_TARGETS_AV1394_IMPL_H */
371