125cf1a3jl/*
225cf1a3jl * CDDL HEADER START
325cf1a3jl *
425cf1a3jl * The contents of this file are subject to the terms of the
525cf1a3jl * Common Development and Distribution License (the "License").
625cf1a3jl * You may not use this file except in compliance with the License.
725cf1a3jl *
825cf1a3jl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
925cf1a3jl * or http://www.opensolaris.org/os/licensing.
1025cf1a3jl * See the License for the specific language governing permissions
1125cf1a3jl * and limitations under the License.
1225cf1a3jl *
1325cf1a3jl * When distributing Covered Code, include this CDDL HEADER in each
1425cf1a3jl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1525cf1a3jl * If applicable, add the following below this CDDL HEADER, with the
1625cf1a3jl * fields enclosed by brackets "[]" replaced with your own identifying
1725cf1a3jl * information: Portions Copyright [yyyy] [name of copyright owner]
1825cf1a3jl *
1925cf1a3jl * CDDL HEADER END
2025cf1a3jl */
2125cf1a3jl/*
2225cf1a3jl * All Rights Reserved, Copyright (c) FUJITSU LIMITED 2006
2325cf1a3jl */
2425cf1a3jl
2525cf1a3jl#ifndef _OPLMSU_PROTO_H
2625cf1a3jl#define	_OPLMSU_PROTO_H
2725cf1a3jl
2825cf1a3jl#pragma ident	"%Z%%M%	%I%	%E% SMI"
2925cf1a3jl
3025cf1a3jl#ifdef __cplusplus
3125cf1a3jlextern "C" {
3225cf1a3jl#endif
3325cf1a3jl
3425cf1a3jl/*
3525cf1a3jl *	PROTOTYPE DECLARATIONS
3625cf1a3jl */
3725cf1a3jl
3825cf1a3jlint	oplmsu_attach(dev_info_t *, ddi_attach_cmd_t);
3925cf1a3jlint	oplmsu_detach(dev_info_t *, ddi_detach_cmd_t);
4025cf1a3jlint	oplmsu_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **);
4125cf1a3jlint	oplmsu_open(queue_t *, dev_t *, int, int, cred_t *);
4225cf1a3jlint	oplmsu_close(queue_t *, int, cred_t *);
4325cf1a3jlint	oplmsu_uwput(queue_t *, mblk_t *);
4425cf1a3jlint	oplmsu_uwsrv(queue_t *);
4525cf1a3jlint	oplmsu_lwsrv(queue_t *);
4625cf1a3jlint	oplmsu_lrput(queue_t *, mblk_t *);
4725cf1a3jlint	oplmsu_lrsrv(queue_t *);
4825cf1a3jlint	oplmsu_ursrv(queue_t *);
4925cf1a3jl
5025cf1a3jlint	oplmsu_open_msu(dev_info_t *, ldi_ident_t *, ldi_handle_t *);
5125cf1a3jlint	oplmsu_plink_serial(dev_info_t *, ldi_handle_t, int *);
5225cf1a3jlint	oplmsu_set_lpathnum(int, int);
5325cf1a3jlint	oplmsu_dr_attach(dev_info_t *);
5425cf1a3jlint	oplmsu_dr_detach(dev_info_t *);
5525cf1a3jlint	oplmsu_find_serial(ser_devl_t **);
5625cf1a3jldev_info_t *oplmsu_find_ser_dip(dev_info_t *);
5725cf1a3jlvoid	oplmsu_conf_stream(uinst_t *);
5825cf1a3jlvoid	oplmsu_unlinks(ldi_handle_t, int *, int);
5925cf1a3jlvoid	oplmsu_setup(uinst_t *);
6025cf1a3jlint	oplmsu_create_upath(dev_info_t *);
6125cf1a3jlint	oplmsu_config_new(struct msu_path *);
6225cf1a3jlint	oplmsu_config_add(dev_info_t *);
6325cf1a3jlint	oplmsu_config_del(struct msu_path *);
6425cf1a3jlint	oplmsu_config_stop(int);
6525cf1a3jlint	oplmsu_config_start(int);
6625cf1a3jlint	oplmsu_config_disc(int);
6725cf1a3jl
6825cf1a3jl/*
6925cf1a3jl *	UPPER WRITE SERVICE PROCEDURE
7025cf1a3jl */
7125cf1a3jlint	oplmsu_uwioctl_iplink(queue_t *, mblk_t *);
7225cf1a3jlint	oplmsu_uwioctl_ipunlink(queue_t *, mblk_t *);
7325cf1a3jlint	oplmsu_uwioctl_termios(queue_t *, mblk_t *);
7425cf1a3jl
7525cf1a3jl/*
7625cf1a3jl *	LOWER READ SERVICE PROCEDURE
7725cf1a3jl */
7825cf1a3jlint	oplmsu_lrioctl_termios(queue_t *, mblk_t *);
7925cf1a3jlint	oplmsu_lrmsg_error(queue_t *, mblk_t *);
8025cf1a3jlint	oplmsu_lrdata_xoffxon(queue_t *, mblk_t *);
8125cf1a3jl
8225cf1a3jl/*
8325cf1a3jl *	COMMON FUNCTIONS
8425cf1a3jl */
8525cf1a3jlvoid	oplmsu_link_upath(upath_t *);
8625cf1a3jlvoid	oplmsu_unlink_upath(upath_t *);
8725cf1a3jlvoid	oplmsu_link_lpath(lpath_t *);
8825cf1a3jlvoid	oplmsu_unlink_lpath(lpath_t *);
8925cf1a3jlvoid	oplmsu_link_high_primsg(mblk_t **, mblk_t **, mblk_t *);
9025cf1a3jlint	oplmsu_check_lpath_usable(void);
9125cf1a3jlupath_t	*oplmsu_search_upath_info(int);
9225cf1a3jl
9325cf1a3jlvoid	oplmsu_iocack(queue_t *, mblk_t *, int);
9425cf1a3jlvoid	oplmsu_delete_upath_info(void);
9525cf1a3jlint 	oplmsu_set_ioctl_path(lpath_t *, queue_t *, mblk_t *);
9625cf1a3jlvoid	oplmsu_clear_ioctl_path(lpath_t *);
9725cf1a3jl
9825cf1a3jlint	oplmsu_get_inst_status(void);
9925cf1a3jlupath_t	*oplmsu_search_standby(void);
10025cf1a3jlvoid	oplmsu_search_min_stop_path(void);
10125cf1a3jlint	oplmsu_get_pathnum(void);
10225cf1a3jlint	oplmsu_cmn_put_xoffxon(queue_t *, int);
10325cf1a3jlvoid	oplmsu_cmn_putxoff_standby(void);
10425cf1a3jlvoid	oplmsu_cmn_set_mflush(mblk_t *);
10525cf1a3jlvoid	oplmsu_cmn_set_upath_sts(upath_t *, int, int, ulong_t);
10625cf1a3jlint	oplmsu_cmn_allocmb(queue_t *, mblk_t *, mblk_t **, size_t, int);
10725cf1a3jlint	oplmsu_cmn_copymb(queue_t *, mblk_t *, mblk_t **, mblk_t *, int);
10825cf1a3jlvoid	oplmsu_cmn_bufcall(queue_t *, mblk_t *, size_t, int);
10925cf1a3jlint	oplmsu_cmn_prechg(queue_t *, mblk_t *, int, mblk_t **, int *, int *);
11025cf1a3jlint	oplmsu_stop_prechg(mblk_t **, int *, int *);
11125cf1a3jlint	oplmsu_cmn_prechg_termio(queue_t *, mblk_t *, int, int, mblk_t **,
11225cf1a3jl	    int *);
11325cf1a3jlint	oplmsu_cmn_pullup_msg(queue_t *, mblk_t *);
11425cf1a3jl
11525cf1a3jlvoid	oplmsu_cmn_wakeup(queue_t *);
11625cf1a3jlvoid	oplmsu_cmn_bufcb(void *);
11725cf1a3jlvoid	oplmsu_wbufcb_posthndl(ctrl_t *);
11825cf1a3jl
11925cf1a3jl/*
12025cf1a3jl *	common functions for write stream
12125cf1a3jl */
12225cf1a3jlint	oplmsu_wcmn_chknode(queue_t *, int, mblk_t *);
12325cf1a3jlvoid	oplmsu_wcmn_flush_hndl(queue_t *, mblk_t *, krw_t);
12425cf1a3jlint	oplmsu_wcmn_through_hndl(queue_t *, mblk_t *, int, krw_t);
12525cf1a3jlmblk_t	*oplmsu_wcmn_high_getq(queue_t *);
12625cf1a3jlvoid	oplmsu_wcmn_norm_putbq(queue_t *, mblk_t *, queue_t *);
12725cf1a3jlvoid	oplmsu_wcmn_high_qenable(queue_t *, krw_t);
12825cf1a3jl
12925cf1a3jl/*
13025cf1a3jl *	common functions for read stream
13125cf1a3jl */
13225cf1a3jlvoid	oplmsu_rcmn_flush_hndl(queue_t *, mblk_t *);
13325cf1a3jlint	oplmsu_rcmn_through_hndl(queue_t *, mblk_t *, int);
13425cf1a3jlvoid	oplmsu_rcmn_high_qenable(queue_t *);
13525cf1a3jl
13625cf1a3jl
13725cf1a3jl#ifdef DEBUG
13825cf1a3jlvoid	oplmsu_cmn_trace(queue_t *, mblk_t *, int);
13925cf1a3jlvoid	oplmsu_cmn_msglog(mblk_t *, int);
14025cf1a3jlvoid	oplmsu_cmn_prt_pathname(dev_info_t *);
14125cf1a3jl#endif
14225cf1a3jl
14325cf1a3jl
14425cf1a3jl/*
14525cf1a3jl *	GLOBAL VARIABLES
14625cf1a3jl */
14725cf1a3jlextern	uinst_t		*oplmsu_uinst;
14825cf1a3jlextern	int		oplmsu_queue_flag;
14925cf1a3jlextern	int		oplmsu_check_su;
15025cf1a3jl
15125cf1a3jl#ifdef DEBUG
15225cf1a3jlextern	int		oplmsu_debug_mode;
15325cf1a3jlextern	int		oplmsu_trace_on;
15425cf1a3jlextern	uint_t		oplmsu_ltrc_size;
15525cf1a3jlextern	msu_trc_t	*oplmsu_ltrc_top;
15625cf1a3jlextern	msu_trc_t	*oplmsu_ltrc_tail;
15725cf1a3jlextern	msu_trc_t	*oplmsu_ltrc_cur;
15825cf1a3jlextern	ulong_t		oplmsu_ltrc_ccnt;
15925cf1a3jlextern	kmutex_t	oplmsu_ltrc_lock;
16025cf1a3jl#endif
16125cf1a3jl
16225cf1a3jl#ifdef __cplusplus
16325cf1a3jl}
16425cf1a3jl#endif
16525cf1a3jl
16625cf1a3jl#endif	/* _OPLMSU_PROTO_H */
167