xref: /onnv-gate/usr/src/uts/sun4u/opl/sys/oplmsu/oplmsu_proto.h (revision 1772:78cca3d2cc4b)
1*1772Sjl139090 /*
2*1772Sjl139090  * CDDL HEADER START
3*1772Sjl139090  *
4*1772Sjl139090  * The contents of this file are subject to the terms of the
5*1772Sjl139090  * Common Development and Distribution License (the "License").
6*1772Sjl139090  * You may not use this file except in compliance with the License.
7*1772Sjl139090  *
8*1772Sjl139090  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1772Sjl139090  * or http://www.opensolaris.org/os/licensing.
10*1772Sjl139090  * See the License for the specific language governing permissions
11*1772Sjl139090  * and limitations under the License.
12*1772Sjl139090  *
13*1772Sjl139090  * When distributing Covered Code, include this CDDL HEADER in each
14*1772Sjl139090  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1772Sjl139090  * If applicable, add the following below this CDDL HEADER, with the
16*1772Sjl139090  * fields enclosed by brackets "[]" replaced with your own identifying
17*1772Sjl139090  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1772Sjl139090  *
19*1772Sjl139090  * CDDL HEADER END
20*1772Sjl139090  */
21*1772Sjl139090 /*
22*1772Sjl139090  * All Rights Reserved, Copyright (c) FUJITSU LIMITED 2006
23*1772Sjl139090  */
24*1772Sjl139090 
25*1772Sjl139090 #ifndef _OPLMSU_PROTO_H
26*1772Sjl139090 #define	_OPLMSU_PROTO_H
27*1772Sjl139090 
28*1772Sjl139090 #pragma ident	"%Z%%M%	%I%	%E% SMI"
29*1772Sjl139090 
30*1772Sjl139090 #ifdef __cplusplus
31*1772Sjl139090 extern "C" {
32*1772Sjl139090 #endif
33*1772Sjl139090 
34*1772Sjl139090 /*
35*1772Sjl139090  *	PROTOTYPE DECLARATIONS
36*1772Sjl139090  */
37*1772Sjl139090 
38*1772Sjl139090 int	oplmsu_attach(dev_info_t *, ddi_attach_cmd_t);
39*1772Sjl139090 int	oplmsu_detach(dev_info_t *, ddi_detach_cmd_t);
40*1772Sjl139090 int	oplmsu_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **);
41*1772Sjl139090 int	oplmsu_open(queue_t *, dev_t *, int, int, cred_t *);
42*1772Sjl139090 int	oplmsu_close(queue_t *, int, cred_t *);
43*1772Sjl139090 int	oplmsu_uwput(queue_t *, mblk_t *);
44*1772Sjl139090 int	oplmsu_uwsrv(queue_t *);
45*1772Sjl139090 int	oplmsu_lwsrv(queue_t *);
46*1772Sjl139090 int	oplmsu_lrput(queue_t *, mblk_t *);
47*1772Sjl139090 int	oplmsu_lrsrv(queue_t *);
48*1772Sjl139090 int	oplmsu_ursrv(queue_t *);
49*1772Sjl139090 
50*1772Sjl139090 int	oplmsu_open_msu(dev_info_t *, ldi_ident_t *, ldi_handle_t *);
51*1772Sjl139090 int	oplmsu_plink_serial(dev_info_t *, ldi_handle_t, int *);
52*1772Sjl139090 int	oplmsu_set_lpathnum(int, int);
53*1772Sjl139090 int	oplmsu_dr_attach(dev_info_t *);
54*1772Sjl139090 int	oplmsu_dr_detach(dev_info_t *);
55*1772Sjl139090 int	oplmsu_find_serial(ser_devl_t **);
56*1772Sjl139090 dev_info_t *oplmsu_find_ser_dip(dev_info_t *);
57*1772Sjl139090 void	oplmsu_conf_stream(uinst_t *);
58*1772Sjl139090 void	oplmsu_unlinks(ldi_handle_t, int *, int);
59*1772Sjl139090 void	oplmsu_setup(uinst_t *);
60*1772Sjl139090 int	oplmsu_create_upath(dev_info_t *);
61*1772Sjl139090 int	oplmsu_config_new(struct msu_path *);
62*1772Sjl139090 int	oplmsu_config_add(dev_info_t *);
63*1772Sjl139090 int	oplmsu_config_del(struct msu_path *);
64*1772Sjl139090 int	oplmsu_config_stop(int);
65*1772Sjl139090 int	oplmsu_config_start(int);
66*1772Sjl139090 int	oplmsu_config_disc(int);
67*1772Sjl139090 
68*1772Sjl139090 /*
69*1772Sjl139090  *	UPPER WRITE SERVICE PROCEDURE
70*1772Sjl139090  */
71*1772Sjl139090 int	oplmsu_uwioctl_iplink(queue_t *, mblk_t *);
72*1772Sjl139090 int	oplmsu_uwioctl_ipunlink(queue_t *, mblk_t *);
73*1772Sjl139090 int	oplmsu_uwioctl_termios(queue_t *, mblk_t *);
74*1772Sjl139090 
75*1772Sjl139090 /*
76*1772Sjl139090  *	LOWER READ SERVICE PROCEDURE
77*1772Sjl139090  */
78*1772Sjl139090 int	oplmsu_lrioctl_termios(queue_t *, mblk_t *);
79*1772Sjl139090 int	oplmsu_lrmsg_error(queue_t *, mblk_t *);
80*1772Sjl139090 int	oplmsu_lrdata_xoffxon(queue_t *, mblk_t *);
81*1772Sjl139090 
82*1772Sjl139090 /*
83*1772Sjl139090  *	COMMON FUNCTIONS
84*1772Sjl139090  */
85*1772Sjl139090 void	oplmsu_link_upath(upath_t *);
86*1772Sjl139090 void	oplmsu_unlink_upath(upath_t *);
87*1772Sjl139090 void	oplmsu_link_lpath(lpath_t *);
88*1772Sjl139090 void	oplmsu_unlink_lpath(lpath_t *);
89*1772Sjl139090 void	oplmsu_link_high_primsg(mblk_t **, mblk_t **, mblk_t *);
90*1772Sjl139090 int	oplmsu_check_lpath_usable(void);
91*1772Sjl139090 upath_t	*oplmsu_search_upath_info(int);
92*1772Sjl139090 
93*1772Sjl139090 void	oplmsu_iocack(queue_t *, mblk_t *, int);
94*1772Sjl139090 void	oplmsu_delete_upath_info(void);
95*1772Sjl139090 int 	oplmsu_set_ioctl_path(lpath_t *, queue_t *, mblk_t *);
96*1772Sjl139090 void	oplmsu_clear_ioctl_path(lpath_t *);
97*1772Sjl139090 
98*1772Sjl139090 int	oplmsu_get_inst_status(void);
99*1772Sjl139090 upath_t	*oplmsu_search_standby(void);
100*1772Sjl139090 void	oplmsu_search_min_stop_path(void);
101*1772Sjl139090 int	oplmsu_get_pathnum(void);
102*1772Sjl139090 int	oplmsu_cmn_put_xoffxon(queue_t *, int);
103*1772Sjl139090 void	oplmsu_cmn_putxoff_standby(void);
104*1772Sjl139090 void	oplmsu_cmn_set_mflush(mblk_t *);
105*1772Sjl139090 void	oplmsu_cmn_set_upath_sts(upath_t *, int, int, ulong_t);
106*1772Sjl139090 int	oplmsu_cmn_allocmb(queue_t *, mblk_t *, mblk_t **, size_t, int);
107*1772Sjl139090 int	oplmsu_cmn_copymb(queue_t *, mblk_t *, mblk_t **, mblk_t *, int);
108*1772Sjl139090 void	oplmsu_cmn_bufcall(queue_t *, mblk_t *, size_t, int);
109*1772Sjl139090 int	oplmsu_cmn_prechg(queue_t *, mblk_t *, int, mblk_t **, int *, int *);
110*1772Sjl139090 int	oplmsu_stop_prechg(mblk_t **, int *, int *);
111*1772Sjl139090 int	oplmsu_cmn_prechg_termio(queue_t *, mblk_t *, int, int, mblk_t **,
112*1772Sjl139090 	    int *);
113*1772Sjl139090 int	oplmsu_cmn_pullup_msg(queue_t *, mblk_t *);
114*1772Sjl139090 
115*1772Sjl139090 void	oplmsu_cmn_wakeup(queue_t *);
116*1772Sjl139090 void	oplmsu_cmn_bufcb(void *);
117*1772Sjl139090 void	oplmsu_wbufcb_posthndl(ctrl_t *);
118*1772Sjl139090 
119*1772Sjl139090 /*
120*1772Sjl139090  *	common functions for write stream
121*1772Sjl139090  */
122*1772Sjl139090 int	oplmsu_wcmn_chknode(queue_t *, int, mblk_t *);
123*1772Sjl139090 void	oplmsu_wcmn_flush_hndl(queue_t *, mblk_t *, krw_t);
124*1772Sjl139090 int	oplmsu_wcmn_through_hndl(queue_t *, mblk_t *, int, krw_t);
125*1772Sjl139090 mblk_t	*oplmsu_wcmn_high_getq(queue_t *);
126*1772Sjl139090 void	oplmsu_wcmn_norm_putbq(queue_t *, mblk_t *, queue_t *);
127*1772Sjl139090 void	oplmsu_wcmn_high_qenable(queue_t *, krw_t);
128*1772Sjl139090 
129*1772Sjl139090 /*
130*1772Sjl139090  *	common functions for read stream
131*1772Sjl139090  */
132*1772Sjl139090 void	oplmsu_rcmn_flush_hndl(queue_t *, mblk_t *);
133*1772Sjl139090 int	oplmsu_rcmn_through_hndl(queue_t *, mblk_t *, int);
134*1772Sjl139090 void	oplmsu_rcmn_high_qenable(queue_t *);
135*1772Sjl139090 
136*1772Sjl139090 
137*1772Sjl139090 #ifdef DEBUG
138*1772Sjl139090 void	oplmsu_cmn_trace(queue_t *, mblk_t *, int);
139*1772Sjl139090 void	oplmsu_cmn_msglog(mblk_t *, int);
140*1772Sjl139090 void	oplmsu_cmn_prt_pathname(dev_info_t *);
141*1772Sjl139090 #endif
142*1772Sjl139090 
143*1772Sjl139090 
144*1772Sjl139090 /*
145*1772Sjl139090  *	GLOBAL VARIABLES
146*1772Sjl139090  */
147*1772Sjl139090 extern	uinst_t		*oplmsu_uinst;
148*1772Sjl139090 extern	int		oplmsu_queue_flag;
149*1772Sjl139090 extern	int		oplmsu_check_su;
150*1772Sjl139090 
151*1772Sjl139090 #ifdef DEBUG
152*1772Sjl139090 extern	int		oplmsu_debug_mode;
153*1772Sjl139090 extern	int		oplmsu_trace_on;
154*1772Sjl139090 extern	uint_t		oplmsu_ltrc_size;
155*1772Sjl139090 extern	msu_trc_t	*oplmsu_ltrc_top;
156*1772Sjl139090 extern	msu_trc_t	*oplmsu_ltrc_tail;
157*1772Sjl139090 extern	msu_trc_t	*oplmsu_ltrc_cur;
158*1772Sjl139090 extern	ulong_t		oplmsu_ltrc_ccnt;
159*1772Sjl139090 extern	kmutex_t	oplmsu_ltrc_lock;
160*1772Sjl139090 #endif
161*1772Sjl139090 
162*1772Sjl139090 #ifdef __cplusplus
163*1772Sjl139090 }
164*1772Sjl139090 #endif
165*1772Sjl139090 
166*1772Sjl139090 #endif	/* _OPLMSU_PROTO_H */
167