old-www/HOWTO/SCSI-Generic-HOWTO/x192.html

180 lines
3.1 KiB
HTML

<HTML
><HEAD
><TITLE
>iovec_count</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="The Linux SCSI Generic (sg) HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="The sg_io_hdr_t structure in detail"
HREF="sg_io_hdr_t.html"><LINK
REL="PREVIOUS"
TITLE="mx_sb_len"
HREF="x189.html"><LINK
REL="NEXT"
TITLE="dxfer_len"
HREF="x198.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux SCSI Generic (sg) HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x189.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 6. The sg_io_hdr_t structure in detail</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x198.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN192">6.5. iovec_count</H1
><P
> This is the number of scatter gather elements in an array pointed
to by 'dxferp'. If the value is zero then scatter gather (in the
user space) is _not_ being used and 'dxferp' points to the data
transfer buffer. If the value is greater than zero then each
element of the array is assumed to be of the form:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="PROGRAMLISTING"
> typedef struct sg_iovec
{
void * iov_base; /* starting address */
size_t iov_len; /* length in bytes */
} sg_iovec_t;</PRE
></FONT
></TD
></TR
></TABLE
>
Note that this structure has been named and defined in such a way to
parallel "struct iovec" used by the readv() and writev() system calls
in Linux. See "man 2 readv".</P
><P
>Note that the scatter gather capability offered by 'iovec_count' is unrelated
to the scatter gather capability (often associated with DMA) offered by
most modern SCSI adapters. Furthermore iovec_count's variety of scatter
gather (into the user space) is only available when normal (or "indirect")
IO is being used. Hence when the SG_FLAG_DIRECT_IO or SG_FLAG_MMAP_IO are
set in 'flags' then 'iovec_count' should be zero.</P
><P
>The type of iovec_count is unsigned short.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x189.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x198.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>mx_sb_len</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="sg_io_hdr_t.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>dxfer_len</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>