diff options
author | Toomas Soome <tsoome@me.com> | 2018-10-15 22:13:49 +0300 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-11-26 11:11:27 -0500 |
commit | 5e1743f0d6a1d79ccc247d50153ad830fa07768b (patch) | |
tree | b3d1fac7244691fbbca058b21a4af814c43ecc53 | |
parent | a239e970c64e3cf36327bef7b63193d0e6a25544 (diff) | |
download | illumos-joyent-5e1743f0d6a1d79ccc247d50153ad830fa07768b.tar.gz |
9903 qinfo: add typed members
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Dan McDonald <danmcd@joyent.com>
30 files changed, 190 insertions, 147 deletions
diff --git a/usr/src/man/man9s/qinit.9s b/usr/src/man/man9s/qinit.9s index 0f9cda2f60..925267adb6 100644 --- a/usr/src/man/man9s/qinit.9s +++ b/usr/src/man/man9s/qinit.9s @@ -1,54 +1,71 @@ -'\" te -.\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T -.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. -.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH QINIT 9S "Apr 11, 1991" -.SH NAME -qinit \- STREAMS queue processing procedures structure -.SH SYNOPSIS -.LP -.nf -#include <sys/stream.h> -.fi +.\" The contents of this file are subject to the terms of the +.\" Common Development and Distribution License (the "License"). +.\" You may not use this file except in compliance with the License. +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +.\" or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions and +.\" limitations under the License. +.\" When distributing Covered Code, include this CDDL HEADER in each file +.\" and include the License file at usr/src/OPENSOLARIS.LICENSE. +.\" If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying +.\" information: Portions Copyright [yyyy] [name of copyright owner] +.Dd Oct 17, 2018 +.Dt QINIT 9S +.Os +.Sh NAME +.Nm qinit +.Nd STREAMS queue processing procedures structure +.Sh SYNOPSIS +.In sys/stream.h +.Sh INTERFACE LEVEL +.Sy Architecture independent level 1 (DDI/DKI) +.Sh DESCRIPTION +The +.Nm +structure contains pointers to processing procedures for a +.Sy QUEUE . +The +.Sy streamtab +structure for the module or driver contains +pointers to one +.Xr queue 9S +structure for both upstream and downstream processing. +.Sh STRUCTURE MEMBERS +The +.Nm +structure includes the following members: +.Bd -literal -offset indent -.SH INTERFACE LEVEL -.sp -.LP -Architecture independent level 1 (DDI/DKI) -.SH DESCRIPTION -.sp -.LP -The \fBqinit\fR structure contains pointers to processing procedures for a -\fBQUEUE\fR. The \fBstreamtab\fR structure for the module or driver contains -pointers to one \fBqueue\fR(9S) structure for both upstream and downstream -processing. -.SH STRUCTURE MEMBERS -.sp -.in +2 -.nf -int (*qi_putp)(); /* put procedure */ -int (*qi_srvp)(); /* service procedure */ -int (*qi_qopen)(); /* open procedure */ -int (*qi_qclose)(); /* close procedure */ -int (*qi_qadmin)(); /* unused */ -struct module_info *qi_minfo; /* module parameters */ -struct module_stat *qi_mstat; /* module statistics */ -.fi -.in -2 +typedef int (*qi_putp_t)(queue_t *, mblk_t *); +typedef int (*qi_srvp_t)(queue_t *); +typedef int (*qi_qopen_t)(queue_t *, dev_t *, int, int, cred_t *); +typedef int (*qi_qclose_t)(queue_t *, int, cred_t *); +typedef int (*qi_qadmin_t)(void); +typedef int (*qi_rwp_t)(queue_t *, struiod_t *); +typedef int (*qi_infop_t)(queue_t *, infod_t *); -.SH SEE ALSO -.sp -.LP -\fBqueue\fR(9S), \fBstreamtab\fR(9S) -.sp -.LP -\fIWriting Device Drivers\fR -.sp -.LP -\fISTREAMS Programming Guide\fR -.SH NOTES -.sp -.LP +struct qinit { + qi_putp_t qi_putp; /* put procedure */ + qi_srvp_t qi_srvp; /* service procedure */ + qi_qopen_t qi_qopen; /* called on startup */ + qi_qclose_t qi_qclose; /* called on finish */ + qi_qadmin_t qi_qadmin; /* for future use */ + struct module_info *qi_minfo; /* module information */ + struct module_stat *qi_mstat; /* module statistics */ + qi_rwp_t qi_rwp; /* r/w procedure */ + qi_infop_t qi_infop; /* information procedure */ + int qi_struiot; /* stream uio type for struio() */ +}; +.Ed +.Sh SEE ALSO +.Xr queue 9S , +.Xr streamtab 9S +.Pp +.Xr Writing Device Drivers +.Pp +.Xr STREAMS Programming Guide +.Sh NOTES This release includes no support for module statistics. diff --git a/usr/src/uts/common/inet/ip.h b/usr/src/uts/common/inet/ip.h index cc8c489c8c..3c65fcf97e 100644 --- a/usr/src/uts/common/inet/ip.h +++ b/usr/src/uts/common/inet/ip.h @@ -3226,7 +3226,7 @@ extern mblk_t *ip_check_optlen(mblk_t *, ipha_t *, uint_t, uint_t, ip_recv_attr_t *); extern mblk_t *ip_fix_dbref(mblk_t *, ip_recv_attr_t *); extern uint_t ip_cksum(mblk_t *, int, uint32_t); -extern int ip_close(queue_t *, int); +extern int ip_close(queue_t *, int, cred_t *); extern uint16_t ip_csum_hdr(ipha_t *); extern void ip_forward_xmit_v4(nce_t *, ill_t *, mblk_t *, ipha_t *, ip_recv_attr_t *, uint32_t, uint32_t); diff --git a/usr/src/uts/common/inet/ip/icmp.c b/usr/src/uts/common/inet/ip/icmp.c index a4abdbd130..de1a68dcb7 100644 --- a/usr/src/uts/common/inet/ip/icmp.c +++ b/usr/src/uts/common/inet/ip/icmp.c @@ -100,7 +100,7 @@ static void icmp_bind_proto(icmp_t *icmp); static int icmp_build_hdr_template(conn_t *, const in6_addr_t *, const in6_addr_t *, uint32_t); static void icmp_capability_req(queue_t *q, mblk_t *mp); -static int icmp_close(queue_t *q, int flags); +static int icmp_close(queue_t *q, int flags, cred_t *); static void icmp_close_free(conn_t *); static void icmp_tpi_connect(queue_t *q, mblk_t *mp); static void icmp_tpi_disconnect(queue_t *q, mblk_t *mp); @@ -979,8 +979,9 @@ rawip_do_close(conn_t *connp) ipcl_conn_destroy(connp); } +/* ARGSUSED */ static int -icmp_close(queue_t *q, int flags) +icmp_close(queue_t *q, int flags, cred_t *credp __unused) { conn_t *connp; diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c index 215d09e724..4a8f4f298e 100644 --- a/usr/src/uts/common/inet/ip/ip.c +++ b/usr/src/uts/common/inet/ip/ip.c @@ -666,7 +666,6 @@ static void icmp_send_reply_v4(mblk_t *, ipha_t *, icmph_t *, mblk_t *ip_dlpi_alloc(size_t, t_uscalar_t); char *ip_dot_addr(ipaddr_t, char *); mblk_t *ip_carve_mp(mblk_t **, ssize_t); -int ip_close(queue_t *, int); static char *ip_dot_saddr(uchar_t *, char *); static void ip_lrput(queue_t *, mblk_t *); ipaddr_t ip_net_mask(ipaddr_t); @@ -4236,7 +4235,7 @@ ip_quiesce_conn(conn_t *connp) /* ARGSUSED */ int -ip_close(queue_t *q, int flags) +ip_close(queue_t *q, int flags, cred_t *credp __unused) { conn_t *connp; @@ -5938,7 +5937,7 @@ ip_modopen(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) mutex_exit(&ipst->ips_ip_mi_lock); fail: if (err) { - (void) ip_close(q, 0); + (void) ip_close(q, 0, credp); return (err); } return (0); diff --git a/usr/src/uts/common/inet/ip/ip_arp.c b/usr/src/uts/common/inet/ip/ip_arp.c index 683fcf577e..ab7a1ab209 100644 --- a/usr/src/uts/common/inet/ip/ip_arp.c +++ b/usr/src/uts/common/inet/ip/ip_arp.c @@ -58,7 +58,7 @@ typedef struct arp_m_s { uint32_t arp_mac_hw_addr_length; } arp_m_t; -static int arp_close(queue_t *, int); +static int arp_close(queue_t *, int, cred_t *); static void arp_rput(queue_t *, mblk_t *); static void arp_wput(queue_t *, mblk_t *); static arp_m_t *arp_m_lookup(t_uscalar_t mac_type); @@ -1801,7 +1801,7 @@ arp_ll_down(ill_t *ill) /* ARGSUSED */ int -arp_close(queue_t *q, int flags) +arp_close(queue_t *q, int flags __unused, cred_t *credp __unused) { if (WR(q)->q_next != NULL) { /* This is a module close */ @@ -2384,7 +2384,7 @@ arp_modopen(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) mutex_exit(&ipst->ips_ip_mi_lock); fail: if (err) { - (void) arp_close(q, 0); + (void) arp_close(q, 0, credp); return (err); } return (0); diff --git a/usr/src/uts/common/inet/ip/ip_dummy.c b/usr/src/uts/common/inet/ip/ip_dummy.c index 57b23ba286..c304d23f82 100644 --- a/usr/src/uts/common/inet/ip/ip_dummy.c +++ b/usr/src/uts/common/inet/ip/ip_dummy.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/conf.h> #include <sys/modctl.h> @@ -39,7 +37,7 @@ * MIB information comes from IP. */ -static int dummy_modclose(queue_t *q); +static int dummy_modclose(queue_t *, int, cred_t *); static int dummy_modopen(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp); @@ -66,8 +64,9 @@ struct streamtab dummymodinfo = { &dummyrmodinit, &dummywmodinit }; +/* ARGSUSED */ static int -dummy_modclose(queue_t *q) +dummy_modclose(queue_t *q, int flags __unused, cred_t *credp __unused) { qprocsoff(q); return (0); diff --git a/usr/src/uts/common/inet/ip/ip_helper_stream.c b/usr/src/uts/common/inet/ip/ip_helper_stream.c index 3fa6364417..9f40c09acf 100644 --- a/usr/src/uts/common/inet/ip/ip_helper_stream.c +++ b/usr/src/uts/common/inet/ip/ip_helper_stream.c @@ -42,7 +42,7 @@ void ip_helper_wput(queue_t *q, mblk_t *mp); -static int ip_helper_stream_close(queue_t *, int); +static int ip_helper_stream_close(queue_t *, int, cred_t *); static struct module_info ip_helper_stream_info = { 0, "iphelper", IP_MOD_MINPSZ, IP_MOD_MAXPSZ, IP_MOD_HIWAT, IP_MOD_LOWAT @@ -153,9 +153,9 @@ ip_helper_stream_setup(queue_t *q, dev_t *devp, int flag, int sflag, return (0); } -/* ARGSUSED1 */ +/* ARGSUSED */ static int -ip_helper_stream_close(queue_t *q, int flag) +ip_helper_stream_close(queue_t *q, int flag __unused, cred_t *credp __unused) { ip_helper_minfo_t *ip_minfop; diff --git a/usr/src/uts/common/inet/ip/ipsecah.c b/usr/src/uts/common/inet/ip/ipsecah.c index 87936d7623..05e92c4fa4 100644 --- a/usr/src/uts/common/inet/ip/ipsecah.c +++ b/usr/src/uts/common/inet/ip/ipsecah.c @@ -134,7 +134,7 @@ static mblk_t *ah_outbound(mblk_t *, ip_xmit_attr_t *); static void ah_outbound_finish(mblk_t *, ip_xmit_attr_t *); static int ipsecah_open(queue_t *, dev_t *, int, int, cred_t *); -static int ipsecah_close(queue_t *); +static int ipsecah_close(queue_t *, int, cred_t *); static void ipsecah_wput(queue_t *, mblk_t *); static boolean_t ah_register_out(uint32_t, uint32_t, uint_t, ipsecah_stack_t *, cred_t *); @@ -491,8 +491,9 @@ ipsecah_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) /* * AH module close routine. */ +/* ARGSUSED */ static int -ipsecah_close(queue_t *q) +ipsecah_close(queue_t *q, int flags __unused, cred_t *credp __unused) { ipsecah_stack_t *ahstack = (ipsecah_stack_t *)q->q_ptr; diff --git a/usr/src/uts/common/inet/ip/ipsecesp.c b/usr/src/uts/common/inet/ip/ipsecesp.c index 78f33bf0c7..ce7a4d0f4f 100644 --- a/usr/src/uts/common/inet/ip/ipsecesp.c +++ b/usr/src/uts/common/inet/ip/ipsecesp.c @@ -106,7 +106,7 @@ static ipsecespparam_t lcl_param_arr[] = { #define esp3dbg(espstack, a) if (espstack->ipsecesp_debug > 2) printf a static int ipsecesp_open(queue_t *, dev_t *, int, int, cred_t *); -static int ipsecesp_close(queue_t *); +static int ipsecesp_close(queue_t *, int, cred_t *); static void ipsecesp_wput(queue_t *, mblk_t *); static void *ipsecesp_stack_init(netstackid_t stackid, netstack_t *ns); static void ipsecesp_stack_fini(netstackid_t stackid, void *arg); @@ -541,8 +541,9 @@ ipsecesp_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) /* * ESP module close routine. */ +/* ARGSUSED */ static int -ipsecesp_close(queue_t *q) +ipsecesp_close(queue_t *q, int flags __unused, cred_t *credp __unused) { ipsecesp_stack_t *espstack = (ipsecesp_stack_t *)q->q_ptr; diff --git a/usr/src/uts/common/inet/ip/keysock.c b/usr/src/uts/common/inet/ip/keysock.c index 3567710fda..a01eeaa3c8 100644 --- a/usr/src/uts/common/inet/ip/keysock.c +++ b/usr/src/uts/common/inet/ip/keysock.c @@ -144,7 +144,7 @@ static keysockparam_t lcl_param_arr[] = { #define ks2dbg(keystack, a) if (keystack->keystack_debug > 1) printf a #define ks3dbg(keystack, a) if (keystack->keystack_debug > 2) printf a -static int keysock_close(queue_t *); +static int keysock_close(queue_t *, int, cred_t *); static int keysock_open(queue_t *, dev_t *, int, int, cred_t *); static void keysock_wput(queue_t *, mblk_t *); static void keysock_rput(queue_t *, mblk_t *); @@ -471,8 +471,9 @@ keysock_stack_fini(netstackid_t stackid, void *arg) /* * Close routine for keysock. */ +/* ARGSUSED */ static int -keysock_close(queue_t *q) +keysock_close(queue_t *q, int flags __unused, cred_t *credp __unused) { keysock_t *ks; keysock_consumer_t *kc; @@ -710,7 +711,7 @@ keysock_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) */ if (!ipsec_loader_wait(q, keystack->keystack_netstack->netstack_ipsec)) { - (void) keysock_close(q); + (void) keysock_close(q, 0, credp); return (EPFNOSUPPORT); } } diff --git a/usr/src/uts/common/inet/ip/rts.c b/usr/src/uts/common/inet/ip/rts.c index e265a994b2..ee092ef18e 100644 --- a/usr/src/uts/common/inet/ip/rts.c +++ b/usr/src/uts/common/inet/ip/rts.c @@ -132,7 +132,7 @@ static int rts_stream_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp); static conn_t *rts_open(int flag, cred_t *credp); -static int rts_stream_close(queue_t *q); +static int rts_stream_close(queue_t *, int, cred_t *); static int rts_close(sock_lower_handle_t proto_handle, int flags, cred_t *cr); @@ -237,8 +237,9 @@ rts_common_close(queue_t *q, conn_t *connp) return (0); } +/* ARGSUSED */ static int -rts_stream_close(queue_t *q) +rts_stream_close(queue_t *q, int flags __unused, cred_t *credp __unused) { conn_t *connp = Q_TO_CONN(q); diff --git a/usr/src/uts/common/inet/ip/spdsock.c b/usr/src/uts/common/inet/ip/spdsock.c index 0703ec931b..267bad10ba 100644 --- a/usr/src/uts/common/inet/ip/spdsock.c +++ b/usr/src/uts/common/inet/ip/spdsock.c @@ -152,7 +152,7 @@ static spdsockparam_t lcl_param_arr[] = { (ss)->spdsock_dump_cur_chain = 0; \ } -static int spdsock_close(queue_t *); +static int spdsock_close(queue_t *, int, cred_t *); static int spdsock_open(queue_t *, dev_t *, int, int, cred_t *); static void spdsock_wput(queue_t *, mblk_t *); static void spdsock_wsrv(queue_t *); @@ -3618,8 +3618,9 @@ spdsock_wsrv(queue_t *q) } } +/* ARGSUSED */ static int -spdsock_close(queue_t *q) +spdsock_close(queue_t *q, int flags __unused, cred_t *credp __unused) { spdsock_t *ss = q->q_ptr; spd_stack_t *spds = ss->spdsock_spds; diff --git a/usr/src/uts/common/inet/ipnet/ipnet.c b/usr/src/uts/common/inet/ipnet/ipnet.c index 16d75c50d9..5220236dfb 100644 --- a/usr/src/uts/common/inet/ipnet/ipnet.c +++ b/usr/src/uts/common/inet/ipnet/ipnet.c @@ -132,7 +132,7 @@ static void ipnet_input(mblk_t *); static int ipnet_wput(queue_t *, mblk_t *); static int ipnet_rsrv(queue_t *); static int ipnet_open(queue_t *, dev_t *, int, int, cred_t *); -static int ipnet_close(queue_t *); +static int ipnet_close(queue_t *, int, cred_t *); static void ipnet_ioctl(queue_t *, mblk_t *); static void ipnet_iocdata(queue_t *, mblk_t *); static void ipnet_wputnondata(queue_t *, mblk_t *); @@ -588,8 +588,9 @@ done: return (err); } +/* ARGSUSED */ static int -ipnet_close(queue_t *rq) +ipnet_close(queue_t *rq, int flags __unused, cred_t *credp __unused) { ipnet_t *ipnet = rq->q_ptr; ipnet_stack_t *ips = ipnet->ipnet_ns->netstack_ipnet; diff --git a/usr/src/uts/common/inet/nca/ncaddi.c b/usr/src/uts/common/inet/nca/ncaddi.c index 233fc4e5e3..e4fa85ef00 100644 --- a/usr/src/uts/common/inet/nca/ncaddi.c +++ b/usr/src/uts/common/inet/nca/ncaddi.c @@ -80,8 +80,9 @@ nca_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) return (0); } +/* ARGSUSED */ static int -nca_close(queue_t *q) +nca_close(queue_t *q, int flags __unused, cred_t *credp __unused) { qprocsoff(q); RD(q)->q_ptr = NULL; diff --git a/usr/src/uts/common/inet/tcp/tcp_tpi.c b/usr/src/uts/common/inet/tcp/tcp_tpi.c index d04979f3e4..2ce72e7daa 100644 --- a/usr/src/uts/common/inet/tcp/tcp_tpi.c +++ b/usr/src/uts/common/inet/tcp/tcp_tpi.c @@ -332,8 +332,9 @@ tcp_tpi_unbind(tcp_t *tcp, mblk_t *mp) } } +/* ARGSUSED */ int -tcp_tpi_close(queue_t *q, int flags) +tcp_tpi_close(queue_t *q, int flags, cred_t *credp __unused) { conn_t *connp; @@ -376,8 +377,9 @@ done: return (0); } +/* ARGSUSED */ int -tcp_tpi_close_accept(queue_t *q) +tcp_tpi_close_accept(queue_t *q, int flags __unused, cred_t *credp __unused) { vmem_t *minor_arena; dev_t conn_dev; diff --git a/usr/src/uts/common/inet/tcp_impl.h b/usr/src/uts/common/inet/tcp_impl.h index ab7ffa4594..d45f7a66ac 100644 --- a/usr/src/uts/common/inet/tcp_impl.h +++ b/usr/src/uts/common/inet/tcp_impl.h @@ -736,8 +736,8 @@ extern void tcp_send_conn_ind(void *, mblk_t *, void *); extern void tcp_send_pending(void *, mblk_t *, void *, ip_recv_attr_t *); extern void tcp_tpi_accept(queue_t *, mblk_t *); extern void tcp_tpi_bind(tcp_t *, mblk_t *); -extern int tcp_tpi_close(queue_t *, int); -extern int tcp_tpi_close_accept(queue_t *); +extern int tcp_tpi_close(queue_t *, int, cred_t *); +extern int tcp_tpi_close_accept(queue_t *, int, cred_t *); extern void tcp_tpi_connect(tcp_t *, mblk_t *); extern int tcp_tpi_opt_get(queue_t *, t_scalar_t, t_scalar_t, uchar_t *); extern int tcp_tpi_opt_set(queue_t *, uint_t, int, int, uint_t, uchar_t *, diff --git a/usr/src/uts/common/inet/udp/udp.c b/usr/src/uts/common/inet/udp/udp.c index 5a15aea4de..bce32cd82b 100644 --- a/usr/src/uts/common/inet/udp/udp.c +++ b/usr/src/uts/common/inet/udp/udp.c @@ -125,7 +125,7 @@ static void udp_bind_hash_remove(udp_t *udp, boolean_t caller_holds_lock); static int udp_build_hdr_template(conn_t *, const in6_addr_t *, const in6_addr_t *, in_port_t, uint32_t); static void udp_capability_req(queue_t *q, mblk_t *mp); -static int udp_tpi_close(queue_t *q, int flags); +static int udp_tpi_close(queue_t *q, int flags, cred_t *); static void udp_close_free(conn_t *); static void udp_tpi_connect(queue_t *q, mblk_t *mp); static void udp_tpi_disconnect(queue_t *q, mblk_t *mp); @@ -718,8 +718,9 @@ udp_tpi_connect(queue_t *q, mblk_t *mp) } } +/* ARGSUSED */ static int -udp_tpi_close(queue_t *q, int flags) +udp_tpi_close(queue_t *q, int flags, cred_t *credp __unused) { conn_t *connp; diff --git a/usr/src/uts/common/io/bridge.c b/usr/src/uts/common/io/bridge.c index 97ee9f1f0e..28f16175ee 100644 --- a/usr/src/uts/common/io/bridge.c +++ b/usr/src/uts/common/io/bridge.c @@ -1540,8 +1540,9 @@ bridge_open(queue_t *rq, dev_t *devp, int oflag, int sflag, cred_t *credp) * This is used only for bridge control streams. DLPI goes through dld * instead. */ +/* ARGSUSED */ static int -bridge_close(queue_t *rq) +bridge_close(queue_t *rq, int flags __unused, cred_t *credp __unused) { bridge_stream_t *bsp = rq->q_ptr; bridge_inst_t *bip; diff --git a/usr/src/uts/common/io/cryptmod.c b/usr/src/uts/common/io/cryptmod.c index ad6c5fb2f0..7d7626e2ef 100644 --- a/usr/src/uts/common/io/cryptmod.c +++ b/usr/src/uts/common/io/cryptmod.c @@ -67,7 +67,7 @@ static int cryptmodopen(queue_t *, dev_t *, int, int, cred_t *); static void cryptmodrput(queue_t *, mblk_t *); static void cryptmodwput(queue_t *, mblk_t *); -static int cryptmodclose(queue_t *); +static int cryptmodclose(queue_t *, int, cred_t *); static int cryptmodwsrv(queue_t *); static int cryptmodrsrv(queue_t *); @@ -300,8 +300,9 @@ cryptmodopen(queue_t *rq, dev_t *dev, int oflag, int sflag, cred_t *crp) return (0); } +/* ARGSUSED */ static int -cryptmodclose(queue_t *rq) +cryptmodclose(queue_t *rq, int flags __unused, cred_t *credp __unused) { struct tmodinfo *tmi = (struct tmodinfo *)rq->q_ptr; ASSERT(tmi); diff --git a/usr/src/uts/common/io/dld/dld_str.c b/usr/src/uts/common/io/dld/dld_str.c index 6f0d0b9a6c..24b5ab2e72 100644 --- a/usr/src/uts/common/io/dld/dld_str.c +++ b/usr/src/uts/common/io/dld/dld_str.c @@ -379,8 +379,9 @@ dld_open(queue_t *rq, dev_t *devp, int flag, int sflag, cred_t *credp) /* * qi_qclose: close(9e) */ +/* ARGSUSED */ int -dld_close(queue_t *rq) +dld_close(queue_t *rq, int flags __unused, cred_t *credp __unused) { /* * Disable the queue srv(9e) routine. diff --git a/usr/src/uts/common/io/fibre-channel/ulp/fcip.c b/usr/src/uts/common/io/fibre-channel/ulp/fcip.c index b4aaef3437..5989490929 100644 --- a/usr/src/uts/common/io/fibre-channel/ulp/fcip.c +++ b/usr/src/uts/common/io/fibre-channel/ulp/fcip.c @@ -145,7 +145,7 @@ static void fcip_proto(queue_t *, mblk_t *); static void fcip_ioctl(queue_t *, mblk_t *); static int fcip_open(queue_t *wq, dev_t *devp, int flag, int sflag, cred_t *credp); -static int fcip_close(queue_t *rq, int flag, int otyp, cred_t *credp); +static int fcip_close(queue_t *rq, int flag, cred_t *credp); static int fcip_start(queue_t *wq, mblk_t *mp, struct fcip *fptr, struct fcip_dest *fdestp, int flags); static void fcip_sendup(struct fcip *fptr, mblk_t *mp, @@ -3571,7 +3571,7 @@ done: */ /* ARGSUSED */ static int -fcip_close(queue_t *rq, int flag, int otyp, cred_t *credp) +fcip_close(queue_t *rq, int flag, cred_t *credp) { struct fcipstr *slp; struct fcipstr **prevslp; diff --git a/usr/src/uts/common/io/ib/clients/rds/rdsddi.c b/usr/src/uts/common/io/ib/clients/rds/rdsddi.c index 13a1d4bf75..8a78af2b51 100644 --- a/usr/src/uts/common/io/ib/clients/rds/rdsddi.c +++ b/usr/src/uts/common/io/ib/clients/rds/rdsddi.c @@ -232,8 +232,9 @@ rds_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) return (0); } +/* ARGSUSED */ static int -rds_close(queue_t *q) +rds_close(queue_t *q, int flags __unused, cred_t *credp __unused) { rds_t *rdsp = (rds_t *)q->q_ptr; diff --git a/usr/src/uts/common/io/pfmod.c b/usr/src/uts/common/io/pfmod.c index 9a7d66e995..c9c452e6ef 100644 --- a/usr/src/uts/common/io/pfmod.c +++ b/usr/src/uts/common/io/pfmod.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * STREAMS Packet Filter Module * @@ -86,7 +84,7 @@ struct packdesc { * Function prototypes. */ static int pfopen(queue_t *, dev_t *, int, int, cred_t *); -static int pfclose(queue_t *); +static int pfclose(queue_t *, int, cred_t *); static void pfioctl(queue_t *wq, mblk_t *mp); static int FilterPacket(struct packdesc *, struct epacketfilt *); /* @@ -189,8 +187,9 @@ pfopen(queue_t *rq, dev_t *dev, int oflag, int sflag, cred_t *crp) return (0); } +/* ARGSUSED */ static int -pfclose(queue_t *rq) +pfclose(queue_t *rq, int flags __unused, cred_t *credp __unused) { struct epacketfilt *pfp = (struct epacketfilt *)rq->q_ptr; diff --git a/usr/src/uts/common/io/ppp/sppp/sppp.c b/usr/src/uts/common/io/ppp/sppp/sppp.c index 7aee946b5f..1b12b6406b 100644 --- a/usr/src/uts/common/io/ppp/sppp/sppp.c +++ b/usr/src/uts/common/io/ppp/sppp/sppp.c @@ -319,8 +319,9 @@ sppp_create_ppa(uint32_t ppa_id, zoneid_t zoneid) * Description: * Common close procedure for module. */ +/* ARGSUSED */ int -sppp_close(queue_t *q) +sppp_close(queue_t *q, int flags __unused, cred_t *credp __unused) { spppstr_t *sps; spppstr_t **nextmn; diff --git a/usr/src/uts/common/io/ppp/sppp/sppp.h b/usr/src/uts/common/io/ppp/sppp/sppp.h index d3056a4fd2..71911c231e 100644 --- a/usr/src/uts/common/io/ppp/sppp/sppp.h +++ b/usr/src/uts/common/io/ppp/sppp/sppp.h @@ -359,7 +359,7 @@ typedef struct sppa { /* * Function declarations. */ -extern int sppp_close(queue_t *); +extern int sppp_close(queue_t *, int, cred_t *); extern mblk_t *sppp_dladdud(spppstr_t *, mblk_t *, t_scalar_t, boolean_t); extern void sppp_dlpi_pinfoinit(void); extern void sppp_dlprsendup(spppstr_t *, mblk_t *, t_scalar_t, boolean_t); diff --git a/usr/src/uts/common/io/ppp/sppptun/sppptun.c b/usr/src/uts/common/io/ppp/sppptun/sppptun.c index 18a729a1db..08b5693286 100644 --- a/usr/src/uts/common/io/ppp/sppptun/sppptun.c +++ b/usr/src/uts/common/io/ppp/sppptun/sppptun.c @@ -110,7 +110,7 @@ static const char *tcl_kstats_list[] = { TCL_KSTATS_NAMES }; #define KCDECR(vn) KDECR(tcl, tcl_kstats, vn) static int sppptun_open(queue_t *, dev_t *, int, int, cred_t *); -static int sppptun_close(queue_t *); +static int sppptun_close(queue_t *, int, cred_t *); static void sppptun_urput(queue_t *, mblk_t *); static void sppptun_uwput(queue_t *, mblk_t *); static int sppptun_ursrv(queue_t *); @@ -623,8 +623,9 @@ tclvm_remove_tll(void *arg, void *firstv, size_t numv) * Description: * Common close procedure for module and driver. */ +/* ARGSUSED */ static int -sppptun_close(queue_t *q) +sppptun_close(queue_t *q, int flags __unused, cred_t *credp __unused) { int err; void *qptr; diff --git a/usr/src/uts/common/io/softmac/softmac_dev.c b/usr/src/uts/common/io/softmac/softmac_dev.c index eeb09fcb0b..bbb3e9ad3e 100644 --- a/usr/src/uts/common/io/softmac/softmac_dev.c +++ b/usr/src/uts/common/io/softmac/softmac_dev.c @@ -44,7 +44,7 @@ static int softmac_cmn_open(queue_t *, dev_t *, int, int, cred_t *); * The following softmac_mod_xxx() functions are (9E) entry point functions for * the softmac module. */ -static int softmac_mod_close(queue_t *); +static int softmac_mod_close(queue_t *, int, cred_t *); static void softmac_mod_rput(queue_t *, mblk_t *); static void softmac_mod_wput(queue_t *, mblk_t *); static void softmac_mod_wsrv(queue_t *); @@ -54,7 +54,7 @@ static void softmac_mod_wsrv(queue_t *); * the softmac driver. */ static int softmac_drv_open(queue_t *, dev_t *, int, int, cred_t *); -static int softmac_drv_close(queue_t *); +static int softmac_drv_close(queue_t *, int, cred_t *); static void softmac_drv_wput(queue_t *, mblk_t *); static void softmac_drv_wsrv(queue_t *); @@ -276,8 +276,9 @@ softmac_cmn_open(queue_t *rq, dev_t *devp, int flag, int sflag, cred_t *credp) return (softmac_drv_open(rq, devp, flag, sflag, credp)); } +/* ARGSUSED */ static int -softmac_mod_close(queue_t *rq) +softmac_mod_close(queue_t *rq, int flags __unused, cred_t *credp __unused) { softmac_lower_t *slp = rq->q_ptr; @@ -562,8 +563,9 @@ fail: return (err); } +/* ARGSUSED */ static int -softmac_drv_close(queue_t *rq) +softmac_drv_close(queue_t *rq, int flags __unused, cred_t *credp __unused) { softmac_upper_t *sup = dld_str_private(rq); softmac_t *softmac = sup->su_softmac; diff --git a/usr/src/uts/common/io/vuidmice/vuidmice.c b/usr/src/uts/common/io/vuidmice/vuidmice.c index 7e15b6fc52..cbca7db795 100644 --- a/usr/src/uts/common/io/vuidmice/vuidmice.c +++ b/usr/src/uts/common/io/vuidmice/vuidmice.c @@ -48,15 +48,13 @@ #include <sys/ddi.h> #include <sys/sunddi.h> -static int vuidmice_open(queue_t *const, const dev_t *const, - const int, const int, const cred_t *const); -static int vuidmice_close(queue_t *const, const int, const cred_t *const); -static int vuidmice_rput(queue_t *const, mblk_t *); -static int vuidmice_rsrv(queue_t *const); -static int vuidmice_wput(queue_t *const, mblk_t *); -static void vuidmice_miocdata(queue_t *const, mblk_t *); -static int vuidmice_handle_wheel_resolution_ioctl(queue_t *const, - mblk_t *, int); +static int vuidmice_open(queue_t *, dev_t *, int, int, cred_t *); +static int vuidmice_close(queue_t *, int, cred_t *); +static int vuidmice_rput(queue_t *, mblk_t *); +static int vuidmice_rsrv(queue_t *); +static int vuidmice_wput(queue_t *, mblk_t *); +static void vuidmice_miocdata(queue_t *, mblk_t *); +static int vuidmice_handle_wheel_resolution_ioctl(queue_t *, mblk_t *, int); static int vuidmice_service_wheel_info(mblk_t *); static int vuidmice_service_wheel_state(queue_t *, mblk_t *, uint_t); @@ -177,8 +175,7 @@ _info(struct modinfo *modinfop) /* ARGSUSED1 */ static int -vuidmice_open(queue_t *const qp, const dev_t *const devp, - const int oflag, const int sflag, const cred_t *const crp) +vuidmice_open(queue_t *qp, dev_t *devp, int oflag, int sflag, cred_t *crp) { if (qp->q_ptr != NULL) return (0); /* reopen */ @@ -223,7 +220,7 @@ vuidmice_open(queue_t *const qp, const dev_t *const devp, /* ARGSUSED1 */ static int -vuidmice_close(queue_t *const qp, const int flag, const cred_t *const crp) +vuidmice_close(queue_t *qp, int flag, cred_t *crp) { ASSERT(qp != NULL); diff --git a/usr/src/uts/common/sys/dld.h b/usr/src/uts/common/sys/dld.h index 06d74804bd..f2c628b06e 100644 --- a/usr/src/uts/common/sys/dld.h +++ b/usr/src/uts/common/sys/dld.h @@ -440,7 +440,7 @@ typedef struct dld_capab_lso_s { int dld_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); int dld_devt_to_instance(dev_t); int dld_open(queue_t *, dev_t *, int, int, cred_t *); -int dld_close(queue_t *); +int dld_close(queue_t *, int, cred_t *); void dld_wput(queue_t *, mblk_t *); void dld_wsrv(queue_t *); int dld_str_open(queue_t *, dev_t *, void *); diff --git a/usr/src/uts/common/sys/stream.h b/usr/src/uts/common/sys/stream.h index 7a2f3c9305..4e3482dadc 100644 --- a/usr/src/uts/common/sys/stream.h +++ b/usr/src/uts/common/sys/stream.h @@ -125,8 +125,8 @@ typedef struct queue { size_t q_lowat; /* Q9S: Q low water mark */ struct qband *q_bandp; /* QLK: band flow information */ kmutex_t q_lock; /* NOLK: structure lock */ - struct stdata *q_stream; /* NOLK: stream backpointer */ - struct syncq *q_syncq; /* NOLK: associated syncq */ + struct stdata *q_stream; /* NOLK: stream backpointer */ + struct syncq *q_syncq; /* NOLK: associated syncq */ unsigned char q_nband; /* QLK: number of bands */ kcondvar_t q_wait; /* NOLK: read/write sleep CV */ struct queue *q_nfsrv; /* STR: next Q with svc routine */ @@ -142,9 +142,9 @@ typedef struct queue { * Syncq scheduling */ struct msgb *q_sqhead; /* QLK: first syncq message */ - struct msgb *q_sqtail; /* QLK: last syncq message */ + struct msgb *q_sqtail; /* QLK: last syncq message */ struct queue *q_sqnext; /* SQLK: next Q on syncq list */ - struct queue *q_sqprev; /* SQLK: prev Q on syncq list */ + struct queue *q_sqprev; /* SQLK: prev Q on syncq list */ uint_t q_sqflags; /* SQLK: syncq flags */ clock_t q_sqtstamp; /* SQLK: when Q was scheduled for sq */ @@ -168,9 +168,9 @@ typedef struct queue { #define QWANTRMQSYNC 0x00000080 /* Want to remove sync stream Q */ #define QBACK 0x00000100 /* queue has been back-enabled */ /* UNUSED 0x00000200 was QHLIST */ -/* UNUSED 0x00000400 was QUNSAFE */ +/* UNUSED 0x00000400 was QUNSAFE */ #define QPAIR 0x00000800 /* per queue-pair syncq */ -#define QPERQ 0x00001000 /* per queue-instance syncq */ +#define QPERQ 0x00001000 /* per queue-instance syncq */ #define QPERMOD 0x00002000 /* per module syncq */ #define QMTSAFE 0x00004000 /* stream module is MT-safe */ #define QMTOUTPERIM 0x00008000 /* Has outer perimeter */ @@ -184,7 +184,7 @@ typedef struct queue { #define QISDRV 0x00200000 /* the Queue is attached to a driver */ /* UNUSED 0x00400000 was QHOT */ /* UNUSED 0x00800000 was QNEXTHOT */ -/* UNUSED 0x01000000 was _QNEXTLESS */ +/* UNUSED 0x01000000 was _QNEXTLESS */ #define _QINSERTING 0x04000000 /* Private, module is being inserted */ #define _QREMOVING 0x08000000 /* Private, module is being removed */ #define _QASSOCIATED 0x10000000 /* queue is associated with a device */ @@ -248,27 +248,40 @@ typedef enum qfields { */ struct module_info { ushort_t mi_idnum; /* module id number */ - char *mi_idname; /* module name */ + char *mi_idname; /* module name */ ssize_t mi_minpsz; /* min packet size accepted */ ssize_t mi_maxpsz; /* max packet size accepted */ size_t mi_hiwat; /* hi-water mark */ - size_t mi_lowat; /* lo-water mark */ + size_t mi_lowat; /* lo-water mark */ }; /* * queue information structure (with Synchronous STREAMS extensions) */ + +typedef struct msgb mblk_t; +typedef struct struiod struiod_t; +typedef struct infod infod_t; + +typedef int (*qi_putp_t)(queue_t *, mblk_t *); +typedef int (*qi_srvp_t)(queue_t *); +typedef int (*qi_qopen_t)(queue_t *, dev_t *, int, int, cred_t *); +typedef int (*qi_qclose_t)(queue_t *, int, cred_t *); +typedef int (*qi_qadmin_t)(void); +typedef int (*qi_rwp_t)(queue_t *, struiod_t *); +typedef int (*qi_infop_t)(queue_t *, infod_t *); + struct qinit { - int (*qi_putp)(); /* put procedure */ - int (*qi_srvp)(); /* service procedure */ - int (*qi_qopen)(); /* called on startup */ - int (*qi_qclose)(); /* called on finish */ - int (*qi_qadmin)(); /* for future use */ + qi_putp_t qi_putp; /* put procedure */ + qi_srvp_t qi_srvp; /* service procedure */ + qi_qopen_t qi_qopen; /* called on startup */ + qi_qclose_t qi_qclose; /* called on finish */ + qi_qadmin_t qi_qadmin; /* for future use */ struct module_info *qi_minfo; /* module information structure */ struct module_stat *qi_mstat; /* module statistics structure */ - int (*qi_rwp)(); /* r/w procedure */ - int (*qi_infop)(); /* information procedure */ - int qi_struiot; /* stream uio type for struio() */ + qi_rwp_t qi_rwp; /* r/w procedure */ + qi_infop_t qi_infop; /* information procedure */ + int qi_struiot; /* stream uio type for struio() */ }; /* @@ -367,18 +380,18 @@ typedef struct datab { /* * Message block descriptor */ -typedef struct msgb { +struct msgb { struct msgb *b_next; struct msgb *b_prev; struct msgb *b_cont; unsigned char *b_rptr; unsigned char *b_wptr; - struct datab *b_datap; + struct datab *b_datap; unsigned char b_band; unsigned char b_tag; unsigned short b_flag; queue_t *b_queue; /* for sync queues */ -} mblk_t; +}; /* * bcache descriptor @@ -479,7 +492,7 @@ typedef struct bcache { */ #if defined(_LP64) struct iocblk { - int ioc_cmd; /* ioctl command type */ + int ioc_cmd; /* ioctl command type */ cred_t *ioc_cr; /* full credentials */ uint_t ioc_id; /* ioctl id */ uint_t ioc_flag; /* see below */ @@ -489,7 +502,7 @@ struct iocblk { }; #else struct iocblk { - int ioc_cmd; /* ioctl command type */ + int ioc_cmd; /* ioctl command type */ cred_t *ioc_cr; /* full credentials */ uint_t ioc_id; /* ioctl id */ size_t ioc_count; /* count of bytes in data field */ @@ -554,7 +567,7 @@ struct copyresp { uint_t cp_flag; /* datamodel IOC_ flags; see above */ mblk_t *cp_private; /* private state information */ caddr_t cp_rval; /* status of request: 0 -> success */ - /* non-zero -> failure */ + /* non-zero -> failure */ }; #else struct copyresp { @@ -562,7 +575,7 @@ struct copyresp { cred_t *cp_cr; /* full credentials */ uint_t cp_id; /* ioctl id (from ioc_id) */ caddr_t cp_rval; /* status of request: 0 -> success */ - /* non-zero -> failure */ + /* non-zero -> failure */ size_t cp_pad1; uint_t cp_pad2; mblk_t *cp_private; /* private state information */ @@ -637,22 +650,22 @@ struct stroptions { */ #define DEF_IOV_MAX 16 -typedef struct struiod { +struct struiod { mblk_t *d_mp; /* pointer to mblk (chain) */ uio_t d_uio; /* uio info */ iovec_t d_iov[DEF_IOV_MAX]; /* iov referenced by uio */ -} struiod_t; +}; /* * Structure for information procedure calls. */ -typedef struct infod { +struct infod { unsigned char d_cmd; /* info info request command */ unsigned char d_res; /* info info command results */ int d_bytes; /* mblk(s) byte count */ int d_count; /* count of mblk(s) */ uio_t *d_uiop; /* pointer to uio struct */ -} infod_t; +}; /* * Values for d_cmd & d_res. */ @@ -681,7 +694,7 @@ typedef struct cmdblk { * Values for stream flag in open to indicate module open, clone open, * and the return value for failure. */ -#define MODOPEN 0x1 /* open as a module */ +#define MODOPEN 0x1 /* open as a module */ #define CLONEOPEN 0x2 /* clone open; pick own minor dev */ #define OPENFAIL -1 /* returned for open failure */ |