4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_DKTP_FLOWCTRL_H
28 #define _SYS_DKTP_FLOWCTRL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 struct flc_objops
*flc_ops
;
42 int (*flc_init
)(opaque_t
, opaque_t
, opaque_t
, void *);
43 int (*flc_free
)(struct flc_obj
*);
44 int (*flc_enque
)(opaque_t
, struct buf
*);
45 int (*flc_deque
)(opaque_t
, struct buf
*);
46 int (*flc_start_kstat
)(opaque_t
, char *, int);
47 int (*flc_stop_kstat
)(opaque_t
);
51 struct flc_obj
*dsngl_create();
52 struct flc_obj
*dmult_create();
53 struct flc_obj
*duplx_create();
54 struct flc_obj
*adapt_create();
56 #define FLC_INIT(X, tgcomobjp, queobjp, lkarg) \
57 (*((struct flc_obj *)(X))->flc_ops->flc_init) \
58 (((struct flc_obj *)(X))->flc_data, (tgcomobjp), (queobjp), (lkarg))
59 #define FLC_FREE(X) (*((struct flc_obj *)(X))->flc_ops->flc_free) ((X))
60 #define FLC_ENQUE(X, bp) (*((struct flc_obj *)(X))->flc_ops->flc_enque) \
61 (((struct flc_obj *)(X))->flc_data, (bp))
62 #define FLC_DEQUE(X, bp) (*((struct flc_obj *)(X))->flc_ops->flc_deque) \
63 (((struct flc_obj *)(X))->flc_data, (bp))
64 #define FLC_START_KSTAT(X, devtype, instance) \
65 (*((struct flc_obj *)(X))->flc_ops->flc_start_kstat)\
66 (((struct flc_obj *)(X))->flc_data, (devtype), (instance))
67 #define FLC_STOP_KSTAT(X) (*((struct flc_obj *)(X))->flc_ops->flc_stop_kstat) \
68 (((struct flc_obj *)(X))->flc_data)
74 #endif /* _SYS_DKTP_FLOWCTRL_H */