7 * with the License.
8 *
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.
13 *
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]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #pragma ident "%Z%%M% %I% %E% SMI"
28
29 /*
30 * STREAMS Buffering module
31 *
32 * This streams module collects incoming messages from modules below
33 * it on the stream and buffers them up into a smaller number of
34 * aggregated messages. Its main purpose is to reduce overhead by
35 * cutting down on the number of read (or getmsg) calls its client
36 * user process makes.
37 * - only M_DATA is buffered.
38 * - multithreading assumes configured as D_MTQPAIR
39 * - packets are lost only if flag SB_NO_HEADER is clear and buffer
40 * allocation fails.
41 * - in order message transmission. This is enforced for messages other
42 * than high priority messages.
43 * - zero length messages on the read side are not passed up the
44 * stream but used internally for synchronization.
45 * FLAGS:
46 * - SB_NO_PROTO_CVT - no conversion of M_PROTO messages to M_DATA.
47 * (conversion is the default for backwards compatibility
48 * hence the negative logic).
156
157 /*
158 * This is the loadable module wrapper.
159 */
160
161 static struct fmodsw fsw = {
162 "bufmod",
163 &sb_info,
164 D_MTQPAIR | D_MP
165 };
166
167 /*
168 * Module linkage information for the kernel.
169 */
170
171 static struct modlstrmod modlstrmod = {
172 &mod_strmodops, "streams buffer mod", &fsw
173 };
174
175 static struct modlinkage modlinkage = {
176 MODREV_1, &modlstrmod, NULL
177 };
178
179
180 int
181 _init(void)
182 {
183 return (mod_install(&modlinkage));
184 }
185
186 int
187 _fini(void)
188 {
189 return (mod_remove(&modlinkage));
190 }
191
192 int
193 _info(struct modinfo *modinfop)
194 {
195 return (mod_info(&modlinkage, modinfop));
196 }
|
7 * with the License.
8 *
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.
13 *
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]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * STREAMS Buffering module
29 *
30 * This streams module collects incoming messages from modules below
31 * it on the stream and buffers them up into a smaller number of
32 * aggregated messages. Its main purpose is to reduce overhead by
33 * cutting down on the number of read (or getmsg) calls its client
34 * user process makes.
35 * - only M_DATA is buffered.
36 * - multithreading assumes configured as D_MTQPAIR
37 * - packets are lost only if flag SB_NO_HEADER is clear and buffer
38 * allocation fails.
39 * - in order message transmission. This is enforced for messages other
40 * than high priority messages.
41 * - zero length messages on the read side are not passed up the
42 * stream but used internally for synchronization.
43 * FLAGS:
44 * - SB_NO_PROTO_CVT - no conversion of M_PROTO messages to M_DATA.
45 * (conversion is the default for backwards compatibility
46 * hence the negative logic).
154
155 /*
156 * This is the loadable module wrapper.
157 */
158
159 static struct fmodsw fsw = {
160 "bufmod",
161 &sb_info,
162 D_MTQPAIR | D_MP
163 };
164
165 /*
166 * Module linkage information for the kernel.
167 */
168
169 static struct modlstrmod modlstrmod = {
170 &mod_strmodops, "streams buffer mod", &fsw
171 };
172
173 static struct modlinkage modlinkage = {
174 MODREV_1, { &modlstrmod, NULL }
175 };
176
177
178 int
179 _init(void)
180 {
181 return (mod_install(&modlinkage));
182 }
183
184 int
185 _fini(void)
186 {
187 return (mod_remove(&modlinkage));
188 }
189
190 int
191 _info(struct modinfo *modinfop)
192 {
193 return (mod_info(&modlinkage, modinfop));
194 }
|