90 lines
3.0 KiB
Plaintext
90 lines
3.0 KiB
Plaintext
'\"! tbl | mmdoc
|
|
'\"macro stdmacro
|
|
.if n .pH ddi.rm/d4/gen/copyreq @(#)copyreq 43.9 of 11/23/92
|
|
.\" Copyright 1992, 1991 UNIX System Laboratories, Inc.
|
|
.TH copyreq D4
|
|
.IX "\f4copyreq\fP(D4)"
|
|
.SH NAME
|
|
\f4copyreq\fP \- STREAMS transparent \f4ioctl\fP copy request structure
|
|
.SH SYNOPSIS
|
|
.nf
|
|
.na
|
|
.ft 4
|
|
#include <sys/stream.h>
|
|
#include <sys/ddi.h>
|
|
.ft 1
|
|
.ad
|
|
.fi
|
|
.SH DESCRIPTION
|
|
The \f4copyreq\fP structure contains the information necessary to process
|
|
transparent \f4ioctl\fPs.
|
|
.SH USAGE
|
|
The \f4copyreq\fP structure is used
|
|
in \f4M_COPYIN\fP and \f4M_COPYOUT\fP messages.
|
|
The module or driver usually converts an \f4M_IOCTL\fP or
|
|
\f4M_IOCDATA\fP message
|
|
into an \f4M_COPYIN\fP or \f4M_COPYOUT\fP message.
|
|
The \f4copyreq\fP structure
|
|
is thus overlaid on top of the \f4iocblk\fP(D4) or \f4copyresp\fP(D4) structure.
|
|
The stream head guarantees that the message is large enough
|
|
to contain the different structures.
|
|
.SS Structure Definitions
|
|
The \f4copyreq\fP structure contains the following members:
|
|
.P
|
|
.TS
|
|
lf4p8 2 lf4p8 2 lf4p8.
|
|
int cq_cmd; /* ioctl command */
|
|
cred_t *cq_cr; /* user credentials */
|
|
uint_t cq_id; /* ioctl ID */
|
|
caddr_t cq_addr; /* copy buffer address */
|
|
uint_t cq_size; /* number of bytes to copy */
|
|
int cq_flag; /* for future use */
|
|
mblk_t *cq_private; /* module private data */
|
|
.TE
|
|
The \f4cq_cmd\fP field is the \f4ioctl\fP command, copied from the \f4ioc_cmd\fP field
|
|
of the \f4iocblk\fP structure.
|
|
If the same message is used, then the \f4cq_cmd\fP
|
|
field directly overlays the \f4ioc_cmd\fP field (that is, it need not be copied.)
|
|
.P
|
|
The \f4cq_cr\fP field contains a pointer to the user credentials.
|
|
It is copied from
|
|
the \f4ioc_cr\fP field of the \f4iocblk\fP structure.
|
|
If the same message is used,
|
|
then the \f4cq_cr\fP field directly overlays the \f4ioc_cr\fP field
|
|
(that is, it need not
|
|
be copied.)
|
|
.P
|
|
The \f4cq_id\fP field is the \f4ioctl\fP ID, copied from the \f4ioc_id\fP field
|
|
of the \f4iocblk\fP structure.
|
|
It is used to uniquely identify the \f4ioctl\fP
|
|
request in the stream.
|
|
If the same message is used, then the \f4cq_id\fP
|
|
field directly overlays the \f4ioc_id\fP field (that is, it need not be copied.)
|
|
.P
|
|
For an \f4M_COPYIN\fP message, the \f4cq_addr\fP field contains the user address
|
|
from which the data are to be copied.
|
|
For an \f4M_COPYOUT\fP message, the \f4cq_addr\fP
|
|
field contains the user address to which the data are to be copied.
|
|
In both cases, the \f4cq_size\fP field contains the number of bytes to copy.
|
|
.P
|
|
The \f4cq_flag\fP field is reserved for future use and should be set to 0 by the
|
|
module or driver.
|
|
.P
|
|
The \f4cq_private\fP field is a field set aside for use by the driver.
|
|
It can be used
|
|
to hold whatever state information is necessary to process the \f4ioctl\fP.
|
|
It is copied to the \f4cp_private\fP field in the resultant \f4M_IOCDATA\fP message.
|
|
When the \f4M_COPYIN\fP or \f4M_COPYOUT\fP message is freed,
|
|
any message that \f4cq_private\fP
|
|
refers to is not freed by the STREAMS subsystem.
|
|
It is the responsibility
|
|
of the module or driver to free it.
|
|
.SH REFERENCES
|
|
.na
|
|
\f4copyresp\fP(D4),
|
|
\f4datab\fP(D4),
|
|
\f4iocblk\fP(D4),
|
|
\f4messages\fP(D5),
|
|
\f4msgb\fP(D4)
|
|
.ad
|